diff --git a/htdocs/admin/eventorganization.php b/htdocs/admin/eventorganization.php index cc9b8d7bca8..528a6bf2a9c 100644 --- a/htdocs/admin/eventorganization.php +++ b/htdocs/admin/eventorganization.php @@ -83,9 +83,7 @@ if ($cancel) { $action =''; } -if ((float) DOL_VERSION >= 6) { - include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; -} +include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; if ($action == 'updateMask') { $maskconstorder = GETPOST('maskconstorder', 'alpha'); diff --git a/htdocs/admin/hrm.php b/htdocs/admin/hrm.php index 838e9bf9a0b..73931ebf83d 100644 --- a/htdocs/admin/hrm.php +++ b/htdocs/admin/hrm.php @@ -70,9 +70,7 @@ $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); * Actions */ -if ((float) DOL_VERSION >= 6) { - include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; -} +include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; if ($action == 'update') { $max_rank = GETPOST('HRM_MAXRANK', 'int'); diff --git a/htdocs/asset/admin/setup.php b/htdocs/asset/admin/setup.php index 67448b0e304..965566c3a74 100644 --- a/htdocs/asset/admin/setup.php +++ b/htdocs/asset/admin/setup.php @@ -68,16 +68,14 @@ $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); * Actions */ -if ((float) DOL_VERSION >= 6) { - include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; -} +include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; if ($action == 'updateMask') { - $maskconstorder = GETPOST('maskconstorder', 'alpha'); - $maskorder = GETPOST('maskorder', 'alpha'); + $maskconst = GETPOST('maskconst', 'alpha'); + $mask = GETPOST('mask', 'alpha'); - if ($maskconstorder) { - $res = dolibarr_set_const($db, $maskconstorder, $maskorder, 'chaine', 0, '', $conf->entity); + if ($maskconst) { + $res = dolibarr_set_const($db, $maskconst, $mask, 'chaine', 0, '', $conf->entity); if (!($res > 0)) { $error++; } @@ -206,7 +204,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { } if ($myTmpObjectArray['includerefgeneration']) { /* - * Orders Numbering model + * Assets Numbering model */ $setupnotempty++; diff --git a/htdocs/core/modules/asset/mod_asset_advanced.php b/htdocs/core/modules/asset/mod_asset_advanced.php index 995e067b822..4c27609ff59 100644 --- a/htdocs/core/modules/asset/mod_asset_advanced.php +++ b/htdocs/core/modules/asset/mod_asset_advanced.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2007 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019-2022 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -63,12 +63,12 @@ class mod_asset_advanced extends ModeleNumRefAsset $form = new Form($db); - $texte = $langs->trans('GenericNumRefModelDesc')."
\n"; - $texte .= '
'; - $texte .= ''; - $texte .= ''; - $texte .= ''; - $texte .= ''; + $text = $langs->trans('GenericNumRefModelDesc')."
\n"; + $text .= ''; + $text .= ''; + $text .= ''; + $text .= ''; + $text .= '
'; $tooltip = $langs->trans("GenericMaskCodes", $langs->transnoentities("Asset"), $langs->transnoentities("Asset")); $tooltip .= $langs->trans("GenericMaskCodes2"); @@ -77,17 +77,17 @@ class mod_asset_advanced extends ModeleNumRefAsset $tooltip .= $langs->trans("GenericMaskCodes5"); // Parametrage du prefix - $texte .= ''; - $texte .= ''; + $text .= ''; + $text .= ''; - $texte .= ''; + $text .= ''; - $texte .= ''; + $text .= ''; - $texte .= '
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).'
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).'   
'; - $texte .= '
'; + $text .= ''; + $text .= ''; - return $texte; + return $text; } /** @@ -102,16 +102,8 @@ class mod_asset_advanced extends ModeleNumRefAsset $object = new Asset($db); $object->initAsSpecimen(); - /*$old_code_client = $mysoc->code_client; - $old_code_type = $mysoc->typent_code; - $mysoc->code_client = 'CCCCCCCCCC'; - $mysoc->typent_code = 'TTTTTTTTTT';*/ - $numExample = $this->getNextValue($object); - /*$mysoc->code_client = $old_code_client; - $mysoc->typent_code = $old_code_type;*/ - if (!$numExample) { $numExample = $langs->trans('NotConfigured'); } @@ -121,7 +113,7 @@ class mod_asset_advanced extends ModeleNumRefAsset /** * Return next free value * - * @param Object $object Object we need next value for + * @param Asset $object Object we need next value for * @return string Value if KO, <0 if KO */ public function getNextValue($object) @@ -131,7 +123,7 @@ class mod_asset_advanced extends ModeleNumRefAsset require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; // We get cursor rule - $mask = getDolGlobalString('ASSET_ASSET_ADVANCED_MASK'); + $mask = getDolGlobalString('ASSET_ADVANCED_MASK'); if (!$mask) { $this->error = 'NotConfigured'; @@ -140,7 +132,7 @@ class mod_asset_advanced extends ModeleNumRefAsset $date = $object->date; - $numFinal = get_next_value($db, $mask, 'asset_asset', 'ref', '', null, $date); + $numFinal = get_next_value($db, $mask, 'asset', 'ref', '', null, $date); return $numFinal; } diff --git a/htdocs/core/modules/asset/mod_asset_standard.php b/htdocs/core/modules/asset/mod_asset_standard.php index 2e3ee3938e1..4fbf889fc9b 100644 --- a/htdocs/core/modules/asset/mod_asset_standard.php +++ b/htdocs/core/modules/asset/mod_asset_standard.php @@ -1,6 +1,7 @@ - * Copyright (C) 2005-2009 Regis Houssin +/* Copyright (C) 2005-2010 Laurent Destailleur + * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2022 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -83,7 +84,8 @@ class mod_asset_standard extends ModeleNumRefAsset { global $conf, $langs, $db; - $coyymm = ''; $max = ''; + $coyymm = ''; + $max = ''; $posindice = strlen($this->prefix) + 6; $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; @@ -124,7 +126,7 @@ class mod_asset_standard extends ModeleNumRefAsset // first we get the max value $posindice = strlen($this->prefix) + 6; $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; - $sql .= " FROM ".MAIN_DB_PREFIX."asset_asset"; + $sql .= " FROM ".MAIN_DB_PREFIX."asset"; $sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'"; if ($object->ismultientitymanaged == 1) { $sql .= " AND entity = ".$conf->entity; diff --git a/htdocs/recruitment/admin/setup.php b/htdocs/recruitment/admin/setup.php index 517bbca5c19..4b9fc9a133f 100644 --- a/htdocs/recruitment/admin/setup.php +++ b/htdocs/recruitment/admin/setup.php @@ -88,9 +88,7 @@ $setupnotempty = 0; * Actions */ -if ((float) DOL_VERSION >= 6) { - include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; -} +include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; if ($action == 'updateMask') { $maskconstjob = GETPOST('maskconstjob', 'alpha'); diff --git a/htdocs/recruitment/admin/setup_candidatures.php b/htdocs/recruitment/admin/setup_candidatures.php index adc12a656f4..584dee06ab4 100644 --- a/htdocs/recruitment/admin/setup_candidatures.php +++ b/htdocs/recruitment/admin/setup_candidatures.php @@ -88,9 +88,7 @@ $setupnotempty = 0; * Actions */ -if ((float) DOL_VERSION >= 6) { - include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; -} +include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; if ($action == 'updateMask') { $maskconstcand = GETPOST('maskconstcand', 'alpha'); diff --git a/htdocs/zapier/admin/setup.php b/htdocs/zapier/admin/setup.php index 6737d23354f..6fe6365d1b9 100644 --- a/htdocs/zapier/admin/setup.php +++ b/htdocs/zapier/admin/setup.php @@ -54,10 +54,7 @@ if (empty($user->admin)) accessforbidden(); * Actions */ -if ((float) DOL_VERSION >= 6) { - include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; -} - +include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; /* * View