diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php
index 6816023f8de..b9e04015d7d 100644
--- a/htdocs/adherents/card.php
+++ b/htdocs/adherents/card.php
@@ -110,10 +110,10 @@ if ($id > 0 || !empty($ref)) {
}
// 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
if ($id) {
- $caneditfieldmember = $user->rights->adherent->creer;
+ $caneditfieldmember = $user->hasRight('adherent', 'creer');
}
// Security check
@@ -246,7 +246,7 @@ if (empty($reshook)) {
}
}
- if ($action == 'update' && !$cancel && $user->rights->adherent->creer) {
+ if ($action == 'update' && !$cancel && $user->hasRight('adherent', 'creer')) {
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$birthdate = '';
@@ -421,7 +421,7 @@ if (empty($reshook)) {
}
}
- if ($action == 'add' && $user->rights->adherent->creer) {
+ if ($action == 'add' && $user->hasRight('adherent', 'creer')) {
if ($canvas) {
$object->canvas = $canvas;
}
@@ -629,7 +629,7 @@ if (empty($reshook)) {
}
}
- if ($user->rights->adherent->creer && $action == 'confirm_valid' && $confirm == 'yes') {
+ if ($user->hasRight('adherent', 'creer') && $action == 'confirm_valid' && $confirm == 'yes') {
$error = 0;
$db->begin();
@@ -854,7 +854,7 @@ if (empty($reshook)) {
}
}
- if ($user->rights->adherent->creer && $action == 'confirm_add_spip' && $confirm == 'yes') {
+ if ($user->hasRight('adherent', 'creer') && $action == 'confirm_add_spip' && $confirm == 'yes') {
if (!count($object->errors)) {
if (!$mailmanspip->add_to_spip($object)) {
setEventMessages($langs->trans('AddIntoSpipError').': '.$mailmanspip->error, null, 'errors');
@@ -867,7 +867,7 @@ if (empty($reshook)) {
// Actions to build doc
$upload_dir = $conf->adherent->dir_output;
- $permissiontoadd = $user->rights->adherent->creer;
+ $permissiontoadd = $user->hasRight('adherent', 'creer');
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
// Actions to send emails
@@ -1222,7 +1222,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Type
print '
| '.$langs->trans("Type").' | ';
- if ($user->rights->adherent->creer) {
+ if ($user->hasRight('adherent', 'creer')) {
print $form->selectarray("typeid", $adht->liste_array(), (GETPOSTISSET("typeid") ? GETPOST("typeid", 'int') : $object->typeid), 0, 0, 0, '', 0, 0, 0, '', '', 1);
} else {
print $adht->getNomUrl(1);
@@ -1820,7 +1820,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Third party Dolibarr
if (isModEnabled('societe')) {
print ' |
| ';
- $editenable = $user->rights->adherent->creer;
+ $editenable = $user->hasRight('adherent', 'creer');
print $form->editfieldkey('LinkedToDolibarrThirdParty', 'thirdparty', '', $object, $editenable);
print ' | ';
if ($action == 'editthirdparty') {
@@ -1857,7 +1857,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Login Dolibarr - Link to user
print ' |
| ';
- $editenable = $user->rights->adherent->creer && $user->rights->user->user->creer;
+ $editenable = $user->hasRight('adherent', 'creer') && $user->rights->user->user->creer;
print $form->editfieldkey('LinkedToDolibarrUser', 'login', '', $object, $editenable);
print ' | ';
if ($action == 'editlogin') {
@@ -1901,7 +1901,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Send card by email
// TODO Remove this to replace with a template
/*
- if ($user->rights->adherent->creer) {
+ if ($user->hasRight('adherent', 'creer')) {
if (Adherent::STATUS_VALIDATED == $object->statut) {
if ($object->email) print ''.$langs->trans("SendCardByMail")."\n";
else print ''.$langs->trans("SendCardByMail")."\n";
@@ -1913,7 +1913,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
}*/
// Modify
- if (!empty($user->rights->adherent->creer)) {
+ if ($user->hasRight('adherent', 'creer')) {
print ''.$langs->trans("Modify").''."\n";
} else {
print ''.$langs->trans("Modify").''."\n";
@@ -1921,7 +1921,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Validate
if (Adherent::STATUS_DRAFT == $object->statut) {
- if ($user->rights->adherent->creer) {
+ if ($user->hasRight('adherent', 'creer')) {
print ''.$langs->trans("Validate").''."\n";
} else {
print ''.$langs->trans("Validate").''."\n";
@@ -1930,7 +1930,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Reactivate
if (Adherent::STATUS_RESILIATED == $object->statut || Adherent::STATUS_EXCLUDED == $object->statut) {
- if ($user->rights->adherent->creer) {
+ if ($user->hasRight('adherent', 'creer')) {
print ''.$langs->trans("Reenable")."\n";
} else {
print ''.$langs->trans("Reenable").''."\n";
@@ -2022,7 +2022,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
$filedir = $conf->adherent->dir_output.'/'.get_exdir(0, 0, 0, 1, $object, 'member');
$urlsource = $_SERVER['PHP_SELF'].'?id='.$object->id;
$genallowed = $user->rights->adherent->lire;
- $delallowed = $user->rights->adherent->creer;
+ $delallowed = $user->hasRight('adherent', 'creer');
print $formfile->showdocuments('member', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', (empty($object->default_lang) ? '' : $object->default_lang), '', $object);
$somethingshown = $formfile->numoffiles;
|