Merge pull request #22169 from grandoc/new_branch_09_09_2022

fix : Typo
This commit is contained in:
Laurent Destailleur 2022-09-09 15:47:55 +02:00 committed by GitHub
commit 72dbf4f36e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 53 additions and 53 deletions

View File

@ -1,6 +1,6 @@
<?php
/* 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
* 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)) {
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>';
}

View File

@ -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 '<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);
} else {
print $adht->getNomUrl(1);
@ -1820,7 +1820,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Third party Dolibarr
if (isModEnabled('societe')) {
print '<tr><td>';
$editenable = $user->rights->adherent->creer;
$editenable = $user->hasRight('adherent', 'creer');
print $form->editfieldkey('LinkedToDolibarrThirdParty', 'thirdparty', '', $object, $editenable);
print '</td><td colspan="2" class="valeur">';
if ($action == 'editthirdparty') {
@ -1857,7 +1857,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Login Dolibarr - Link to user
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 '</td><td colspan="2" class="valeur">';
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 '<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";
@ -1913,7 +1913,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
}*/
// 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";
} else {
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
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";
} else {
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
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";
} else {
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');
$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;

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2016 Xebax Christy <xebax@wanadoo.fr>
* Copyright (C) 2017 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2020 Thibault FOUCART<support@ptibogxiv.net>
* Copyright (C) 2020 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2020 Frédéric France <frederic.france@netlogic.fr>
*
* 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
@ -286,7 +286,7 @@ class Members extends DolibarrApi
*/
public function post($request_data = null)
{
if (!DolibarrApiAccess::$user->rights->adherent->creer) {
if (!DolibarrApiAccess::$user->hasRight('adherent', 'creer')) {
throw new RestException(401);
}
// Check mandatory fields
@ -311,7 +311,7 @@ class Members extends DolibarrApi
*/
public function put($id, $request_data = null)
{
if (!DolibarrApiAccess::$user->rights->adherent->creer) {
if (!DolibarrApiAccess::$user->hasRight('adherent', 'creer')) {
throw new RestException(401);
}

View File

@ -173,7 +173,7 @@ class Subscriptions extends DolibarrApi
*/
public function put($id, $request_data = null)
{
if (!DolibarrApiAccess::$user->rights->adherent->creer) {
if (!DolibarrApiAccess::$user->hasRight('adherent', 'creer')) {
throw new RestException(401);
}

View File

@ -87,10 +87,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');
}
$permissiontoadd = $canaddmember;
@ -186,8 +186,8 @@ if ($id > 0) {
print dol_get_fiche_end();
$modulepart = 'member';
$permissiontoadd = $user->rights->adherent->creer;
$permtoedit = $user->rights->adherent->creer;
$permissiontoadd = $user->hasRight('adherent', 'creer');
$permtoedit = $user->hasRight('adherent', 'creer');
$param = '&id='.$object->id;
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
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
$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

View File

@ -232,7 +232,7 @@ if (empty($reshook)) {
}
// Close
if ($massaction == 'close' && $user->rights->adherent->creer) {
if ($massaction == 'close' && $user->hasRight('adherent', 'creer')) {
$tmpmember = new Adherent($db);
$error = 0;
$nbclose = 0;
@ -262,7 +262,7 @@ if (empty($reshook)) {
}
// 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);
$error = 0;
$nbcreated = 0;
@ -302,7 +302,7 @@ if (empty($reshook)) {
$objectlabel = 'Members';
$permissiontoread = $user->rights->adherent->lire;
$permissiontodelete = $user->rights->adherent->supprimer;
$permissiontoadd = $user->rights->adherent->creer;
$permissiontoadd = $user->hasRight('adherent', 'creer');
$uploaddir = $conf->adherent->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
}
@ -617,7 +617,7 @@ $arrayofmassactions = array(
//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
//'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");
}
if ($user->rights->adherent->supprimer) {
@ -626,7 +626,7 @@ if ($user->rights->adherent->supprimer) {
if ($user->rights->societe->creer) {
$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");
}
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);
$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');
}

View File

@ -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
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
$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');
}
$hookmanager->initHooks(array('membernote'));
@ -155,7 +155,7 @@ if ($id) {
$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';

View File

@ -112,10 +112,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
@ -594,7 +594,7 @@ if ($rowid > 0) {
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans("LinkedToDolibarrThirdParty");
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 '</tr></table>';
@ -636,7 +636,7 @@ if ($rowid > 0) {
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans("LinkedToDolibarrUser");
print '</td>';
if ($action != 'editlogin' && $user->rights->adherent->creer) {
if ($action != 'editlogin' && $user->hasRight('adherent', 'creer')) {
print '<td class="right">';
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>';

View File

@ -753,7 +753,7 @@ if ($rowid > 0) {
// Actions
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>';
}
if ($user->rights->adherent->supprimer) {

View File

@ -53,10 +53,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

View File

@ -386,7 +386,7 @@ class Categories extends DolibarrApi
}
$object = new Contact($this->db);
} elseif ($type === Categorie::TYPE_MEMBER) {
if (!DolibarrApiAccess::$user->rights->adherent->creer) {
if (!DolibarrApiAccess::$user->hasRight('adherent', 'creer')) {
throw new RestException(401);
}
$object = new Adherent($this->db);
@ -466,7 +466,7 @@ class Categories extends DolibarrApi
}
$object = new Contact($this->db);
} elseif ($type === Categorie::TYPE_MEMBER) {
if (!DolibarrApiAccess::$user->rights->adherent->creer) {
if (!DolibarrApiAccess::$user->hasRight('adherent', 'creer')) {
throw new RestException(401);
}
$object = new Adherent($this->db);
@ -546,7 +546,7 @@ class Categories extends DolibarrApi
}
$object = new Contact($this->db);
} elseif ($type === Categorie::TYPE_MEMBER) {
if (!DolibarrApiAccess::$user->rights->adherent->creer) {
if (!DolibarrApiAccess::$user->hasRight('adherent', 'creer')) {
throw new RestException(401);
}
$object = new Adherent($this->db);
@ -624,7 +624,7 @@ class Categories extends DolibarrApi
}
$object = new Contact($this->db);
} elseif ($type === Categorie::TYPE_MEMBER) {
if (!DolibarrApiAccess::$user->rights->adherent->creer) {
if (!DolibarrApiAccess::$user->hasRight('adherent', 'creer')) {
throw new RestException(401);
}
$object = new Adherent($this->db);

View File

@ -117,7 +117,7 @@ if ($id > 0 && $removeelem > 0 && $action == 'unlink') {
$tmpobject = new Societe($db);
$result = $tmpobject->fetch($removeelem);
$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';
$tmpobject = new Adherent($db);
$result = $tmpobject->fetch($removeelem);
@ -733,7 +733,7 @@ if ($type == Categorie::TYPE_MEMBER) {
if ($user->hasRight("adherent", "read")) {
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);
if ($prods < 0) {
@ -768,7 +768,7 @@ if ($type == Categorie::TYPE_MEMBER) {
print '<br>';
$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 "<table class='noborder' width='100%'>\n";

View File

@ -41,8 +41,8 @@ if ((GETPOST('sendit', 'alpha')
|| ($action == 'confirm_deletefile' && $confirm == 'yes')
|| ($action == 'confirm_updateline' && GETPOST('save', 'alpha') && GETPOST('link', 'alpha'))
|| ($action == 'renamefile' && GETPOST('renamefilesave', 'alpha'))) && empty($permissiontoadd)) {
dol_syslog('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 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 parameter $permissiontoadd was not set before.';
die;
}