diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index da9c4f57c7a..b0b78b3bf03 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -3737,8 +3737,7 @@ class Facture extends CommonInvoice // Include file with class - $dirmodels = array_merge(array('/'), (array)$conf->modules_parts['models']); - + $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); foreach ($dirmodels as $reldir) { $dir = dol_buildpath($reldir . 'core/modules/' . $moduleName . '/'); diff --git a/htdocs/core/modules/takepos/mod_takepos_ref_simple.php b/htdocs/core/modules/takepos/mod_takepos_ref_simple.php index 18039198a6e..f63acb7f7e4 100644 --- a/htdocs/core/modules/takepos/mod_takepos_ref_simple.php +++ b/htdocs/core/modules/takepos/mod_takepos_ref_simple.php @@ -31,17 +31,35 @@ dol_include_once('/core/modules/takepos/modules_takepos.php'); */ class mod_takepos_ref_simple extends ModeleNumRefTakepos { - var $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr' - var $prefix = 'TK'; - var $error = ''; - var $nom = 'Simple'; + /** + * Dolibarr version of the loaded document 'development', 'experimental', 'dolibarr' + * @var string + */ + public $version = 'dolibarr'; + + /** + * Prefix + * @var string + */ + public $prefix = 'TK'; + + /** + * @var string Error code (or message) + */ + public $error = ''; + + /** + * Name + * @var string + */ + public $nom = 'Simple'; /** * Return description of numbering module * * @return string Text with description */ - function info() + public function info() { global $langs; @@ -53,7 +71,7 @@ class mod_takepos_ref_simple extends ModeleNumRefTakepos * * @return string Example */ - function getExample() + public function getExample() { return $this->prefix . '0-0501-0001'; } @@ -64,7 +82,7 @@ class mod_takepos_ref_simple extends ModeleNumRefTakepos * * @return boolean false si conflit, true si ok */ - function canBeActivated() + public function canBeActivated() { global $conf, $langs, $db; @@ -103,7 +121,7 @@ class mod_takepos_ref_simple extends ModeleNumRefTakepos * @param string $mode 'next' for next value or 'last' for last value * @return string Next value */ - function getNextValue($objsoc = null, $invoice = null, $mode = 'next') + public function getNextValue($objsoc = null, $invoice = null, $mode = 'next') { global $db; @@ -168,7 +186,7 @@ class mod_takepos_ref_simple extends ModeleNumRefTakepos * @param Object $objforref Object for number to search * @return string Next free value */ - function getNumRef($objsoc, $objforref) + public function getNumRef($objsoc, $objforref) { return $this->getNextValue($objsoc, $objforref); } diff --git a/htdocs/core/modules/takepos/mod_takepos_ref_universal.php b/htdocs/core/modules/takepos/mod_takepos_ref_universal.php index aff9f373528..a84f4b28125 100644 --- a/htdocs/core/modules/takepos/mod_takepos_ref_universal.php +++ b/htdocs/core/modules/takepos/mod_takepos_ref_universal.php @@ -33,16 +33,29 @@ dol_include_once('/core/modules/takepos/modules_takepos.php'); */ class mod_takepos_ref_universal extends ModeleNumRefTakepos { - var $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr' - var $error = ''; - var $nom = 'Universal'; + /** + * Dolibarr version of the loaded document 'development', 'experimental', 'dolibarr' + * @var string + */ + public $version = 'dolibarr'; + + /** + * @var string Error code (or message) + */ + public $error = ''; + + /** + * Name + * @var string + */ + public $nom = 'Universal'; /** * Renvoi la description du modele de numerotation * * @return string Texte descripif */ - function info() + public function info() { global $conf, $langs; @@ -83,7 +96,7 @@ class mod_takepos_ref_universal extends ModeleNumRefTakepos * * @return string Example */ - function getExample() + public function getExample() { global $conf, $langs, $mysoc; @@ -99,14 +112,14 @@ class mod_takepos_ref_universal extends ModeleNumRefTakepos } /** - * Return next free value + * Return next free value * * @param Societe $objsoc Object thirdparty * @param Facture $invoice Object invoice * @param string $mode 'next' for next value or 'last' for last value * @return string Value if KO, <0 if KO */ - function getNextValue($objsoc = 0, $invoice = null, $mode = 'next') + public function getNextValue($objsoc = 0, $invoice = null, $mode = 'next') { global $db, $conf; @@ -124,7 +137,7 @@ class mod_takepos_ref_universal extends ModeleNumRefTakepos $entity = getEntity('invoicenumber', 1, $invoice); $pos_source = is_object($invoice) && $invoice->pos_source > 0 ? $invoice->pos_source : 0; - $mask = str_replace('{TN}' , $pos_source, $mask); + $mask = str_replace('{TN}', $pos_source, $mask); $numFinal = get_next_value($db, $mask, 'facture', 'ref', '', $objsoc, $invoice->date, $mode, false, null, $entity); return $numFinal; @@ -138,7 +151,7 @@ class mod_takepos_ref_universal extends ModeleNumRefTakepos * @param Object $objforref Object for number to search * @return string Next free value */ - function getNumRef($objsoc, $objforref) + public function getNumRef($objsoc, $objforref) { return $this->getNextValue($objsoc, $objforref); } diff --git a/htdocs/core/modules/takepos/modules_takepos.php b/htdocs/core/modules/takepos/modules_takepos.php index df327a87a1c..cb33fd2d9b3 100644 --- a/htdocs/core/modules/takepos/modules_takepos.php +++ b/htdocs/core/modules/takepos/modules_takepos.php @@ -33,71 +33,76 @@ */ abstract class ModeleNumRefTakepos { - var $error=''; - public $version = ''; + /** + * @var string Error code (or message) + */ + public $error=''; - /** - * Return if a module can be used or not - * - * @return boolean true if module can be used - */ - function isEnabled() + + public $version = ''; + + /** + * Return if a module can be used or not + * + * @return boolean true if module can be used + */ + public function isEnabled() { return true; } - /** - * Renvoi la description par defaut du modele de numerotation - * - * @return string Texte descripif - */ - function info() + /** + * Renvoi la description par defaut du modele de numerotation + * + * @return string Texte descripif + */ + public function info() { global $langs; $langs->load("cashdesk@cashdesk"); return $langs->trans("NoDescription"); } - /** - * Renvoi un exemple de numerotation - * - * @return string Example - */ - function getExample() + /** + * Return an example of numbering + * + * @return string Example + */ + public function getExample() { global $langs; $langs->load('cashdesk@cashdesk'); return $langs->trans('NoExample'); } - /** - * Test si les numeros deja en vigueur dans la base ne provoquent pas de - * de conflits qui empechera cette numerotation de fonctionner. - * - * @return boolean false si conflit, true si ok - */ - function canBeActivated() + /** + * Checks if the numbers already in force in the data base do not + * cause conflicts that would prevent this numbering from working. + * + * @return boolean false if conflict, true if ok + */ + public function canBeActivated() { return true; } /** - * Renvoi prochaine valeur attribuee + * Renvoi prochaine valeur attribuee * - * @return string Valeur + * @return string Valeur */ - function getNextValue() + public function getNextValue() { global $langs; return $langs->trans('NotAvailable'); } - /** - * Renvoi version du module numerotation - * - * @return string Valeur - */ - function getVersion() + /** + * Renvoi version du modele de numerotation + * + * @return string Valeur + */ + public function getVersion() { global $langs; $langs->load("admin"); @@ -108,4 +113,4 @@ abstract class ModeleNumRefTakepos if ($this->version) return $this->version; return $langs->trans('NotAvailable'); } -} \ No newline at end of file +}