diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php
index eeeba5b20c3..ffdfa80e1c4 100644
--- a/htdocs/categories/class/categorie.class.php
+++ b/htdocs/categories/class/categorie.class.php
@@ -322,7 +322,7 @@ class Categorie extends CommonObject
'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 10, 'notnull' => 1, 'visible' => -1,),
'entity' => array('type' => 'integer', 'label' => 'Entity', 'enabled' => 1, 'visible' => 0, 'default' => '1', 'notnull' => 1, 'index' => 1, 'position' => 5),
'fk_parent' => array('type' => 'integer', 'label' => 'Fkparent', 'enabled' => 1, 'position' => 20, 'notnull' => 1, 'visible' => -1, 'css' => 'maxwidth500 widthcentpercentminusxx',),
- 'label' => array('type' => 'varchar(180)', 'label' => 'Label', 'enabled' => 1, 'position' => 25, 'notnull' => 1, 'visible' => -1, 'alwayseditable' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'csslist' => 'tdoverflowmax150',),
+ 'label' => array('type' => 'varchar(180)', 'label' => 'Label', 'enabled' => 1, 'position' => 25, 'notnull' => 1, 'visible' => -1, 'alwayseditable' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'csslist' => 'tdoverflowmax150', 'showoncombobox' => 1),
'ref_ext' => array('type' => 'varchar(255)', 'label' => 'RefExt', 'enabled' => 1, 'position' => 30, 'notnull' => 0, 'visible' => 0, 'alwayseditable' => 1,),
'type' => array('type' => 'integer', 'label' => 'Type', 'enabled' => 1, 'position' => 35, 'notnull' => 1, 'visible' => -1, 'alwayseditable' => 1,),
'description' => array('type' => 'text', 'label' => 'Description', 'enabled' => 1, 'position' => 40, 'notnull' => 0, 'visible' => -1, 'alwayseditable' => 1,),
diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php
index 1ba1f950242..2a0f0d1bcb3 100644
--- a/htdocs/compta/index.php
+++ b/htdocs/compta/index.php
@@ -433,7 +433,7 @@ if (isModEnabled('don') && $user->hasRight('don', 'lire')) {
$langs->load("boxes");
$donationstatic = new Don($db);
- $sql = "SELECT d.rowid, d.lastname, d.firstname, d.societe, d.datedon as date, d.tms as dm, d.amount, d.fk_statut as status";
+ $sql = "SELECT d.rowid, d.lastname, d.firstname, d.societe, d.datedon as date, d.tms as dm, d.amount, d.fk_statut as status, d.fk_soc as socid";
$sql .= " FROM ".MAIN_DB_PREFIX."don as d";
$sql .= " WHERE d.entity IN (".getEntity('donation').")";
// Add where from hooks
@@ -484,9 +484,17 @@ if (isModEnabled('don') && $user->hasRight('don', 'lire')) {
$donationstatic->statut = $obj->status;
$donationstatic->status = $obj->status;
- $label = $donationstatic->getFullName($langs);
- if ($obj->societe) {
- $label .= ($label ? ' - ' : '').$obj->societe;
+ if (!empty($obj->socid)) {
+ $companystatic = new Societe($db);
+ $ret = $companystatic->fetch($obj->socid);
+ if ($ret > 0) {
+ $label = $companystatic->getNomUrl(1);
+ }
+ } else {
+ $label = $donationstatic->getFullName($langs);
+ if ($obj->societe) {
+ $label .= ($label ? ' - ' : '').$obj->societe;
+ }
}
print '
';
diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php
index f03f3dfe15d..3313aa39bc7 100644
--- a/htdocs/core/class/extrafields.class.php
+++ b/htdocs/core/class/extrafields.class.php
@@ -2065,7 +2065,7 @@ class ExtraFields
} elseif ($type == 'price') {
//$value = price($value, 0, $langs, 0, 0, -1, $conf->currency);
if ($value || $value == '0') {
- $value = price($value, 0, $outputlangs, 0, $conf->global->MAIN_MAX_DECIMALS_TOT, -1).' '.$outputlangs->getCurrencySymbol($conf->currency);
+ $value = price($value, 0, $outputlangs, 0, getDolGlobalInt('MAIN_MAX_DECIMALS_TOT'), -1).' '.$outputlangs->getCurrencySymbol($conf->currency);
}
} elseif ($type == 'pricecy') {
$currency = $conf->currency;
@@ -2076,7 +2076,7 @@ class ExtraFields
$value = $pricetmp[0];
}
if ($value || $value == '0') {
- $value = price($value, 0, $outputlangs, 0, $conf->global->MAIN_MAX_DECIMALS_TOT, -1, $currency);
+ $value = price($value, 0, $outputlangs, 0, getDolGlobalInt('MAIN_MAX_DECIMALS_TOT'), -1, $currency);
}
} elseif ($type == 'select') {
$valstr = (!empty($param['options'][$value]) ? $param['options'][$value] : '');
@@ -2313,7 +2313,17 @@ class ExtraFields
$tmpobject = new $classname($this->db);
'@phan-var-force CommonObject $tmpobject';
$tmpobject->fetch($value);
- $value = $tmpobject->getNomUrl(3);
+
+ if (get_class($tmpobject) == 'Categorie') {
+ // For category object, rendering must use the same method than the one deinfed into showCategories()
+ $color = $tmpobject->color;
+ $sfortag = '';
+ $sfortag .= $tmpobject->getNomUrl(3);
+ $sfortag .= '';
+ $value = $sfortag;
+ } else {
+ $value = $tmpobject->getNomUrl(3);
+ }
}
} else {
dol_syslog('Error bad setup of extrafield', LOG_WARNING);
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index aea65289ce9..55699796ffa 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -9587,7 +9587,11 @@ class Form
foreach ($categories as $c) {
$ways = $c->print_all_ways(' >> ', ($nolink ? 'none' : ''), 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
foreach ($ways as $way) {
- $toprint[] = 'color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '';
+ $color = $c->color;
+ $sfortag = '';
+ $sfortag .= $way;
+ $sfortag .= '';
+ $toprint[] = $sfortag;
}
}
if (empty($toprint)) {
diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php
index 6d8bcef1bc3..da18964bf1b 100644
--- a/htdocs/core/lib/files.lib.php
+++ b/htdocs/core/lib/files.lib.php
@@ -1597,9 +1597,7 @@ function dol_delete_file($file, $disableglob = 0, $nophperrors = 0, $nohook = 0,
}
}
} else {
- if (empty($nophperrors)) {
- $ok = false; // to avoid false positive
- }
+ $ok = true; // nothing to delete when glob is on must return ok
dol_syslog("No files to delete found", LOG_DEBUG);
}
} else {
diff --git a/htdocs/core/tpl/admin_extrafields_add.tpl.php b/htdocs/core/tpl/admin_extrafields_add.tpl.php
index 5a55b5b1f3a..25452bca8db 100644
--- a/htdocs/core/tpl/admin_extrafields_add.tpl.php
+++ b/htdocs/core/tpl/admin_extrafields_add.tpl.php
@@ -195,8 +195,8 @@ print $formadmin->selectTypeOfFields('type', GETPOST('type', 'alpha'));
textwithpicto('', $langs->trans("ExtrafieldParamHelpselect"), 1, 0, '', 0, 2, 'helpvalue1')?>
- textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist"), 1, 0, '', 0, 2, 'helpvalue2')?>
- textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist"), 1, 0, '', 0, 2, 'helpvalue3')?>
+ textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist").(getDolGlobalInt('MAIN_FEATUREES_LEVEL') > 0 ? ' '.$langs->trans("ExtrafieldParamHelpsellist2") : ''), 1, 0, '', 0, 2, 'helpvalue2')?>
+ textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist").(getDolGlobalInt('MAIN_FEATUREES_LEVEL') > 0 ? ' '.$langs->trans("ExtrafieldParamHelpsellist2") : ''), 1, 0, '', 0, 2, 'helpvalue3')?>
textwithpicto('', $langs->trans("ExtrafieldParamHelplink").'
'.$langs->trans("Examples").': '.$listofexamplesforlink, 1, 0, '', 0, 2, 'helpvalue4')?>
textwithpicto('', $langs->trans("ExtrafieldParamHelpPassword"), 1, 0, '', 0, 2, 'helpvalue5')?>
textwithpicto('', $langs->trans("ExtrafieldParamHelpSeparator"), 1, 0, '', 0, 2, 'helpvalue6')?>
diff --git a/htdocs/core/tpl/admin_extrafields_edit.tpl.php b/htdocs/core/tpl/admin_extrafields_edit.tpl.php
index 9c931d0503e..78e0e8a2da0 100644
--- a/htdocs/core/tpl/admin_extrafields_edit.tpl.php
+++ b/htdocs/core/tpl/admin_extrafields_edit.tpl.php
@@ -257,8 +257,8 @@ if (in_array($type, array_keys($typewecanchangeinto))) {
|
textwithpicto('', $langs->trans("ExtrafieldParamHelpselect"), 1, 0, '', 0, 2, 'helpvalue1')?>
- textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist"), 1, 0, '', 0, 2, 'helpvalue2')?>
- textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist"), 1, 0, '', 0, 2, 'helpvalue3')?>
+ textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist").(getDolGlobalInt('MAIN_FEATUREES_LEVEL') > 0 ? ' '.$langs->trans("ExtrafieldParamHelpsellist2") : ''), 1, 0, '', 0, 2, 'helpvalue2')?>
+ textwithpicto('', $langs->trans("ExtrafieldParamHelpsellist").(getDolGlobalInt('MAIN_FEATUREES_LEVEL') > 0 ? ' '.$langs->trans("ExtrafieldParamHelpsellist2") : ''), 1, 0, '', 0, 2, 'helpvalue3')?>
textwithpicto('', $langs->trans("ExtrafieldParamHelplink").'
'.$langs->trans("Examples").': '.$listofexamplesforlink, 1, 0, '', 0, 2, 'helpvalue4')?>
textwithpicto('', $langs->trans("ExtrafieldParamHelpPassword"), 1, 0, '', 0, 2, 'helpvalue5')?>
textwithpicto('', $langs->trans("ExtrafieldParamHelpSeparator"), 1, 0, '', 0, 2, 'helpvalue6')?>
diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php
index 1c8c0104b43..0227bd16ba7 100644
--- a/htdocs/core/tpl/extrafields_view.tpl.php
+++ b/htdocs/core/tpl/extrafields_view.tpl.php
@@ -254,6 +254,7 @@ if (empty($reshook) && !empty($object->table_element) && isset($extrafields->att
//TODO Improve element and rights detection
if ($action == 'edit_extras' && $permok && GETPOST('attribute', 'restricthtml') == $tmpkeyextra) {
+ // Show the extrafield in create or edit mode
$fieldid = 'id';
if ($object->table_element == 'societe') {
$fieldid = 'socid';
@@ -269,6 +270,8 @@ if (empty($reshook) && !empty($object->table_element) && isset($extrafields->att
print '';
} else {
+ // Show the extrafield in view mode
+
//var_dump($tmpkeyextra.'-'.$value.'-'.$object->table_element);
print $extrafields->showOutputField($tmpkeyextra, $value, '', $object->table_element, null, $object);
}
diff --git a/htdocs/don/card.php b/htdocs/don/card.php
index 0660940beb4..8571c73f094 100644
--- a/htdocs/don/card.php
+++ b/htdocs/don/card.php
@@ -422,7 +422,7 @@ if ($action == 'create') {
print ' | '.$langs->trans('ThirdParty').' | ';
print '';
$filter = '((s.client:IN:1,2,3) AND (status:=:1))';
- print $form->select_company('', 'socid', $filter, 'SelectThirdParty', 0, 0, array(), 0, 'minwidth300');
+ print $form->select_company($socid, 'socid', $filter, 'SelectThirdParty', 0, 0, array(), 0, 'minwidth300');
// Option to reload page to retrieve customer information. Note, this clear other input
if (getDolGlobalString('RELOAD_PAGE_ON_CUSTOMER_CHANGE_DISABLED')) {
print ' |