Clean code
This commit is contained in:
parent
29b3880e6c
commit
c0e395ee11
2 changed files with 15 additions and 18 deletions
|
|
@ -367,7 +367,7 @@ foreach ($arrayofmodules as $file => $modCodeMember) {
|
|||
print '<td>'.$modCodeMember->info($langs).'</td>'."\n";
|
||||
print '<td class="nowrap">'.$modCodeMember->getExample().'</td>'."\n";
|
||||
|
||||
if (getDolGlobalString('MEMBER_CODEMEMBER_ADDON') == "$file") {
|
||||
if (getDolGlobalString('MEMBER_CODEMEMBER_ADDON', 'mod_member_simple') == "$file") {
|
||||
print '<td class="center">'."\n";
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
print "</td>\n";
|
||||
|
|
|
|||
|
|
@ -712,23 +712,20 @@ class Adherent extends CommonObject
|
|||
$id = $this->db->last_insert_id(MAIN_DB_PREFIX."adherent");
|
||||
if ($id > 0) {
|
||||
$this->id = $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();
|
||||
'@phan-var-force ModeleNumRefMembers $modCodeMember';
|
||||
/** @var ModeleNumRefMembers $modCodeMember */
|
||||
$this->ref = $modCodeMember->getNextValue($mysoc, $this);
|
||||
} catch (Exception $e) {
|
||||
dol_syslog($e->getMessage(), LOG_ERR);
|
||||
$error++;
|
||||
}
|
||||
|
||||
$modulenum = getDolGlobalString('MEMBER_CODEMEMBER_ADDON', 'mod_member_simple');
|
||||
|
||||
$modfile = dol_buildpath('core/modules/member/'.$modulenum.'.php', 0);
|
||||
try {
|
||||
require_once $modfile;
|
||||
$modname = $modulenum;
|
||||
$modCodeMember = new $modname();
|
||||
'@phan-var-force ModeleNumRefMembers $modCodeMember';
|
||||
/** @var ModeleNumRefMembers $modCodeMember */
|
||||
$this->ref = $modCodeMember->getNextValue($mysoc, $this);
|
||||
} catch (Exception $e) {
|
||||
dol_syslog($e->getMessage(), LOG_ERR);
|
||||
$error++;
|
||||
}
|
||||
|
||||
// Update minor fields
|
||||
|
|
|
|||
Loading…
Reference in a new issue