From 270caf0dcbc9004dc0b700a4ceeee4d6d615f814 Mon Sep 17 00:00:00 2001 From: ldestailleur Date: Thu, 17 Jul 2025 16:13:33 +0200 Subject: [PATCH] Debug v22 --- htdocs/bom/bom_list.php | 28 +++++---- htdocs/comm/propal/list.php | 4 +- htdocs/commande/list.php | 8 +-- htdocs/compta/facture/list.php | 6 +- htdocs/expedition/list.php | 4 +- htdocs/fichinter/list.php | 4 +- htdocs/fourn/commande/list.php | 6 +- .../modulebuilder/template/myobject_list.php | 8 ++- htdocs/mrp/class/mo.class.php | 5 +- htdocs/mrp/mo_list.php | 58 +++++++++++-------- htdocs/societe/list.php | 4 +- 11 files changed, 82 insertions(+), 53 deletions(-) diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index 65f6ffbc3f5..80c98a3fc68 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -42,8 +42,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; // Load translation files required by the page $langs->loadLangs(array('mrp', 'other')); -// Get Parameters -$id = GETPOSTINT('id'); +// Get parameters $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) $show_files = GETPOSTINT('show_files'); // Show files area generated by bulk actions ? @@ -55,6 +54,7 @@ $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') $mode = GETPOST('mode', 'aZ'); // mode view (kanban or common) +$id = GETPOSTINT('id'); // Load variable for pagination $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; @@ -104,8 +104,8 @@ foreach ($object->fields as $key => $val) { } } -$fieldstosearchall = array(); // List of fields to search into when doing a "search in all" +$fieldstosearchall = array(); foreach ($object->fields as $key => $val) { if (!empty($val['searchall'])) { $fieldstosearchall['t.'.$key] = $val['label']; @@ -139,7 +139,6 @@ $permissiontodelete = $user->hasRight('bom', 'delete'); // Security check if ($user->socid > 0) { - // Protection if external user accessforbidden(); } $result = restrictedArea($user, 'bom'); @@ -172,11 +171,15 @@ if (empty($reshook)) { if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers foreach ($object->fields as $key => $val) { $search[$key] = ''; + if ($key == 'status') { + $search[$key] = -1; + } if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { $search[$key.'_dtstart'] = ''; $search[$key.'_dtend'] = ''; } } + $search_all = ''; $toselect = array(); $search_array_options = array(); } @@ -188,8 +191,6 @@ if (empty($reshook)) { // Mass actions $objectclass = 'BOM'; $objectlabel = 'BillOfMaterials'; - $permissiontoread = $user->hasRight('bom', 'read'); - $permissiontodelete = $user->hasRight('bom', 'delete'); $uploaddir = $conf->bom->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; @@ -373,7 +374,7 @@ $sql .= $hookmanager->resPrint; /* If a group by is required $sql.= " GROUP BY "; foreach($object->fields as $key => $val) { - $sql .= "t.".$db->escape($key).", "; + $sql .= "t.".$db->sanitize($key).", "; } // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { @@ -551,7 +552,7 @@ $htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arra $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); -print '
'; +print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table print ''."\n"; @@ -740,6 +741,7 @@ while ($i < $imaxinloop) { $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'))) { @@ -761,7 +763,7 @@ while ($i < $imaxinloop) { if (!empty($arrayfields['t.'.$key]['checked'])) { print '$key)) { - print ' title="'.dol_escape_htmltag((string) $object->$key).'"'; + print ' title="'.dolPrintHTMLForAttribute((string) $object->$key).'"'; } print '>'; if ($key == 'status') { @@ -769,7 +771,13 @@ while ($i < $imaxinloop) { } elseif ($key == 'rowid') { print $object->showOutputField($val, $key, (string) $object->id, ''); } else { - print $object->showOutputField($val, $key, $object->$key, ''); + if ($val['type'] == 'html') { + print '
'; + } + print $object->showOutputField($val, $key, (string) $object->$key, ''); + if ($val['type'] == 'html') { + print '
'; + } } print ''; if (!$i) { diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 421f72cd2ac..b52e64f0637 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -2382,7 +2382,7 @@ while ($i < $imaxinloop) { // Note public if (!empty($arrayfields['p.note_public']['checked'])) { print '
'; if (!$i) { $totalarray['nbfield']++; @@ -2391,7 +2391,7 @@ while ($i < $imaxinloop) { // Note private if (!empty($arrayfields['p.note_private']['checked'])) { print ''; if (!$i) { $totalarray['nbfield']++; diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index a1deb097418..92bbd5730b1 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -2908,8 +2908,8 @@ while ($i < $imaxinloop) { // Note public if (!empty($arrayfields['c.note_public']['checked'])) { - print ''; if (!$i) { $totalarray['nbfield']++; @@ -2918,8 +2918,8 @@ while ($i < $imaxinloop) { // Note private if (!empty($arrayfields['c.note_private']['checked'])) { - print ''; if (!$i) { $totalarray['nbfield']++; diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 3bc57e4e184..68e9df96c8e 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -2920,7 +2920,7 @@ if ($num > 0) { // Note public if (!empty($arrayfields['f.note_public']['checked'])) { print ''; if (!$i) { $totalarray['nbfield']++; @@ -2928,8 +2928,8 @@ if ($num > 0) { } // Note private if (!empty($arrayfields['f.note_private']['checked'])) { - print ''; if (!$i) { $totalarray['nbfield']++; diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index f3bd1f9481d..71ca3350a38 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -1688,7 +1688,7 @@ while ($i < $imaxinloop) { // Note public if (!empty($arrayfields['e.note_public']['checked'])) { print ''; if (!$i) { $totalarray['nbfield']++; @@ -1697,7 +1697,7 @@ while ($i < $imaxinloop) { // Note private if (!empty($arrayfields['e.note_private']['checked'])) { print ''; if (!$i) { $totalarray['nbfield']++; diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index 3f277de7a23..84492378558 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -996,7 +996,7 @@ while ($i < $imaxinloop) { // Note public if (!empty($arrayfields['f.note_public']['checked'])) { print ''; if (!$i) { $totalarray['nbfield']++; @@ -1005,7 +1005,7 @@ while ($i < $imaxinloop) { // Note private if (!empty($arrayfields['f.note_private']['checked'])) { print ''; if (!$i) { $totalarray['nbfield']++; diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 266ca57e2c7..bf2edf45f95 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -2102,8 +2102,8 @@ if ($resql) { } // Note public if (!empty($arrayfields['cf.note_public']['checked'])) { - print ''; if (!$i) { $totalarray['nbfield']++; @@ -2113,7 +2113,7 @@ if ($resql) { // Note private if (!empty($arrayfields['cf.note_private']['checked'])) { print ''; if (!$i) { $totalarray['nbfield']++; diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 36a63f017a3..1bb33de989c 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -162,8 +162,8 @@ foreach ($object->fields as $key => $val) { } } -$fieldstosearchall = array(); // List of fields to search into when doing a "search in all" +$fieldstosearchall = array(); // foreach ($object->fields as $key => $val) { // if (!empty($val['searchall'])) { // $fieldstosearchall['t.'.$key] = $val['label']; @@ -850,7 +850,13 @@ while ($i < $imaxinloop) { } elseif ($key == 'rowid') { print $object->showOutputField($val, $key, (string) $object->id, ''); } else { + if ($val['type'] == 'html') { + print '
'; + } print $object->showOutputField($val, $key, (string) $object->$key, ''); + if ($val['type'] == 'html') { + print '
'; + } } print ''; if (!$i) { diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index a4056201417..cc9417b85af 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -2045,7 +2045,10 @@ class Mo extends CommonObject if ($this->status != Mo::STATUS_VALIDATED && $this->status != Mo::STATUS_INPROGRESS) { return false; } - return (dol_now() > ($this->date_end_planned + $conf->mrp->progress->warning_delay)); + if (empty($this->date_end_planned)) { + return false; + } + return (dol_now() > ((int) $this->date_end_planned + $conf->mrp->progress->warning_delay)); } diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php index 9a03478e937..b748217388f 100644 --- a/htdocs/mrp/mo_list.php +++ b/htdocs/mrp/mo_list.php @@ -32,7 +32,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; - // load mrp libraries require_once __DIR__.'/class/mo.class.php'; @@ -58,6 +57,7 @@ $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') $mode = GETPOST('mode', 'alpha'); +$groupby = GETPOST('groupby', 'aZ09'); // Example: $groupby = 'p.fk_opp_status' or $groupby = 'p.fk_statut' $id = GETPOSTINT('id'); @@ -65,7 +65,7 @@ $id = GETPOSTINT('id'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT('page'); $also_cancel_consumed_and_produced_lines = (GETPOST('alsoCancelConsumedAndProducedLines', 'alpha') ? 1 : 0); $changeDate = GETPOST('change_date', 'alpha'); @@ -128,15 +128,16 @@ foreach ($object->fields as $key => $val) { } // Definition of array of fields for columns +$tableprefix = 't'; $arrayfields = array(); foreach ($object->fields as $key => $val) { // If $val['visible']==0, then we never show the field if (!empty($val['visible'])) { $visible = (int) dol_eval((string) $val['visible'], 1); - $arrayfields['t.'.$key] = array( + $arrayfields[$tableprefix.'.'.$key] = array( 'label' => $val['label'], - 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'checked' => (($visible < 0) ? '0' : '1'), + 'enabled' => (string) (int) (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); @@ -144,7 +145,7 @@ foreach ($object->fields as $key => $val) { if ($key == 'fk_parent_line') { $visible = (int) dol_eval((string) $val['visible'], 1); - $arrayfields['t.'.$key] = array( + $arrayfields[$tableprefix.'.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible <= 0) ? 0 : 1), 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), @@ -182,7 +183,7 @@ if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massa $massaction = ''; } -$parameters = array(); +$parameters = array('arrayfields' => &$arrayfields); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -306,8 +307,8 @@ $morecss = array(); // Build and execute select // -------------------------------------------------------------------- -$sql = 'SELECT '; -$sql .= $object->getFieldList('t'); +$sql = "SELECT "; +$sql .= " ".$object->getFieldList('t'); // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { @@ -322,13 +323,13 @@ $sql = preg_replace('/,\s*$/', '', $sql); $sqlfields = $sql; // $sql fields to remove for count total -$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t"; +$sql .= " FROM ".$db->prefix().$object->table_element." as t"; if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)"; } -$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."mrp_production as lineparent ON t.fk_parent_line = lineparent.rowid"; -$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."mrp_mo as moparent ON lineparent.fk_mo = moparent.rowid"; -$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON t.fk_product = p.rowid"; +$sql .= " LEFT JOIN ".$db->prefix()."mrp_production as lineparent ON t.fk_parent_line = lineparent.rowid"; +$sql .= " LEFT JOIN ".$db->prefix()."mrp_mo as moparent ON lineparent.fk_mo = moparent.rowid"; +$sql .= " LEFT JOIN ".$db->prefix()."product as p ON t.fk_product = p.rowid"; // Add table from hooks $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook @@ -431,7 +432,7 @@ if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { dol_print_error($db); } - if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller than paging size (filtering), goto and load page 0 + if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller than the paging size (filtering), goto and load page 0 $page = 0; $offset = 0; } @@ -481,6 +482,9 @@ if ($limit > 0 && $limit != $conf->liste_limit) { if ($optioncss != '') { $param .= '&optioncss='.urlencode($optioncss); } +if ($groupby != '') { + $param .= '&groupby='.urlencode($groupby); +} foreach ($search as $key => $val) { if (is_array($search[$key])) { foreach ($search[$key] as $skey) { @@ -489,9 +493,9 @@ foreach ($search as $key => $val) { } } } elseif (preg_match('/(_dtstart|_dtend)$/', $key) && !empty($val)) { - $param .= '&search_'.$key.'month='.((int) GETPOST('search_'.$key.'month', 'int')); - $param .= '&search_'.$key.'day='.((int) GETPOST('search_'.$key.'day', 'int')); - $param .= '&search_'.$key.'year='.((int) GETPOST('search_'.$key.'year', 'int')); + $param .= '&search_'.$key.'month='.GETPOSTINT('search_'.$key.'month'); + $param .= '&search_'.$key.'day='.GETPOSTINT('search_'.$key.'day'); + $param .= '&search_'.$key.'year='.GETPOSTINT('search_'.$key.'year'); } elseif ($search[$key] != '') { $param .= '&search_'.$key.'='.urlencode($search[$key]); } @@ -670,7 +674,7 @@ foreach ($object->fields as $key => $val) { } print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1); } elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:') === 0)) { - print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', 'maxwidth125', 1); + print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', $cssforfield.' maxwidth125', 1); } elseif (!preg_match('/^(date|timestamp|datetime)/', $val['type'])) { print ''; } elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { @@ -722,9 +726,10 @@ 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'])) { if ($key == "fk_product") { print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 'p.ref', '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''))."\n"; @@ -737,7 +742,7 @@ foreach ($object->fields as $key => $val) { // 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); +$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 @@ -779,7 +784,7 @@ while ($i < $imaxinloop) { $object->setVarsFromFetchObj($obj); - if ($mode == 'kanban') { + if ($mode == 'kanban' || $mode == 'kanbangroupby') { if ($i == 0) { print '
'; - print '
'.dolPrintHTML(dolGetFirstLineOfText($obj->note_public), 5).'
'; + print '
'.dolPrintHTML(dolGetFirstLineOfText($obj->note_public, 5)).'
'; print '
'; - print '
'.dolPrintHTML(dolGetFirstLineOfText($obj->note_private), 5).'
'; + print '
'.dolPrintHTML(dolGetFirstLineOfText($obj->note_private, 5)).'
'; print '
'; - print '
'.dolPrintHTML(dolGetFirstLineOfText($obj->note_public), 5).'
'; + print '
'; + print '
'.dolPrintHTML(dolGetFirstLineOfText($obj->note_public, 5)).'
'; print '
'; - print '
'.dolPrintHTML(dolGetFirstLineOfText($obj->note_private), 5).'
'; + print '
'; + print '
'.dolPrintHTML(dolGetFirstLineOfText($obj->note_private, 5)).'
'; print '
'; - print dolPrintHTML($obj->note_public); + print '
'.dolPrintHTML(dolGetFirstLineOfText($obj->note_public, 5)).'
'; print '
'; - print dolPrintHTML($obj->note_private); + print ''; + print '
'.dolPrintHTML(dolGetFirstLineOfText($obj->note_private, 5)).'
'; print '
'; - print dolPrintHTML($obj->note_public); + print '
'.dolPrintHTML(dolGetFirstLineOfText($obj->note_public, 5)).'
'; print '
'; - print dolPrintHTML($obj->note_private); + print '
'.dolPrintHTML(dolGetFirstLineOfText($obj->note_private, 5)).'
'; print '
'; - print dolPrintHTML($obj->note_public); + print '
'.dolPrintHTML(dolGetFirstLineOfText($obj->note_public, 5)).'
'; print '
'; - print dolPrintHTML($obj->note_private); + print '
'.dolPrintHTML(dolGetFirstLineOfText($obj->note_private, 5)).'
'; print '
'; - print '
'.dolPrintHTML(dolGetFirstLineOfText($obj->note_public), 5).'
'; + print '
'; + print '
'.dolPrintHTML(dolGetFirstLineOfText($obj->note_public, 5)).'
'; print '
'; - print '
'.dolPrintHTML(dolGetFirstLineOfText($obj->note_private), 5).'
'; + print '
'.dolPrintHTML(dolGetFirstLineOfText($obj->note_private, 5)).'
'; print '
'; print '
'; @@ -851,7 +856,7 @@ while ($i < $imaxinloop) { if (!empty($arrayfields['t.'.$key]['checked'])) { print '$key)) { - print ' title="'.dol_escape_htmltag((string) $object->$key).'"'; + print ' title="'.dolPrintHTMLForAttribute((string) $object->$key).'"'; } print '>'; if ($key == 'status') { @@ -864,7 +869,14 @@ while ($i < $imaxinloop) { } elseif ($key == 'rowid') { print $object->showOutputField($val, $key, (string) $object->id, ''); } else { + if ($val['type'] == 'html') { + print '
'; + } print $object->showOutputField($val, $key, (string) $object->$key, ''); + if ($val['type'] == 'html') { + print '
'; + } + if ($key == 'date_end_planned' && $object->hasDelay()) { print img_warning($langs->trans('Alert').' - '.$langs->trans('Late')); } @@ -934,7 +946,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"; diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 70f1bbcbeb1..58f203f7e01 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -2325,7 +2325,7 @@ while ($i < $imaxinloop) { // Note public if (!empty($arrayfields['s.note_public']['checked'])) { print ''; - print '
'.dolPrintHTML(dolGetFirstLineOfText($obj->note_public), 5).'
'; + print '
'.dolPrintHTML(dolGetFirstLineOfText($obj->note_public, 5)).'
'; print ''; if (!$i) { $totalarray['nbfield']++; @@ -2334,7 +2334,7 @@ while ($i < $imaxinloop) { // Note private if (!empty($arrayfields['s.note_private']['checked'])) { print ''; - print '
'.dolPrintHTML(dolGetFirstLineOfText($obj->note_private), 5).'
'; + print '
'.dolPrintHTML(dolGetFirstLineOfText($obj->note_private, 5)).'
'; print ''; if (!$i) { $totalarray['nbfield']++;