Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
628554caf4
@ -8279,10 +8279,11 @@ class Form
|
||||
* @param string $htmlname Name of HTML field
|
||||
* @param array $array Array with array of fields we could show. This array may be modified according to setup of user.
|
||||
* @param string $varpage Id of context for page. Can be set by caller with $varpage=(empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage);
|
||||
* @param string $pos position colon on liste value left or right
|
||||
* @return string HTML multiselect string
|
||||
* @see selectarray()
|
||||
*/
|
||||
public static function multiSelectArrayWithCheckbox($htmlname, &$array, $varpage)
|
||||
public static function multiSelectArrayWithCheckbox($htmlname, &$array, $varpage, $pos = '')
|
||||
{
|
||||
global $conf, $langs, $user, $extrafields;
|
||||
|
||||
@ -8349,7 +8350,7 @@ class Form
|
||||
</dt>
|
||||
<dd class="dropdowndd">
|
||||
<div class="multiselectcheckbox'.$htmlname.'">
|
||||
<ul class="ul'.$htmlname.'">
|
||||
<ul class="ul'.$htmlname.' '.$htmlname.$pos.'">
|
||||
'.$listoffieldsforselection.'
|
||||
</ul>
|
||||
</div>
|
||||
@ -9440,13 +9441,19 @@ class Form
|
||||
/**
|
||||
* Return HTML to show the search and clear seach button
|
||||
*
|
||||
* @param string $pos position colon on liste value left or right
|
||||
* @return string
|
||||
*/
|
||||
public function showFilterButtons()
|
||||
public function showFilterButtons($pos = '')
|
||||
{
|
||||
$out = '<div class="nowraponall">';
|
||||
$out .= '<button type="submit" class="liste_titre button_search reposition" name="button_search_x" value="x"><span class="fa fa-search"></span></button>';
|
||||
$out .= '<button type="submit" class="liste_titre button_removefilter reposition" name="button_removefilter_x" value="x"><span class="fa fa-remove"></span></button>';
|
||||
if ($pos == 'left') {
|
||||
$out .= '<button type="submit" class="liste_titre button_removefilter reposition" name="button_removefilter_x" value="x"><span class="fa fa-remove"></span></button>';
|
||||
$out .= '<button type="submit" class="liste_titre button_search reposition" name="button_search_x" value="x"><span class="fa fa-search"></span></button>';
|
||||
} else {
|
||||
$out .= '<button type="submit" class="liste_titre button_search reposition" name="button_search_x" value="x"><span class="fa fa-search"></span></button>';
|
||||
$out .= '<button type="submit" class="liste_titre button_removefilter reposition" name="button_removefilter_x" value="x"><span class="fa fa-remove"></span></button>';
|
||||
}
|
||||
$out .= '</div>';
|
||||
|
||||
return $out;
|
||||
|
||||
@ -173,7 +173,12 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ
|
||||
// Create the global $hookmanager object
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
||||
$hookmanager = new HookManager($db);
|
||||
$reshook = $hookmanager->initHooks(array('doUpgradeBefore'));
|
||||
$hookmanager->initHooks(array('upgrade2'));
|
||||
|
||||
$parameters = array('versionfrom' => $versionfrom, 'versionto' => $versionto);
|
||||
$object = new stdClass();
|
||||
$action = "upgrade";
|
||||
$reshook = $hookmanager->executeHooks('doUpgradeBefore', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook >= 0 && is_array($hookmanager->resArray)) {
|
||||
// Example: $hookmanager->resArray = array(2, 3, 10);
|
||||
$listofentities = array_unique(array_merge($listofentities, $hookmanager->resArray));
|
||||
|
||||
@ -12,6 +12,7 @@
|
||||
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (C) 2020 Open-Dsi <support@open-dsi.fr>
|
||||
* Copyright (C) 2021 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2022 Anthony Berton <anthony.berton@bb2a.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -998,8 +999,12 @@ if ($moreforfilter) {
|
||||
}
|
||||
|
||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||
// Show the massaction checkboxes only when this page is not opend from the Extended POS
|
||||
if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
|
||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||
} else {
|
||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, 'left'); // This also change content of $arrayfields
|
||||
}
|
||||
// Show the massaction checkboxes only when this page is not opend from the Extended POS
|
||||
if ($massactionbutton && $contextpage != 'poslist') {
|
||||
$selectedfields .= $form->showCheckAddButtons('checkforselect', 1);
|
||||
}
|
||||
@ -1013,6 +1018,13 @@ print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" :
|
||||
|
||||
// Fields title search
|
||||
print '<tr class="liste_titre_filter">';
|
||||
if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
|
||||
// Action column
|
||||
print '<td class="liste_titre center actioncolumn">';
|
||||
$searchpicto = $form->showFilterButtons('left');
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
}
|
||||
if (!empty($arrayfields['s.rowid']['checked'])) {
|
||||
print '<td class="liste_titre" data-key="id">';
|
||||
print '<input class="flat searchstring" type="text" name="search_id" size="1" value="'.dol_escape_htmltag($search_id).'">';
|
||||
@ -1241,14 +1253,19 @@ if (!empty($arrayfields['s.import_key']['checked'])) {
|
||||
print '<input class="flat searchstring maxwidth50" type="text" name="search_import_key" value="'.dol_escape_htmltag($search_import_key).'">';
|
||||
print '</td>';
|
||||
}
|
||||
// Action column
|
||||
print '<td class="liste_titre center actioncolumn">';
|
||||
$searchpicto = $form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
|
||||
// Action column
|
||||
print '<td class="liste_titre center actioncolumn">';
|
||||
$searchpicto = $form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
print "</tr>\n";
|
||||
print '<tr class="liste_titre">';
|
||||
if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch actioncolumn ');
|
||||
}
|
||||
if (!empty($arrayfields['s.rowid']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['s.rowid']['label'], $_SERVER["PHP_SELF"], "s.rowid", "", $param, ' data-key="id"', $sortfield, $sortorder, 'actioncolumn ');
|
||||
}
|
||||
@ -1363,7 +1380,9 @@ if (!empty($arrayfields['s.status']['checked'])) {
|
||||
if (!empty($arrayfields['s.import_key']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['s.import_key']['label'], $_SERVER["PHP_SELF"], "s.import_key", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
}
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch actioncolumn ');
|
||||
if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch actioncolumn ');
|
||||
}
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
@ -1399,6 +1418,19 @@ while ($i < min($num, $limit)) {
|
||||
print ' onclick="location.href=\'list.php?action=change&contextpage=poslist&idcustomer='.$obj->rowid.'&place='.urlencode($place).'\'"';
|
||||
}
|
||||
print '>';
|
||||
|
||||
// Action column (Show the massaction button only when this page is not opend from the Extended POS)
|
||||
if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
|
||||
print '<td class="nowrap center actioncolumn">';
|
||||
if (($massactionbutton || $massaction) && $contextpage != 'poslist') { // 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 '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
if (!empty($arrayfields['s.rowid']['checked'])) {
|
||||
print '<td class="tdoverflowmax50" data-key="id">';
|
||||
print $obj->rowid;
|
||||
@ -1707,17 +1739,18 @@ while ($i < min($num, $limit)) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
|
||||
// Action column (Show the massaction button only when this page is not opend from the Extended POS)
|
||||
print '<td class="nowrap center actioncolumn">';
|
||||
if (($massactionbutton || $massaction) && $contextpage != 'poslist') { // 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 (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
|
||||
print '<td class="nowrap center actioncolumn">';
|
||||
if (($massactionbutton || $massaction) && $contextpage != 'poslist') { // 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 '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
print '</td>';
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
@ -6494,6 +6494,9 @@ dl.dropdown {
|
||||
overflow: auto;
|
||||
border-radius: 2px;
|
||||
}
|
||||
.dropdown dd ul.selectedfieldsleft {
|
||||
right: auto;
|
||||
}
|
||||
.dropdown dd ul li {
|
||||
white-space: nowrap;
|
||||
font-weight: normal;
|
||||
|
||||
@ -6259,6 +6259,9 @@ dl.dropdown {
|
||||
max-height: 264px;
|
||||
overflow: auto;
|
||||
}
|
||||
.dropdown dd ul.selectedfieldsleft {
|
||||
right: auto;
|
||||
}
|
||||
.dropdown dd ul li {
|
||||
white-space: nowrap;
|
||||
font-weight: normal;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user