diff --git a/htdocs/adherents/admin/member.php b/htdocs/adherents/admin/member.php index d20bd784cedcd..f9e15e88fca4f 100644 --- a/htdocs/adherents/admin/member.php +++ b/htdocs/adherents/admin/member.php @@ -152,10 +152,13 @@ setEventMessages('RecordModifiedSuccessfully', null, 'mesgs'); $db->commit(); } -} - -// Action to update or add a constant -if ($action == 'update' || $action == 'add') { +} elseif ($action == 'setcodemember') { + $result = dolibarr_set_const($db, "MEMBER_CODEMEMBER_ADDON", $value, 'chaine', 0, '', $conf->entity); + if ($result <= 0) { + dol_print_error($db); + } +} elseif ($action == 'update' || $action == 'add') { + // Action to update or add a constant $constname = GETPOST('constname', 'alpha'); $constvalue = (GETPOST('constvalue_'.$constname) ? GETPOST('constvalue_'.$constname) : GETPOST('constvalue')); @@ -223,6 +226,97 @@ print dol_get_fiche_head($head, 'general', $langs->trans("Members"), -1, 'user'); +$dirModMember = array_merge(array('/core/modules/member/'), $conf->modules_parts['member']); +foreach ($conf->modules_parts['models'] as $mo) { + //Add more models + $dirModMember[] = $mo.'core/modules/member/'; +} + +// Module to manage customer/supplier code + +print load_fiche_titre($langs->trans("MemberCodeChecker"), '', ''); + +print '
'; +print ''."\n"; +print ''."\n"; +print ' '; +print ' '; +print ' '; +print ' '; +print ' '; +print "\n"; + +$arrayofmodules = array(); + +foreach ($dirModMember as $dirroot) { + $dir = dol_buildpath($dirroot, 0); + + $handle = @opendir($dir); + if (is_resource($handle)) { + // Loop on each module find in opened directory + while (($file = readdir($handle)) !== false) { + // module filename has to start with mod_member_ + if (substr($file, 0, 11) == 'mod_member_' && substr($file, -3) == 'php') { + $file = substr($file, 0, dol_strlen($file) - 4); + try { + dol_include_once($dirroot.$file.'.php'); + } catch (Exception $e) { + dol_syslog($e->getMessage(), LOG_ERR); + continue; + } + $modCodeMember = new $file; + // Show modules according to features level + if ($modCodeMember->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) { + continue; + } + if ($modCodeMember->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) { + continue; + } + + $arrayofmodules[$file] = $modCodeMember; + } + } + closedir($handle); + } +} + +$arrayofmodules = dol_sort_array($arrayofmodules, 'position'); + +foreach ($arrayofmodules as $file => $modCodeMember) { + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + + if (getDolGlobalString('MEMBER_CODEMEMBER_ADDON') == "$file") { + print '\n"; + } else { + $disabled = (isModEnabled('multicompany') && (is_object($mc) && !empty($mc->sharings['referent']) && $mc->sharings['referent'] != $conf->entity) ? true : false); + print ''; + } + + print ''; + + print ''; +} +print '
'.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Example").''.$langs->trans("Status").''.$langs->trans("ShortInfo").'
'.$modCodeMember->name.''.$modCodeMember->info($langs).''.$modCodeMember->getExample($langs).''."\n"; + print img_picto($langs->trans("Activated"), 'switch_on'); + print "'; + if (!$disabled) { + print ''; + } + print img_picto($langs->trans("Disabled"), 'switch_off'); + if (!$disabled) { + print ''; + } + print ''; + $s = $modCodeMember->getToolTip($langs, null, -1); + print $form->textwithpicto('', $s, 1); + print '
'; +print '
'; + +print "
"; + print '
'; print ''; print ''; diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 4c68b3e91ecc8..5cf0ca69251af 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -92,6 +92,7 @@ class Adherent extends CommonObject /** * @var string company name * @deprecated + * @see $company */ public $societe; @@ -102,8 +103,14 @@ class Adherent extends CommonObject /** * @var int Thirdparty ID + * @deprecated + * @see $socid */ public $fk_soc; + + /** + * @var int socid + */ public $socid; /** @@ -154,24 +161,28 @@ class Adherent extends CommonObject /** * @var string skype account * @deprecated + * @see $socialnetworks */ public $skype; /** * @var string twitter account * @deprecated + * @see $socialnetworks */ public $twitter; /** * @var string facebook account * @deprecated + * @see $socialnetworks */ public $facebook; /** * @var string linkedin account * @deprecated + * @see $socialnetworks */ public $linkedin; @@ -259,10 +270,19 @@ class Adherent extends CommonObject */ public $type; + /** + * @var int need_subscription + */ public $need_subscription; + /** + * @var int user_id + */ public $user_id; + /** + * @var string user_login + */ public $user_login; public $datefin; @@ -576,7 +596,7 @@ public function getmorphylib($morphy = '', $addbadge = 0) */ public function create($user, $notrigger = 0) { - global $conf, $langs; + global $conf, $langs, $mysoc; $error = 0; @@ -624,7 +644,22 @@ public function create($user, $notrigger = 0) $id = $this->db->last_insert_id(MAIN_DB_PREFIX."adherent"); if ($id > 0) { $this->id = $id; - $this->ref = (string) $id; + if (getDolGlobalString('MEMBER_CODEMEMBER_ADDON') == '') { + // keep old numbering + $this->ref = (string) $id; + } else { + // auto code + $modfile = dol_buildpath('core/modules/member/'.getDolGlobalString('MEMBER_CODEMEMBER_ADDON').'.php', 0); + try { + require_once $modfile; + $modname = getDolGlobalString('MEMBER_CODEMEMBER_ADDON'); + $modCodeMember = new $modname; + $this->ref = $modCodeMember->getNextValue($mysoc, $this); + } catch (Exception $e) { + dol_syslog($e->getMessage(), LOG_ERR); + $error++; + } + } // Update minor fields $result = $this->update($user, 1, 1, 0, 0, 'add'); // nosync is 1 to avoid update data of user @@ -1505,7 +1540,7 @@ public function fetch_subscriptions() require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php'; - $sql = "SELECT c.rowid, c.fk_adherent, c.fk_type, c.subscription, c.note, c.fk_bank,"; + $sql = "SELECT c.rowid, c.fk_adherent, c.fk_type, c.subscription, c.note as note_public, c.fk_bank,"; $sql .= " c.tms as datem,"; $sql .= " c.datec as datec,"; $sql .= " c.dateadh as dateh,"; @@ -1537,7 +1572,8 @@ public function fetch_subscriptions() $subscription->fk_adherent = $obj->fk_adherent; $subscription->fk_type = $obj->fk_type; $subscription->amount = $obj->subscription; - $subscription->note = $obj->note; + $subscription->note = $obj->note_public; + $subscription->note_public = $obj->note_public; $subscription->fk_bank = $obj->fk_bank; $subscription->datem = $this->db->jdate($obj->datem); $subscription->datec = $this->db->jdate($obj->datec); diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 279ccded71c67..4bc04a270376f 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -133,6 +133,7 @@ public function __construct() 'barcode' => array(), 'models' => array(), 'societe' => array(), + 'member' => array(), 'hooks' => array(), 'dir' => array(), 'syslog' => array() @@ -145,22 +146,22 @@ public function __construct() $this->expedition_bon = new stdClass(); $this->delivery_note = new stdClass(); $this->fournisseur = new stdClass(); - $this->product = new stdClass(); - $this->service = new stdClass(); - $this->contrat = new stdClass(); - $this->actions = new stdClass(); - $this->agenda = new stdClass(); + $this->product = new stdClass(); + $this->service = new stdClass(); + $this->contrat = new stdClass(); + $this->actions = new stdClass(); + $this->agenda = new stdClass(); $this->commande = new stdClass(); $this->propal = new stdClass(); - $this->facture = new stdClass(); - $this->contrat = new stdClass(); + $this->facture = new stdClass(); + $this->contrat = new stdClass(); $this->user = new stdClass(); - $this->adherent = new stdClass(); + $this->adherent = new stdClass(); $this->bank = new stdClass(); - $this->notification = new stdClass(); + $this->notification = new stdClass(); $this->mailing = new stdClass(); - $this->expensereport = new stdClass(); - $this->productbatch = new stdClass(); + $this->expensereport = new stdClass(); + $this->productbatch = new stdClass(); } /** @@ -215,22 +216,22 @@ public function setValues($db) $this->expedition_bon = new stdClass(); $this->delivery_note = new stdClass(); $this->fournisseur = new stdClass(); - $this->product = new stdClass(); - $this->service = new stdClass(); - $this->contrat = new stdClass(); - $this->actions = new stdClass(); - $this->agenda = new stdClass(); + $this->product = new stdClass(); + $this->service = new stdClass(); + $this->contrat = new stdClass(); + $this->actions = new stdClass(); + $this->agenda = new stdClass(); $this->commande = new stdClass(); $this->propal = new stdClass(); - $this->facture = new stdClass(); - $this->contrat = new stdClass(); + $this->facture = new stdClass(); + $this->contrat = new stdClass(); $this->user = new stdClass(); - $this->adherent = new stdClass(); + $this->adherent = new stdClass(); $this->bank = new stdClass(); - $this->notification = new stdClass(); + $this->notification = new stdClass(); $this->mailing = new stdClass(); - $this->expensereport = new stdClass(); - $this->productbatch = new stdClass(); + $this->expensereport = new stdClass(); + $this->productbatch = new stdClass(); // Common arrays $this->cache = array(); @@ -249,6 +250,7 @@ public function setValues($db) 'barcode' => array(), 'models' => array(), 'societe' => array(), + 'member' => array(), 'hooks' => array(), 'dir' => array(), 'syslog' => array(), diff --git a/htdocs/core/modules/asset/mod_asset_advanced.php b/htdocs/core/modules/asset/mod_asset_advanced.php index 34780c3423f73..995e067b822ff 100644 --- a/htdocs/core/modules/asset/mod_asset_advanced.php +++ b/htdocs/core/modules/asset/mod_asset_advanced.php @@ -53,7 +53,7 @@ class mod_asset_advanced extends ModeleNumRefAsset /** * Returns the description of the numbering model * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/core/modules/asset/modules_asset.php b/htdocs/core/modules/asset/modules_asset.php index f7f361a10cc4d..0b90eab00e362 100644 --- a/htdocs/core/modules/asset/modules_asset.php +++ b/htdocs/core/modules/asset/modules_asset.php @@ -121,7 +121,7 @@ public function isEnabled() /** * Returns the default description of the numbering template * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/core/modules/barcode/doc/phpbarcode.modules.php b/htdocs/core/modules/barcode/doc/phpbarcode.modules.php index 4add94ffafbfe..d11d052cc02b0 100644 --- a/htdocs/core/modules/barcode/doc/phpbarcode.modules.php +++ b/htdocs/core/modules/barcode/doc/phpbarcode.modules.php @@ -58,7 +58,7 @@ public function isEnabled() /** * Return description * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/core/modules/bom/mod_bom_advanced.php b/htdocs/core/modules/bom/mod_bom_advanced.php index 2228d6434341d..81c4792630f44 100644 --- a/htdocs/core/modules/bom/mod_bom_advanced.php +++ b/htdocs/core/modules/bom/mod_bom_advanced.php @@ -54,7 +54,7 @@ class mod_bom_advanced extends ModeleNumRefboms /** * Returns the description of the numbering model * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/core/modules/bom/modules_bom.php b/htdocs/core/modules/bom/modules_bom.php index 84182993756f1..4c58e57c5468b 100644 --- a/htdocs/core/modules/bom/modules_bom.php +++ b/htdocs/core/modules/bom/modules_bom.php @@ -87,7 +87,7 @@ public function isEnabled() /** * Returns the default description of the numbering template * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php b/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php index 40d63e6314338..5534bf38698db 100644 --- a/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php +++ b/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php @@ -48,7 +48,7 @@ class mod_chequereceipt_thyme extends ModeleNumRefChequeReceipts /** * Returns the description of the numbering model * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/core/modules/cheque/modules_chequereceipts.php b/htdocs/core/modules/cheque/modules_chequereceipts.php index e50a68778489b..519b13db443d0 100644 --- a/htdocs/core/modules/cheque/modules_chequereceipts.php +++ b/htdocs/core/modules/cheque/modules_chequereceipts.php @@ -54,7 +54,7 @@ public function isEnabled() /** * Return the default description of numbering module * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/core/modules/commande/mod_commande_saphir.php b/htdocs/core/modules/commande/mod_commande_saphir.php index 07dcfdced9e6b..b62124f765229 100644 --- a/htdocs/core/modules/commande/mod_commande_saphir.php +++ b/htdocs/core/modules/commande/mod_commande_saphir.php @@ -54,7 +54,7 @@ class mod_commande_saphir extends ModeleNumRefCommandes /** * Returns the description of the numbering model * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/core/modules/commande/modules_commande.php b/htdocs/core/modules/commande/modules_commande.php index 4f3378a0683ed..055286ddf37b6 100644 --- a/htdocs/core/modules/commande/modules_commande.php +++ b/htdocs/core/modules/commande/modules_commande.php @@ -86,9 +86,9 @@ public function isEnabled() } /** - * Renvoie la description par defaut du modele de numerotation + * Returns the default description of the numbering pattern * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/core/modules/delivery/mod_delivery_jade.php b/htdocs/core/modules/delivery/mod_delivery_jade.php index 605265fde00c0..d348957afd3f7 100644 --- a/htdocs/core/modules/delivery/mod_delivery_jade.php +++ b/htdocs/core/modules/delivery/mod_delivery_jade.php @@ -63,7 +63,7 @@ class mod_delivery_jade extends ModeleNumRefDeliveryOrder /** * Returns the description of the numbering model * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { @@ -174,7 +174,7 @@ public function getNextValue($objsoc, $object) * * @param Societe $objsoc Object thirdparty * @param Object $object Object livraison - * @return string Texte descriptif + * @return string Descriptive text */ public function delivery_get_num($objsoc = 0, $object = '') { diff --git a/htdocs/core/modules/delivery/mod_delivery_saphir.php b/htdocs/core/modules/delivery/mod_delivery_saphir.php index 7fc9b2e6e5260..68da925e62b48 100644 --- a/htdocs/core/modules/delivery/mod_delivery_saphir.php +++ b/htdocs/core/modules/delivery/mod_delivery_saphir.php @@ -58,7 +58,7 @@ class mod_delivery_saphir extends ModeleNumRefDeliveryOrder /** * Returns the description of the numbering model * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { @@ -162,7 +162,7 @@ public function getNumRef($objsoc, $objforref) * * @param Societe $objsoc Object thirdparty * @param Object $object Objet livraison - * @return string Texte descripif + * @return string Descriptive text */ public function delivery_get_num($objsoc = 0, $object = '') { diff --git a/htdocs/core/modules/delivery/modules_delivery.php b/htdocs/core/modules/delivery/modules_delivery.php index 5bd3bd3386654..66e9727bc7bfe 100644 --- a/htdocs/core/modules/delivery/modules_delivery.php +++ b/htdocs/core/modules/delivery/modules_delivery.php @@ -88,9 +88,9 @@ public function isEnabled() } /** - * Renvoi la description par defaut du modele de numerotation + * Returns the default description of the numbering pattern * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/core/modules/dons/modules_don.php b/htdocs/core/modules/dons/modules_don.php index cd332c48fcb65..6bb78ab98ac85 100644 --- a/htdocs/core/modules/dons/modules_don.php +++ b/htdocs/core/modules/dons/modules_don.php @@ -84,9 +84,9 @@ public function isEnabled() } /** - * Renvoi la description par defaut du modele de numerotation + * Returns the default description of the numbering pattern * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/core/modules/expensereport/mod_expensereport_sand.php b/htdocs/core/modules/expensereport/mod_expensereport_sand.php index d14f17de0673b..920861f2b3ef4 100644 --- a/htdocs/core/modules/expensereport/mod_expensereport_sand.php +++ b/htdocs/core/modules/expensereport/mod_expensereport_sand.php @@ -57,7 +57,7 @@ class mod_expensereport_sand extends ModeleNumRefExpenseReport /** * Returns the description of the numbering model * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/core/modules/facture/mod_facture_mars.php b/htdocs/core/modules/facture/mod_facture_mars.php index 9e0ff0d5b4ebf..fb4ba06b9ce8e 100644 --- a/htdocs/core/modules/facture/mod_facture_mars.php +++ b/htdocs/core/modules/facture/mod_facture_mars.php @@ -72,7 +72,7 @@ public function __construct() /** * Returns the description of the numbering model * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/core/modules/facture/mod_facture_mercure.php b/htdocs/core/modules/facture/mod_facture_mercure.php index 321741ea8a05d..e67cb252a17b9 100644 --- a/htdocs/core/modules/facture/mod_facture_mercure.php +++ b/htdocs/core/modules/facture/mod_facture_mercure.php @@ -49,7 +49,7 @@ class mod_facture_mercure extends ModeleNumRefFactures /** * Returns the description of the numbering model * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/core/modules/facture/mod_facture_terre.php b/htdocs/core/modules/facture/mod_facture_terre.php index 2b11ee3976f2b..0e6ce61093bdc 100644 --- a/htdocs/core/modules/facture/mod_facture_terre.php +++ b/htdocs/core/modules/facture/mod_facture_terre.php @@ -88,7 +88,7 @@ public function __construct() /** * Returns the description of the numbering model * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/core/modules/facture/modules_facture.php b/htdocs/core/modules/facture/modules_facture.php index 480c532cc1f2a..b0d3c4682bad6 100644 --- a/htdocs/core/modules/facture/modules_facture.php +++ b/htdocs/core/modules/facture/modules_facture.php @@ -94,9 +94,9 @@ public function isEnabled() } /** - * Renvoi la description par defaut du modele de numerotation + * Returns the default description of the numbering pattern * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/core/modules/fichinter/mod_arctic.php b/htdocs/core/modules/fichinter/mod_arctic.php index 8efd936601b4f..d1f313e1bd598 100644 --- a/htdocs/core/modules/fichinter/mod_arctic.php +++ b/htdocs/core/modules/fichinter/mod_arctic.php @@ -59,7 +59,7 @@ class mod_arctic extends ModeleNumRefFicheinter /** * Returns the description of the numbering model * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/core/modules/hrm/mod_evaluation_advanced.php b/htdocs/core/modules/hrm/mod_evaluation_advanced.php index cdb1cc20109f8..7e495e449f309 100644 --- a/htdocs/core/modules/hrm/mod_evaluation_advanced.php +++ b/htdocs/core/modules/hrm/mod_evaluation_advanced.php @@ -54,7 +54,7 @@ class mod_evaluation_advanced extends ModeleNumRefEvaluation /** * Returns the description of the numbering model * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/core/modules/hrm/modules_evaluation.php b/htdocs/core/modules/hrm/modules_evaluation.php index 36fc7e26d81fd..a28d3f2ef9d1c 100644 --- a/htdocs/core/modules/hrm/modules_evaluation.php +++ b/htdocs/core/modules/hrm/modules_evaluation.php @@ -86,7 +86,7 @@ public function isEnabled() /** * Returns the default description of the numbering template * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/core/modules/member/mod_member_advanced.php b/htdocs/core/modules/member/mod_member_advanced.php new file mode 100644 index 0000000000000..3edb86030e88c --- /dev/null +++ b/htdocs/core/modules/member/mod_member_advanced.php @@ -0,0 +1,165 @@ + + * Copyright (C) 2022 Frédéric France + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * or see https://www.gnu.org/ + */ + +/** + * \file htdocs/core/modules/member/mod_member_advanced.php + * \ingroup member + * \brief File with class to manage the numbering module Advanced for member references + */ + +require_once DOL_DOCUMENT_ROOT.'/core/modules/member/modules_member.class.php'; + + +/** + * Class to manage the numbering module Advanced for member references + */ +class mod_member_advanced extends ModeleNumRefMembers +{ + /** + * Dolibarr version of the loaded document + * @var string + */ + public $version = 'dolibarr'; + + /** + * prefix + * + * @var string + */ + public $prefix = 'MEM'; + + /** + * @var string Error code (or message) + */ + public $error = ''; + + /** + * @var string model name + */ + public $name = 'Advanced'; + + /** + * @var int Automatic numbering + */ + public $code_auto = 1; + + /** + * Return description of numbering module + * + * @return string Text with description + */ + public function info() + { + global $langs; + return $langs->trans("AdvancedNumRefModelDesc", $this->prefix); + } + + + /** + * Return an example of numbering module values + * + * @return string Example + */ + public function getExample() + { + return $this->prefix."2301-0001"; + } + + + /** + * Checks if the numbers already in the database do not + * cause conflicts that would prevent this numbering working. + * + * @return boolean false if conflict, true if ok + */ + public function canBeActivated() + { + global $conf, $langs, $db; + + $coyymm = ''; + $max = ''; + + $posindice = strlen($this->prefix) + 6; + $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; + $sql .= " FROM ".MAIN_DB_PREFIX."adherent"; + $sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'"; + $sql .= " AND entity = ".$conf->entity; + $resql = $db->query($sql); + if ($resql) { + $row = $db->fetch_row($resql); + if ($row) { + $coyymm = substr($row[0], 0, 6); + $max = $row[0]; + } + } + if (!$coyymm || preg_match('/'.$this->prefix.'[0-9][0-9][0-9][0-9]/i', $coyymm)) { + return true; + } else { + $langs->load("errors"); + $this->error = $langs->trans('ErrorNumRefModel', $max); + return false; + } + } + + + /** + * Return next value + * + * @param Societe $objsoc Object third party + * @param Member $object Object we need next value for + * @return string Value if OK, 0 if KO + */ + public function getNextValue($objsoc, $object) + { + global $db, $conf; + + // First, we get the max value + $posindice = strlen($this->prefix) + 6; + $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; + $sql .= " FROM ".MAIN_DB_PREFIX."adherent"; + $sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'"; + $sql .= " AND entity = ".$conf->entity; + + $resql = $db->query($sql); + if ($resql) { + $obj = $db->fetch_object($resql); + if ($obj) { + $max = intval($obj->max); + } else { + $max = 0; + } + } else { + dol_syslog("mod_member_advanced::getNextValue", LOG_DEBUG); + return -1; + } + + $date = empty($object->datec) ? dol_now() : $object->datec; + + $yymm = dol_print_date($date, '%y%m', 'gmt'); + + 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); + } + + dol_syslog("mod_member_advanced::getNextValue return ".$this->prefix.$yymm."-".$num, LOG_INFO); + return $this->prefix.$yymm."-".$num; + } +} diff --git a/htdocs/core/modules/member/mod_member_simple.php b/htdocs/core/modules/member/mod_member_simple.php index 50eccd0f244f7..c45738c85cb85 100644 --- a/htdocs/core/modules/member/mod_member_simple.php +++ b/htdocs/core/modules/member/mod_member_simple.php @@ -1,5 +1,6 @@ + * Copyright (C) 2022 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -34,27 +35,29 @@ class mod_member_simple extends ModeleNumRefMembers * Dolibarr version of the loaded document * @var string */ - public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr' - - public $prefix = 'MEM'; + public $version = 'dolibarr'; /** - * @var string Error code (or message) + * prefix + * + * @var string */ - public $error = ''; + public $prefix = ''; /** - * @var string Nom du modele - * @deprecated - * @see $name + * @var string Error code (or message) */ - public $nom = 'Simple'; + public $error = ''; /** * @var string model name */ public $name = 'Simple'; + /** + * @var int Automatic numbering + */ + public $code_auto = 1; /** * Return description of numbering module @@ -64,7 +67,7 @@ class mod_member_simple extends ModeleNumRefMembers public function info() { global $langs; - return $langs->trans("SimpleNumRefModelDesc", $this->prefix); + return $langs->trans("SimpleRefNumRefModelDesc"); } @@ -75,7 +78,7 @@ public function info() */ public function getExample() { - return $this->prefix."0501-0001"; + return "1"; } @@ -92,11 +95,9 @@ public function canBeActivated() $coyymm = ''; $max = ''; - $posindice = strlen($this->prefix) + 6; - $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; + $sql = "SELECT MAX(CAST(ref AS SIGNED)) as max"; $sql .= " FROM ".MAIN_DB_PREFIX."adherent"; - $sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'"; - $sql .= " AND entity = ".$conf->entity; + $sql .= " WHERE entity = ".$conf->entity; $resql = $db->query($sql); if ($resql) { $row = $db->fetch_row($resql); @@ -105,7 +106,7 @@ public function canBeActivated() $max = $row[0]; } } - if (!$coyymm || preg_match('/'.$this->prefix.'[0-9][0-9][0-9][0-9]/i', $coyymm)) { + if (!$coyymm || preg_match('/[0-9][0-9][0-9][0-9]/i', $coyymm)) { return true; } else { $langs->load("errors"); @@ -119,65 +120,31 @@ public function canBeActivated() * Return next value * * @param Societe $objsoc Object third party - * @param Object $object Object we need next value for + * @param Member $object Object we need next value for * @return string Value if OK, 0 if KO */ public function getNextValue($objsoc, $object) { - global $db, $conf; - - /* - // First, we get the max value - $posindice = strlen($this->prefix) + 6; - $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; - $sql .= " FROM ".MAIN_DB_PREFIX."adherent"; - $sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'"; - $sql .= " AND entity = ".$conf->entity; - - $resql = $db->query($sql); - if ($resql) { - $obj = $db->fetch_object($resql); - if ($obj) { - $max = intval($obj->max); - } else { - $max = 0; - } - } else { - dol_syslog("mod_member_simple::getNextValue", LOG_DEBUG); - return -1; - } - - $date = empty($object->date_c) ? dol_now() : $object->date_c; - - //$yymm = strftime("%y%m",time()); - $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); - } - - dol_syslog("mod_member_simple::getNextValue return ".$this->prefix.$yymm."-".$num); - return $this->prefix.$yymm."-".$num; - */ + global $conf, $db; - // For the moment, the ref of a member is the rowid - $sql = "SELECT MAX(rowid) as max"; + // the ref of a member is the rowid + $sql = "SELECT MAX(CAST(ref AS SIGNED)) as max"; $sql .= " FROM ".MAIN_DB_PREFIX."adherent"; + $sql .= " WHERE entity = ".(int) $conf->entity; $resql = $db->query($sql); if ($resql) { $obj = $db->fetch_object($resql); if ($obj) { - $max = intval($obj->max); + $max = intval($obj->max) + 1; } else { - $max = 0; + $max = 1; } } else { dol_syslog("mod_member_simple::getNextValue", LOG_DEBUG); return -1; } - return ($max + 1); + $max = str_pad((string) $max, getDolGlobalInt('MEMBER_MOD_SIMPLE_LPAD'), "0", STR_PAD_LEFT); + return $max; } } diff --git a/htdocs/core/modules/member/modules_member.class.php b/htdocs/core/modules/member/modules_member.class.php index cdc37231901b3..a356c76ee7c69 100644 --- a/htdocs/core/modules/member/modules_member.class.php +++ b/htdocs/core/modules/member/modules_member.class.php @@ -84,9 +84,9 @@ public function isEnabled() } /** - * Renvoi la description par defaut du modele de numerotation + * Returns the default description of the numbering pattern * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { @@ -95,6 +95,16 @@ public function info() return $langs->trans("NoDescription"); } + /** + * Return name of module + * + * @return string Module name + */ + public function getName() + { + return $this->name; + } + /** * Return an example of numbering * @@ -153,4 +163,50 @@ public function getVersion() return $langs->trans("NotAvailable"); } } + + /** + * Return description of module parameters + * + * @param Translate $langs Output language + * @param Societe $soc Third party object + * @return string HTML translated description + */ + public function getToolTip($langs, $soc) + { + global $conf; + + $langs->loadLangs(array("admin", "companies")); + + $strikestart = ''; + $strikeend = ''; + if (!empty($conf->global->MAIN_MEMBER_CODE_ALWAYS_REQUIRED) && !empty($this->code_null)) { + $strikestart = ''; + $strikeend = ' '.yn(1, 1, 2).' ('.$langs->trans("ForcedToByAModule", $langs->transnoentities("yes")).')'; + } + + $s = ''; + $s .= $langs->trans("Name").': '.$this->getName().'
'; + $s .= $langs->trans("Version").': '.$this->getVersion().'
'; + $s .= $langs->trans("MemberCodeDesc").'
'; + $s .= $langs->trans("ValidityControledByModule").': '.$this->getName().'
'; + $s .= '
'; + $s .= ''.$langs->trans("ThisIsModuleRules").':
'; + + $s .= $langs->trans("Required").': '.$strikestart; + $s .= yn(!$this->code_null, 1, 2).$strikeend; + $s .= '
'; + $s .= $langs->trans("CanBeModifiedIfOk").': '; + $s .= yn($this->code_modifiable, 1, 2); + $s .= '
'; + $s .= $langs->trans("CanBeModifiedIfKo").': '.yn($this->code_modifiable_invalide, 1, 2).'
'; + $s .= $langs->trans("AutomaticCode").': '.yn($this->code_auto, 1, 2).'
'; + $s .= '
'; + $nextval = $this->getNextValue($soc, 0); + if (empty($nextval)) { + $nextval = $langs->trans("Undefined"); + } + $s .= $langs->trans("NextValue").' ('.$langs->trans("Member").'): '.$nextval.'
'; + + return $s; + } } diff --git a/htdocs/core/modules/mrp/mod_mo_advanced.php b/htdocs/core/modules/mrp/mod_mo_advanced.php index 5588d1cae1649..cd134537ea211 100644 --- a/htdocs/core/modules/mrp/mod_mo_advanced.php +++ b/htdocs/core/modules/mrp/mod_mo_advanced.php @@ -55,7 +55,7 @@ class mod_mo_advanced extends ModeleNumRefMos /** * Returns the description of the numbering model * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/core/modules/mrp/modules_mo.php b/htdocs/core/modules/mrp/modules_mo.php index 454df89bcde16..1b3af7f6b8cda 100644 --- a/htdocs/core/modules/mrp/modules_mo.php +++ b/htdocs/core/modules/mrp/modules_mo.php @@ -87,7 +87,7 @@ public function isEnabled() /** * Returns the default description of the numbering template * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/core/modules/payment/mod_payment_ant.php b/htdocs/core/modules/payment/mod_payment_ant.php index 958074202fed8..03a6109bd6788 100644 --- a/htdocs/core/modules/payment/mod_payment_ant.php +++ b/htdocs/core/modules/payment/mod_payment_ant.php @@ -57,7 +57,7 @@ class mod_payment_ant extends ModeleNumRefPayments /** * Returns the description of the numbering model * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/core/modules/payment/modules_payment.php b/htdocs/core/modules/payment/modules_payment.php index f19e80dd3d274..68b864fe94d95 100644 --- a/htdocs/core/modules/payment/modules_payment.php +++ b/htdocs/core/modules/payment/modules_payment.php @@ -41,7 +41,7 @@ public function isEnabled() /** * Return the default description of numbering module * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/core/modules/product/modules_product.class.php b/htdocs/core/modules/product/modules_product.class.php index 6c47847ef606c..3a85676314493 100644 --- a/htdocs/core/modules/product/modules_product.class.php +++ b/htdocs/core/modules/product/modules_product.class.php @@ -104,10 +104,10 @@ abstract class ModeleProductCode */ public $error = ''; - /** Renvoi la description par defaut du modele de numerotation + /** Returns the default description of the numbering pattern * * @param Translate $langs Object langs - * @return string Texte descripif + * @return string Descriptive text */ public function info($langs) { diff --git a/htdocs/core/modules/product_batch/mod_lot_advanced.php b/htdocs/core/modules/product_batch/mod_lot_advanced.php index d6128573f97b4..27cc509ea0297 100644 --- a/htdocs/core/modules/product_batch/mod_lot_advanced.php +++ b/htdocs/core/modules/product_batch/mod_lot_advanced.php @@ -55,7 +55,7 @@ class mod_lot_advanced extends ModeleNumRefBatch /** * Returns the description of the numbering model * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/core/modules/product_batch/mod_sn_advanced.php b/htdocs/core/modules/product_batch/mod_sn_advanced.php index 6c796f06c3b29..91fc99a1363c5 100644 --- a/htdocs/core/modules/product_batch/mod_sn_advanced.php +++ b/htdocs/core/modules/product_batch/mod_sn_advanced.php @@ -55,7 +55,7 @@ class mod_sn_advanced extends ModeleNumRefBatch /** * Returns the description of the numbering model * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/core/modules/product_batch/modules_product_batch.class.php b/htdocs/core/modules/product_batch/modules_product_batch.class.php index ea64bd9860933..1446d20aeda8d 100644 --- a/htdocs/core/modules/product_batch/modules_product_batch.class.php +++ b/htdocs/core/modules/product_batch/modules_product_batch.class.php @@ -89,7 +89,7 @@ public function isEnabled() /** * Returns the default description of the numbering template * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/core/modules/project/mod_project_universal.php b/htdocs/core/modules/project/mod_project_universal.php index 1020c42ebf640..889164fbfe5b4 100644 --- a/htdocs/core/modules/project/mod_project_universal.php +++ b/htdocs/core/modules/project/mod_project_universal.php @@ -62,7 +62,7 @@ class mod_project_universal extends ModeleNumRefProjects /** * Returns the description of the numbering model * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/core/modules/project/modules_project.php b/htdocs/core/modules/project/modules_project.php index 894df4bf8f31a..6f55426e65fd0 100644 --- a/htdocs/core/modules/project/modules_project.php +++ b/htdocs/core/modules/project/modules_project.php @@ -143,9 +143,9 @@ public function isEnabled() } /** - * Renvoi la description par defaut du modele de numerotation + * Returns the default description of the numbering pattern * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/core/modules/project/task/mod_task_universal.php b/htdocs/core/modules/project/task/mod_task_universal.php index 6de02dcaf99a1..55c1a3ff89de0 100644 --- a/htdocs/core/modules/project/task/mod_task_universal.php +++ b/htdocs/core/modules/project/task/mod_task_universal.php @@ -57,7 +57,7 @@ class mod_task_universal extends ModeleNumRefTask /** * Returns the description of the numbering model * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/core/modules/project/task/modules_task.php b/htdocs/core/modules/project/task/modules_task.php index 09ba33332f1ed..6614369aa4336 100644 --- a/htdocs/core/modules/project/task/modules_task.php +++ b/htdocs/core/modules/project/task/modules_task.php @@ -84,9 +84,9 @@ public function isEnabled() } /** - * Renvoi la description par defaut du modele de numerotation + * Returns the default description of the numbering pattern * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/core/modules/propale/mod_propale_saphir.php b/htdocs/core/modules/propale/mod_propale_saphir.php index 98c9803d55c02..74395dcc59950 100644 --- a/htdocs/core/modules/propale/mod_propale_saphir.php +++ b/htdocs/core/modules/propale/mod_propale_saphir.php @@ -60,7 +60,7 @@ class mod_propale_saphir extends ModeleNumRefPropales /** * Return description of module * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/core/modules/propale/modules_propale.php b/htdocs/core/modules/propale/modules_propale.php index dcb386947a3e8..b58ae681ef20b 100644 --- a/htdocs/core/modules/propale/modules_propale.php +++ b/htdocs/core/modules/propale/modules_propale.php @@ -87,9 +87,9 @@ public function isEnabled() } /** - * Renvoi la description par defaut du modele de numerotation + * Returns the default description of the numbering pattern * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/core/modules/societe/modules_societe.class.php b/htdocs/core/modules/societe/modules_societe.class.php index e8b0fbe91931c..a1067c14d30b5 100644 --- a/htdocs/core/modules/societe/modules_societe.class.php +++ b/htdocs/core/modules/societe/modules_societe.class.php @@ -75,10 +75,10 @@ abstract class ModeleThirdPartyCode public $errors; - /** Renvoi la description par defaut du modele de numerotation + /** Returns the default description of the numbering pattern * * @param Translate $langs Object langs - * @return string Texte descripif + * @return string Descriptive text */ public function info($langs) { diff --git a/htdocs/core/modules/stocktransfer/mod_stocktransfer_advanced.php b/htdocs/core/modules/stocktransfer/mod_stocktransfer_advanced.php index dd29e48d0b84a..c19067c019da1 100644 --- a/htdocs/core/modules/stocktransfer/mod_stocktransfer_advanced.php +++ b/htdocs/core/modules/stocktransfer/mod_stocktransfer_advanced.php @@ -55,7 +55,7 @@ class mod_stocktransfer_advanced extends ModeleNumRefStockTransfer /** * Returns the description of the numbering model * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/core/modules/stocktransfer/modules_stocktransfer.php b/htdocs/core/modules/stocktransfer/modules_stocktransfer.php index 3da0a0ae644a5..6c0213afb0c0e 100644 --- a/htdocs/core/modules/stocktransfer/modules_stocktransfer.php +++ b/htdocs/core/modules/stocktransfer/modules_stocktransfer.php @@ -87,7 +87,7 @@ public function isEnabled() /** * Returns the default description of the numbering template * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php index 5aa92995c4c19..7ebc035ef61b2 100644 --- a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php +++ b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php @@ -178,7 +178,7 @@ public function getNextValue($objsoc = 0, $object = '') * * @param Societe $objsoc Object third party * @param Object $object Object - * @return string Texte descripif + * @return string Descriptive text */ public function commande_get_num($objsoc = 0, $object = '') { diff --git a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php index 8f67f28b42dee..f829048e623e8 100644 --- a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php +++ b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php @@ -59,7 +59,7 @@ class mod_commande_fournisseur_orchidee extends ModeleNumRefSuppliersOrders /** * Returns the description of the numbering model * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { @@ -150,7 +150,7 @@ public function getNextValue($objsoc = 0, $object = '') * * @param Societe $objsoc Object third party * @param Object $object Object - * @return string Texte descripif + * @return string Descriptive text */ public function commande_get_num($objsoc = 0, $object = '') { diff --git a/htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php b/htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php index 292662a14adb8..a3e938a38ac0e 100644 --- a/htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php +++ b/htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php @@ -57,7 +57,7 @@ class mod_supplier_payment_brodator extends ModeleNumRefSupplierPayments /** * Returns the description of the numbering model * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/core/modules/supplier_payment/modules_supplier_payment.php b/htdocs/core/modules/supplier_payment/modules_supplier_payment.php index c5db770bdb4c4..9409c4c688b76 100644 --- a/htdocs/core/modules/supplier_payment/modules_supplier_payment.php +++ b/htdocs/core/modules/supplier_payment/modules_supplier_payment.php @@ -111,7 +111,7 @@ public function isEnabled() /** * Return the default description of numbering module * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_saphir.php b/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_saphir.php index c73a8a16db60a..d4282eb80eca3 100644 --- a/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_saphir.php +++ b/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_saphir.php @@ -60,7 +60,7 @@ class mod_supplier_proposal_saphir extends ModeleNumRefSupplierProposal /** * Return description of module * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/core/modules/supplier_proposal/modules_supplier_proposal.php b/htdocs/core/modules/supplier_proposal/modules_supplier_proposal.php index 5a3d9e2280a4e..42c935ca13c67 100644 --- a/htdocs/core/modules/supplier_proposal/modules_supplier_proposal.php +++ b/htdocs/core/modules/supplier_proposal/modules_supplier_proposal.php @@ -87,9 +87,9 @@ public function isEnabled() } /** - * Renvoi la description par defaut du modele de numerotation + * Returns the default description of the numbering pattern * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/core/modules/takepos/mod_takepos_ref_universal.php b/htdocs/core/modules/takepos/mod_takepos_ref_universal.php index 7b515ca6b3b7a..3ebc5858ae4e8 100644 --- a/htdocs/core/modules/takepos/mod_takepos_ref_universal.php +++ b/htdocs/core/modules/takepos/mod_takepos_ref_universal.php @@ -54,7 +54,7 @@ class mod_takepos_ref_universal extends ModeleNumRefTakepos /** * return description of the numbering model * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/core/modules/takepos/modules_takepos.php b/htdocs/core/modules/takepos/modules_takepos.php index 89b3dbde5bc97..bd554a85a657c 100644 --- a/htdocs/core/modules/takepos/modules_takepos.php +++ b/htdocs/core/modules/takepos/modules_takepos.php @@ -52,9 +52,9 @@ public function isEnabled() } /** - * Renvoi la description par defaut du modele de numerotation + * Returns the default description of the numbering pattern * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/core/modules/ticket/mod_ticket_universal.php b/htdocs/core/modules/ticket/mod_ticket_universal.php index 8efc2f6a4e5f9..8cd2cd6f61463 100644 --- a/htdocs/core/modules/ticket/mod_ticket_universal.php +++ b/htdocs/core/modules/ticket/mod_ticket_universal.php @@ -55,7 +55,7 @@ class mod_ticket_universal extends ModeleNumRefTicket /** * Returns the description of the numbering model * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/core/modules/ticket/modules_ticket.php b/htdocs/core/modules/ticket/modules_ticket.php index c8561382436fd..263803162fd69 100644 --- a/htdocs/core/modules/ticket/modules_ticket.php +++ b/htdocs/core/modules/ticket/modules_ticket.php @@ -78,9 +78,9 @@ public function isEnabled() } /** - * Renvoi la description par defaut du modele de numerotation + * Returns the default description of the numbering pattern * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/core/modules/workstation/mod_workstation_advanced.php b/htdocs/core/modules/workstation/mod_workstation_advanced.php index 125aa0f7c5321..253e4224b644d 100644 --- a/htdocs/core/modules/workstation/mod_workstation_advanced.php +++ b/htdocs/core/modules/workstation/mod_workstation_advanced.php @@ -55,7 +55,7 @@ class mod_workstation_advanced extends ModeleNumRefWorkstation /** * Returns the description of the numbering model * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/core/modules/workstation/modules_workstation.php b/htdocs/core/modules/workstation/modules_workstation.php index c8052ed4ff8a0..a99dab9b17a42 100644 --- a/htdocs/core/modules/workstation/modules_workstation.php +++ b/htdocs/core/modules/workstation/modules_workstation.php @@ -87,7 +87,7 @@ public function isEnabled() /** * Returns the default description of the numbering template * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_advanced.php b/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_advanced.php index ba0cf9818dc45..f2d0f448a6921 100644 --- a/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_advanced.php +++ b/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_advanced.php @@ -54,7 +54,7 @@ class mod_knowledgerecord_advanced extends ModeleNumRefKnowledgeRecord /** * Returns the description of the numbering model * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/knowledgemanagement/core/modules/knowledgemanagement/modules_knowledgerecord.php b/htdocs/knowledgemanagement/core/modules/knowledgemanagement/modules_knowledgerecord.php index edfe6beff62d8..8e19931fbdb8a 100644 --- a/htdocs/knowledgemanagement/core/modules/knowledgemanagement/modules_knowledgerecord.php +++ b/htdocs/knowledgemanagement/core/modules/knowledgemanagement/modules_knowledgerecord.php @@ -86,7 +86,7 @@ public function isEnabled() /** * Returns the default description of the numbering template * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 28205d1dcba0e..038ff2d7ba19d 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1302,6 +1302,8 @@ YouMustRunCommandFromCommandLineAfterLoginToUser=You must run this command from YourPHPDoesNotHaveSSLSupport=SSL functions not available in your PHP DownloadMoreSkins=More skins to download SimpleNumRefModelDesc=Returns the reference number in the format %syymm-nnnn where yy is the year, mm is the month and nnnn is a sequential auto-incrementing number with no reset +SimpleRefNumRefModelDesc=Returns the reference number in the format n where n is a sequential auto-incrementing number with no reset +AdvancedNumRefModelDesc=Returns the reference number in the format %syymm-nnnn where yy is the year, mm is the month and nnnn is a sequential auto-incrementing number with no reset SimpleNumRefNoDateModelDesc=Returns the reference number in the format %s-nnnn where nnnn is a sequential auto-incrementing number with no reset ShowProfIdInAddress=Show professional ID with addresses ShowVATIntaInAddress=Hide intra-Community VAT number @@ -1488,6 +1490,7 @@ WatermarkOnDraftContractCards=Watermark on draft contracts (none if empty) ##### Members ##### MembersSetup=Members module setup MemberMainOptions=Main options +MemberCodeChecker=Options for automatic generation of member codes AdherentLoginRequired= Manage a Login for each member AdherentMailRequired=Email required to create a new member MemberSendInformationByMailByDefault=Checkbox to send mail confirmation to members (validation or new subscription) is on by default diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index 71f01b3673983..eb911c1cdbf9e 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -98,7 +98,7 @@ MorAndPhy=Corporation and Individual Reenable=Re-Enable ExcludeMember=Exclude a member Exclude=Exclude -ConfirmExcludeMember=Are you sure you want to exclude this member ? +ConfirmExcludeMember=Are you sure you want to exclude this member ? ResiliateMember=Terminate a member ConfirmResiliateMember=Are you sure you want to terminate this member? DeleteMember=Delete a member @@ -230,4 +230,5 @@ ForceMemberNature=Force member nature (Individual or Corporation) CreateDolibarrLoginDesc=The creation of a user login for members allows them to connect to the application. Depending on the authorizations granted, they will be able, for example, to consult or modify their file themselves. CreateDolibarrThirdPartyDesc=A thirdparty is the legal entity that will be used on the invoice if you decide to generate invoice for each contribution. You will be able to create it later during the process of recording the contribution. MemberFirstname=Member firstname -MemberLastname=Member lastname \ No newline at end of file +MemberLastname=Member lastname +MemberCodeDesc=Member Code, unique for all members diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_advanced.php b/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_advanced.php index cce647de224f0..a31a63f0b1406 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_advanced.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_advanced.php @@ -54,7 +54,7 @@ class mod_myobject_advanced extends ModeleNumRefMyObject /** * Returns the description of the numbering model * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/modules_myobject.php b/htdocs/modulebuilder/template/core/modules/mymodule/modules_myobject.php index c2eeb2322192a..1037dba63b6f8 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/modules_myobject.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/modules_myobject.php @@ -122,7 +122,7 @@ public function isEnabled() /** * Returns the default description of the numbering template * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/partnership/core/modules/partnership/mod_partnership_advanced.php b/htdocs/partnership/core/modules/partnership/mod_partnership_advanced.php index 676de03265939..9d3e204201067 100644 --- a/htdocs/partnership/core/modules/partnership/mod_partnership_advanced.php +++ b/htdocs/partnership/core/modules/partnership/mod_partnership_advanced.php @@ -54,7 +54,7 @@ class mod_partnership_advanced extends ModeleNumRefPartnership /** * Returns the description of the numbering model * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/partnership/core/modules/partnership/modules_partnership.php b/htdocs/partnership/core/modules/partnership/modules_partnership.php index 005d77835b6aa..4d1f6c0b1076e 100644 --- a/htdocs/partnership/core/modules/partnership/modules_partnership.php +++ b/htdocs/partnership/core/modules/partnership/modules_partnership.php @@ -86,7 +86,7 @@ public function isEnabled() /** * Returns the default description of the numbering template * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_advanced.php b/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_advanced.php index 9635eba3e5859..6ed0a02731053 100644 --- a/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_advanced.php +++ b/htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_advanced.php @@ -54,7 +54,7 @@ class mod_recruitmentcandidature_advanced extends ModeleNumRefRecruitmentCandida /** * Returns the description of the numbering model * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_advanced.php b/htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_advanced.php index 4f781a18214cb..a49a4714b24e2 100644 --- a/htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_advanced.php +++ b/htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_advanced.php @@ -54,7 +54,7 @@ class mod_recruitmentjobposition_advanced extends ModeleNumRefRecruitmentJobPosi /** * Returns the description of the numbering model * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/recruitment/core/modules/recruitment/modules_recruitmentcandidature.php b/htdocs/recruitment/core/modules/recruitment/modules_recruitmentcandidature.php index 089aa720fa717..362e890c6ef68 100644 --- a/htdocs/recruitment/core/modules/recruitment/modules_recruitmentcandidature.php +++ b/htdocs/recruitment/core/modules/recruitment/modules_recruitmentcandidature.php @@ -86,7 +86,7 @@ public function isEnabled() /** * Returns the default description of the numbering template * - * @return string Texte descripif + * @return string Descriptive text */ public function info() { diff --git a/htdocs/recruitment/core/modules/recruitment/modules_recruitmentjobposition.php b/htdocs/recruitment/core/modules/recruitment/modules_recruitmentjobposition.php index 9efabac2d371b..aaf8bed6c53c6 100644 --- a/htdocs/recruitment/core/modules/recruitment/modules_recruitmentjobposition.php +++ b/htdocs/recruitment/core/modules/recruitment/modules_recruitmentjobposition.php @@ -122,7 +122,7 @@ public function isEnabled() /** * Returns the default description of the numbering template * - * @return string Texte descripif + * @return string Descriptive text */ public function info() {