From 231fdd50e2b1a13ae16c259084fe0f03e35be25d Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 5 Feb 2025 16:05:20 +0100 Subject: [PATCH 1/8] FIX Prices didn't update when clone a propale with update prices --- htdocs/comm/propal/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 27cc54b38e3..48e65c735d6 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -224,7 +224,7 @@ if (empty($reshook)) { } } - $result = $object->createFromClone($user, $socid, (GETPOSTISSET('entity') ? GETPOSTINT('entity') : null), (GETPOSTINT('update_prices') ? true : false), (GETPOSTINT('update_desc') ? true : false)); + $result = $object->createFromClone($user, $socid, (GETPOSTISSET('entity') ? GETPOSTINT('entity') : null), (GETPOSTISSET('update_prices') ? true : false), (GETPOSTISSET('update_desc') ? true : false)); if ($result > 0) { $warningMsgLineList = array(); // check all product lines are to sell otherwise add a warning message for each product line is not to sell From 45c62dec9ab4dff646e7862c39b93a5ebb80b351 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 5 Feb 2025 16:32:37 +0100 Subject: [PATCH 2/8] FIX wrong check --- htdocs/comm/propal/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 48e65c735d6..2db169bd49e 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -224,7 +224,7 @@ if (empty($reshook)) { } } - $result = $object->createFromClone($user, $socid, (GETPOSTISSET('entity') ? GETPOSTINT('entity') : null), (GETPOSTISSET('update_prices') ? true : false), (GETPOSTISSET('update_desc') ? true : false)); + $result = $object->createFromClone($user, $socid, (GETPOSTISSET('entity') ? GETPOSTINT('entity') : null), (GETPOST('update_prices') == 'on' ? true : false), (GETPOST('update_desc') == 'on' ? true : false)); if ($result > 0) { $warningMsgLineList = array(); // check all product lines are to sell otherwise add a warning message for each product line is not to sell From c5a4bcf9438aac0078f794fe58055e8c8c020f7d Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Thu, 6 Feb 2025 10:48:01 +0100 Subject: [PATCH 3/8] Debug v21 --- htdocs/public/payment/paymentko.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/public/payment/paymentko.php b/htdocs/public/payment/paymentko.php index 5f833ed119d..9372a667b1e 100644 --- a/htdocs/public/payment/paymentko.php +++ b/htdocs/public/payment/paymentko.php @@ -74,7 +74,13 @@ if (isModEnabled('paypal')) { * @var string $dolibarr_main_url_root */ +// Hook to be used by external payment modules (ie Payzen, ...) +$hookmanager = new HookManager($db); + +$hookmanager->initHooks(array('newpayment')); + $langs->loadLangs(array("main", "other", "dict", "bills", "companies", "paybox", "paypal", "stripe")); + $PAYPALTOKEN = ""; $PAYPALPAYERID = ""; if (isModEnabled('paypal')) { From 1195777042251a7418f6f7e6842e97ba7fd5262e Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Thu, 6 Feb 2025 11:39:56 +0100 Subject: [PATCH 4/8] FIX line_date_xxx into ODF was not loaded --- htdocs/core/class/commondocgenerator.class.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 632f7e1b3b3..892069373d8 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -925,8 +925,9 @@ abstract class CommonDocGenerator array('line_date_end_rfc', 'date_end', 'dayrfc', 'auto', null) ); foreach ($date_specs as $date_spec) { - if (property_exists($line, $date_spec[1])) { - $resarray[$date_spec[0]] = dol_print_date($line->${$date_spec[1]}, $date_spec[2], $date_spec[3], $date_spec[4]); + $propertyname = $date_spec[1]; + if (property_exists($line, $propertyname)) { + $resarray[$date_spec[0]] = dol_print_date($line->$propertyname, $date_spec[2], $date_spec[3], $date_spec[4]); } } @@ -1082,9 +1083,9 @@ abstract class CommonDocGenerator * Define array with couple substitution key => substitution value * * @param array $object Dolibarr Object - * @param Translate $outputlangs Language object for output - * @param boolean|int $recursive Want to fetch child array or child object. - * @return array Array of substitution key->code + * @param Translate $outputlangs Language object for output + * @param boolean|int $recursive Want to fetch child array or child object. + * @return array Array of substitution key->code */ public function get_substitutionarray_each_var_object(&$object, $outputlangs, $recursive = 1) { From 4d97945cf96a47f2463d5c5c65fb766a3a293457 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Thu, 6 Feb 2025 12:01:21 +0100 Subject: [PATCH 5/8] FIX get_substitutionarray_each_var_object was returning empty array --- htdocs/core/class/commondocgenerator.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 892069373d8..ba37cce06b2 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -1082,7 +1082,7 @@ abstract class CommonDocGenerator /** * Define array with couple substitution key => substitution value * - * @param array $object Dolibarr Object + * @param array|CommonObject $object Dolibarr Object * @param Translate $outputlangs Language object for output * @param boolean|int $recursive Want to fetch child array or child object. * @return array Array of substitution key->code @@ -1091,7 +1091,9 @@ abstract class CommonDocGenerator { // phpcs:enable $array_other = array(); - if (is_array($object) && count($object)) { + + if ((is_array($object) && count($object)) || is_object($object)) { + // Loop on each entry of array or on each property of object foreach ($object as $key => $value) { if (in_array($key, array('db', 'fields', 'lines', 'modelpdf', 'model_pdf'))) { // discard some properties continue; From 142f62b4b9bc43cc40b590b0e0e19adb9e3de2e8 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Thu, 6 Feb 2025 12:32:00 +0100 Subject: [PATCH 6/8] FIX bad link, page size lost --- htdocs/categories/viewcat.php | 42 +++++++++++++++++------------------ 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 725e43717cd..fcef409cc55 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -298,9 +298,9 @@ dol_banner_tab($object, 'label', $linkback, ($user->socid ? 0 : 1), 'label', 'la // Confirmation of deletion if ($action == 'delete') { if ($backtopage) { - print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&type='.$type.'&backtopage='.urlencode($backtopage), $langs->trans('DeleteCategory'), $langs->trans('ConfirmDeleteCategory'), 'confirm_delete', '', '', 2); + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&type='.urlencode($type).'&backtopage='.urlencode($backtopage), $langs->trans('DeleteCategory'), $langs->trans('ConfirmDeleteCategory'), 'confirm_delete', '', '', 2); } else { - print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&type='.$type, $langs->trans('DeleteCategory'), $langs->trans('ConfirmDeleteCategory'), 'confirm_delete', '', '', 1); + print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&type='.urlencode($type), $langs->trans('DeleteCategory'), $langs->trans('ConfirmDeleteCategory'), 'confirm_delete', '', '', 1); } } @@ -349,11 +349,11 @@ if ($reshook < 0) { if (empty($reshook)) { if ($user->hasRight('categorie', 'creer')) { $socid = ($object->socid ? "&socid=".$object->socid : ""); - print ''.$langs->trans("Modify").''; + print ''.$langs->trans("Modify").''; } if ($user->hasRight('categorie', 'supprimer')) { - print 'id.'&type='.$type.'&backtolist='.urlencode($backtolist).'">'.$langs->trans("Delete").''; + print 'id.'&type='.urlencode($type).'&backtolist='.urlencode($backtolist).'">'.$langs->trans("Delete").''; } } @@ -363,8 +363,8 @@ $newcardbutton = ''; if ($user->hasRight('categorie', 'creer')) { $link = DOL_URL_ROOT.'/categories/card.php'; $link .= '?action=create'; - $link .= '&type='.$type; - $link .= '&catorigin='.$object->id; + $link .= '&type='.urlencode($type); + $link .= '&catorigin='.((int) $object->id); $link .= '&backtopage='.urlencode($_SERVER["PHP_SELF"].'?type='.$type.'&id='.$id); $newcardbutton = '
'; @@ -462,13 +462,13 @@ if ($cats < 0) { $entry .= $counter; $entry .= ''; - $entry .= ''.img_view().''; + $entry .= ''.img_view().''; $entry .= ''; $entry .= ''; - $entry .= ''.img_edit().''; + $entry .= ''.img_edit().''; $entry .= ''; $entry .= ''; - $entry .= ''.img_delete().''; + $entry .= ''.img_delete().''; $entry .= ''; $entry .= ''; @@ -517,7 +517,7 @@ $arrayofmassactions = array( ); $massactionbutton = $form->selectMassAction('', $arrayofmassactions); -$typeid = $type; +$typeid = $type; // warning, typeid can be a string // List of products or services (type is type of category) @@ -579,7 +579,7 @@ if ($type == Categorie::TYPE_PRODUCT) { // Link to delete from category print ''; if ($permission) { - print 'id.'">'; + print 'id).($limit ? '&limit='.$limit : '').'">'; //print $langs->trans("DeleteFromCat"); print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', 0, 0, 0, '', 'paddingleft'); print ""; @@ -659,7 +659,7 @@ if ($type == Categorie::TYPE_CUSTOMER) { // Link to delete from category print ''; if ($permission) { - print "id."'>"; + print "id).($limit ? '&limit='.$limit : '')."'>"; //print $langs->trans("DeleteFromCat"); print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', 0, 0, 0, '', 'paddingleft'); print ""; @@ -740,7 +740,7 @@ if ($type == Categorie::TYPE_SUPPLIER) { // Link to delete from category print ''; if ($permission) { - print 'id.($limit ? '&limit='.$limit : '').'">'; + print 'id).($limit ? '&limit='.$limit : '').'">'; //print $langs->trans("DeleteFromCat"); print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', 0, 0, 0, '', 'paddingleft'); print ""; @@ -825,7 +825,7 @@ if ($type == Categorie::TYPE_MEMBER) { // Link to delete from category print ''; if ($permission) { - print "id."'>"; + print "id).($limit ? '&limit='.$limit : '')."'>"; //print $langs->trans("DeleteFromCat"); print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', 0, 0, 0, '', 'paddingleft'); print ""; @@ -911,7 +911,7 @@ if ($type == Categorie::TYPE_CONTACT) { // Link to delete from category print ''; if ($permission) { - print "id."'>"; + print "id).($limit ? '&limit='.$limit : '')."'>"; //print $langs->trans("DeleteFromCat"); print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', 0, 0, 0, '', 'paddingleft'); print ""; @@ -994,7 +994,7 @@ if ($type == Categorie::TYPE_ACCOUNT) { // Link to delete from category print ''; if ($permission) { - print "id."'>"; + print "id).($limit ? '&limit='.$limit : '')."'>"; //print $langs->trans("DeleteFromCat"); print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', 0, 0, 0, '', 'paddingleft'); print ""; @@ -1076,7 +1076,7 @@ if ($type == Categorie::TYPE_PROJECT) { // Link to delete from category print ''; if ($permission) { - print "id."'>"; + print "id).($limit ? '&limit='.$limit : '')."'>"; //print $langs->trans("DeleteFromCat"); print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', 0, 0, 0, '', 'paddingleft'); print ""; @@ -1154,7 +1154,7 @@ if ($type == Categorie::TYPE_USER) { // Link to delete from category print ''; if ($user->hasRight('user', 'user', 'creer')) { - print "id."'>"; + print "id).($limit ? '&limit='.$limit : '')."'>"; //print $langs->trans("DeleteFromCat"); print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', 0, 0, 0, '', 'paddingleft'); print ""; @@ -1225,7 +1225,7 @@ if ($type == Categorie::TYPE_WAREHOUSE) { // Link to delete from category print ''; if ($permission) { - print "id."'>"; + print "id).($limit ? '&limit='.$limit : '')."'>"; //print $langs->trans("DeleteFromCat"); print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', 0, 0, 0, '', 'paddingleft'); print ""; @@ -1305,7 +1305,7 @@ if ($type == Categorie::TYPE_TICKET) { // Link to delete from category print ''; if ($permission) { - print "id."'>"; + print "id).($limit ? '&limit='.$limit : '')."'>"; //print $langs->trans("DeleteFromCat"); print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', 0, 0, 0, '', 'paddingleft'); print ""; @@ -1391,7 +1391,7 @@ if ($type == Categorie::TYPE_FICHINTER) { // Link to delete from category print ''; if ($permission) { - print "id."'>"; + print "id).($limit ? '&limit='.$limit : '')."'>"; print $langs->trans("DeleteFromCat"); print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', 0, 0, 0, '', 'paddingleft'); print ""; From 9043d1ad3e8d7e3f98c3488162c9ed435f4f64cb Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Thu, 6 Feb 2025 13:59:58 +0100 Subject: [PATCH 7/8] Fix doc --- htdocs/modulebuilder/template/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/modulebuilder/template/README.md b/htdocs/modulebuilder/template/README.md index d6e49e154b7..978192bb622 100644 --- a/htdocs/modulebuilder/template/README.md +++ b/htdocs/modulebuilder/template/README.md @@ -34,10 +34,10 @@ You can also get a ready-to-use instance in the cloud from https://saas.dolibarr If the module is a ready-to-deploy zip file, so with a name `module_xxx-version.zip` (e.g., when downloading it from a marketplace like [Dolistore](https://www.dolistore.com)), go to menu `Home> Setup> Modules> Deploy external module` and upload the zip file. -Note: If this screen tells you that there is no "custom" directory, check that your setup is correct: - '."\n"; + print '
'.$langs->trans("FilterOnInto", $search_all).implode(', ', $fieldstosearchall).'
'."\n"; } $moreforfilter = ''; @@ -455,6 +483,9 @@ if (empty($reshook)) { } else { $moreforfilter = $hookmanager->resPrint; } +$parameters = array( + 'arrayfields' => &$arrayfields, +); if (!empty($moreforfilter)) { print '
'; @@ -463,7 +494,8 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields +$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column); // This also change content of $arrayfields +$selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table @@ -472,8 +504,16 @@ print ''; +print ''; +// Action column +if ($conf->main_checkbox_left_column) { + print ''; +} foreach ($object->fields as $key => $val) { + //$searchkey = empty($search[$key]) ? '' : $search[$key]; $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); if ($key == 'status') { $cssforfield .= ($cssforfield ? ' ' : '').'center'; @@ -481,15 +521,19 @@ foreach ($object->fields as $key => $val) { $cssforfield .= ($cssforfield ? ' ' : '').'center'; } elseif (in_array($val['type'], array('timestamp'))) { $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; - } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { + } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('id', 'rowid', 'ref', 'status')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { $cssforfield .= ($cssforfield ? ' ' : '').'right'; } if (!empty($arrayfields['t.'.$key]['checked'])) { - print ''; } @@ -512,19 +556,28 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; // Fields from hook $parameters = array('arrayfields' => $arrayfields); -$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column -print ''; +if (!$conf->main_checkbox_left_column) { + print ''; +} print ''."\n"; +$totalarray = array(); +$totalarray['nbfield'] = 0; // Fields title label // -------------------------------------------------------------------- print ''; +// Action column +if ($conf->main_checkbox_left_column) { + print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; + $totalarray['nbfield']++; +} foreach ($object->fields as $key => $val) { $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); if ($key == 'status') { @@ -533,21 +586,26 @@ foreach ($object->fields as $key => $val) { $cssforfield .= ($cssforfield ? ' ' : '').'center'; } elseif (in_array($val['type'], array('timestamp'))) { $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; - } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { + } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('id', 'rowid', 'ref', 'status')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { $cssforfield .= ($cssforfield ? ' ' : '').'right'; } + $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label if (!empty($arrayfields['t.'.$key]['checked'])) { - print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''))."\n"; + print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''), 0, (empty($val['helplist']) ? '' : $val['helplist']))."\n"; + $totalarray['nbfield']++; } } // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields -$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder); -$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook +$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder, 'totalarray' => &$totalarray); +$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column -print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; +if (!$conf->main_checkbox_left_column) { + print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; + $totalarray['nbfield']++; +} print ''."\n"; @@ -565,9 +623,11 @@ if (isset($extrafields->attributes[$object->table_element]['computed']) && is_ar // Loop on record // -------------------------------------------------------------------- $i = 0; +$savnbfield = $totalarray['nbfield']; $totalarray = array(); $totalarray['nbfield'] = 0; -while ($i < ($limit ? min($num, $limit) : $num)) { +$imaxinloop = ($limit ? min($num, $limit) : $num); +while ($i < $imaxinloop) { $obj = $db->fetch_object($resql); if (empty($obj)) { break; // Should not happen @@ -576,8 +636,26 @@ while ($i < ($limit ? min($num, $limit) : $num)) { // Store properties in $object $object->setVarsFromFetchObj($obj); - // Show here line of result - print ''; + // Show line of result + $j = 0; + print ''; + + // Action column + if ($conf->main_checkbox_left_column) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Fields foreach ($object->fields as $key => $val) { $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { @@ -587,18 +665,22 @@ while ($i < ($limit ? min($num, $limit) : $num)) { } if (in_array($val['type'], array('timestamp'))) { - $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; + $cssforfield .= ($cssforfield ? ' ' : '').'nowraponall'; } elseif ($key == 'ref') { - $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; + $cssforfield .= ($cssforfield ? ' ' : '').'nowraponall'; } - if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'status')) && empty($val['arrayofkeyval'])) { + if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('id', 'rowid', 'ref', 'status')) && empty($val['arrayofkeyval'])) { $cssforfield .= ($cssforfield ? ' ' : '').'right'; } //if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100'; if (!empty($arrayfields['t.'.$key]['checked'])) { - print ''; + print '$key) && !in_array($key, array('ref'))) { + print ' title="'.dol_escape_htmltag($object->$key).'"'; + } + print '>'; if ($key == 'status') { print $object->getLibStatut(5); } elseif ($key == 'rowid') { @@ -628,20 +710,22 @@ while ($i < ($limit ? min($num, $limit) : $num)) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook $parameters = array('arrayfields' => $arrayfields, 'object' => $object, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray); - $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook + $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column - print ''; + if (!$i) { + $totalarray['nbfield']++; } - print ''; - } - print ''; - if (!$i) { - $totalarray['nbfield']++; } print ''."\n"; @@ -667,7 +751,7 @@ if ($num == 0) { $db->free($resql); $parameters = array('arrayfields' => $arrayfields, 'sql' => $sql); -$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; print ''."\n";