diff --git a/dev/tools/apstats.php b/dev/tools/apstats.php index d4de218a253..763d5e46c01 100755 --- a/dev/tools/apstats.php +++ b/dev/tools/apstats.php @@ -1,7 +1,7 @@ #!/usr/bin/env php + * Copyright (C) 2023-2024 Laurent Destailleur * Copyright (C) 2024 MDW * Copyright (C) 2024 Frédéric France * @@ -40,8 +40,6 @@ error_reporting(E_ALL & ~E_DEPRECATED); define('PRODUCT', "apstats"); define('VERSION', "1.0"); -$phpstanlevel = 3; - // Include Dolibarr environment if (!is_readable("{$path}../../htdocs/config/config.php")) { define("DOL_DOCUMENT_ROOT", __DIR__."/../../htdocs"); @@ -99,11 +97,12 @@ while ($i < $argc) { $i++; } +// PHPSTAN setup +$PHPSTANLEVEL = 4; -// Configuration is required, otherwise phan is disabled. +// PHAN setup. Configuration is required, otherwise phan is disabled. $PHAN_CONFIG = "{$path}phan/config_extended.php"; -// BASELINE is ignored if it does not exist -$PHAN_BASELINE = "{$path}phan/baseline_extended.txt"; +$PHAN_BASELINE = "{$path}phan/baseline_extended.txt"; // BASELINE is ignored if it does not exist $PHAN_MIN_PHP = "7.0"; $PHAN_MEMORY_OPT = "--memory-limit 5G"; @@ -150,7 +149,7 @@ $phpstanversion = $output_arrtd[0]; $output_arrtd = array(); if ($dirphpstan != 'disabled') { - $commandcheck = ($dirphpstan ? $dirphpstan.'/' : '').'phpstan --level='.$phpstanlevel.' -v analyze -a build/phpstan/bootstrap.php --memory-limit 5G --error-format=github'; + $commandcheck = ($dirphpstan ? $dirphpstan.'/' : '').'phpstan --level='.$PHPSTANLEVEL.' -v analyze -a build/phpstan/bootstrap.php --memory-limit 5G --error-format=github'; print 'Execute PHPStan to get the technical debt: '.$commandcheck."\n"; $resexectd = 0; exec($commandcheck, $output_arrtd, $resexectd); @@ -1044,7 +1043,7 @@ if ($dirphpstan != 'disabled') { ]}); '; $html .= '
'."\n"; - $html .= '

Technical debt ('.$phpstanversion.' - level '.$phpstanlevel.' -> '.$nblines.' warnings)

'."\n"; + $html .= '

Technical debt ('.$phpstanversion.' - level '.$PHPSTANLEVEL.' -> '.$nblines.' warnings)

'."\n"; $html .= '
'."\n"; $html .= '
'."\n"; diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 1e6cd487bc2..2eea530e96e 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -457,7 +457,8 @@ if ($resql) { 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 + $htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup + $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); $moreforfilter = ''; diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php index 28c07287bc0..cbe4bb37352 100644 --- a/htdocs/accountancy/admin/accountmodel.php +++ b/htdocs/accountancy/admin/accountmodel.php @@ -185,7 +185,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) { setEventMessages($langs->transnoentities('ErrorCodeCantContainZero'), null, 'errors'); } } - if (GETPOSTISSET("country") && (GETPOST("country") == '0') && ($id != 2)) { + if (GETPOSTISSET("country") && GETPOST("country") == '0') { $ok = 0; setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities("Country")), null, 'errors'); } @@ -358,315 +358,307 @@ if ($action == 'delete') { } //var_dump($elementList); -/* - * Show a dictionary - */ -if ($id) { - // Complete requete recherche valeurs avec critere de tri - $sql = $tabsql[$id]; +// Show a dictionary - if ($search_country_id > 0) { - if (preg_match('/ WHERE /', $sql)) { - $sql .= " AND "; +// Complete requete recherche valeurs avec critere de tri +$sql = $tabsql[$id]; + +if ($search_country_id > 0) { + if (preg_match('/ WHERE /', $sql)) { + $sql .= " AND "; + } else { + $sql .= " WHERE "; + } + $sql .= " c.rowid = ".((int) $search_country_id); +} + +// If sort order is "country", we use country_code instead +if ($sortfield == 'country') { + $sortfield = 'country_code'; +} +$sql .= $db->order($sortfield, $sortorder); +$sql .= $db->plimit($listlimit + 1, $offset); +//print $sql; + +$fieldlist = explode(',', $tabfield[$id]); + +print '
'; +print ''; + +print '
'; +print ''; + +// Form to add a new line + +$fieldlist = explode(',', $tabfield[$id]); + +// Line for title +print ''; +foreach ($fieldlist as $field => $value) { + // Determine le nom du champ par rapport aux noms possibles + // dans les dictionnaires de donnees + $valuetoshow = ucfirst($fieldlist[$field]); // By default + $valuetoshow = $langs->trans($valuetoshow); // try to translate + $class = "left"; + if ($fieldlist[$field] == 'code') { + $valuetoshow = $langs->trans("Code"); + } + if ($fieldlist[$field] == 'label') { + $valuetoshow = $langs->trans("Label"); + $class = 'minwidth300'; + } + if ($fieldlist[$field] == 'country') { + if (in_array('region_id', $fieldlist)) { + print ''; + continue; + } // For region page, we do not show the country input + $valuetoshow = $langs->trans("Country"); + } + if ($fieldlist[$field] == 'country_id') { + $valuetoshow = ''; + } + if ($fieldlist[$field] == 'pcg_version' || $fieldlist[$field] == 'fk_pcg_version') { + $valuetoshow = $langs->trans("Pcg_version"); + } + //var_dump($value); + + if ($valuetoshow != '') { + print ''; + } +} + +print ''; +print ''; +print ''; +print ''; + +// Line to enter new values +print ''; + +$obj = new stdClass(); +// If data was already input, we define them in obj to populate input fields. +if (GETPOST('actionadd', 'alpha')) { + foreach ($fieldlist as $key => $val) { + if (GETPOST($val)) { + $obj->$val = GETPOST($val); + } + } +} + +$tmpaction = 'create'; +$parameters = array('fieldlist' => $fieldlist, 'tabname' => $tabname[$id]); +$reshook = $hookmanager->executeHooks('createDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks +$error = $hookmanager->error; +$errors = $hookmanager->errors; + +if (empty($reshook)) { + fieldListAccountModel($fieldlist, $obj, $tabname[$id], 'add'); +} + +print ''; +print ""; + +$colspan = count($fieldlist) + 3; + +print ''; // Keep   to have a line with enough height + + + +// List of available values in database +dol_syslog("htdocs/admin/dict", LOG_DEBUG); +$resql = $db->query($sql); +if ($resql) { + $num = $db->num_rows($resql); + $i = 0; + + $param = '&id='.urlencode((string) ($id)); + if ($search_country_id > 0) { + $param .= '&search_country_id='.urlencode((string) ($search_country_id)); + } + $paramwithsearch = $param; + if ($sortorder) { + $paramwithsearch .= '&sortorder='.urlencode($sortorder); + } + if ($sortfield) { + $paramwithsearch .= '&sortfield='.urlencode($sortfield); } - // If sort order is "country", we use country_code instead - if ($sortfield == 'country') { - $sortfield = 'country_code'; + // There is several pages + if ($num > $listlimit) { + print ''; } - $sql .= $db->order($sortfield, $sortorder); - $sql .= $db->plimit($listlimit + 1, $offset); - //print $sql; - $fieldlist = explode(',', $tabfield[$id]); + // Title line with search boxes + print ''; + foreach ($fieldlist as $field => $value) { + $showfield = 1; // By default - print ''; - print ''; + if ($fieldlist[$field] == 'region_id' || $fieldlist[$field] == 'country_id') { + $showfield = 0; + } - print '
'; - print '
 '; + if (!empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i', $tabhelp[$id][$value])) { + print ''.$valuetoshow.' '.img_help(1, $valuetoshow).''; + } elseif (!empty($tabhelp[$id][$value])) { + print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value]); } else { - $sql .= " WHERE "; + print $valuetoshow; } - $sql .= " c.rowid = ".((int) $search_country_id); + print ''; +print ''; +print '
'; +print ''; +print '
 
