diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_advanced.php b/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_advanced.php index 26866a6b9f1..371a287dffb 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_advanced.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_advanced.php @@ -38,7 +38,7 @@ class mod_myobject_advanced extends ModeleNumRefMyObject * Dolibarr version of the loaded document * @var string */ - public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr' + public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr' /** * @var string Error message @@ -48,7 +48,7 @@ class mod_myobject_advanced extends ModeleNumRefMyObject /** * @var string name */ - public $name='advanced'; + public $name = 'advanced'; /** @@ -65,28 +65,28 @@ class mod_myobject_advanced extends ModeleNumRefMyObject $form = new Form($db); $texte = $langs->trans('GenericNumRefModelDesc')."
\n"; - $texte.= '
'; - $texte.= ''; - $texte.= ''; - $texte.= ''; - $texte.= ''; + $texte .= ''; + $texte .= ''; + $texte .= ''; + $texte .= ''; + $texte .= '
'; - $tooltip=$langs->trans("GenericMaskCodes", $langs->transnoentities("MyObject"), $langs->transnoentities("MyObject")); - $tooltip.=$langs->trans("GenericMaskCodes2"); - $tooltip.=$langs->trans("GenericMaskCodes3"); - $tooltip.=$langs->trans("GenericMaskCodes4a", $langs->transnoentities("MyObject"), $langs->transnoentities("MyObject")); - $tooltip.=$langs->trans("GenericMaskCodes5"); + $tooltip = $langs->trans("GenericMaskCodes", $langs->transnoentities("MyObject"), $langs->transnoentities("MyObject")); + $tooltip .= $langs->trans("GenericMaskCodes2"); + $tooltip .= $langs->trans("GenericMaskCodes3"); + $tooltip .= $langs->trans("GenericMaskCodes4a", $langs->transnoentities("MyObject"), $langs->transnoentities("MyObject")); + $tooltip .= $langs->trans("GenericMaskCodes5"); // Parametrage du prefix - $texte.= ''; - $texte.= ''; + $texte .= ''; + $texte .= ''; - $texte.= ''; + $texte .= ''; - $texte.= ''; + $texte .= ''; - $texte.= '
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).'
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).'   
'; - $texte.= '
'; + $texte .= ''; + $texte .= ''; return $texte; } @@ -98,17 +98,17 @@ class mod_myobject_advanced extends ModeleNumRefMyObject */ public function getExample() { - global $conf,$langs,$mysoc; + global $conf, $langs, $mysoc; - $old_code_client=$mysoc->code_client; - $old_code_type=$mysoc->typent_code; - $mysoc->code_client='CCCCCCCCCC'; - $mysoc->typent_code='TTTTTTTTTT'; + $old_code_client = $mysoc->code_client; + $old_code_type = $mysoc->typent_code; + $mysoc->code_client = 'CCCCCCCCCC'; + $mysoc->typent_code = 'TTTTTTTTTT'; $numExample = $this->getNextValue($mysoc, ''); - $mysoc->code_client=$old_code_client; - $mysoc->typent_code=$old_code_type; + $mysoc->code_client = $old_code_client; + $mysoc->typent_code = $old_code_type; - if (! $numExample) + if (!$numExample) { $numExample = $langs->trans('NotConfigured'); } @@ -123,22 +123,22 @@ class mod_myobject_advanced extends ModeleNumRefMyObject */ public function getNextValue($object) { - global $db,$conf; + global $db, $conf; - require_once DOL_DOCUMENT_ROOT .'/core/lib/functions2.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; // We get cursor rule - $mask=$conf->global->MYMODULE_MYOBJECT_ADVANCED_MASK; + $mask = $conf->global->MYMODULE_MYOBJECT_ADVANCED_MASK; - if (! $mask) + if (!$mask) { - $this->error='NotConfigured'; + $this->error = 'NotConfigured'; return 0; } $date = $object->date; - $numFinal=get_next_value($db, $mask, 'mymodule_myobject', 'ref', '', null, $date); + $numFinal = get_next_value($db, $mask, 'mymodule_myobject', 'ref', '', null, $date); return $numFinal; } diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_standard.php b/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_standard.php index e18e7636b6d..71926700aa4 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_standard.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_standard.php @@ -34,19 +34,19 @@ class mod_myobject_standard extends ModeleNumRefMyObject * Dolibarr version of the loaded document * @var string */ - public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr' + public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr' - public $prefix='MYOBJECT'; + public $prefix = 'MYOBJECT'; /** * @var string Error code (or message) */ - public $error=''; + public $error = ''; /** * @var string name */ - public $name='standard'; + public $name = 'standard'; /** @@ -80,26 +80,26 @@ class mod_myobject_standard extends ModeleNumRefMyObject */ public function canBeActivated() { - global $conf,$langs,$db; + global $conf, $langs, $db; - $coyymm=''; $max=''; + $coyymm = ''; $max = ''; - $posindice=8; + $posindice = 8; $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; - $sql.= " FROM ".MAIN_DB_PREFIX."mymodule_myobject"; - $sql.= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'"; - $sql.= " AND entity = ".$conf->entity; + $sql .= " FROM ".MAIN_DB_PREFIX."mymodule_myobject"; + $sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'"; + $sql .= " AND entity = ".$conf->entity; - $resql=$db->query($sql); + $resql = $db->query($sql); if ($resql) { $row = $db->fetch_row($resql); - if ($row) { $coyymm = substr($row[0], 0, 6); $max=$row[0]; } + if ($row) { $coyymm = substr($row[0], 0, 6); $max = $row[0]; } } - 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)) { $langs->load("errors"); - $this->error=$langs->trans('ErrorNumRefModel', $max); + $this->error = $langs->trans('ErrorNumRefModel', $max); return false; } @@ -114,21 +114,21 @@ class mod_myobject_standard extends ModeleNumRefMyObject */ public function getNextValue($object) { - global $db,$conf; + global $db, $conf; // D'abord on recupere la valeur max - $posindice=9; + $posindice = 9; $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; - $sql.= " FROM ".MAIN_DB_PREFIX."mymodule_myobject"; - $sql.= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'"; - $sql.= " AND entity = ".$conf->entity; + $sql .= " FROM ".MAIN_DB_PREFIX."mymodule_myobject"; + $sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'"; + $sql .= " AND entity = ".$conf->entity; - $resql=$db->query($sql); + $resql = $db->query($sql); if ($resql) { $obj = $db->fetch_object($resql); if ($obj) $max = intval($obj->max); - else $max=0; + else $max = 0; } else { @@ -137,11 +137,11 @@ class mod_myobject_standard extends ModeleNumRefMyObject } //$date=time(); - $date=$object->date_creation; + $date = $object->date_creation; $yymm = strftime("%y%m", $date); - 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); dol_syslog("mod_myobject_standard::getNextValue return ".$this->prefix.$yymm."-".$num); return $this->prefix.$yymm."-".$num; diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index e3b5e159913..fbf9540aab9 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -649,8 +649,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''.$tmpproduct->getNomUrl(1).''; print ''; $help = ''; - if ($line->qty_frozen) $help.=($help ? '
' : '').''.$langs->trans("QuantityFrozen").': '.yn(1).' ('.$langs->trans("QuantityConsumedInvariable").')'; - if ($line->disable_stock_change) $help.=($help ? '
' : '').''.$langs->trans("DisableStockChange").': '.yn(1).' ('.(($tmpproduct->type == Product::TYPE_SERVICE && empty($conf->global->STOCK_SUPPORTS_SERVICES)) ? $langs->trans("NoStockChangeOnServices") : $langs->trans("DisableStockChangeHelp")).')'; + if ($line->qty_frozen) $help .= ($help ? '
' : '').''.$langs->trans("QuantityFrozen").': '.yn(1).' ('.$langs->trans("QuantityConsumedInvariable").')'; + if ($line->disable_stock_change) $help .= ($help ? '
' : '').''.$langs->trans("DisableStockChange").': '.yn(1).' ('.(($tmpproduct->type == Product::TYPE_SERVICE && empty($conf->global->STOCK_SUPPORTS_SERVICES)) ? $langs->trans("NoStockChangeOnServices") : $langs->trans("DisableStockChangeHelp")).')'; if ($help) { print $form->textwithpicto($line->qty, $help, -1); } else {