update code toward php8 compliance

This commit is contained in:
Philippe GRAND 2022-09-09 10:24:38 +02:00
parent ab9652db5f
commit 1bacb20a87
3 changed files with 12 additions and 12 deletions

View File

@ -87,10 +87,10 @@ if ($id > 0 || !empty($ref)) {
} }
// Define variables to determine what the current user can do on the members // Define variables to determine what the current user can do on the members
$canaddmember = $user->rights->adherent->creer; $canaddmember = $user->hasRight('adherent', 'creer');
// Define variables to determine what the current user can do on the properties of a member // Define variables to determine what the current user can do on the properties of a member
if ($id) { if ($id) {
$caneditfieldmember = $user->rights->adherent->creer; $caneditfieldmember = $user->hasRight('adherent', 'creer');
} }
$permissiontoadd = $canaddmember; $permissiontoadd = $canaddmember;
@ -186,8 +186,8 @@ if ($id > 0) {
print dol_get_fiche_end(); print dol_get_fiche_end();
$modulepart = 'member'; $modulepart = 'member';
$permissiontoadd = $user->rights->adherent->creer; $permissiontoadd = $user->hasRight('adherent', 'creer');
$permtoedit = $user->rights->adherent->creer; $permtoedit = $user->hasRight('adherent', 'creer');
$param = '&id='.$object->id; $param = '&id='.$object->id;
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
print "<br><br>"; print "<br><br>";

View File

@ -62,10 +62,10 @@ if ($id > 0 || !empty($ref)) {
} }
// Define variables to determine what the current user can do on the members // Define variables to determine what the current user can do on the members
$canaddmember = $user->rights->adherent->creer; $canaddmember = $user->hasRight('adherent', 'creer');
// Define variables to determine what the current user can do on the properties of a member // Define variables to determine what the current user can do on the properties of a member
if ($id) { if ($id) {
$caneditfieldmember = $user->rights->adherent->creer; $caneditfieldmember = $user->hasRight('adherent', 'creer');
} }
// Security check // Security check

View File

@ -232,7 +232,7 @@ if (empty($reshook)) {
} }
// Close // Close
if ($massaction == 'close' && $user->rights->adherent->creer) { if ($massaction == 'close' && $user->hasRight('adherent', 'creer')) {
$tmpmember = new Adherent($db); $tmpmember = new Adherent($db);
$error = 0; $error = 0;
$nbclose = 0; $nbclose = 0;
@ -262,7 +262,7 @@ if (empty($reshook)) {
} }
// Create external user // Create external user
if ($massaction == 'createexternaluser' && $user->rights->adherent->creer && $user->rights->user->user->creer) { if ($massaction == 'createexternaluser' && $user->hasRight('adherent', 'creer') && $user->rights->user->user->creer) {
$tmpmember = new Adherent($db); $tmpmember = new Adherent($db);
$error = 0; $error = 0;
$nbcreated = 0; $nbcreated = 0;
@ -302,7 +302,7 @@ if (empty($reshook)) {
$objectlabel = 'Members'; $objectlabel = 'Members';
$permissiontoread = $user->rights->adherent->lire; $permissiontoread = $user->rights->adherent->lire;
$permissiontodelete = $user->rights->adherent->supprimer; $permissiontodelete = $user->rights->adherent->supprimer;
$permissiontoadd = $user->rights->adherent->creer; $permissiontoadd = $user->hasRight('adherent', 'creer');
$uploaddir = $conf->adherent->dir_output; $uploaddir = $conf->adherent->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
} }
@ -617,7 +617,7 @@ $arrayofmassactions = array(
//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
); );
if ($user->rights->adherent->creer) { if ($user->hasRight('adherent', 'creer')) {
$arrayofmassactions['close'] = img_picto('', 'close_title', 'class="pictofixedwidth"').$langs->trans("Resiliate"); $arrayofmassactions['close'] = img_picto('', 'close_title', 'class="pictofixedwidth"').$langs->trans("Resiliate");
} }
if ($user->rights->adherent->supprimer) { if ($user->rights->adherent->supprimer) {
@ -626,7 +626,7 @@ if ($user->rights->adherent->supprimer) {
if ($user->rights->societe->creer) { if ($user->rights->societe->creer) {
$arrayofmassactions['preaffecttag'] = img_picto('', 'category', 'class="pictofixedwidth"').$langs->trans("AffectTag"); $arrayofmassactions['preaffecttag'] = img_picto('', 'category', 'class="pictofixedwidth"').$langs->trans("AffectTag");
} }
if ($user->rights->adherent->creer && $user->rights->user->user->creer) { if ($user->hasRight('adherent', 'creer') && $user->rights->user->user->creer) {
$arrayofmassactions['createexternaluser'] = img_picto('', 'user', 'class="pictofixedwidth"').$langs->trans("CreateExternalUser"); $arrayofmassactions['createexternaluser'] = img_picto('', 'user', 'class="pictofixedwidth"').$langs->trans("CreateExternalUser");
} }
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete', 'preaffecttag'))) { if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete', 'preaffecttag'))) {
@ -635,7 +635,7 @@ if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'pr
$massactionbutton = $form->selectMassAction('', $arrayofmassactions); $massactionbutton = $form->selectMassAction('', $arrayofmassactions);
$newcardbutton = ''; $newcardbutton = '';
if ($user->rights->adherent->creer) { if ($user->hasRight('adherent', 'creer')) {
$newcardbutton .= dolGetButtonTitle($langs->trans('NewMember'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/adherents/card.php?action=create'); $newcardbutton .= dolGetButtonTitle($langs->trans('NewMember'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/adherents/card.php?action=create');
} }