'; + print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit), ''); + print '
'; - - // Form to add a new line - - if ($tabname[$id]) { - $fieldlist = explode(',', $tabfield[$id]); - - // Line for title - print ''; - foreach ($fieldlist as $field => $value) { - // Determine le nom du champ par rapport aux noms possibles - // dans les dictionnaires de donnees - $valuetoshow = ucfirst($fieldlist[$field]); // By default - $valuetoshow = $langs->trans($valuetoshow); // try to translate - $class = "left"; - if ($fieldlist[$field] == 'code') { - $valuetoshow = $langs->trans("Code"); - } - if ($fieldlist[$field] == 'label') { - $valuetoshow = $langs->trans("Label"); - $class = 'minwidth300'; - } - if ($fieldlist[$field] == 'country') { - if (in_array('region_id', $fieldlist)) { - print ''; - continue; - } // For region page, we do not show the country input - $valuetoshow = $langs->trans("Country"); - } - if ($fieldlist[$field] == 'country_id') { - $valuetoshow = ''; - } - if ($fieldlist[$field] == 'pcg_version' || $fieldlist[$field] == 'fk_pcg_version') { - $valuetoshow = $langs->trans("Pcg_version"); - } - //var_dump($value); - - if ($valuetoshow != '') { - print ''; + } else { + print ''; } } - - print ''; - print ''; - print ''; - print ''; - - // Line to enter new values - print ''; - - $obj = new stdClass(); - // If data was already input, we define them in obj to populate input fields. - if (GETPOST('actionadd', 'alpha')) { - foreach ($fieldlist as $key => $val) { - if (GETPOST($val)) { - $obj->$val = GETPOST($val); - } - } - } - - $tmpaction = 'create'; - $parameters = array('fieldlist' => $fieldlist, 'tabname' => $tabname[$id]); - $reshook = $hookmanager->executeHooks('createDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks - $error = $hookmanager->error; - $errors = $hookmanager->errors; - - if (empty($reshook)) { - fieldListAccountModel($fieldlist, $obj, $tabname[$id], 'add'); - } - - print ''; - print ""; - - $colspan = count($fieldlist) + 3; - - print ''; // Keep   to have a line with enough height } + print ''; + print ''; + print ''; + // Title of lines + print ''; + print getTitleFieldOfList($langs->trans("Pcg_version"), 0, $_SERVER["PHP_SELF"], "pcg_version", ($page ? 'page='.$page.'&' : ''), $param, '', $sortfield, $sortorder, ''); + print getTitleFieldOfList($langs->trans("Label"), 0, $_SERVER["PHP_SELF"], "label", ($page ? 'page='.$page.'&' : ''), $param, '', $sortfield, $sortorder, ''); + print getTitleFieldOfList($langs->trans("Country"), 0, $_SERVER["PHP_SELF"], "country_code", ($page ? 'page='.$page.'&' : ''), $param, '', $sortfield, $sortorder, ''); + print getTitleFieldOfList($langs->trans("Status"), 0, $_SERVER["PHP_SELF"], "active", ($page ? 'page='.$page.'&' : ''), $param, '', $sortfield, $sortorder, 'center '); + print getTitleFieldOfList(''); + print getTitleFieldOfList(''); + print ''; - - // List of available values in database - dol_syslog("htdocs/admin/dict", LOG_DEBUG); - $resql = $db->query($sql); - if ($resql) { - $num = $db->num_rows($resql); + if ($num) { $i = 0; + // Lines with values + while ($i < $num) { + $obj = $db->fetch_object($resql); + //print_r($obj); - $param = '&id='.urlencode((string) ($id)); - if ($search_country_id > 0) { - $param .= '&search_country_id='.urlencode((string) ($search_country_id)); - } - $paramwithsearch = $param; - if ($sortorder) { - $paramwithsearch .= '&sortorder='.urlencode($sortorder); - } - if ($sortfield) { - $paramwithsearch .= '&sortfield='.urlencode($sortfield); - } + print ''; + if ($action == 'edit' && ($rowid == (!empty($obj->rowid) ? $obj->rowid : $obj->code))) { + print ''; + print ''; + print ''; + print ''; - // There is several pages - if ($num > $listlimit) { - print ''; - } + $tmpaction = 'edit'; + $parameters = array('fieldlist' => $fieldlist, 'tabname' => $tabname[$id]); + $reshook = $hookmanager->executeHooks('editDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks + $error = $hookmanager->error; + $errors = $hookmanager->errors; - // Title line with search boxes - print ''; - foreach ($fieldlist as $field => $value) { - $showfield = 1; // By default - - if ($fieldlist[$field] == 'region_id' || $fieldlist[$field] == 'country_id') { - $showfield = 0; - } - - if ($showfield) { - if ($value == 'country') { - print ''; - } else { - print ''; + if (empty($reshook)) { + fieldListAccountModel($fieldlist, $obj, $tabname[$id], 'edit'); } - } - } - print ''; - print ''; - print ''; - // Title of lines - print ''; - print getTitleFieldOfList($langs->trans("Pcg_version"), 0, $_SERVER["PHP_SELF"], "pcg_version", ($page ? 'page='.$page.'&' : ''), $param, '', $sortfield, $sortorder, ''); - print getTitleFieldOfList($langs->trans("Label"), 0, $_SERVER["PHP_SELF"], "label", ($page ? 'page='.$page.'&' : ''), $param, '', $sortfield, $sortorder, ''); - print getTitleFieldOfList($langs->trans("Country"), 0, $_SERVER["PHP_SELF"], "country_code", ($page ? 'page='.$page.'&' : ''), $param, '', $sortfield, $sortorder, ''); - print getTitleFieldOfList($langs->trans("Status"), 0, $_SERVER["PHP_SELF"], "active", ($page ? 'page='.$page.'&' : ''), $param, '', $sortfield, $sortorder, 'center '); - print getTitleFieldOfList(''); - print getTitleFieldOfList(''); - print ''; + print ''; + } else { + $tmpaction = 'view'; + $parameters = array('fieldlist' => $fieldlist, 'tabname' => $tabname[$id]); + $reshook = $hookmanager->executeHooks('viewDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks - if ($num) { - $i = 0; - // Lines with values - while ($i < $num) { - $obj = $db->fetch_object($resql); - //print_r($obj); + $error = $hookmanager->error; + $errors = $hookmanager->errors; - print ''; - if ($action == 'edit' && ($rowid == (!empty($obj->rowid) ? $obj->rowid : $obj->code))) { - print ''; - print ''; - print ''; - print ''; - - $tmpaction = 'edit'; - $parameters = array('fieldlist' => $fieldlist, 'tabname' => $tabname[$id]); - $reshook = $hookmanager->executeHooks('editDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks - $error = $hookmanager->error; - $errors = $hookmanager->errors; - - if (empty($reshook)) { - fieldListAccountModel($fieldlist, $obj, $tabname[$id], 'edit'); - } - - print ''; - } else { - $tmpaction = 'view'; - $parameters = array('fieldlist' => $fieldlist, 'tabname' => $tabname[$id]); - $reshook = $hookmanager->executeHooks('viewDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks - - $error = $hookmanager->error; - $errors = $hookmanager->errors; - - if (empty($reshook)) { - foreach ($fieldlist as $field => $value) { - $showfield = 1; - $class = "left"; - $tmpvar = $fieldlist[$field]; - $valuetoshow = $obj->$tmpvar; - if ($value == 'type_template') { - $valuetoshow = isset($elementList[$valuetoshow]) ? $elementList[$valuetoshow] : $valuetoshow; - } - if ($value == 'element') { - $valuetoshow = isset($elementList[$valuetoshow]) ? $elementList[$valuetoshow] : $valuetoshow; - } elseif ($value == 'source') { - $valuetoshow = isset($sourceList[$valuetoshow]) ? $sourceList[$valuetoshow] : $valuetoshow; - } elseif ($valuetoshow == 'all') { - $valuetoshow = $langs->trans('All'); - } elseif ($fieldlist[$field] == 'country') { - if (empty($obj->country_code)) { - $valuetoshow = '-'; - } else { - $key = $langs->trans("Country".strtoupper($obj->country_code)); - $valuetoshow = ($key != "Country".strtoupper($obj->country_code) ? $obj->country_code." - ".$key : $obj->country); - } - } elseif ($fieldlist[$field] == 'country_id') { - $showfield = 0; + if (empty($reshook)) { + foreach ($fieldlist as $field => $value) { + $showfield = 1; + $class = "left"; + $tmpvar = $fieldlist[$field]; + $valuetoshow = $obj->$tmpvar; + if ($value == 'type_template') { + $valuetoshow = isset($elementList[$valuetoshow]) ? $elementList[$valuetoshow] : $valuetoshow; + } + if ($value == 'element') { + $valuetoshow = isset($elementList[$valuetoshow]) ? $elementList[$valuetoshow] : $valuetoshow; + } elseif ($value == 'source') { + $valuetoshow = isset($sourceList[$valuetoshow]) ? $sourceList[$valuetoshow] : $valuetoshow; + } elseif ($valuetoshow == 'all') { + $valuetoshow = $langs->trans('All'); + } elseif ($fieldlist[$field] == 'country') { + if (empty($obj->country_code)) { + $valuetoshow = '-'; + } else { + $key = $langs->trans("Country".strtoupper($obj->country_code)); + $valuetoshow = ($key != "Country".strtoupper($obj->country_code) ? $obj->country_code." - ".$key : $obj->country); } + } elseif ($fieldlist[$field] == 'country_id') { + $showfield = 0; + } - $class = 'tddict'; - if ($fieldlist[$field] == 'tracking') { - $class .= ' tdoverflowauto'; - } - // Show value for field - if ($showfield) { - print ''; - } + $class = 'tddict'; + if ($fieldlist[$field] == 'tracking') { + $class .= ' tdoverflowauto'; + } + // Show value for field + if ($showfield) { + print ''; } } - - // Can an entry be erased or disabled ? - $iserasable = 1; - $canbedisabled = 1; - $canbemodified = 1; // true by default - - $url = $_SERVER["PHP_SELF"].'?token='.newToken().($page ? '&page='.$page : '').'&sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(!empty($obj->rowid) ? $obj->rowid : (!empty($obj->code) ? $obj->code : '')).'&code='.(!empty($obj->code) ? urlencode($obj->code) : ''); - if ($param) { - $url .= '&'.$param; - } - $url .= '&'; - - // Active - print '"; - - // Modify link - if ($canbemodified) { - print ''; - } else { - print ''; - } - - // Delete link - if ($iserasable) { - print ''; - } else { - print ''; - } - - print "\n"; } - $i++; + // Can an entry be erased or disabled ? + $iserasable = 1; + $canbedisabled = 1; + $canbemodified = 1; // true by default + + $url = $_SERVER["PHP_SELF"].'?token='.newToken().($page ? '&page='.$page : '').'&sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(!empty($obj->rowid) ? $obj->rowid : (!empty($obj->code) ? $obj->code : '')).'&code='.(!empty($obj->code) ? urlencode($obj->code) : ''); + $url .= '&'.$param.'&'; + + // Active + print '"; + + // Modify link + if ($canbemodified) { + print ''; + } else { + print ''; + } + + // Delete link + if ($iserasable) { + print ''; + } else { + print ''; + } + + print "\n"; } - } else { - print ''; + + $i++; } } else { - dol_print_error($db); + print ''; } - - print '
 '; - if (!empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i', $tabhelp[$id][$value])) { - print ''.$valuetoshow.' '.img_help(1, $valuetoshow).''; - } elseif (!empty($tabhelp[$id][$value])) { - print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value]); - } else { - print $valuetoshow; - } + if ($showfield) { + if ($value == 'country') { + print ''; + print $form->select_country($search_country_id, 'search_country_id', '', 28, 'maxwidth200 maxwidthonsmartphone'); print ''; - print ''; - print '
'; - print ''; - print '
 
'; + $searchpicto = $form->showFilterAndCheckAddButtons(0); + print $searchpicto; + print '
'; - print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit), ''); - print '
'; - print $form->select_country($search_country_id, 'search_country_id', '', 28, 'maxwidth200 maxwidthonsmartphone'); - print ''; - $searchpicto = $form->showFilterAndCheckAddButtons(0); - print $searchpicto; - print '
'; + print ' '; + print ' '; + print '
'; - print ' '; - print ' '; - print ''.$valuetoshow.''.$valuetoshow.''; - if ($canbedisabled) { - print ''.$actl[$obj->active].''; - } else { - print $langs->trans("AlwaysActive"); - } - print "'.img_edit().' '.img_delete().' 
'; + if ($canbedisabled) { + print ''.$actl[$obj->active].''; + } else { + print $langs->trans("AlwaysActive"); + } + print "'.img_edit().' '.img_delete().' 
'.$langs->trans("NoRecordFound").'
'.$langs->trans("NoRecordFound").'
'; - print '
'; - - print '
'; +} else { + dol_print_error($db); } +print ''; +print '
'; + +print ''; + print '
'; // End of page diff --git a/htdocs/accountancy/admin/subaccount.php b/htdocs/accountancy/admin/subaccount.php index 99adc36e2a9..d20ec36af07 100644 --- a/htdocs/accountancy/admin/subaccount.php +++ b/htdocs/accountancy/admin/subaccount.php @@ -333,7 +333,8 @@ if ($resql) { print '
'.$langs->trans("WarningCreateSubAccounts").'
'; $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 + $htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup + $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); $moreforfilter = ''; diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index f688d1e4445..413358c2c9f 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -1855,7 +1855,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; print $form->select_company($object->socid, 'socid', '', 1); print ''; - print ''; + print ''; print ''; } else { if ($object->socid) { diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index f70433f2c9d..8eb5fd63daf 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -819,7 +819,8 @@ if ($search_all) { } $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 +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup +$selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); $moreforfilter = ''; diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index 6e6a4e9eab5..ece0d4399fc 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -414,7 +414,8 @@ if (!empty($moreforfilter)) { } $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 +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup +$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 diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index b8d523666aa..16962bedeaa 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -51,7 +51,6 @@ $boxes = array(); */ if ($action == 'addconst') { - dolibarr_set_const($db, "MAIN_BOXES_MAXLINES", GETPOSTINT("MAIN_BOXES_MAXLINES"), '', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_ACTIVATE_FILECACHE", GETPOST("MAIN_ACTIVATE_FILECACHE", 'alpha'), 'chaine', 0, '', $conf->entity); } @@ -449,15 +448,6 @@ print ''.$langs->trans("Parameter").''; print ''.$langs->trans("Value").''; print ''; -print ''; -print ''; -print $langs->trans("MaxNbOfLinesForBoxes"); -print ''."\n"; -print ''; -print ''; -print ''; -print ''; - // Activate FileCache (so content of file boxes are stored into a cache file int boxes/temp for 3600 seconds) print ''.$langs->trans("EnableFileCache").''; print $form->selectyesno('MAIN_ACTIVATE_FILECACHE', getDolGlobalInt('MAIN_ACTIVATE_FILECACHE', 0), 1); diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index d1d80394832..8733d18c6dd 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -249,7 +249,7 @@ if ($action == 'update') { dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", getDolGlobalInt('MAIN_IHM_PARAMS_REV') + 1, 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", GETPOSTINT("MAIN_SIZE_LISTE_LIMIT"), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_SIZE_SHORTLIST_LIMIT", GETPOSTINT("main_size_shortliste_limit"), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_SIZE_SHORTLIST_LIMIT", GETPOSTINT("MAIN_SIZE_SHORTLIST_LIMIT"), 'chaine', 0, '', $conf->entity); if (GETPOSTISSET("MAIN_CHECKBOX_LEFT_COLUMN")) { dolibarr_set_const($db, "MAIN_CHECKBOX_LEFT_COLUMN", GETPOSTINT("MAIN_CHECKBOX_LEFT_COLUMN"), 'chaine', 0, '', $conf->entity); @@ -430,11 +430,11 @@ if ($mode == 'other') { print ''; // Max size of lists - print '' . $langs->trans("DefaultMaxSizeList") . ''; + print '' . $langs->trans("DefaultMaxSizeList") . ''; print ''; // Max size of short lists on customer card - print '' . $langs->trans("DefaultMaxSizeShortList") . ''; + print '' . $langs->trans("DefaultMaxSizeShortList") . ''; print ''; // Display checkboxes and fields menu left / right diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index bcf786ec1b0..7b76bcc5aa7 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -536,7 +536,8 @@ if (!empty($moreforfilter)) { } $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 +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup +$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 diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index 3fb4d4681c7..974ca725c55 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -143,7 +143,7 @@ if ($action == 'specimen') { } elseif ($action == 'del') { $ret = delDocumentModel($value, $type); if ($ret > 0) { - if ($conf->global->STOCK_ADDON_PDF == "$value") { + if (getDolGlobalString('STOCK_ADDON_PDF') == "$value") { dolibarr_del_const($db, 'STOCK_ADDON_PDF', $conf->entity); } } @@ -694,7 +694,7 @@ print ''; print ''.$langs->trans("MainDefaultWarehouse").''; print ''; print $formproduct->selectWarehouses(getDolGlobalString('MAIN_DEFAULT_WAREHOUSE') ? $conf->global->MAIN_DEFAULT_WAREHOUSE : -1, 'default_warehouse', '', 1, 0, 0, '', 0, 0, array(), 'left reposition'); -print ''; +print ''; print ""; print "\n"; diff --git a/htdocs/admin/system/modules.php b/htdocs/admin/system/modules.php index 71a10e7e7c0..d24f8734b7e 100644 --- a/htdocs/admin/system/modules.php +++ b/htdocs/admin/system/modules.php @@ -230,7 +230,8 @@ $mode = ''; $arrayofmassactions = array(); $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 +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup +$selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); $moreforfilter = ''; diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index a3d335c11da..7e1e4c09342 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -540,7 +540,8 @@ if (!empty($moreforfilter)) { } $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 +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup +$selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; diff --git a/htdocs/bookcal/availabilities_list.php b/htdocs/bookcal/availabilities_list.php index 16efbe2d5df..bfc771f29a1 100644 --- a/htdocs/bookcal/availabilities_list.php +++ b/htdocs/bookcal/availabilities_list.php @@ -517,7 +517,8 @@ if (!empty($moreforfilter)) { } $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 +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup +$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 diff --git a/htdocs/bookcal/calendar_list.php b/htdocs/bookcal/calendar_list.php index 7a735b81c86..fd323ab6bca 100644 --- a/htdocs/bookcal/calendar_list.php +++ b/htdocs/bookcal/calendar_list.php @@ -499,7 +499,8 @@ if (!empty($moreforfilter)) { } $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 +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup +$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 diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 5278090d66d..fec308899c5 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1534,7 +1534,8 @@ if (!empty($moreforfilter)) { } $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 +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup +$selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); if (GETPOSTINT('autoselectall')) { diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index c2ccf442c28..74ee21c41e5 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -1085,7 +1085,8 @@ if ($resql) { } $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 + $htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup + $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); $selectedfields .= ($action == 'reconcile' ? $form->showCheckAddButtons('checkforselect', 1) : ''); // When action is 'reconcile', we force to have the column num_releve always enabled (otherwise we can't make reconciliation). diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php index 12a0dff52ec..9dcb5a28f4b 100644 --- a/htdocs/compta/bank/list.php +++ b/htdocs/compta/bank/list.php @@ -425,7 +425,8 @@ if (!empty($moreforfilter)) { } $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 +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup +$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 diff --git a/htdocs/compta/bank/various_payment/list.php b/htdocs/compta/bank/various_payment/list.php index 3c7e306646b..b50bc52ad90 100644 --- a/htdocs/compta/bank/various_payment/list.php +++ b/htdocs/compta/bank/various_payment/list.php @@ -468,7 +468,8 @@ $arrayofmassactions = array(); $moreforfilter = ''; $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 +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup +$selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 71961c72d3c..9e6eca9c4a9 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -3151,7 +3151,7 @@ class Facture extends CommonInvoice * * @param User $user Object user that validate * @param string $force_number Reference to force on invoice - * @param int $idwarehouse Id of warehouse to use for stock decrease if option to decreasenon stock is on (0=no decrease) + * @param int $idwarehouse Id of warehouse to use for stock decrease if option to decrease on stock is on (0=no decrease) * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @param int $batch_rule 0=do not decrement batch, else batch rule to use, 1=take in batches ordered by sellby and eatby dates * @return int Return integer <0 if KO, 0=Nothing done because invoice is not a draft, >0 if OK @@ -3366,6 +3366,10 @@ class Facture extends CommonInvoice $mouvP = new MouvementStock($this->db); $mouvP->origin = &$this; $mouvP->setOrigin($this->element, $this->id); + + // TODO If warehouseid has been set into invoice line, we should use this value in priority + // $idwarehouse = $this->lines[$i]->fk_warehouse; + // We decrease stock for product if ($this->type == self::TYPE_CREDIT_NOTE) { $result = $mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, 0, $langs->trans("InvoiceValidatedInDolibarr", $num)); diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index adf808dc101..80b7bca5830 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -535,7 +535,8 @@ $arrayofmassactions = array( $massactionbutton = $form->selectMassAction('', $massaction == 'presend' ? array() : array('presend' => $langs->trans("SendByMail"), 'builddoc' => $langs->trans("PDFMerge"))); $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 +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup +$selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); //$selectedfields.=$form->showCheckAddButtons('checkforselect', 1); print '
'."\n"; diff --git a/htdocs/compta/prelevement/list.php b/htdocs/compta/prelevement/list.php index c21f88d2157..3417e5b6d8d 100644 --- a/htdocs/compta/prelevement/list.php +++ b/htdocs/compta/prelevement/list.php @@ -323,7 +323,8 @@ if (!empty($moreforfilter)) { } $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 +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup +$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 diff --git a/htdocs/compta/prelevement/orders_list.php b/htdocs/compta/prelevement/orders_list.php index b6dd673f37f..01a30e5ea3c 100644 --- a/htdocs/compta/prelevement/orders_list.php +++ b/htdocs/compta/prelevement/orders_list.php @@ -315,7 +315,8 @@ if (!empty($moreforfilter)) { } $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 +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup +$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 diff --git a/htdocs/compta/tva/list.php b/htdocs/compta/tva/list.php index 63a5d5ef182..5f9df0856dc 100644 --- a/htdocs/compta/tva/list.php +++ b/htdocs/compta/tva/list.php @@ -402,7 +402,8 @@ if (!empty($moreforfilter)) { } $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 +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup +$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 diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php index c61e72867f2..d1caafeae0a 100644 --- a/htdocs/contrat/services_list.php +++ b/htdocs/contrat/services_list.php @@ -559,7 +559,8 @@ if (!empty($moreforfilter)) { } $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 +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup +$selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php index 3d5a5bb8760..ea727fbf289 100644 --- a/htdocs/core/boxes/modules_boxes.php +++ b/htdocs/core/boxes/modules_boxes.php @@ -212,7 +212,7 @@ class ModeleBoxes // Can't be abstract as it is instantiated to build "empty" bo $MAXLENGTHBOX = 60; // When set to 0: no length limit $cachetime = 900; // 900 : 15mn - $cachedir = DOL_DATA_ROOT.'/boxes/temp'; + $cachedir = DOL_DATA_ROOT.'/users/temp/widgets'; $fileid = get_class($this).'id-'.$this->box_id.'-e'.$conf->entity.'-u'.$user->id.'-s'.$user->socid.'.cache'; $filename = '/box-'.$fileid; $refresh = dol_cache_refresh($cachedir, $filename, $cachetime); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index bb19b01f538..0c9e89b421b 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -8980,7 +8980,8 @@ class Form /** - * Show a multiselect dropbox from an array. If a saved selection of fields exists for user (into $user->conf->MAIN_SELECTEDFIELDS_contextofpage), we use this one instead of default. + * Show a multiselect dropbox from an array. + * If a saved selection of fields exists for user (into $user->conf->MAIN_SELECTEDFIELDS_contextofpage), we use this one instead of default. * * @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. diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 06733016faa..a99af668fd8 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -1373,10 +1373,7 @@ class FormOther $boxlista .= "\n\n"; // Define $box_max_lines - $box_max_lines = 5; - if (getDolGlobalString('MAIN_BOXES_MAXLINES')) { - $box_max_lines = getDolGlobalString('MAIN_BOXES_MAXLINES'); - } + $box_max_lines = getDolUserInt('MAIN_SIZE_SHORTLIST_LIMIT', getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5)); $ii = 0; foreach ($boxactivated as $key => $box) { diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 1e88cdbf04f..3f12c44b269 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -701,6 +701,7 @@ class FormTicket if ($subelement != 'contract') { if (isModEnabled('contract') && !$this->ispublic) { + $langs->load('contracts'); $formcontract = new FormContract($this->db); print ''; print img_picto('', 'contract'); diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 351d67a22de..48c6340c708 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1254,7 +1254,8 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl $mode = 'view'; $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 + $htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup + $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 diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 8b318d895a6..76b98339c8b 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -3445,9 +3445,9 @@ function dol_filecache($directory, $filename, $object) /** * Test if Refresh needed. * - * @param string $directory Directory of cache - * @param string $filename Name of filecache - * @param int $cachetime Cachetime delay + * @param string $directory Directory of cache + * @param string $filename Name of filecache + * @param int $cachetime Cachetime delay * @return boolean 0 no refresh 1 if refresh needed */ function dol_cache_refresh($directory, $filename, $cachetime) @@ -3461,9 +3461,9 @@ function dol_cache_refresh($directory, $filename, $cachetime) /** * Read object from cachefile. * - * @param string $directory Directory of cache - * @param string $filename Name of filecache - * @return mixed Unserialise from file + * @param string $directory Directory of cache + * @param string $filename Name of filecache + * @return mixed Unserialise from file */ function dol_readcachefile($directory, $filename) { @@ -3475,7 +3475,7 @@ function dol_readcachefile($directory, $filename) /** * Return the relative dirname (relative to DOL_DATA_ROOT) of a full path string. * - * @param string $pathfile Full path of a file + * @param string $pathfile Full path of a file * @return string Path of file relative to DOL_DATA_ROOT */ function dirbasename($pathfile) diff --git a/htdocs/core/tpl/extrafields_list_search_input.tpl.php b/htdocs/core/tpl/extrafields_list_search_input.tpl.php index fc4e5c7fb41..ad282d70a43 100644 --- a/htdocs/core/tpl/extrafields_list_search_input.tpl.php +++ b/htdocs/core/tpl/extrafields_list_search_input.tpl.php @@ -29,7 +29,6 @@ if (!empty($extrafieldsobjectkey)) { // $extrafieldsobject is the $object->table } $cssclass = $extrafields->getAlignFlag($key, $extrafieldsobjectkey); $typeofextrafield = $extrafields->attributes[$extrafieldsobjectkey]['type'][$key]; - print ''; $tmpkey = preg_replace('/'.$search_options_pattern.'/', '', $key); if (in_array($typeofextrafield, array('varchar', 'mail', 'ip', 'url', 'int', 'double')) && empty($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key])) { diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index 6599bd2ba58..85643206762 100644 --- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php +++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php @@ -241,7 +241,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers // First classify billed the order to allow the proposal classify process if (isModEnabled('order') && isModEnabled('workflow') && getDolGlobalString('WORKFLOW_SUM_INVOICES_AMOUNT_CLASSIFY_BILLED_ORDER')) { $object->fetchObjectLinked('', 'commande', $object->id, $object->element); - if (count($object->linkedObjects['commande']) == 1) { // If the invoice has only 1 source order + if (!empty($object->linkedObjects['commande']) && count($object->linkedObjects['commande']) == 1) { // If the invoice has only 1 source order $orderLinked = reset($object->linkedObjects['commande']); $orderLinked->fetchObjectLinked($orderLinked->id, '', $orderLinked->element); if (count($orderLinked->linkedObjects['facture']) >= 1) { diff --git a/htdocs/don/list.php b/htdocs/don/list.php index 2d2a651228a..6e5844311ce 100644 --- a/htdocs/don/list.php +++ b/htdocs/don/list.php @@ -353,7 +353,8 @@ if ($search_all) { } $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 +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup +$selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index 18b52f93683..d135806272f 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -828,7 +828,8 @@ if (!empty($moreforfilter)) { } $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 +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup +$selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php index 93ae78eeeb2..af775526c02 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_list.php +++ b/htdocs/eventorganization/conferenceorboothattendee_list.php @@ -803,7 +803,8 @@ if (!empty($moreforfilter)) { } $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 +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup +$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 diff --git a/htdocs/expensereport/payment/list.php b/htdocs/expensereport/payment/list.php index 7a0b0f2db35..60221163175 100644 --- a/htdocs/expensereport/payment/list.php +++ b/htdocs/expensereport/payment/list.php @@ -358,7 +358,8 @@ if ($moreforfilter) { $arrayofmassactions = array(); $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 +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup +$selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index eb4596b9302..29751e732aa 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -565,7 +565,8 @@ if (!empty($moreforfilter)) { } $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 +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup +$selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; diff --git a/htdocs/fourn/facture/list-rec.php b/htdocs/fourn/facture/list-rec.php index c0642f3728f..737a003e54f 100644 --- a/htdocs/fourn/facture/list-rec.php +++ b/htdocs/fourn/facture/list-rec.php @@ -530,7 +530,8 @@ $arrayofmassactions = array( $massactionbutton = $form->selectMassAction('', $massaction == 'presend' ? array() : array('presend' => $langs->trans("SendByMail"), 'builddoc' => $langs->trans("PDFMerge"))); $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 +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup +$selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); //$selectedfields.=$form->showCheckAddButtons('checkforselect', 1); print ''."\n"; diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 78dfaf6a63d..00a5e2fde0a 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -1068,7 +1068,8 @@ if (!empty($moreforfilter)) { } $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 +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup +$selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index e0190a0504a..218fe17870d 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -582,7 +582,8 @@ if (!empty($moreforfilter)) { } $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 +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup +$selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); $include = ''; diff --git a/htdocs/holiday/view_log.php b/htdocs/holiday/view_log.php index 5eabf481294..2187692b95a 100644 --- a/htdocs/holiday/view_log.php +++ b/htdocs/holiday/view_log.php @@ -311,7 +311,8 @@ $disabled = 0; $include = ''; $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 +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup +$selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; diff --git a/htdocs/hrm/evaluation_list.php b/htdocs/hrm/evaluation_list.php index 20b8ee4359c..1fe98a0a8c6 100644 --- a/htdocs/hrm/evaluation_list.php +++ b/htdocs/hrm/evaluation_list.php @@ -495,7 +495,8 @@ if (!empty($moreforfilter)) { } $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 +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup +$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 diff --git a/htdocs/hrm/skill_list.php b/htdocs/hrm/skill_list.php index ea155ac684f..62fa4f2f04d 100644 --- a/htdocs/hrm/skill_list.php +++ b/htdocs/hrm/skill_list.php @@ -483,7 +483,8 @@ if (!empty($moreforfilter)) { } $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 +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup +$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 diff --git a/htdocs/intracommreport/list.php b/htdocs/intracommreport/list.php index 7b91ed0e6bc..a830e2dfa8e 100644 --- a/htdocs/intracommreport/list.php +++ b/htdocs/intracommreport/list.php @@ -431,7 +431,8 @@ if (!empty($moreforfilter)) { } $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 +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup +$selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index bf626257163..b5f4ef00dde 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1205,10 +1205,11 @@ DefaultMenuManager= Standard menu manager DefaultMenuSmartphoneManager=Smartphone menu manager Skin=Skin theme DefaultSkin=Default skin theme -MaxSizeList=Max length for list +MaxSizeList=Max length for lists DefaultMaxSizeList=Default max length for lists -DisplayGrandTotalInList=Display grand total (for all pages) in lists footer +MaxSizeShortList=Max length for short lists DefaultMaxSizeShortList=Default max length for short lists (i.e. in customer card) +DisplayGrandTotalInList=Display grand total (for all pages) in lists footer MessageOfDay=Message of the day MessageLogin=Login page message LoginPage=Login page @@ -1217,7 +1218,7 @@ PermanentLeftSearchForm=Permanent search form on left menu DefaultLanguage=Default language EnableMultilangInterface=Enable multilanguage support for customer or vendor relationships EnableShowLogo=Show the company logos in the menu -THEME_MENU_COLORLOGO=Show main menu logo in color +THEME_MENU_COLORLOGO=Show main menu logo in color CompanyInfo=Company/Organization CompanyIds=Company/Organization identities CompanyAddress=Address @@ -1882,7 +1883,7 @@ ClickToDialUseTelLinkDesc=Use this method if your users have a softphone or a so CashDesk=Point of Sale CashDeskSetup=Point of Sales module setup CashDeskThirdPartyForSell=Default generic third party to use for sales -ForbidSalesToTheDefaultCustomer=Forbid sales to the generic third party +ForbidSalesToTheDefaultCustomer=Do not allow to record sales on a generic third party (must use a different third party for each sale) CashDeskBankAccountForSell=Default account to use to receive cash payments CashDeskBankAccountForCheque=Default account to use to receive payments by check CashDeskBankAccountForCB=Default account to use to receive payments by credit cards @@ -1896,7 +1897,7 @@ CashDeskYouDidNotDisableStockDecease=You did not disable stock decrease when mak CashDeskForceDecreaseStockLabel=Stock decrease for batch products was forced. CashDeskForceDecreaseStockDesc=Decrease first by the oldest eatby and sellby dates. CashDeskReaderKeyCodeForEnter=Key ASCII code for "Enter" defined in barcode reader (Example: 13) -CashDeskDefaultProject=Assign all future sales to this project +CashDeskDefaultProject=Assign new POS sales (invoices) to a project ##### Bookmark ##### BookmarkSetup=Bookmark module setup BookmarkDesc=This module allows you to manage bookmarks. You can also add shortcuts to any Dolibarr pages or external web sites on your left menu. diff --git a/htdocs/loan/list.php b/htdocs/loan/list.php index 013c41e3cce..a98cab59988 100644 --- a/htdocs/loan/list.php +++ b/htdocs/loan/list.php @@ -320,7 +320,8 @@ if (!empty($moreforfilter)) { } $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 +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup +$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 diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index c7aca98e383..fec8e793146 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -580,7 +580,8 @@ if (!empty($moreforfilter)) { } $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 +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup +$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 diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php index 65ba4dbf744..27b7fc82943 100644 --- a/htdocs/product/inventory/list.php +++ b/htdocs/product/inventory/list.php @@ -508,7 +508,8 @@ if (!empty($moreforfilter)) { } $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 +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup +$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 diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 2920f0004eb..4f0f4469f09 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -964,7 +964,8 @@ if (!empty($moreforfilter)) { } $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 +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup +$selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index 7caef3b1493..d817e78d67f 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -526,7 +526,8 @@ if (!empty($moreforfilter)) { } $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 +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup +$selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index 3da03aa9a56..6603b3aabce 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -59,6 +59,7 @@ $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list $backtopage = GETPOST("backtopage", "alpha"); $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') +$show_files = GETPOST('show_files', 'aZ'); $mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...) $id = GETPOSTINT('id'); @@ -1147,7 +1148,8 @@ if (!empty($moreforfilter)) { } $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 +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup +$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 diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_list.php b/htdocs/product/stock/stocktransfer/stocktransfer_list.php index d798b7556ac..2a52f696da3 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_list.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_list.php @@ -470,7 +470,8 @@ if (!empty($moreforfilter)) { } $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 +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup +$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 diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 79ca634c1bd..b7c8766c7cd 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -1160,7 +1160,8 @@ if (!empty($moreforfilter)) { } $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 +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup +$selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index 7afad1aee62..7a083e52ce9 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -837,7 +837,8 @@ if (!empty($moreforfilter)) { } $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 +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup +$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 diff --git a/htdocs/salaries/list.php b/htdocs/salaries/list.php index 92b8be19ceb..9710d373fdd 100644 --- a/htdocs/salaries/list.php +++ b/htdocs/salaries/list.php @@ -562,7 +562,8 @@ if (!empty($moreforfilter)) { } $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 +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup +$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 diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 39e574b7bca..376c805e876 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -1253,8 +1253,8 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields -//$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup +$selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); $selectedfields .= ((count($arrayofmassactions) && $contextpage != 'poslist') ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table diff --git a/htdocs/societe/website.php b/htdocs/societe/website.php index 29484d9773d..9c393344cfc 100644 --- a/htdocs/societe/website.php +++ b/htdocs/societe/website.php @@ -419,7 +419,8 @@ if (!empty($moreforfilter)) { } $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 +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup +$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 diff --git a/htdocs/takepos/admin/terminal.php b/htdocs/takepos/admin/terminal.php index b6b2b2857b7..0aaeff60988 100644 --- a/htdocs/takepos/admin/terminal.php +++ b/htdocs/takepos/admin/terminal.php @@ -192,29 +192,20 @@ print ''; print 'trans("TerminalName", $terminal)).'" >'; print ''; -if (isModEnabled('project')) { - require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; - $formproject = new FormProjets($db); - print ''.$langs->trans("CashDeskDefaultProject").''; - print img_picto('', 'project', 'class="pictofixedwidth"'); - // select_projects($socid = -1, $selected = '', $htmlname = 'projectid', $maxlength = 16, $option_only = 0, $show_empty = 1, $discard_closed = 0, $forcefocus = 0, $disabled = 0, $mode = 0, $filterkey = '', $nooutput = 0, $forceaddid = 0, $morecss = '', $htmlid = '', $morefilter = '') - $projectid = getDolGlobalInt('CASHDESK_ID_PROJECT'.$terminaltouse); - print $formproject->select_projects(-1, $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 1, 'maxwidth500 widthcentpercentminusxx'); - print ''; -} - -print ''.$langs->trans("CashDeskThirdPartyForSell").''; -print ''; -print img_picto('', 'company', 'class="pictofixedwidth"'); -$filter = '((s.client:IN:1,2,3) AND (s.status:=:1))'; -print $form->select_company(getDolGlobalInt('CASHDESK_ID_THIRDPARTY'.$terminaltouse), 'socid', $filter, 1, 0, 0, array(), 0, 'maxwidth500 widthcentpercentminusx'); -print ''; - print ''.$langs->trans("ForbidSalesToTheDefaultCustomer").''; print ''; print ajax_constantonoff("TAKEPOS_FORBID_SALES_TO_DEFAULT_CUSTOMER", array(), $conf->entity, 0, 0, 1, 0); print ''; +if (!getDolGlobalString('TAKEPOS_FORBID_SALES_TO_DEFAULT_CUSTOMER')) { + print ''.$langs->trans("CashDeskThirdPartyForSell").''; + print ''; + print img_picto('', 'company', 'class="pictofixedwidth"'); + $filter = '((s.client:IN:1,2,3) AND (s.status:=:1))'; + print $form->select_company(getDolGlobalInt('CASHDESK_ID_THIRDPARTY'.$terminaltouse), 'socid', $filter, 1, 0, 0, array(), 0, 'maxwidth500 widthcentpercentminusx'); + print ''; +} + $atleastonefound = 0; if (isModEnabled("bank")) { print ''.$langs->trans("CashDeskBankAccountForSell").''; @@ -317,9 +308,11 @@ if (isModEnabled('stock')) { print $form->textwithpicto($langs->trans("CashDeskDoNotDecreaseStock"), $langs->trans("CashDeskDoNotDecreaseStockHelp")); print ''; // Force warehouse (this is not a default value) print ''; - print $form->selectyesno('CASHDESK_NO_DECREASE_STOCK'.$terminal, getDolGlobalInt('CASHDESK_NO_DECREASE_STOCK'.$terminal), 1); + //print $form->selectyesno('CASHDESK_NO_DECREASE_STOCK'.$terminal, getDolGlobalInt('CASHDESK_NO_DECREASE_STOCK'.$terminal), 1); + print ajax_constantonoff('CASHDESK_NO_DECREASE_STOCK'.$terminal, array(), $conf->entity, 0, 0, 1, 0); print ''; + $disabled = getDolGlobalString('CASHDESK_NO_DECREASE_STOCK'.$terminal); @@ -345,6 +338,7 @@ if (isModEnabled('stock')) { } print ''; + // Deprecated: CASHDESK_FORCE_DECREASE_STOCK is now always false. No more required/used. if (isModEnabled('productbatch') && getDolGlobalString('CASHDESK_FORCE_DECREASE_STOCK') && !getDolGlobalString('CASHDESK_NO_DECREASE_STOCK'.$terminal)) { print ''.$langs->trans('CashDeskForceDecreaseStockLabel').''; print ''; @@ -353,6 +347,17 @@ if (isModEnabled('stock')) { } } +if (isModEnabled('project')) { + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; + $formproject = new FormProjets($db); + print ''.$langs->trans("CashDeskDefaultProject").''; + print img_picto('', 'project', 'class="pictofixedwidth"'); + // select_projects($socid = -1, $selected = '', $htmlname = 'projectid', $maxlength = 16, $option_only = 0, $show_empty = 1, $discard_closed = 0, $forcefocus = 0, $disabled = 0, $mode = 0, $filterkey = '', $nooutput = 0, $forceaddid = 0, $morecss = '', $htmlid = '', $morefilter = '') + $projectid = getDolGlobalInt('CASHDESK_ID_PROJECT'.$terminaltouse); + print $formproject->select_projects(-1, $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 1, 'maxwidth500 widthcentpercentminusxx'); + print ''; +} + if (isModEnabled('receiptprinter')) { // Select printer to use with terminal require_once DOL_DOCUMENT_ROOT.'/core/class/dolreceiptprinter.class.php'; diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index e70265e1dbd..360c10bcaa5 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -206,6 +206,8 @@ if (empty($reshook)) { $invoice = new Facture($db); $invoice->fetch($placeid); + $db->begin(); + if ($invoice->total_ttc < 0) { $invoice->type = $invoice::TYPE_CREDIT_NOTE; @@ -233,7 +235,7 @@ if (empty($reshook)) { $constantforkey = 'CASHDESK_NO_DECREASE_STOCK'.(isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : ''); if ($error) { dol_htmloutput_errors($errormsg, null, 1); - } elseif ($invoice->statut != Facture::STATUS_DRAFT) { + } elseif ($invoice->status != Facture::STATUS_DRAFT) { //If invoice is validated but it is not fully paid is not error and make the payment if ($invoice->getRemainToPay() > 0) { $res = 1; @@ -245,26 +247,31 @@ if (empty($reshook)) { $error++; dol_syslog('Sale without lines'); dol_htmloutput_errors($langs->trans("NoLinesToBill", "TakePos"), null, 1); - } elseif (isModEnabled('stock') && getDolGlobalString($constantforkey) != "1" && !isModEnabled('productbatch')) { + } elseif (isModEnabled('stock') && !isModEnabled('productbatch') && getDolGlobalString($constantforkey) != "1") { + // Validation of invoice with change into stock when produt/lot module is not enabled and stock change not disabled. + // The case for isModEnabled('productbatch') is processed few lines later. $savconst = getDolGlobalString('STOCK_CALCULATE_ON_BILL'); if (isModEnabled('productbatch') && !getDolGlobalInt('CASHDESK_FORCE_DECREASE_STOCK')) { - $conf->global->STOCK_CALCULATE_ON_BILL = 0; // To not change the stock (not yet compatible with batch management) + $conf->global->STOCK_CALCULATE_ON_BILL = 0; // To not change the stock (this will be done later) } else { + // Deprecated: CASHDESK_FORCE_DECREASE_STOCK is now always false. No more required/used. $conf->global->STOCK_CALCULATE_ON_BILL = 1; // To force the change of stock } $constantforkey = 'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"]; dol_syslog("Validate invoice with stock change into warehouse defined into constant ".$constantforkey." = ".getDolGlobalString($constantforkey)); + $batch_rule = 0; if (isModEnabled('productbatch') && getDolGlobalString('CASHDESK_FORCE_DECREASE_STOCK')) { require_once DOL_DOCUMENT_ROOT.'/product/class/productbatch.class.php'; $batch_rule = Productbatch::BATCH_RULE_SELLBY_EATBY_DATES_FIRST; } - $res = $invoice->validate($user, '', getDolGlobalString($constantforkey), 0, $batch_rule); + $res = $invoice->validate($user, '', getDolGlobalInt($constantforkey), 0, $batch_rule); $conf->global->STOCK_CALCULATE_ON_BILL = $savconst; } else { + // Validation of invoice with no change into stock $res = $invoice->validate($user); if ($res < 0) { $error++; @@ -273,12 +280,6 @@ if (empty($reshook)) { } } - // Restore save values - //if (!empty($sav_FACTURE_ADDON)) - //{ - // $conf->global->FACTURE_ADDON = $sav_FACTURE_ADDON; - //} - // Add the payment if (!$error && $res >= 0) { $remaintopay = $invoice->getRemainToPay(); @@ -327,26 +328,51 @@ if (empty($reshook)) { } else { dol_htmloutput_errors($invoice->error, $invoice->errors, 1); } + // Update stock for batch products - if (isModEnabled('productbatch')) { - require_once DOL_DOCUMENT_ROOT . "/product/stock/class/mouvementstock.class.php"; - $constantforkey = 'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"]; - foreach ($invoice->lines as $line) { - if ($line->batch && $line->fk_warehouse > 0) { - $prod_batch = new Productbatch($db); - $prod_batch->find(0, '', '', $line->batch, $line->fk_warehouse); - $mouvP = new MouvementStock($db); - $mouvP->origin = $invoice; - $mouvP->livraison($user, $line->fk_product, getDolGlobalString($constantforkey), $line->qty, $line->price, 'TakePOS', '', '', '', $prod_batch->batch, $line->batch); - } else { - $mouvP = new MouvementStock($db); - $mouvP->origin = $invoice; - $mouvP->livraison($user, $line->fk_product, getDolGlobalString($constantforkey), $line->qty, $line->price, 'TakePOS', '', '', ''); + if (!$error && $res >= 0) { + if (isModEnabled('stock') && isModEnabled('productbatch')) { // The case !isModEnabled('productbatch') was processed few lines before. + require_once DOL_DOCUMENT_ROOT . "/product/stock/class/mouvementstock.class.php"; + $constantforkey = 'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"]; + $inventorycode = dol_print_date(dol_now(), 'dayhourlog'); + $labeltakeposmovement = 'TakePOS - '.$langs->trans("Invoice").' '.$invoice->ref; + + foreach ($invoice->lines as $line) { + $warehouseid = ($line->fk_warehouse ? $line->fk_warehouse : getDolGlobalInt($constantforkey)); + + // var_dump('fk_product='.$line->fk_product.' batch='.$line->batch.' warehouse='.$line->fk_warehouse.' qty='.$line->qty); + if ($line->batch != '' && $warehouseid > 0) { + $prod_batch = new Productbatch($db); + $prod_batch->find(0, '', '', $line->batch, $warehouseid); + $mouvP = new MouvementStock($db); + $mouvP->origin = $invoice; + $res = $mouvP->livraison($user, $line->fk_product, $warehouseid, $line->qty, $line->price, $labeltakeposmovement, '', '', '', $prod_batch->batch, $prod_batch->id, $inventorycode); + if ($res < 0) { + setEventMessages($mouvP->error, $mouvP->errors, 'errors'); + $error++; + } + } else { + $mouvP = new MouvementStock($db); + $mouvP->origin = $invoice; + $res = $mouvP->livraison($user, $line->fk_product, $warehouseid, $line->qty, $line->price, $labeltakeposmovement, '', '', '', '', 0, $inventorycode); + if ($res < 0) { + setEventMessages($mouvP->error, $mouvP->errors, 'errors'); + $error++; + } + } } } } + + if (!$error && $res >= 0) { + $db->commit(); + } else { + $db->rollback(); + } } if ($action == 'creditnote' && $user->hasRight('facture', 'creer')) { + $db->begin(); + $creditnote = new Facture($db); $creditnote->socid = $invoice->socid; $creditnote->date = dol_now(); @@ -487,6 +513,12 @@ if (empty($reshook)) { } else { $res = $creditnote->validate($user); } + + if (!$error && $res >= 0) { + $db->commit(); + } else { + $db->rollback(); + } } if (($action == 'history' || $action == 'creditnote') && $user->hasRight('takepos', 'run')) { @@ -511,13 +543,24 @@ if (empty($reshook)) { $langs->load('errors'); dol_htmloutput_errors($langs->trans("ErrorModuleSetupNotComplete", "TakePos"), null, 1); } else { + $db->begin(); + // Create invoice $placeid = $invoice->create($user); if ($placeid < 0) { dol_htmloutput_errors($invoice->error, $invoice->errors, 1); } $sql = "UPDATE ".MAIN_DB_PREFIX."facture set ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")' where rowid = ".((int) $placeid); - $db->query($sql); + $resql = $db->query($sql); + if (!$resql) { + $error++; + } + + if (!$error) { + $db->commit(); + } else { + $db->rollback(); + } } } @@ -547,63 +590,85 @@ if (empty($reshook)) { if (isModEnabled('productbatch') && isModEnabled('stock')) { $batch = GETPOST('batch', 'alpha'); - if (!empty($batch)) { + if (!empty($batch)) { // We have just clicked on the batch number $action = "setbatch"; - } else { + } elseif ($prod->status_batch > 0) { + // If product need a lot/serial, we show the list of lot/serial available for the product... + // Set nb of suggested with nb of batch into the warehouse of the terminal $nbofsuggested = 0; $prod->load_stock('warehouseopen'); + $constantforkey = 'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"]; - if ($prod->stock_warehouse[getDolGlobalString($constantforkey)]->detail_batch != "") { - if (is_object($prod->stock_warehouse[getDolGlobalString($constantforkey)]) && count($prod->stock_warehouse[getDolGlobalString($constantforkey)]->detail_batch)) { - foreach ($prod->stock_warehouse[getDolGlobalString($constantforkey)]->detail_batch as $dbatch) { - $nbofsuggested++; + $warehouseid = getDolGlobalInt($constantforkey); + + //var_dump($prod->stock_warehouse); + foreach ($prod->stock_warehouse as $tmpwarehouseid => $tmpval) { + if (getDolGlobalInt($constantforkey) && $tmpwarehouseid != getDolGlobalInt($constantforkey)) { + // Not on the forced warehous, so we ignore this warehous + continue; + } + if (!empty($prod->stock_warehouse[$tmpwarehouseid]) && is_array($prod->stock_warehouse[$tmpwarehouseid]->detail_batch)) { + if (is_object($prod->stock_warehouse[$tmpwarehouseid]) && count($prod->stock_warehouse[$tmpwarehouseid]->detail_batch)) { + foreach ($prod->stock_warehouse[$tmpwarehouseid]->detail_batch as $dbatch) { + $nbofsuggested++; + } } } } + //var_dump($prod->stock_warehouse); - echo ""; + echo "\n"; - if ($nbofsuggested > 0) { - $quantityToBeDelivered = 0; - echo "
".$langs->trans("SearchIntoBatch").": $nbofsuggested

"; - foreach ($prod->stock_warehouse[getDolGlobalString($constantforkey)]->detail_batch as $dbatch) { // $dbatch is instance of Productbatch - $batchStock = + $dbatch->qty; // To get a numeric - $deliverableQty = min($quantityToBeDelivered, $batchStock); - print ''; - print ''; - print ''; + $suggestednb = 1; + echo "
".$langs->trans("SearchIntoBatch").": $nbofsuggested

'; - $staticwarehouse = new Entrepot($db); - if ($warehouse_id > 0) { - $staticwarehouse->fetch(getDolGlobalString($constantforkey)); - } - $detail = ''; - $detail .= $langs->trans("LotSerial").': '.$dbatch->batch; - if (!getDolGlobalString('PRODUCT_DISABLE_SELLBY')) { - //$detail .= ' - '.$langs->trans("SellByDate").': '.dol_print_date($dbatch->sellby, "day"); - } - if (!getDolGlobalString('PRODUCT_DISABLE_EATBY')) { - //$detail .= ' - '.$langs->trans("EatByDate").': '.dol_print_date($dbatch->eatby, "day"); - } - $detail .= ' - '.$langs->trans("Qty").': '.$dbatch->qty; - $detail .= ' "; - $detail .= '
'; - print $detail; - - $quantityToBeDelivered -= $deliverableQty; - if ($quantityToBeDelivered < 0) { - $quantityToBeDelivered = 0; - } - $subj++; - print '
"; + foreach ($prod->stock_warehouse as $tmpwarehouseid => $tmpval) { + if (getDolGlobalInt($constantforkey) && $tmpwarehouseid != getDolGlobalInt($constantforkey)) { + // Not on the forced warehous, so we ignore this warehous + continue; + } + if (!empty($prod->stock_warehouse[$tmpwarehouseid]) && is_array($prod->stock_warehouse[$tmpwarehouseid]->detail_batch)) { + foreach ($prod->stock_warehouse[$tmpwarehouseid]->detail_batch as $dbatch) { // $dbatch is instance of Productbatch + $batchStock = + $dbatch->qty; // To get a numeric + $quantityToBeDelivered = 1; + $deliverableQty = min($quantityToBeDelivered, $batchStock); + print ''; + print ''; + print ''; + print ''; + } } - print "
'; + $detail = ''; + $detail .= ''.$langs->trans("LotSerial").': '.$dbatch->batch; + if (!getDolGlobalString('PRODUCT_DISABLE_SELLBY')) { + //$detail .= ' - '.$langs->trans("SellByDate").': '.dol_print_date($dbatch->sellby, "day"); + } + if (!getDolGlobalString('PRODUCT_DISABLE_EATBY')) { + //$detail .= ' - '.$langs->trans("EatByDate").': '.dol_print_date($dbatch->eatby, "day"); + } + $detail .= ''; + $detail .= ''.$langs->trans("Qty").': '.$dbatch->qty; + $detail .= ''; + $detail .= ' "; + $detail .= '
'; + print $detail; + + $quantityToBeDelivered -= $deliverableQty; + if ($quantityToBeDelivered < 0) { + $quantityToBeDelivered = 0; + } + $suggestednb++; + print '
"; - exit; } + print ""; + + print ''; + exit; } } @@ -700,7 +765,7 @@ if (empty($reshook)) { } if (empty($err)) { - $idoflineadded = $invoice->addline($line['description'], $line['price'], $qty, $line['tva_tx'], $line['localtax1_tx'], $line['localtax2_tx'], $idproduct, $line['remise_percent'], '', 0, 0, 0, '', $price_base_type, $line['price_ttc'], $prod->type, -1, 0, '', 0, (!empty($parent_line)) ? $parent_line : '', $line['fk_fournprice'], $line['pa_ht'], '', $line['array_options'], 100, '', null, 0); + $idoflineadded = $invoice->addline($line['description'], $line['price'], $qty, $line['tva_tx'], $line['localtax1_tx'], $line['localtax2_tx'], $idproduct, $line['remise_percent'], '', 0, 0, 0, '', $price_base_type, $line['price_ttc'], $prod->type, -1, 0, '', 0, (empty($parent_line) ? '' : $parent_line), (empty($line['fk_fournprice']) ? 0 : $line['fk_fournprice']), (empty($line['pa_ht']) ? '' : $line['pa_ht']), '', $line['array_options'], 100, '', null, 0); } } @@ -777,6 +842,7 @@ if (empty($reshook)) { if (count($invoice->lines) == 0) { $invoice->delete($user); + if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) { header("Location: ".DOL_URL_ROOT."/takepos/public/auto_order.php"); } else { @@ -939,7 +1005,9 @@ if (empty($reshook)) { if ($action == "setbatch" && ($user->hasRight('takepos', 'run') || defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE'))) { $constantforkey = 'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"]; - $sql = "UPDATE ".MAIN_DB_PREFIX."facturedet set batch=".$db->escape($batch).", fk_warehouse=".getDolGlobalString($constantforkey)." where rowid=".((int) $idoflineadded); + $warehouseid = getDolGlobalInt($constantforkey); // TODO Get the wrehouse id from GETPOSTINT('warehouseid'); + $sql = "UPDATE ".MAIN_DB_PREFIX."facturedet SET batch = '".$db->escape($batch)."', fk_warehouse = ".((int) $warehouseid); + $sql .= " WHERE rowid=".((int) $idoflineadded); $db->query($sql); } @@ -1692,6 +1760,7 @@ if ($placeid > 0) { return; } + // Loop on each lines on invoice if (is_array($invoice->lines) && count($invoice->lines)) { print ''."\n"; $tmplines = array_reverse($invoice->lines); @@ -1768,6 +1837,12 @@ if ($placeid > 0) { if ($line->product_ref) { $tooltiptext .= ''.$langs->trans("Ref").' : '.$line->product_ref.'
'; $tooltiptext .= ''.$langs->trans("Label").' : '.$line->product_label.'
'; + if (!empty($line->batch)) { + $tooltiptext .= '
'.$langs->trans("LotSerial").' : '.$line->batch.'
'; + } + if (!empty($line->fk_warehouse)) { + $tooltiptext .= ''.$langs->trans("Warehouse").' : '.$line->fk_warehouse.'
'; + } if ($line->product_label != $line->desc) { if ($line->desc) { $tooltiptext .= '
'; diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php index 0e930bed8fc..06f1e44b635 100644 --- a/htdocs/takepos/pay.php +++ b/htdocs/takepos/pay.php @@ -525,8 +525,8 @@ if (getDolGlobalString('TAKEPOS_CUSTOMER_DISPLAY')) { currency != $_SESSION["takeposcustomercurrency"]) { - //Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency +if (isModEnabled('multicurrency') && !empty($_SESSION["takeposcustomercurrency"]) && $_SESSION["takeposcustomercurrency"] != "" && $conf->currency != $_SESSION["takeposcustomercurrency"]) { + // Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency $showothercurrency = 1; include_once DOL_DOCUMENT_ROOT . '/multicurrency/class/multicurrency.class.php'; $multicurrency = new MultiCurrency($db); diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 8095fb1ae42..86aab9a8762 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -4121,12 +4121,12 @@ table.liste tr, table.noborder tr, div.noborder form { min-height: 20px; } table.liste th, table.noborder th, table.noborder tr.liste_titre td, table.noborder tr.box_titre td { - padding: 7px 10px 7px 12px; /* t r b l */ + padding: 6px 10px 6px 12px; /* t r b l */ } table.liste td, table.noborder td, div.noborder form div, table.tableforservicepart1 td, table.tableforservicepart2 td { - padding: 8px 10px 8px 12px; /* t r b l */ + padding: 6px 10px 6px 12px; /* t r b l */ /* line-height: 22px; This create trouble on cell login on list of last events of a contract*/ - height: 22px; + height: 28px; } table.liste tr.trkanban td { padding: 10px 12px 10px 12px; /* t r b l */ diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 0d078112290..7df516908e7 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -40,7 +40,7 @@ include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; // Load translation files required by the page -$langs->loadLangs(array("ticket", "companies", "other", "projects")); +$langs->loadLangs(array("ticket", "companies", "other", "projects", "contracts")); // Get parameters $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... @@ -408,7 +408,7 @@ foreach ($search as $key => $val) { $sql .= natural_search($key, implode(',', $newarrayofstatus), 2); } continue; - } elseif ($key == 'fk_user_assign' || $key == 'fk_user_create' || $key == 'fk_project') { + } elseif ($key == 'fk_user_assign' || $key == 'fk_user_create' || $key == 'fk_project' || $key == 'fk_contract') { if ($search[$key] > 0) { $sql .= natural_search($key, $search[$key], 2); } diff --git a/htdocs/user/group/list.php b/htdocs/user/group/list.php index f8d5da2cc8b..51796328a68 100644 --- a/htdocs/user/group/list.php +++ b/htdocs/user/group/list.php @@ -324,7 +324,8 @@ if (!empty($moreforfilter)) { } $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 +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup +$selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
'; diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index c59313ec708..3ffb3302c96 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -110,12 +110,18 @@ if (empty($reshook)) { $tabparam["MAIN_LANG_DEFAULT"] = ''; } - if (GETPOST("check_SIZE_LISTE_LIMIT") == "on") { + if (GETPOST("check_MAIN_SIZE_LISTE_LIMIT") == "on") { $tabparam["MAIN_SIZE_LISTE_LIMIT"] = GETPOSTINT("MAIN_SIZE_LISTE_LIMIT"); } else { $tabparam["MAIN_SIZE_LISTE_LIMIT"] = ''; } + if (GETPOST("check_MAIN_SIZE_SHORTLIST_LIMIT") == "on") { + $tabparam["MAIN_SIZE_SHORTLIST_LIMIT"] = GETPOSTINT("MAIN_SIZE_SHORTLIST_LIMIT"); + } else { + $tabparam["MAIN_SIZE_SHORTLIST_LIMIT"] = ''; + } + if (GETPOST("check_AGENDA_DEFAULT_VIEW") == "on") { $tabparam["AGENDA_DEFAULT_VIEW"] = GETPOST("AGENDA_DEFAULT_VIEW", 'aZ09'); } else { @@ -174,6 +180,10 @@ if (empty($reshook)) { $result = dol_set_user_param($db, $conf, $object, $tabparam); + // Clear cache of widgets (because we may have modified the length of cached widget lists) + $cachedir = DOL_DATA_ROOT.'/users/temp/widgets'; + dol_delete_dir_recursive($cachedir); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); exit; } @@ -307,9 +317,12 @@ if ($action == 'edit') { if (jQuery("#check_MAIN_LANG_DEFAULT").prop("checked")) { jQuery("#main_lang_default").removeAttr(\'disabled\'); } else { jQuery("#main_lang_default").attr(\'disabled\',\'disabled\'); } - if (jQuery("#check_SIZE_LISTE_LIMIT").prop("checked")) { jQuery("#MAIN_SIZE_LISTE_LIMIT").removeAttr(\'disabled\'); } + if (jQuery("#check_MAIN_SIZE_LISTE_LIMIT").prop("checked")) { jQuery("#MAIN_SIZE_LISTE_LIMIT").removeAttr(\'disabled\'); } else { jQuery("#MAIN_SIZE_LISTE_LIMIT").attr(\'disabled\',\'disabled\'); } + if (jQuery("#check_MAIN_SIZE_SHORTLIST_LIMIT").prop("checked")) { jQuery("#MAIN_SIZE_SHORTLIST_LIMIT").removeAttr(\'disabled\'); } + else { jQuery("#MAIN_SIZE_SHORTLIST_LIMIT").attr(\'disabled\',\'disabled\'); } + if (jQuery("#check_AGENDA_DEFAULT_VIEW").prop("checked")) { jQuery("#AGENDA_DEFAULT_VIEW").removeAttr(\'disabled\'); } else { jQuery("#AGENDA_DEFAULT_VIEW").attr(\'disabled\',\'disabled\'); } @@ -322,7 +335,8 @@ if ($action == 'edit') { init_myfunc(); jQuery("#check_MAIN_LANDING_PAGE").click(function() { init_myfunc(); }); jQuery("#check_MAIN_LANG_DEFAULT").click(function() { init_myfunc(); }); - jQuery("#check_SIZE_LISTE_LIMIT").click(function() { init_myfunc(); }); + jQuery("#check_MAIN_SIZE_LISTE_LIMIT").click(function() { init_myfunc(); }); + jQuery("#check_MAIN_SIZE_SHORTLIST_LIMIT").click(function() { init_myfunc(); }); jQuery("#check_AGENDA_DEFAULT_VIEW").click(function() { init_myfunc(); }); jQuery("#check_MAIN_THEME").click(function() { init_myfunc(); }); jQuery("#check_THEME_ELDY_TOPMENU_BACK1").click(function() { init_myfunc(); }); @@ -379,11 +393,19 @@ if ($action == 'edit') { // Max size of lists print ''.$langs->trans("MaxSizeList").''; print '' . getDolGlobalString('MAIN_SIZE_LISTE_LIMIT').''; - print 'conf->MAIN_SIZE_LISTE_LIMIT) ? " checked" : ""); + print 'conf->MAIN_SIZE_LISTE_LIMIT) ? " checked" : ""); print empty($dolibarr_main_demo) ? '' : ' disabled="disabled"'; // Disabled for demo - print '> '; + print '> '; print ''; + // Max size of lists + print ''.$langs->trans("MaxSizeShortList").''; + print '' . getDolGlobalString('MAIN_SIZE_SHORTLIST_LIMIT').''; + print 'conf->MAIN_SIZE_SHORTLIST_LIMIT) ? " checked" : ""); + print empty($dolibarr_main_demo) ? '' : ' disabled="disabled"'; // Disabled for demo + print '> '; + print ''; + print '
'; // Theme @@ -505,10 +527,16 @@ if ($action == 'edit') { // Max size for lists print ''.$langs->trans("MaxSizeList").''; - print ''.(getDolGlobalString('MAIN_SIZE_LISTE_LIMIT') ? $conf->global->MAIN_SIZE_LISTE_LIMIT : ' ').''; + print ''.getDolGlobalString('MAIN_SIZE_LISTE_LIMIT', ' ').''; print 'conf->MAIN_SIZE_LISTE_LIMIT) ? " checked" : "").'> '.$langs->trans("UsePersonalValue").''; print ''.(!empty($object->conf->MAIN_SIZE_LISTE_LIMIT) ? $object->conf->MAIN_SIZE_LISTE_LIMIT : ' ').''; + // Max size for lists + print ''.$langs->trans("MaxSizeShortList").''; + print ''.getDolGlobalString('MAIN_SIZE_SHORTLIST_LIMIT', ' ').''; + print 'conf->MAIN_SIZE_SHORTLIST_LIMIT) ? " checked" : "").'> '.$langs->trans("UsePersonalValue").''; + print ''.(!empty($object->conf->MAIN_SIZE_SHORTLIST_LIMIT) ? $object->conf->MAIN_SIZE_SHORTLIST_LIMIT : ' ').''; + print ''; print '
'; print '
'; diff --git a/htdocs/variants/list.php b/htdocs/variants/list.php index 2d71f27c474..ba995277097 100644 --- a/htdocs/variants/list.php +++ b/htdocs/variants/list.php @@ -509,7 +509,8 @@ if (!empty($moreforfilter)) { } $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 +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup +$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 diff --git a/htdocs/webhook/target_list.php b/htdocs/webhook/target_list.php index cfc69b02d01..8e311efd8b7 100644 --- a/htdocs/webhook/target_list.php +++ b/htdocs/webhook/target_list.php @@ -512,7 +512,8 @@ if (!empty($moreforfilter)) { } $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 +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup +$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 diff --git a/htdocs/workstation/workstation_list.php b/htdocs/workstation/workstation_list.php index 3638739a101..181f74dc270 100644 --- a/htdocs/workstation/workstation_list.php +++ b/htdocs/workstation/workstation_list.php @@ -495,7 +495,8 @@ if (!empty($moreforfilter)) { } $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 +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup +$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 diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 72bd0fb21fb..3432b327d95 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -51,7 +51,9 @@ parameters: - '#Function llx.* invoked with#' - '#always exists and is not falsy#' - '#is always fal#' + - '#is always true#' - '#always exists and is not nullable#' + - '#in isset() is not nullable#' - '#(\$force_dolibarr_lib|\$dolibarr_main_db).*in empty\(\) is never defined.#' - '#Sprain\\SwissQrBill\\#' - '#Constructor of class .* has an unused parameter #'