--- /tmp/dsg/dolibarr/htdocs/core/modules/mrp/github_19.0.3_mod_mo_advanced.php +++ /tmp/dsg/dolibarr/htdocs/core/modules/mrp/client_mod_mo_advanced.php @@ -7 +6,0 @@ - * Copyright (C) 2020 Josep LluĂ­s Amador @@ -39,3 +38,3 @@ - * Dolibarr version of the loaded document - * @var string - */ + * Dolibarr version of the loaded document + * @var string + */ @@ -55,9 +54,8 @@ - /** - * Returns the description of the numbering model - * - * @param Translate $langs Lang object to use for output - * @return string Descriptive text - */ - public function info($langs) - { - global $conf, $langs, $db; + /** + * Returns the description of the numbering model + * + * @return string Texte descripif + */ + public function info() + { + global $conf, $langs, $db; @@ -73 +71 @@ - $texte .= ''; + $texte .= ''; @@ -84 +82 @@ - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; @@ -86 +84 @@ - $texte .= '  '; + $texte .= '  '; @@ -94 +92 @@ - } + } @@ -96,8 +94,8 @@ - /** - * Return an example of numbering - * - * @return string Example - */ - public function getExample() - { - global $conf, $langs, $mysoc; + /** + * Return an example of numbering + * + * @return string Example + */ + public function getExample() + { + global $conf, $langs, $mysoc; @@ -105,5 +103,5 @@ - $old_code_client = $mysoc->code_client; - $old_code_type = $mysoc->typent_code; - $mysoc->code_client = 'CCCCCCCCCC'; - $mysoc->typent_code = 'TTTTTTTTTT'; - $numExample = $this->getNextValue($mysoc, ''); + $old_code_client = $mysoc->code_client; + $old_code_type = $mysoc->typent_code; + $mysoc->code_client = 'CCCCCCCCCC'; + $mysoc->typent_code = 'TTTTTTTTTT'; + $numExample = $this->getNextValue($mysoc, ''); @@ -113 +111,2 @@ - if (!$numExample) { + if (!$numExample) + { @@ -117 +116 @@ - } + } @@ -126,2 +125,2 @@ - public function getNextValue($objprod, $object) - { + public function getNextValue($objprod, $object) + { @@ -133 +132 @@ - $mask = getDolGlobalString('MRP_MO_ADVANCED_MASK'); + $mask = $conf->global->MRP_MO_ADVANCED_MASK; @@ -135 +134,2 @@ - if (!$mask) { + if (!$mask) + { --- /tmp/dsg/dolibarr/htdocs/core/modules/mrp/github_19.0.3_mod_mo_standard.php +++ /tmp/dsg/dolibarr/htdocs/core/modules/mrp/client_mod_mo_standard.php @@ -54,2 +54 @@ - * @param Translate $langs Lang object to use for output - * @return string Descriptive text + * @return string Text with description @@ -57 +56 @@ - public function info($langs) + public function info() @@ -60 +59 @@ - return $langs->trans("SimpleNumRefModelDesc", $this->prefix); + return $langs->trans("SimpleNumRefModelDesc", $this->prefix); @@ -79,2 +78 @@ - * @param Object $object Object we need next value for - * @return boolean false if conflict, true if ok + * @return boolean false if conflict, true if ok @@ -82 +80 @@ - public function canBeActivated($object) + public function canBeActivated() @@ -86,2 +84 @@ - $coyymm = ''; - $max = ''; + $coyymm = ''; $max = ''; @@ -96 +93,2 @@ - if ($resql) { + if ($resql) + { @@ -98,4 +96 @@ - if ($row) { - $coyymm = substr($row[0], 0, 6); - $max = $row[0]; - } + if ($row) { $coyymm = substr($row[0], 0, 6); $max = $row[0]; } @@ -103 +98,2 @@ - if ($coyymm && !preg_match('/'.$this->prefix.'[0-9][0-9][0-9][0-9]/i', $coyymm)) { + if ($coyymm && !preg_match('/'.$this->prefix.'[0-9][0-9][0-9][0-9]/i', $coyymm)) + { @@ -131 +127,2 @@ - if ($resql) { + if ($resql) + { @@ -133,6 +130,5 @@ - if ($obj) { - $max = intval($obj->max); - } else { - $max = 0; - } - } else { + if ($obj) $max = intval($obj->max); + else $max = 0; + } + else + { @@ -147,5 +143,2 @@ - if ($max >= (pow(10, 4) - 1)) { - $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is - } else { - $num = sprintf("%04s", $max + 1); - } + if ($max >= (pow(10, 4) - 1)) $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is + else $num = sprintf("%04s", $max + 1);