From 574b9159ca991914ca72f9206e66ab2e8f28f868 Mon Sep 17 00:00:00 2001 From: Faustin Date: Sat, 19 Nov 2022 22:42:15 +0100 Subject: [PATCH] checkbox colum on left for contract lists --- htdocs/contrat/list.php | 57 +++++++++++++++++++++++++++++++---------- 1 file changed, 43 insertions(+), 14 deletions(-) diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 65bb4fa8b08..461a8d96684 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -618,7 +618,7 @@ 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, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields if ($massactionbutton) { $selectedfields .= $form->showCheckAddButtons('checkforselect', 1); } @@ -627,6 +627,13 @@ print '
'; print ''."\n"; print ''; +// Action column +if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; +} if (!empty($arrayfields['c.ref']['checked'])) { print ''; } -print ''; + +// Action column +if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; +} print "\n"; print ''; +if(getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch '); +} if (!empty($arrayfields['c.ref']['checked'])) { print_liste_field_titre($arrayfields['c.ref']['label'], $_SERVER["PHP_SELF"], "c.ref", "", $param, '', $sortfield, $sortorder); } @@ -787,7 +801,9 @@ if (!empty($arrayfields['status']['checked'])) { print_liste_field_titre($staticcontratligne->LibStatut(4, 3, 1, 'class="nochangebackground"'), '', '', '', '', 'width="16"'); print_liste_field_titre($staticcontratligne->LibStatut(5, 3, -1, 'class="nochangebackground"'), '', '', '', '', 'width="16"'); } -print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch '); +if(!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch '); +} print "\n"; $totalarray = array(); @@ -826,7 +842,18 @@ while ($i < min($num, $limit)) { print ''; - + // Action column + if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; + } // Ref if (!empty($arrayfields['c.ref']['checked'])) { print ''; } // Action column - print ''; } - print ''; if (!$i) { $totalarray['nbfield']++; }
'; + $searchpicto = $form->showFilterButtons('left'); + print $searchpicto; + print ''; print ''; @@ -723,13 +730,20 @@ if (!empty($arrayfields['lower_planned_end_date']['checked'])) { if (!empty($arrayfields['status']['checked'])) { print ''; -$searchpicto = $form->showFilterButtons(); -print $searchpicto; -print ''; + $searchpicto = $form->showFilterButtons(); + print $searchpicto; + print '
'; + if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + $selected = 0; + if (in_array($obj->rowid, $arrayofselected)) { + $selected = 1; + } + print ''; + } + print ''; @@ -1002,15 +1029,17 @@ while ($i < min($num, $limit)) { print ''.($obj->nb_closed > 0 ? $obj->nb_closed : '').''; - if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined - $selected = 0; - if (in_array($obj->rowid, $arrayofselected)) { - $selected = 1; + if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; + if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + $selected = 0; + if (in_array($obj->rowid, $arrayofselected)) { + $selected = 1; + } + print ''; } - print ''; + print '