Merge pull request #22169 from grandoc/new_branch_09_09_2022
fix : Typo
This commit is contained in:
commit
72dbf4f36e
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@inodbox.com>
|
/* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2012 Philippe Grand <philippe.grand@atoo-net.com>
|
* Copyright (C) 2012-2022 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -124,7 +124,7 @@ if (!empty($this->control->tpl['action_delete'])) {
|
|||||||
if (empty($user->socid)) {
|
if (empty($user->socid)) {
|
||||||
echo '<div class="tabsAction">';
|
echo '<div class="tabsAction">';
|
||||||
|
|
||||||
if ($user->rights->adherent->creer) {
|
if ($user->hasRight('adherent', 'creer')) {
|
||||||
echo '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&action=edit&token='.newToken().'&canvas='.$canvas.'">'.$langs->trans('Modify').'</a>';
|
echo '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&action=edit&token='.newToken().'&canvas='.$canvas.'">'.$langs->trans('Modify').'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -110,10 +110,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
|
||||||
@ -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';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
|
|
||||||
$birthdate = '';
|
$birthdate = '';
|
||||||
@ -421,7 +421,7 @@ if (empty($reshook)) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'add' && $user->rights->adherent->creer) {
|
if ($action == 'add' && $user->hasRight('adherent', 'creer')) {
|
||||||
if ($canvas) {
|
if ($canvas) {
|
||||||
$object->canvas = $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;
|
$error = 0;
|
||||||
|
|
||||||
$db->begin();
|
$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 (!count($object->errors)) {
|
||||||
if (!$mailmanspip->add_to_spip($object)) {
|
if (!$mailmanspip->add_to_spip($object)) {
|
||||||
setEventMessages($langs->trans('AddIntoSpipError').': '.$mailmanspip->error, null, 'errors');
|
setEventMessages($langs->trans('AddIntoSpipError').': '.$mailmanspip->error, null, 'errors');
|
||||||
@ -867,7 +867,7 @@ if (empty($reshook)) {
|
|||||||
|
|
||||||
// Actions to build doc
|
// Actions to build doc
|
||||||
$upload_dir = $conf->adherent->dir_output;
|
$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';
|
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
||||||
|
|
||||||
// Actions to send emails
|
// Actions to send emails
|
||||||
@ -1222,7 +1222,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
|
|
||||||
// Type
|
// Type
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans("Type").'</td><td>';
|
print '<tr><td class="fieldrequired">'.$langs->trans("Type").'</td><td>';
|
||||||
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);
|
print $form->selectarray("typeid", $adht->liste_array(), (GETPOSTISSET("typeid") ? GETPOST("typeid", 'int') : $object->typeid), 0, 0, 0, '', 0, 0, 0, '', '', 1);
|
||||||
} else {
|
} else {
|
||||||
print $adht->getNomUrl(1);
|
print $adht->getNomUrl(1);
|
||||||
@ -1820,7 +1820,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
// Third party Dolibarr
|
// Third party Dolibarr
|
||||||
if (isModEnabled('societe')) {
|
if (isModEnabled('societe')) {
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
$editenable = $user->rights->adherent->creer;
|
$editenable = $user->hasRight('adherent', 'creer');
|
||||||
print $form->editfieldkey('LinkedToDolibarrThirdParty', 'thirdparty', '', $object, $editenable);
|
print $form->editfieldkey('LinkedToDolibarrThirdParty', 'thirdparty', '', $object, $editenable);
|
||||||
print '</td><td colspan="2" class="valeur">';
|
print '</td><td colspan="2" class="valeur">';
|
||||||
if ($action == 'editthirdparty') {
|
if ($action == 'editthirdparty') {
|
||||||
@ -1857,7 +1857,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
|
|
||||||
// Login Dolibarr - Link to user
|
// Login Dolibarr - Link to user
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
$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 $form->editfieldkey('LinkedToDolibarrUser', 'login', '', $object, $editenable);
|
||||||
print '</td><td colspan="2" class="valeur">';
|
print '</td><td colspan="2" class="valeur">';
|
||||||
if ($action == 'editlogin') {
|
if ($action == 'editlogin') {
|
||||||
@ -1901,7 +1901,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
// Send card by email
|
// Send card by email
|
||||||
// TODO Remove this to replace with a template
|
// 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 (Adherent::STATUS_VALIDATED == $object->statut) {
|
||||||
if ($object->email) print '<a class="butAction" href="card.php?rowid='.$object->id.'&action=sendinfo">'.$langs->trans("SendCardByMail")."</a>\n";
|
if ($object->email) print '<a class="butAction" href="card.php?rowid='.$object->id.'&action=sendinfo">'.$langs->trans("SendCardByMail")."</a>\n";
|
||||||
else print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NoEMail")).'">'.$langs->trans("SendCardByMail")."</a>\n";
|
else print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NoEMail")).'">'.$langs->trans("SendCardByMail")."</a>\n";
|
||||||
@ -1913,7 +1913,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
}*/
|
}*/
|
||||||
|
|
||||||
// Modify
|
// Modify
|
||||||
if (!empty($user->rights->adherent->creer)) {
|
if ($user->hasRight('adherent', 'creer')) {
|
||||||
print '<a class="butAction" href="card.php?rowid='.$id.'&action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a>'."\n";
|
print '<a class="butAction" href="card.php?rowid='.$id.'&action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a>'."\n";
|
||||||
} else {
|
} else {
|
||||||
print '<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Modify").'</span>'."\n";
|
print '<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Modify").'</span>'."\n";
|
||||||
@ -1921,7 +1921,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
|
|
||||||
// Validate
|
// Validate
|
||||||
if (Adherent::STATUS_DRAFT == $object->statut) {
|
if (Adherent::STATUS_DRAFT == $object->statut) {
|
||||||
if ($user->rights->adherent->creer) {
|
if ($user->hasRight('adherent', 'creer')) {
|
||||||
print '<a class="butAction" href="card.php?rowid='.$id.'&action=valid">'.$langs->trans("Validate").'</a>'."\n";
|
print '<a class="butAction" href="card.php?rowid='.$id.'&action=valid">'.$langs->trans("Validate").'</a>'."\n";
|
||||||
} else {
|
} else {
|
||||||
print '<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Validate").'</span>'."\n";
|
print '<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Validate").'</span>'."\n";
|
||||||
@ -1930,7 +1930,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
|
|
||||||
// Reactivate
|
// Reactivate
|
||||||
if (Adherent::STATUS_RESILIATED == $object->statut || Adherent::STATUS_EXCLUDED == $object->statut) {
|
if (Adherent::STATUS_RESILIATED == $object->statut || Adherent::STATUS_EXCLUDED == $object->statut) {
|
||||||
if ($user->rights->adherent->creer) {
|
if ($user->hasRight('adherent', 'creer')) {
|
||||||
print '<a class="butAction" href="card.php?rowid='.$id.'&action=valid">'.$langs->trans("Reenable")."</a>\n";
|
print '<a class="butAction" href="card.php?rowid='.$id.'&action=valid">'.$langs->trans("Reenable")."</a>\n";
|
||||||
} else {
|
} else {
|
||||||
print '<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Reenable").'</span>'."\n";
|
print '<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Reenable").'</span>'."\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');
|
$filedir = $conf->adherent->dir_output.'/'.get_exdir(0, 0, 0, 1, $object, 'member');
|
||||||
$urlsource = $_SERVER['PHP_SELF'].'?id='.$object->id;
|
$urlsource = $_SERVER['PHP_SELF'].'?id='.$object->id;
|
||||||
$genallowed = $user->rights->adherent->lire;
|
$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);
|
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;
|
$somethingshown = $formfile->numoffiles;
|
||||||
|
|||||||
@ -286,7 +286,7 @@ class Members extends DolibarrApi
|
|||||||
*/
|
*/
|
||||||
public function post($request_data = null)
|
public function post($request_data = null)
|
||||||
{
|
{
|
||||||
if (!DolibarrApiAccess::$user->rights->adherent->creer) {
|
if (!DolibarrApiAccess::$user->hasRight('adherent', 'creer')) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
// Check mandatory fields
|
// Check mandatory fields
|
||||||
@ -311,7 +311,7 @@ class Members extends DolibarrApi
|
|||||||
*/
|
*/
|
||||||
public function put($id, $request_data = null)
|
public function put($id, $request_data = null)
|
||||||
{
|
{
|
||||||
if (!DolibarrApiAccess::$user->rights->adherent->creer) {
|
if (!DolibarrApiAccess::$user->hasRight('adherent', 'creer')) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -173,7 +173,7 @@ class Subscriptions extends DolibarrApi
|
|||||||
*/
|
*/
|
||||||
public function put($id, $request_data = null)
|
public function put($id, $request_data = null)
|
||||||
{
|
{
|
||||||
if (!DolibarrApiAccess::$user->rights->adherent->creer) {
|
if (!DolibarrApiAccess::$user->hasRight('adherent', 'creer')) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -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>";
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -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');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -51,7 +51,7 @@ if ($result > 0) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$permissionnote = $user->rights->adherent->creer; // Used by the include of actions_setnotes.inc.php
|
$permissionnote = $user->hasRight('adherent', 'creer'); // Used by the include of actions_setnotes.inc.php
|
||||||
|
|
||||||
// Fetch object
|
// Fetch object
|
||||||
if ($id > 0 || !empty($ref)) {
|
if ($id > 0 || !empty($ref)) {
|
||||||
@ -71,10 +71,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');
|
||||||
}
|
}
|
||||||
|
|
||||||
$hookmanager->initHooks(array('membernote'));
|
$hookmanager->initHooks(array('membernote'));
|
||||||
@ -155,7 +155,7 @@ if ($id) {
|
|||||||
|
|
||||||
|
|
||||||
$cssclass = 'titlefield';
|
$cssclass = 'titlefield';
|
||||||
$permission = $user->rights->adherent->creer; // Used by the include of notes.tpl.php
|
$permission = $user->hasRight('adherent', 'creer'); // Used by the include of notes.tpl.php
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -112,10 +112,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
|
||||||
@ -594,7 +594,7 @@ if ($rowid > 0) {
|
|||||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||||
print $langs->trans("LinkedToDolibarrThirdParty");
|
print $langs->trans("LinkedToDolibarrThirdParty");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if ($action != 'editthirdparty' && $user->rights->adherent->creer) {
|
if ($action != 'editthirdparty' && $user->hasRight('adherent', 'creer')) {
|
||||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editthirdparty&token='.newToken().'&rowid='.$object->id.'">'.img_edit($langs->trans('SetLinkToThirdParty'), 1).'</a></td>';
|
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editthirdparty&token='.newToken().'&rowid='.$object->id.'">'.img_edit($langs->trans('SetLinkToThirdParty'), 1).'</a></td>';
|
||||||
}
|
}
|
||||||
print '</tr></table>';
|
print '</tr></table>';
|
||||||
@ -636,7 +636,7 @@ if ($rowid > 0) {
|
|||||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||||
print $langs->trans("LinkedToDolibarrUser");
|
print $langs->trans("LinkedToDolibarrUser");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if ($action != 'editlogin' && $user->rights->adherent->creer) {
|
if ($action != 'editlogin' && $user->hasRight('adherent', 'creer')) {
|
||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
if ($user->rights->user->user->creer) {
|
if ($user->rights->user->user->creer) {
|
||||||
print '<a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editlogin&token='.newToken().'&rowid='.$object->id.'">'.img_edit($langs->trans('SetLinkToUser'), 1).'</a>';
|
print '<a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editlogin&token='.newToken().'&rowid='.$object->id.'">'.img_edit($langs->trans('SetLinkToUser'), 1).'</a>';
|
||||||
|
|||||||
@ -753,7 +753,7 @@ if ($rowid > 0) {
|
|||||||
|
|
||||||
// Actions
|
// Actions
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
if ($user->rights->adherent->creer) {
|
if ($user->hasRight('adherent', 'creer')) {
|
||||||
print '<a class="editfielda marginleftonly" href="card.php?rowid='.$objp->rowid.'&action=edit&token='.newToken().'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?rowid='.$object->id).'">'.img_edit().'</a>';
|
print '<a class="editfielda marginleftonly" href="card.php?rowid='.$objp->rowid.'&action=edit&token='.newToken().'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?rowid='.$object->id).'">'.img_edit().'</a>';
|
||||||
}
|
}
|
||||||
if ($user->rights->adherent->supprimer) {
|
if ($user->rights->adherent->supprimer) {
|
||||||
|
|||||||
@ -53,10 +53,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
|
||||||
|
|||||||
@ -386,7 +386,7 @@ class Categories extends DolibarrApi
|
|||||||
}
|
}
|
||||||
$object = new Contact($this->db);
|
$object = new Contact($this->db);
|
||||||
} elseif ($type === Categorie::TYPE_MEMBER) {
|
} elseif ($type === Categorie::TYPE_MEMBER) {
|
||||||
if (!DolibarrApiAccess::$user->rights->adherent->creer) {
|
if (!DolibarrApiAccess::$user->hasRight('adherent', 'creer')) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
$object = new Adherent($this->db);
|
$object = new Adherent($this->db);
|
||||||
@ -466,7 +466,7 @@ class Categories extends DolibarrApi
|
|||||||
}
|
}
|
||||||
$object = new Contact($this->db);
|
$object = new Contact($this->db);
|
||||||
} elseif ($type === Categorie::TYPE_MEMBER) {
|
} elseif ($type === Categorie::TYPE_MEMBER) {
|
||||||
if (!DolibarrApiAccess::$user->rights->adherent->creer) {
|
if (!DolibarrApiAccess::$user->hasRight('adherent', 'creer')) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
$object = new Adherent($this->db);
|
$object = new Adherent($this->db);
|
||||||
@ -546,7 +546,7 @@ class Categories extends DolibarrApi
|
|||||||
}
|
}
|
||||||
$object = new Contact($this->db);
|
$object = new Contact($this->db);
|
||||||
} elseif ($type === Categorie::TYPE_MEMBER) {
|
} elseif ($type === Categorie::TYPE_MEMBER) {
|
||||||
if (!DolibarrApiAccess::$user->rights->adherent->creer) {
|
if (!DolibarrApiAccess::$user->hasRight('adherent', 'creer')) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
$object = new Adherent($this->db);
|
$object = new Adherent($this->db);
|
||||||
@ -624,7 +624,7 @@ class Categories extends DolibarrApi
|
|||||||
}
|
}
|
||||||
$object = new Contact($this->db);
|
$object = new Contact($this->db);
|
||||||
} elseif ($type === Categorie::TYPE_MEMBER) {
|
} elseif ($type === Categorie::TYPE_MEMBER) {
|
||||||
if (!DolibarrApiAccess::$user->rights->adherent->creer) {
|
if (!DolibarrApiAccess::$user->hasRight('adherent', 'creer')) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
$object = new Adherent($this->db);
|
$object = new Adherent($this->db);
|
||||||
|
|||||||
@ -117,7 +117,7 @@ if ($id > 0 && $removeelem > 0 && $action == 'unlink') {
|
|||||||
$tmpobject = new Societe($db);
|
$tmpobject = new Societe($db);
|
||||||
$result = $tmpobject->fetch($removeelem);
|
$result = $tmpobject->fetch($removeelem);
|
||||||
$elementtype = 'customer';
|
$elementtype = 'customer';
|
||||||
} elseif ($type == Categorie::TYPE_MEMBER && $user->rights->adherent->creer) {
|
} elseif ($type == Categorie::TYPE_MEMBER && $user->hasRight('adherent', 'creer')) {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||||
$tmpobject = new Adherent($db);
|
$tmpobject = new Adherent($db);
|
||||||
$result = $tmpobject->fetch($removeelem);
|
$result = $tmpobject->fetch($removeelem);
|
||||||
@ -733,7 +733,7 @@ if ($type == Categorie::TYPE_MEMBER) {
|
|||||||
if ($user->hasRight("adherent", "read")) {
|
if ($user->hasRight("adherent", "read")) {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||||
|
|
||||||
$permission = $user->rights->adherent->creer;
|
$permission = $user->hasRight('adherent', 'creer');
|
||||||
|
|
||||||
$prods = $object->getObjectsInCateg($type, 0, $limit, $offset);
|
$prods = $object->getObjectsInCateg($type, 0, $limit, $offset);
|
||||||
if ($prods < 0) {
|
if ($prods < 0) {
|
||||||
@ -768,7 +768,7 @@ if ($type == Categorie::TYPE_MEMBER) {
|
|||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
$param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($prods); $nbtotalofrecords = '';
|
$param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($prods); $nbtotalofrecords = '';
|
||||||
$newcardbutton = dolGetButtonTitle($langs->trans("AddMember"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/adherents/card.php?action=create&memcats[]='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id), '', $user->rights->adherent->creer);
|
$newcardbutton = dolGetButtonTitle($langs->trans("AddMember"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/adherents/card.php?action=create&memcats[]='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id), '', $user->hasRight('adherent', 'creer'));
|
||||||
print_barre_liste($langs->trans("Member"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'members', 0, $newcardbutton, '', $limit);
|
print_barre_liste($langs->trans("Member"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'members', 0, $newcardbutton, '', $limit);
|
||||||
|
|
||||||
print "<table class='noborder' width='100%'>\n";
|
print "<table class='noborder' width='100%'>\n";
|
||||||
|
|||||||
@ -41,8 +41,8 @@ if ((GETPOST('sendit', 'alpha')
|
|||||||
|| ($action == 'confirm_deletefile' && $confirm == 'yes')
|
|| ($action == 'confirm_deletefile' && $confirm == 'yes')
|
||||||
|| ($action == 'confirm_updateline' && GETPOST('save', 'alpha') && GETPOST('link', 'alpha'))
|
|| ($action == 'confirm_updateline' && GETPOST('save', 'alpha') && GETPOST('link', 'alpha'))
|
||||||
|| ($action == 'renamefile' && GETPOST('renamefilesave', 'alpha'))) && empty($permissiontoadd)) {
|
|| ($action == 'renamefile' && GETPOST('renamefilesave', 'alpha'))) && empty($permissiontoadd)) {
|
||||||
dol_syslog('The file actions_linkedfiles.inc.php was included but paramater $permissiontoadd as not set before.');
|
dol_syslog('The file actions_linkedfiles.inc.php was included but parameter $permissiontoadd was not set before.');
|
||||||
print 'The file actions_linkedfiles.inc.php was included but paramater $permissiontoadd as not set before.';
|
print 'The file actions_linkedfiles.inc.php was included but parameter $permissiontoadd was not set before.';
|
||||||
die;
|
die;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user