diff --git a/htdocs/adherents/admin/member.php b/htdocs/adherents/admin/member.php index d20bd784ced..f9e15e88fca 100644 --- a/htdocs/adherents/admin/member.php +++ b/htdocs/adherents/admin/member.php @@ -152,10 +152,13 @@ if ($action == 'set_default') { 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 @@ $head = member_admin_prepare_head(); 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 4c68b3e91ec..5cf0ca69251 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 @@ class Adherent extends CommonObject */ public function create($user, $notrigger = 0) { - global $conf, $langs; + global $conf, $langs, $mysoc; $error = 0; @@ -624,7 +644,22 @@ class Adherent extends CommonObject $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 @@ class Adherent extends CommonObject 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 @@ class Adherent extends CommonObject $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 279ccded71c..4bc04a27037 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -133,6 +133,7 @@ class Conf 'barcode' => array(), 'models' => array(), 'societe' => array(), + 'member' => array(), 'hooks' => array(), 'dir' => array(), 'syslog' => array() @@ -145,22 +146,22 @@ class Conf $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 @@ class Conf $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 @@ class Conf '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 34780c3423f..995e067b822 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 f7f361a10cc..0b90eab00e3 100644 --- a/htdocs/core/modules/asset/modules_asset.php +++ b/htdocs/core/modules/asset/modules_asset.php @@ -121,7 +121,7 @@ abstract class ModeleNumRefAsset /** * 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 4add94ffafb..d11d052cc02 100644 --- a/htdocs/core/modules/barcode/doc/phpbarcode.modules.php +++ b/htdocs/core/modules/barcode/doc/phpbarcode.modules.php @@ -58,7 +58,7 @@ class modPhpbarcode extends ModeleBarCode /** * 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 2228d643434..81c4792630f 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 84182993756..4c58e57c546 100644 --- a/htdocs/core/modules/bom/modules_bom.php +++ b/htdocs/core/modules/bom/modules_bom.php @@ -87,7 +87,7 @@ abstract class ModeleNumRefBoms /** * 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 40d63e63143..5534bf38698 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 e50a6877848..519b13db443 100644 --- a/htdocs/core/modules/cheque/modules_chequereceipts.php +++ b/htdocs/core/modules/cheque/modules_chequereceipts.php @@ -54,7 +54,7 @@ abstract class ModeleNumRefChequeReceipts /** * 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 07dcfdced9e..b62124f7652 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 4f3378a0683..055286ddf37 100644 --- a/htdocs/core/modules/commande/modules_commande.php +++ b/htdocs/core/modules/commande/modules_commande.php @@ -86,9 +86,9 @@ abstract class ModeleNumRefCommandes } /** - * 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 605265fde00..d348957afd3 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 @@ class mod_delivery_jade extends ModeleNumRefDeliveryOrder * * @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 7fc9b2e6e52..68da925e62b 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 @@ class mod_delivery_saphir extends ModeleNumRefDeliveryOrder * * @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 5bd3bd33866..66e9727bc7b 100644 --- a/htdocs/core/modules/delivery/modules_delivery.php +++ b/htdocs/core/modules/delivery/modules_delivery.php @@ -88,9 +88,9 @@ abstract class ModeleNumRefDeliveryOrder } /** - * 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 cd332c48fcb..6bb78ab98ac 100644 --- a/htdocs/core/modules/dons/modules_don.php +++ b/htdocs/core/modules/dons/modules_don.php @@ -84,9 +84,9 @@ abstract class ModeleNumRefDons } /** - * 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 d14f17de067..920861f2b3e 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 9e0ff0d5b4e..fb4ba06b9ce 100644 --- a/htdocs/core/modules/facture/mod_facture_mars.php +++ b/htdocs/core/modules/facture/mod_facture_mars.php @@ -72,7 +72,7 @@ class mod_facture_mars 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_mercure.php b/htdocs/core/modules/facture/mod_facture_mercure.php index 321741ea8a0..e67cb252a17 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 2b11ee3976f..0e6ce61093b 100644 --- a/htdocs/core/modules/facture/mod_facture_terre.php +++ b/htdocs/core/modules/facture/mod_facture_terre.php @@ -88,7 +88,7 @@ class mod_facture_terre 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/modules_facture.php b/htdocs/core/modules/facture/modules_facture.php index 480c532cc1f..b0d3c4682ba 100644 --- a/htdocs/core/modules/facture/modules_facture.php +++ b/htdocs/core/modules/facture/modules_facture.php @@ -94,9 +94,9 @@ abstract class ModeleNumRefFactures } /** - * 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 8efd936601b..d1f313e1bd5 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 cdb1cc20109..7e495e449f3 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 36fc7e26d81..a28d3f2ef9d 100644 --- a/htdocs/core/modules/hrm/modules_evaluation.php +++ b/htdocs/core/modules/hrm/modules_evaluation.php @@ -86,7 +86,7 @@ abstract class ModeleNumRefEvaluation /** * 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 00000000000..3edb86030e8 --- /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 50eccd0f244..c45738c85cb 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 $version = 'dolibarr'; - public $prefix = 'MEM'; + /** + * prefix + * + * @var string + */ + public $prefix = ''; /** * @var string Error code (or message) */ public $error = ''; - /** - * @var string Nom du modele - * @deprecated - * @see $name - */ - public $nom = 'Simple'; - /** * @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 @@ class mod_member_simple extends ModeleNumRefMembers */ public function getExample() { - return $this->prefix."0501-0001"; + return "1"; } @@ -92,11 +95,9 @@ class mod_member_simple extends ModeleNumRefMembers $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 @@ class mod_member_simple extends ModeleNumRefMembers $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 @@ class mod_member_simple extends ModeleNumRefMembers * 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; + global $conf, $db; - /* - // First, we get the max value - $posindice = strlen($this->prefix) + 6; - $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) 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 ref LIKE '".$db->escape($this->prefix)."____-%'"; - $sql .= " AND entity = ".$conf->entity; + $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; } - - $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; - */ - - // For the moment, the ref of a member is the rowid - $sql = "SELECT MAX(rowid) as max"; - $sql .= " FROM ".MAIN_DB_PREFIX."adherent"; - - $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; - } - 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 cdc37231901..a356c76ee7c 100644 --- a/htdocs/core/modules/member/modules_member.class.php +++ b/htdocs/core/modules/member/modules_member.class.php @@ -84,9 +84,9 @@ abstract class ModeleNumRefMembers } /** - * 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 @@ abstract class ModeleNumRefMembers 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 @@ abstract class ModeleNumRefMembers 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 5588d1cae16..cd134537ea2 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 454df89bcde..1b3af7f6b8c 100644 --- a/htdocs/core/modules/mrp/modules_mo.php +++ b/htdocs/core/modules/mrp/modules_mo.php @@ -87,7 +87,7 @@ abstract class ModeleNumRefMos /** * 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 958074202fe..03a6109bd67 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 f19e80dd3d2..68b864fe94d 100644 --- a/htdocs/core/modules/payment/modules_payment.php +++ b/htdocs/core/modules/payment/modules_payment.php @@ -41,7 +41,7 @@ abstract class ModeleNumRefPayments /** * 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 6c47847ef60..3a856763144 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 d6128573f97..27cc509ea02 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 6c796f06c3b..91fc99a1363 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 ea64bd98609..1446d20aeda 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 @@ abstract class ModeleNumRefBatch /** * 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 1020c42ebf6..889164fbfe5 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 894df4bf8f3..6f55426e65f 100644 --- a/htdocs/core/modules/project/modules_project.php +++ b/htdocs/core/modules/project/modules_project.php @@ -143,9 +143,9 @@ abstract class ModeleNumRefProjects } /** - * 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 6de02dcaf99..55c1a3ff89d 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 09ba33332f1..6614369aa43 100644 --- a/htdocs/core/modules/project/task/modules_task.php +++ b/htdocs/core/modules/project/task/modules_task.php @@ -84,9 +84,9 @@ abstract class ModeleNumRefTask } /** - * 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 98c9803d55c..74395dcc599 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 dcb386947a3..b58ae681ef2 100644 --- a/htdocs/core/modules/propale/modules_propale.php +++ b/htdocs/core/modules/propale/modules_propale.php @@ -87,9 +87,9 @@ abstract class ModeleNumRefPropales } /** - * 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 e8b0fbe9193..a1067c14d30 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 dd29e48d0b8..c19067c019d 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 3da0a0ae644..6c0213afb0c 100644 --- a/htdocs/core/modules/stocktransfer/modules_stocktransfer.php +++ b/htdocs/core/modules/stocktransfer/modules_stocktransfer.php @@ -87,7 +87,7 @@ abstract class ModeleNumRefStockTransfer /** * 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 5aa92995c4c..7ebc035ef61 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 @@ class mod_commande_fournisseur_muguet extends ModeleNumRefSuppliersOrders * * @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 8f67f28b42d..f829048e623 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 @@ class mod_commande_fournisseur_orchidee extends ModeleNumRefSuppliersOrders * * @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 292662a14ad..a3e938a38ac 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 c5db770bdb4..9409c4c688b 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 @@ abstract class ModeleNumRefSupplierPayments /** * 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 c73a8a16db6..d4282eb80ec 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 5a3d9e2280a..42c935ca13c 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 @@ abstract class ModeleNumRefSupplierProposal } /** - * 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 7b515ca6b3b..3ebc5858ae4 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 89b3dbde5bc..bd554a85a65 100644 --- a/htdocs/core/modules/takepos/modules_takepos.php +++ b/htdocs/core/modules/takepos/modules_takepos.php @@ -52,9 +52,9 @@ abstract class ModeleNumRefTakepos } /** - * 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 8efc2f6a4e5..8cd2cd6f614 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 c8561382436..263803162fd 100644 --- a/htdocs/core/modules/ticket/modules_ticket.php +++ b/htdocs/core/modules/ticket/modules_ticket.php @@ -78,9 +78,9 @@ abstract class ModeleNumRefTicket } /** - * 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 125aa0f7c53..253e4224b64 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 c8052ed4ff8..a99dab9b17a 100644 --- a/htdocs/core/modules/workstation/modules_workstation.php +++ b/htdocs/core/modules/workstation/modules_workstation.php @@ -87,7 +87,7 @@ abstract class ModeleNumRefWorkstation /** * 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 ba0cf9818dc..f2d0f448a69 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 edfe6beff62..8e19931fbdb 100644 --- a/htdocs/knowledgemanagement/core/modules/knowledgemanagement/modules_knowledgerecord.php +++ b/htdocs/knowledgemanagement/core/modules/knowledgemanagement/modules_knowledgerecord.php @@ -86,7 +86,7 @@ abstract class ModeleNumRefKnowledgeRecord /** * 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 28205d1dcba..038ff2d7ba1 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 71f01b36739..eb911c1cdbf 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 cce647de224..a31a63f0b14 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 c2eeb232219..1037dba63b6 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 @@ abstract class ModeleNumRefMyObject /** * 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 676de032659..9d3e2042010 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 005d77835b6..4d1f6c0b107 100644 --- a/htdocs/partnership/core/modules/partnership/modules_partnership.php +++ b/htdocs/partnership/core/modules/partnership/modules_partnership.php @@ -86,7 +86,7 @@ abstract class ModeleNumRefPartnership /** * 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 9635eba3e58..6ed0a027310 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 4f781a18214..a49a4714b24 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 089aa720fa7..362e890c6ef 100644 --- a/htdocs/recruitment/core/modules/recruitment/modules_recruitmentcandidature.php +++ b/htdocs/recruitment/core/modules/recruitment/modules_recruitmentcandidature.php @@ -86,7 +86,7 @@ abstract class ModeleNumRefRecruitmentCandidature /** * 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 9efabac2d37..aaf8bed6c53 100644 --- a/htdocs/recruitment/core/modules/recruitment/modules_recruitmentjobposition.php +++ b/htdocs/recruitment/core/modules/recruitment/modules_recruitmentjobposition.php @@ -122,7 +122,7 @@ abstract class ModeleNumRefRecruitmentJobPosition /** * Returns the default description of the numbering template * - * @return string Texte descripif + * @return string Descriptive text */ public function info() {