--- /tmp/dsg/dolibarr/htdocs/core/modules/fichinter/github_mod_arctic.php +++ /tmp/dsg/dolibarr/htdocs/core/modules/fichinter/client_mod_arctic.php @@ -32,10 +32,10 @@ */ class mod_arctic extends ModeleNumRefFicheinter { - /** - * Dolibarr version of the loaded document - * @var string - */ + /** + * Dolibarr version of the loaded document + * @var string + */ public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr' /** @@ -57,13 +57,13 @@ /** - * 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"); @@ -94,20 +94,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) @@ -115,7 +115,7 @@ $numExample = $langs->trans('NotConfigured'); } return $numExample; - } + } /** * Return next free value @@ -124,8 +124,8 @@ * @param Object $object Object we need next value for * @return string Value if KO, <0 if KO */ - public function getNextValue($objsoc = 0, $object = '') - { + public function getNextValue($objsoc = 0, $object = '') + { global $db, $conf; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; @@ -142,18 +142,18 @@ $numFinal = get_next_value($db, $mask, 'fichinter', 'ref', '', $objsoc, $object->datec); return $numFinal; - } + } /** * Return next free value * - * @param Societe $objsoc Object third party + * @param Societe $objsoc Object third party * @param Object $objforref Object for number to search - * @return string Next free value - */ - public function getNumRef($objsoc, $objforref) - { - return $this->getNextValue($objsoc, $objforref); - } + * @return string Next free value + */ + public function getNumRef($objsoc, $objforref) + { + return $this->getNextValue($objsoc, $objforref); + } } --- /tmp/dsg/dolibarr/htdocs/core/modules/fichinter/github_mod_pacific.php +++ /tmp/dsg/dolibarr/htdocs/core/modules/fichinter/client_mod_pacific.php @@ -30,10 +30,10 @@ */ class mod_pacific extends ModeleNumRefFicheinter { - /** - * Dolibarr version of the loaded document - * @var string - */ + /** + * Dolibarr version of the loaded document + * @var string + */ public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr' public $prefix = 'FI'; @@ -59,13 +59,13 @@ /** * Return description of numbering module * - * @return string Text with description - */ - public function info() - { - global $langs; - return $langs->trans("SimpleNumRefModelDesc", $this->prefix); - } + * @return string Text with description + */ + public function info() + { + global $langs; + return $langs->trans("SimpleNumRefModelDesc", $this->prefix); + } /** * Return an example of numbering @@ -106,7 +106,9 @@ if (!$fayymm || preg_match('/'.$this->prefix.'[0-9][0-9][0-9][0-9]/i', $fayymm)) { return true; - } else { + } + else + { $langs->load("errors"); $this->error = $langs->trans('ErrorNumRefModel', $max); return false; @@ -143,8 +145,8 @@ $date = $object->datec; $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); return $this->prefix.$yymm."-".$num; } --- /tmp/dsg/dolibarr/htdocs/core/modules/fichinter/github_modules_fichinter.php +++ /tmp/dsg/dolibarr/htdocs/core/modules/fichinter/client_modules_fichinter.php @@ -178,7 +178,9 @@ if (!empty($conf->global->FICHEINTER_ADDON_PDF)) { $modele = $conf->global->FICHEINTER_ADDON_PDF; - } else { + } + else + { $modele = 'soleil'; } } @@ -232,12 +234,16 @@ dol_delete_preview($object); return 1; - } else { + } + else + { $outputlangs->charset_output = $sav_charset_output; dol_print_error($db, "fichinter_pdf_create Error: ".$obj->error); return 0; } - } else { + } + else + { print $langs->trans("Error")." ".$langs->trans("ErrorFileDoesNotExists", $file); return 0; }