--- /tmp/dsg/dolibarr/htdocs/core/modules/project/github_mod_project_simple.php +++ /tmp/dsg/dolibarr/htdocs/core/modules/project/client_mod_project_simple.php @@ -106,7 +106,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_project_simple::getNextValue", LOG_DEBUG); return -1; } --- /tmp/dsg/dolibarr/htdocs/core/modules/project/github_mod_project_universal.php +++ /tmp/dsg/dolibarr/htdocs/core/modules/project/client_mod_project_universal.php @@ -31,15 +31,15 @@ class mod_project_universal extends ModeleNumRefProjects { /** - * 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 Nom du modele @@ -54,17 +54,17 @@ public $name = 'Universal'; - /** - * Returns the description of the numbering model - * - * @return string Texte descripif - */ - public function info() - { - global $conf, $langs; + /** + * 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($this->db); @@ -93,20 +93,20 @@ $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) @@ -114,17 +114,17 @@ $numExample = $langs->trans('NotConfigured'); } return $numExample; - } + } - /** - * Return next value - * - * @param Societe $objsoc Object third party - * @param Project $project Object project - * @return string Value if OK, 0 if KO - */ - public function getNextValue($objsoc, $project) - { + /** + * Return next value + * + * @param Societe $objsoc Object third party + * @param Project $project Object project + * @return string Value if OK, 0 if KO + */ + public function getNextValue($objsoc, $project) + { global $db, $conf; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; @@ -145,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 Project $project Object project - * @return string Next not used reference - */ - public function project_get_num($objsoc = 0, $project = '') - { - // phpcs:enable - return $this->getNextValue($objsoc, $project); - } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return next reference not yet used as a reference + * + * @param Societe $objsoc Object third party + * @param Project $project Object project + * @return string Next not used reference + */ + public function project_get_num($objsoc = 0, $project = '') + { + // phpcs:enable + return $this->getNextValue($objsoc, $project); + } } --- /tmp/dsg/dolibarr/htdocs/core/modules/project/github_modules_project.php +++ /tmp/dsg/dolibarr/htdocs/core/modules/project/client_modules_project.php @@ -32,77 +32,22 @@ abstract class ModelePDFProjects extends CommonDocGenerator { /** - * @var DoliDb Database handler - */ - public $db; - - /** - * @var string model name - */ - public $name; - - /** - * @var string model description (short text) - */ - public $description; - - /** - * @var string document type - */ - public $type; - - /** - * @var int page_largeur - */ - public $page_largeur; - - /** - * @var int page_hauteur - */ - public $page_hauteur; - - /** - * @var array format - */ - public $format; - - /** - * @var int marge_gauche - */ - public $marge_gauche; - - /** - * @var int marge_droite - */ - public $marge_droite; - - /** - * @var int marge_haute - */ - public $marge_haute; - - /** - * @var int marge_basse - */ - public $marge_basse; - - /** * @var string Error code (or message) */ 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'; @@ -132,7 +77,7 @@ * * @return boolean true if module can be used */ - public function isEnabled() + public function isEnabled() { return true; } @@ -142,7 +87,7 @@ * * @return string Texte descripif */ - public function info() + public function info() { global $langs; $langs->load("projects"); @@ -154,7 +99,7 @@ * * @return string Example */ - public function getExample() + public function getExample() { global $langs; $langs->load("projects"); @@ -167,7 +112,7 @@ * * @return boolean false if conflict, true if ok */ - public function canBeActivated() + public function canBeActivated() { return true; } @@ -179,7 +124,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"); @@ -190,8 +135,8 @@ * * @return string Valeur */ - public function getVersion() - { + public function getVersion() + { global $langs; $langs->load("admin"); @@ -200,5 +145,5 @@ elseif ($this->version == 'dolibarr') return DOL_VERSION; elseif ($this->version) return $this->version; else return $langs->trans("NotAvailable"); - } + } }