diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php index 39e7d4f67c8..98bb4d72361 100644 --- a/htdocs/admin/emailcollector_list.php +++ b/htdocs/admin/emailcollector_list.php @@ -555,7 +555,14 @@ while ($i < $imaxinloop) { print '
'; } // Output Kanban - print $object->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); + $selected = -1; + 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($object->id, $arrayofselected)) { + $selected = 1; + } + } + print $object->getKanbanView('', array('selected' => $selected)); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index 2826ed9b703..5cb2c0a11fe 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -697,8 +697,15 @@ while ($i < $imaxinloop) { $prod = null; } - // Output kanban - print $object->getKanbanView('', array('prod'=>$prod, 'selected' => in_array($object->id, $arrayofselected))); + // Output Kanban + $selected = -1; + 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($object->id, $arrayofselected)) { + $selected = 1; + } + } + print $object->getKanbanView('', array('prod'=>$prod, 'selected' => $selected)); if ($i == ($imaxinloop - 1)) { print ''; print ''; diff --git a/htdocs/bookcal/availabilities_list.php b/htdocs/bookcal/availabilities_list.php index cf79f93e96e..5adc58a5c16 100644 --- a/htdocs/bookcal/availabilities_list.php +++ b/htdocs/bookcal/availabilities_list.php @@ -641,7 +641,14 @@ while ($i < $imaxinloop) { print '
'; } // Output Kanban - print $object->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); + $selected = -1; + 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($object->id, $arrayofselected)) { + $selected = 1; + } + } + print $object->getKanbanView('', array('selected' => $selected)); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/bookmarks/list.php b/htdocs/bookmarks/list.php index 3e4ae193a94..1ff8d4bd42a 100644 --- a/htdocs/bookmarks/list.php +++ b/htdocs/bookmarks/list.php @@ -358,7 +358,14 @@ while ($i < $imaxinloop) { print '
'; } // Output Kanban - print $object->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); + $selected = -1; + 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($object->id, $arrayofselected)) { + $selected = 1; + } + } + print $object->getKanbanView('', array('selected' => $selected)); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/compta/cashcontrol/cashcontrol_list.php b/htdocs/compta/cashcontrol/cashcontrol_list.php index 7bc7d80aa26..e1797c76ec3 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_list.php +++ b/htdocs/compta/cashcontrol/cashcontrol_list.php @@ -585,7 +585,15 @@ while ($i < ($limit ? min($num, $limit) : $num)) { $object->year_close = $obj->year_close; $object->cheque = $obj->cheque; - print $object->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); + // Output Kanban + $selected = -1; + 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($object->id, $arrayofselected)) { + $selected = 1; + } + } + print $object->getKanbanView('', array('selected' => $selected)); if ($i == (min($num, $limit) - 1)) { print ''; print ''; diff --git a/htdocs/compta/prelevement/list.php b/htdocs/compta/prelevement/list.php index 0e3daaf496b..b9f300ddfc1 100644 --- a/htdocs/compta/prelevement/list.php +++ b/htdocs/compta/prelevement/list.php @@ -379,13 +379,14 @@ while ($i < $imaxinloop) { print '
'; } // Output Kanban + $selected = -1; 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($object->id, $arrayofselected)) { $selected = 1; } } - print $object->getKanbanView('', array('selected' => in_array($bon->id, $arrayofselected))); + print $object->getKanbanView('', array('selected' => $selected)); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/compta/tva/list.php b/htdocs/compta/tva/list.php index 9e5a28b6905..49031f482c9 100644 --- a/htdocs/compta/tva/list.php +++ b/htdocs/compta/tva/list.php @@ -593,13 +593,14 @@ while ($i < $imaxinloop) { print '
'; } // Output Kanban + $selected = -1; 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($object->id, $arrayofselected)) { $selected = 1; } } - print $object->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); + print $object->getKanbanView('', array('selected' => $selected)); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php index dcfb1809936..38f7f5de305 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_list.php +++ b/htdocs/eventorganization/conferenceorboothattendee_list.php @@ -944,13 +944,14 @@ while ($i < $imaxinloop) { print '
'; } // Output Kanban + $selected = -1; 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($object->id, $arrayofselected)) { $selected = 1; } } - print $object->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); + print $object->getKanbanView('', array('selected' => $selected)); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index 119b6ad9b8e..e0b69daf63c 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -908,7 +908,16 @@ while ($i < min($num, $limit)) { } $object->date_delivery = $obj->delivery_date; $object->town = $obj->town; - print $object->getKanbanView('', array('thirdparty' => $companystatic->getNomUrl(1), 'selected' => in_array($obj->id, $arrayofselected))); + + // Output Kanban + $selected = -1; + 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($object->id, $arrayofselected)) { + $selected = 1; + } + } + print $object->getKanbanView('', array('thirdparty' => $companystatic->getNomUrl(1), 'selected' => $selected)); if ($i == min($num, $limit) - 1) { print ''; print ''; diff --git a/htdocs/hrm/evaluation_list.php b/htdocs/hrm/evaluation_list.php index 4b7e343be7e..b5e08794593 100644 --- a/htdocs/hrm/evaluation_list.php +++ b/htdocs/hrm/evaluation_list.php @@ -643,6 +643,7 @@ while ($i < $imaxinloop) { $userstatic = new User($db); $userstatic->fetch($obj->fk_user); + $selected = -1; 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($object->id, $arrayofselected)) { diff --git a/htdocs/hrm/job_list.php b/htdocs/hrm/job_list.php index 369796130e8..f2c52a876e4 100644 --- a/htdocs/hrm/job_list.php +++ b/htdocs/hrm/job_list.php @@ -609,7 +609,14 @@ while ($i < $imaxinloop) { print '
'; } // Output Kanban - print $object->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); + $selected = -1; + 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($object->id, $arrayofselected)) { + $selected = 1; + } + } + print $object->getKanbanView('', array('selected' => $selected)); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/hrm/position_list.php b/htdocs/hrm/position_list.php index dad14763a7d..449a51955d6 100644 --- a/htdocs/hrm/position_list.php +++ b/htdocs/hrm/position_list.php @@ -636,14 +636,15 @@ while ($i < $imaxinloop) { $userstatic->login = $obj->login; $userstatic->photo = $obj->photo; - // output kanban + // Output kanban + $selected = -1; 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($object->id, $arrayofselected)) { $selected = 1; } - print $object->getKanbanView('', array('user' => $userstatic->getNomUrl(-1), 'job'=> $jobstatic->getNomUrl(1), 'selected' => in_array($object->id, $arrayofselected))); } + print $object->getKanbanView('', array('user' => $userstatic->getNomUrl(-1), 'job'=> $jobstatic->getNomUrl(1), 'selected' => $selected)); if ($i == ($imaxinloop - 1)) { print ''; print ''; diff --git a/htdocs/hrm/skill_list.php b/htdocs/hrm/skill_list.php index b6eaef680ba..059bfb1d038 100644 --- a/htdocs/hrm/skill_list.php +++ b/htdocs/hrm/skill_list.php @@ -626,13 +626,15 @@ while ($i < $imaxinloop) { $object->skill_type = $obj->skill_type; $object->description = $obj->description; + // Output Kanban + $selected = -1; 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($object->id, $arrayofselected)) { $selected = 1; } } - print $object->getKanbanView('', array('selected' => in_array($obj->id, $arrayofselected))); + print $object->getKanbanView('', array('selected' => $selected)); if ($i == ($imaxinloop - 1)) { print ''; print ''; diff --git a/htdocs/intracommreport/list.php b/htdocs/intracommreport/list.php index 772c2e6a6eb..84fbf128162 100644 --- a/htdocs/intracommreport/list.php +++ b/htdocs/intracommreport/list.php @@ -578,13 +578,14 @@ while ($i < $imaxinloop) { print '
'; } // Output Kanban + $selected = -1; 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($object->id, $arrayofselected)) { $selected = 1; } } - print $object->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); + print $object->getKanbanView('', array('selected' => $selected)); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/knowledgemanagement/knowledgerecord_list.php b/htdocs/knowledgemanagement/knowledgerecord_list.php index 25f41a0c719..4ac4376b32a 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_list.php +++ b/htdocs/knowledgemanagement/knowledgerecord_list.php @@ -667,7 +667,14 @@ while ($i < $imaxinloop) { print '
'; } // Output Kanban - print $object->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); + $selected = -1; + 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($object->id, $arrayofselected)) { + $selected = 1; + } + } + print $object->getKanbanView('', array('selected' => $selected)); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/loan/list.php b/htdocs/loan/list.php index 7542932b022..ac524a79a4c 100644 --- a/htdocs/loan/list.php +++ b/htdocs/loan/list.php @@ -31,14 +31,16 @@ require_once DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php'; // Load translation files required by the page $langs->loadLangs(array("banks", "bills", "compta", "loan")); +$massaction = GETPOST('massaction', 'alpha'); + $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); -$massaction = GETPOST('massaction', 'alpha'); -if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { +if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { + // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; -} // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action +} $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; @@ -72,12 +74,14 @@ if ($user->socid) { } $result = restrictedArea($user, 'loan', '', '', ''); + /* * Actions */ if (GETPOST('cancel', 'alpha')) { - $action = 'list'; $massaction = ''; + $action = 'list'; + $massaction = ''; } if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction = ''; @@ -113,6 +117,8 @@ llxHeader('', $title, $help_url); $arrayofselected = is_array($toselect) ? $toselect : array(); +// Build and execute select +// -------------------------------------------------------------------- $sql = "SELECT l.rowid, l.label, l.capital, l.datestart, l.dateend, l.paid,"; $sql .= " SUM(pl.amount_capital) as alreadypaid"; @@ -139,7 +145,6 @@ $nbtotalofrecords = ''; if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); - $sqlforcount = preg_replace('/'.preg_quote($linktopl, '/').'/', '', $sqlforcount); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); $resql = $db->query($sqlforcount); if ($resql) { @@ -149,7 +154,7 @@ if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { dol_print_error($db); } - if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then 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; } @@ -171,6 +176,17 @@ if (!$resql) { $num = $db->num_rows($resql); + + +// Direct jump if only one record found +if ($num == 1 && getDolGlobalInt('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) { + $obj = $db->fetch_object($resql); + $id = $obj->rowid; + header("Location: ".dol_buildpath('/mymodule/myobject_card.php', 1).'?id='.((int) $id)); + exit; +} + + // Output page // -------------------------------------------------------------------- if ($resql) { @@ -209,6 +225,8 @@ if ($resql) { $newcardbutton .= dolGetButtonTitleSeparator(); $newcardbutton .= dolGetButtonTitle($langs->trans('NewLoan'), '', 'fa fa-plus-circle', $url, '', $permissiontoadd); + $massactionbutton = $form->selectMassAction('', $arrayofmassactions); + print '
'."\n"; if ($optioncss != '') { print ''; @@ -218,22 +236,50 @@ if ($resql) { print ''; print ''; print ''; + print ''; print ''; + print ''; print ''; + $newcardbutton = ''; + $newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition')); + $newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition')); + $newcardbutton .= dolGetButtonTitleSeparator(); + $newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/loan/card.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd); - print_barre_liste($langs->trans("Loans"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'money-bill-alt', 0, $newcardbutton, '', $limit, 0, 0, 1); + print_barre_liste($langs->trans("Loans"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'money-bill-alt', 0, $newcardbutton, '', $limit, 0, 0, 1); - $moreforfilter = ''; + $parameters = array(); + $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + if (empty($reshook)) { + $moreforfilter .= $hookmanager->resPrint; + } else { + $moreforfilter = $hookmanager->resPrint; + } + + if (!empty($moreforfilter)) { + print '
'; + print $moreforfilter; + $parameters = array(); + $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + print '
'; + } + + $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; + $selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields + $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; - print ''."\n"; + print '
'."\n"; - // Filters lines + // Fields title search + // -------------------------------------------------------------------- print ''; + // Action column if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { - print ''; } @@ -256,14 +302,14 @@ if ($resql) { // No filter: Status print ''; - // Filter: Buttons + // Action column if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { - print ''; } - print ''; + print ''."\n"; $totalarray = array(); $totalarray['nbfield'] = 0; @@ -271,6 +317,7 @@ if ($resql) { // Fields title label // -------------------------------------------------------------------- print ''; + // Action column if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch '); $totalarray['nbfield']++; @@ -293,13 +340,13 @@ if ($resql) { } print "\n"; - print "\n"; // Loop on record // -------------------------------------------------------------------- $i = 0; $savnbfield = $totalarray['nbfield']; $totalarray = array(); + $totalarray['nbfield'] = 0; $imaxinloop = ($limit ? min($num, $limit) : $num); while ($i < $imaxinloop) { $obj = $db->fetch_object($resql); @@ -324,13 +371,21 @@ if ($resql) { $object->capital = $obj->capital; $object->totalpaid = $obj->paid; - print $object->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); + // Output Kanban + $selected = -1; + 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($object->id, $arrayofselected)) { + $selected = 1; + } + } + print $object->getKanbanView('', array('selected' => $selected)); if ($i == ($imaxinloop - 1)) { print ''; print ''; } } else { - print ''; + print ''; // Action column if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { @@ -361,7 +416,7 @@ if ($resql) { print ''; } - print "\n"; + print ''."\n"; } $i++; } @@ -374,7 +429,7 @@ if ($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 '
'; - $searchpicto = $form->showFilterAndCheckAddButtons(); + print ''; + $searchpicto = $form->showFilterButtons('left'); print $searchpicto; print ''; - $searchpicto = $form->showFilterAndCheckAddButtons(); + print ''; + $searchpicto = $form->showFilterButtons(); print $searchpicto; print '
'."\n"; diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php index 62d9babd6bb..c63e2c708a9 100644 --- a/htdocs/mrp/mo_list.php +++ b/htdocs/mrp/mo_list.php @@ -632,7 +632,14 @@ while ($i < $imaxinloop) { } // Output Kanban - print $object->getKanbanView('', array('bom'=>($obj->fk_bom > 0 ? $bom : null), 'product'=>($obj->fk_product > 0 ? $product: null), 'selected' => in_array($object->id, $arrayofselected))); + $selected = -1; + 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($object->id, $arrayofselected)) { + $selected = 1; + } + } + print $object->getKanbanView('', array('bom'=>($obj->fk_bom > 0 ? $bom : null), 'product'=>($obj->fk_product > 0 ? $product: null), 'selected' => $selected)); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/partnership/partnership_list.php b/htdocs/partnership/partnership_list.php index a6653c17a17..bdfec47074c 100644 --- a/htdocs/partnership/partnership_list.php +++ b/htdocs/partnership/partnership_list.php @@ -884,7 +884,14 @@ while ($i < $imaxinloop) { print '
'; } // Output Kanban - print $object->getKanbanView('', array('thirdparty'=>$object->thirdparty, 'selected' => in_array($object->id, $arrayofselected))); + $selected = -1; + 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($object->id, $arrayofselected)) { + $selected = 1; + } + } + print $object->getKanbanView('', array('thirdparty'=>$object->thirdparty, 'selected' => $selected)); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php index 089387cd9a2..35fc87c16e1 100644 --- a/htdocs/product/inventory/list.php +++ b/htdocs/product/inventory/list.php @@ -648,13 +648,14 @@ while ($i < $imaxinloop) { print '
'; } // Output Kanban + $selected = -1; 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($object->id, $arrayofselected)) { $selected = 1; } } - print $object->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); + print $object->getKanbanView('', array('selected' => $selected)); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 2de178bf2de..2ecbc0ecd03 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -1557,13 +1557,14 @@ while ($i < $imaxinloop) { } // Output Kanban + $selected = -1; 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($object->id, $arrayofselected)) { $selected = 1; } } - print $object->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); + print $object->getKanbanView('', array('selected' => $selected)); if ($i == ($imaxinloop - 1)) { print ''; print ''; diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index 0b83b7539a2..29be851b27d 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -1402,13 +1402,14 @@ while ($i < $imaxinloop) { print '
'; } // Output Kanban + $selected = -1; 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($object->id, $arrayofselected)) { $selected = 1; } } - print $object->getKanbanView('', array('selected' => in_array($warehousestatic->id, $arrayofselected))); + print $object->getKanbanView('', array('selected' => $selected)); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/recruitment/recruitmentcandidature_list.php b/htdocs/recruitment/recruitmentcandidature_list.php index ecb15194ab8..069d7ce7129 100644 --- a/htdocs/recruitment/recruitmentcandidature_list.php +++ b/htdocs/recruitment/recruitmentcandidature_list.php @@ -752,11 +752,16 @@ while ($i < $imaxinloop) { $recruitment->fetch($obj->fk_recruitmentjobposition); $object->phone = $obj->phone; - if ($massactionbutton || $massaction) { - $selected = 0; - } + // Output Kanban - print $object->getKanbanView('', array('jobpositionlink'=>$recruitment->getNomUrl(1), 'selected' => in_array($object->id, $arrayofselected))); + $selected = -1; + 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($object->id, $arrayofselected)) { + $selected = 1; + } + } + print $object->getKanbanView('', array('jobpositionlink'=>$recruitment->getNomUrl(1), 'selected' => $selected)); if ($i == ($imaxinloop - 1)) { print ''; print ''; diff --git a/htdocs/recruitment/recruitmentjobposition_list.php b/htdocs/recruitment/recruitmentjobposition_list.php index 4b468fbb317..3e3f4d1c77b 100644 --- a/htdocs/recruitment/recruitmentjobposition_list.php +++ b/htdocs/recruitment/recruitmentjobposition_list.php @@ -597,7 +597,14 @@ while ($i < $imaxinloop) { $selected = 0; } // Output Kanban - print $object->getKanbanView('', array('nbapplications'=>$obj->nbapplications, 'selected' => in_array($object->id, $arrayofselected))); + $selected = -1; + 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($object->id, $arrayofselected)) { + $selected = 1; + } + } + print $object->getKanbanView('', array('nbapplications'=>$obj->nbapplications, 'selected' => $selected)); if ($i == ($imaxinloop - 1)) { print ''; print ''; diff --git a/htdocs/user/group/list.php b/htdocs/user/group/list.php index d0998329fa0..0ffc7111a8e 100644 --- a/htdocs/user/group/list.php +++ b/htdocs/user/group/list.php @@ -409,13 +409,14 @@ while ($i < $imaxinloop) { print '
'; } // Output Kanban + $selected = -1; 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($object->id, $arrayofselected)) { $selected = 1; } } - print $object->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); + print $object->getKanbanView('', array('selected' => $selected)); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/user/list.php b/htdocs/user/list.php index 7377ed83330..a6ca07916f1 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -1017,7 +1017,14 @@ while ($i < $imaxinloop) { } // Output Kanban - print $object->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); + $selected = -1; + 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($object->id, $arrayofselected)) { + $selected = 1; + } + } + print $object->getKanbanView('', array('selected' => $selected)); if ($i == ($imaxinloop - 1)) { print ''; print ''; diff --git a/htdocs/variants/list.php b/htdocs/variants/list.php index c49e87cebd2..408cf2cd800 100644 --- a/htdocs/variants/list.php +++ b/htdocs/variants/list.php @@ -671,13 +671,14 @@ while ($i < $imaxinloop) { print '
'; } // Output Kanban + $selected = -1; 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($object->id, $arrayofselected)) { $selected = 1; } } - print $object->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); + print $object->getKanbanView('', array('selected' => $selected)); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/webhook/target_list.php b/htdocs/webhook/target_list.php index cfca93ba7d3..76d564fbc2b 100644 --- a/htdocs/webhook/target_list.php +++ b/htdocs/webhook/target_list.php @@ -637,7 +637,14 @@ while ($i < $imaxinloop) { print '
'; } // Output Kanban - print $object->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); + $selected = -1; + 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($object->id, $arrayofselected)) { + $selected = 1; + } + } + print $object->getKanbanView('', array('selected' => $selected)); if ($i == ($imaxinloop - 1)) { print '
'; print ''; diff --git a/htdocs/workstation/workstation_list.php b/htdocs/workstation/workstation_list.php index fb334a0d1b4..bd265fc92dd 100644 --- a/htdocs/workstation/workstation_list.php +++ b/htdocs/workstation/workstation_list.php @@ -634,7 +634,14 @@ while ($i < $imaxinloop) { print '
'; } // Output Kanban - print $object->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected))); + $selected = -1; + 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($object->id, $arrayofselected)) { + $selected = 1; + } + } + print $object->getKanbanView('', array('selected' => $selected)); if ($i == ($imaxinloop - 1)) { print '
'; print '';