--- /tmp/dsg/dolibarr/htdocs/core/modules/expensereport/github_mod_expensereport_jade.php +++ /tmp/dsg/dolibarr/htdocs/core/modules/expensereport/client_mod_expensereport_jade.php @@ -122,7 +122,7 @@ global $db, $conf; // For backward compatibility and restore old behavior to get ref of expense report - if (!empty($conf->global->EXPENSEREPORT_USE_OLD_NUMBERING_RULE)) + if ($conf->global->EXPENSEREPORT_USE_OLD_NUMBERING_RULE) { $fuser = null; if ($object->fk_user_author > 0) @@ -186,7 +186,9 @@ $obj = $db->fetch_object($resql); if ($obj) $max = intval($obj->max); else $max = 0; - } else { + } + else + { dol_syslog("mod_expensereport_jade::getNextValue", LOG_DEBUG); return 0; } --- /tmp/dsg/dolibarr/htdocs/core/modules/expensereport/github_mod_expensereport_sand.php +++ /tmp/dsg/dolibarr/htdocs/core/modules/expensereport/client_mod_expensereport_sand.php @@ -31,9 +31,9 @@ class mod_expensereport_sand extends ModeleNumRefExpenseReport { /** - * Dolibarr version of the loaded document - * @var string - */ + * Dolibarr version of the loaded document + * @var string + */ public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr' /** @@ -54,14 +54,14 @@ public $name = 'Sand'; - /** - * Returns the description of the numbering model - * - * @return string Texte descripif - */ - public function info() - { - global $db, $conf, $langs; + /** + * Returns the description of the numbering model + * + * @return string Texte descripif + */ + public function info() + { + global $db, $conf, $langs; $langs->load("bills"); @@ -92,39 +92,39 @@ $texte .= ''; return $texte; - } + } - /** - * Return an example of numbering - * - * @return string Example - */ - public function getExample() - { - global $db, $conf, $langs, $user; + /** + * Return an example of numbering + * + * @return string Example + */ + public function getExample() + { + global $db, $conf, $langs, $user; - $exp = new ExpenseReport($db); - $exp->initAsSpecimen(); - $exp->fk_user_author = $user->id; + $exp = new ExpenseReport($db); + $exp->initAsSpecimen(); + $exp->fk_user_author = $user->id; - $numExample = $this->getNextValue($exp); + $numExample = $this->getNextValue($exp); if (!$numExample) { $numExample = $langs->trans('NotConfigured'); } return $numExample; - } + } - /** - * Return next free value - * - * @param Object $object Object we need next value for - * @return string Value if KO, <0 if KO - */ - public function getNextValue($object) - { - global $db, $conf; + /** + * Return next free value + * + * @param Object $object Object we need next value for + * @return string Value if KO, <0 if KO + */ + public function getNextValue($object) + { + global $db, $conf; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; @@ -154,5 +154,5 @@ $numFinal = get_next_value($db, $mask, 'expensereport', 'ref', '', null, $date, 'next', true, $fuser); return $numFinal; - } + } } --- /tmp/dsg/dolibarr/htdocs/core/modules/expensereport/github_modules_expensereport.php +++ /tmp/dsg/dolibarr/htdocs/core/modules/expensereport/client_modules_expensereport.php @@ -29,17 +29,17 @@ public $error = ''; - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Return list of active models generation - * - * @param DoliDB $db Database handler - * @param integer $maxfilenamelength Max length of value to show - * @return array List of templates - */ + * + * @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 = 'expensereport'; @@ -67,7 +67,7 @@ */ function expensereport_pdf_create(DoliDB $db, ExpenseReport $object, $message, $modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0) { - return $object->generateDocument($modele, $outputlangs, $hidedetails, $hidedesc, $hideref); + return $object->generateDocument($modele, $outputlangs, $hidedetails, $hidedesc, $hideref); } /** @@ -87,7 +87,7 @@ * * @return boolean true if model can be used */ - public function isEnabled() + public function isEnabled() { return true; } @@ -97,7 +97,7 @@ * * @return string Descriptive text */ - public function info() + public function info() { global $langs; $langs->load("orders"); @@ -109,7 +109,7 @@ * * @return string Example */ - public function getExample() + public function getExample() { global $langs; $langs->load("trips"); @@ -121,7 +121,7 @@ * * @return boolean false if conflict, true if ok */ - public function canBeActivated() + public function canBeActivated() { return true; } @@ -132,26 +132,26 @@ * @param Object $object Object we need next value for * @return string Value */ - public function getNextValue($object) + public function getNextValue($object) { global $langs; return $langs->trans("NotAvailable"); } - /** - * Returns the version of the numbering module - * - * @return string Value - */ - public function getVersion() - { - global $langs; - $langs->load("admin"); + /** + * Returns the version of the numbering module + * + * @return string Value + */ + public function getVersion() + { + global $langs; + $langs->load("admin"); - if ($this->version == 'development') return $langs->trans("VersionDevelopment"); - elseif ($this->version == 'experimental') return $langs->trans("VersionExperimental"); - elseif ($this->version == 'dolibarr') return DOL_VERSION; - elseif ($this->version) return $this->version; - else return $langs->trans("NotAvailable"); - } + if ($this->version == 'development') return $langs->trans("VersionDevelopment"); + elseif ($this->version == 'experimental') return $langs->trans("VersionExperimental"); + elseif ($this->version == 'dolibarr') return DOL_VERSION; + elseif ($this->version) return $this->version; + else return $langs->trans("NotAvailable"); + } }