--- /tmp/dsg/dolibarr/htdocs/core/modules/project/task/github_mod_task_simple.php +++ /tmp/dsg/dolibarr/htdocs/core/modules/project/task/client_mod_task_simple.php @@ -107,7 +107,9 @@ if (!$coyymm || preg_match('/'.$this->prefix.'[0-9][0-9][0-9][0-9]/i', $coyymm)) { return true; - } else { + } + else + { $langs->load("errors"); $this->error = $langs->trans('ErrorNumRefModel', $max); return false; @@ -138,7 +140,9 @@ $obj = $db->fetch_object($resql); if ($obj) $max = intval($obj->max); else $max = 0; - } else { + } + else + { dol_syslog("mod_task_simple::getNextValue", LOG_DEBUG); return -1; } --- /tmp/dsg/dolibarr/htdocs/core/modules/project/task/github_mod_task_universal.php +++ /tmp/dsg/dolibarr/htdocs/core/modules/project/task/client_mod_task_universal.php @@ -31,15 +31,15 @@ class mod_task_universal extends ModeleNumRefTask { /** - * Dolibarr version of the loaded document - * @var string - */ + * Dolibarr version of the loaded document + * @var string + */ public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr' /** - * @var string Error code (or message) - */ - public $error = ''; + * @var string Error code (or message) + */ + public $error = ''; /** * @var string @@ -54,19 +54,19 @@ public $name = 'Universal'; - /** - * Returns the description of the numbering model - * - * @return string Texte descripif - */ - public function info() - { - global $conf, $langs, $db; + /** + * Returns the description of the numbering model + * + * @return string Texte descripif + */ + public function info() + { + global $conf, $langs; // Load translation files required by the page - $langs->loadLangs(array("projects", "admin")); + $langs->loadLangs(array("projects", "admin")); - $form = new Form($db); + $form = new Form($this->db); $texte = $langs->trans('GenericNumRefModelDesc')."
\n"; $texte .= '
'; @@ -93,37 +93,38 @@ $texte .= '
'; return $texte; - } + } - /** - * 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; - $old_code_client = $mysoc->code_client; - $mysoc->code_client = 'CCCCCCCCCC'; - $numExample = $this->getNextValue($mysoc, ''); + $old_code_client = $mysoc->code_client; + $mysoc->code_client = 'CCCCCCCCCC'; + $numExample = $this->getNextValue($mysoc, ''); $mysoc->code_client = $old_code_client; - if (!$numExample) { + if (!$numExample) + { $numExample = $langs->trans('NotConfigured'); } return $numExample; - } + } - /** - * Return next value - * - * @param Societe $objsoc Object third party - * @param Task $object Object task - * @return string Value if OK, 0 if KO - */ - public function getNextValue($objsoc, $object) - { + /** + * Return next value + * + * @param Societe $objsoc Object third party + * @param Task $object Object task + * @return string Value if OK, 0 if KO + */ + public function getNextValue($objsoc, $object) + { global $db, $conf; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; @@ -131,7 +132,8 @@ // On defini critere recherche compteur $mask = $conf->global->PROJECT_TASK_UNIVERSAL_MASK; - if (!$mask) { + if (!$mask) + { $this->error = 'NotConfigured'; return 0; } @@ -143,17 +145,17 @@ } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** - * Return next reference not yet used as a reference - * - * @param Societe $objsoc Object third party - * @param Task $object Object task - * @return string Next not used reference - */ - public function project_get_num($objsoc = 0, $object = '') - { - // phpcs:enable - return $this->getNextValue($objsoc, $object); - } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return next reference not yet used as a reference + * + * @param Societe $objsoc Object third party + * @param Task $object Object task + * @return string Next not used reference + */ + public function project_get_num($objsoc = 0, $object = '') + { + // phpcs:enable + return $this->getNextValue($objsoc, $object); + } } --- /tmp/dsg/dolibarr/htdocs/core/modules/project/task/github_modules_task.php +++ /tmp/dsg/dolibarr/htdocs/core/modules/project/task/client_modules_task.php @@ -38,17 +38,17 @@ public $error = ''; - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Return list of active generation modules * - * @param DoliDB $db Database handler - * @param integer $maxfilenamelength Max length of value to show - * @return array List of templates - */ - public static function liste_modeles($db, $maxfilenamelength = 0) + * @param DoliDB $db Database handler + * @param integer $maxfilenamelength Max length of value to show + * @return array List of templates + */ + public static function liste_modeles($db, $maxfilenamelength = 0) { - // phpcs:enable + // phpcs:enable global $conf; $type = 'project_task'; @@ -78,7 +78,7 @@ * * @return boolean true if module can be used */ - public function isEnabled() + public function isEnabled() { return true; } @@ -88,7 +88,7 @@ * * @return string Texte descripif */ - public function info() + public function info() { global $langs; $langs->load("projects"); @@ -100,7 +100,7 @@ * * @return string Example */ - public function getExample() + public function getExample() { global $langs; $langs->load("projects"); @@ -113,7 +113,7 @@ * * @return boolean false if conflict, true if ok */ - public function canBeActivated() + public function canBeActivated() { return true; } @@ -125,7 +125,7 @@ * @param Project $project Object project * @return string Valeur */ - public function getNextValue($objsoc, $project) + public function getNextValue($objsoc, $project) { global $langs; return $langs->trans("NotAvailable"); @@ -136,7 +136,7 @@ * * @return string Valeur */ - public function getVersion() + public function getVersion() { global $langs; $langs->load("admin");