update code toward php8 compliance

This commit is contained in:
Philippe GRAND 2022-09-10 11:19:54 +02:00
parent 236b86bdd3
commit 1b5465d7d0
5 changed files with 5 additions and 5 deletions

View File

@ -481,7 +481,7 @@ if (empty($reshook)) {
$objectclass = 'Bookkeeping';
$objectlabel = 'Bookkeeping';
$permissiontoread = $user->hasRight('societe', 'lire');
$permissiontodelete = $user->rights->societe->supprimer;
$permissiontodelete = $user->hasRight('societe', 'supprimer');
$permissiontoadd = $user->rights->societe->creer;
$uploaddir = $conf->societe->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';

View File

@ -263,7 +263,7 @@ for ($i = 1; $i <= 4; $i++) {
<a class="butAction" href="<?php echo $_SERVER["PHP_SELF"].'?socid='.$this->control->tpl['id'].'&action=edit&token='.newToken().'&canvas='.urlencode($canvas); ?>"><?php echo $langs->trans("Modify"); ?></a>
<?php } ?>
<?php if ($user->rights->societe->supprimer) { ?>
<?php if ($user->hasRight('societe', 'supprimer')) { ?>
<?php if ($conf->use_javascript_ajax) { ?>
<span id="action-delete" class="butActionDelete"><?php echo $langs->trans('Delete'); ?></span>
<?php } else { ?>

View File

@ -190,7 +190,7 @@ if ($this->control->tpl['action_delete']) {
<a class="butAction" href="<?php echo $_SERVER["PHP_SELF"].'?socid='.$this->control->tpl['id'].'&action=edit&token='.newToken().'&canvas='.urlencode($canvas); ?>"><?php echo $langs->trans("Modify"); ?></a>
<?php } ?>
<?php if ($user->rights->societe->supprimer) { ?>
<?php if ($user->hasRight('societe', 'supprimer')) { ?>
<?php if ($conf->use_javascript_ajax) { ?>
<span id="action-delete" class="butActionDelete"><?php echo $langs->trans('Delete'); ?></span>
<?php } else { ?>

View File

@ -527,7 +527,7 @@ class Thirdparties extends DolibarrApi
*/
public function delete($id)
{
if (!DolibarrApiAccess::$user->rights->societe->supprimer) {
if (!DolibarrApiAccess::$user->hasRight('societe', 'supprimer')) {
throw new RestException(401);
}
$result = $this->company->fetch($id);

View File

@ -162,7 +162,7 @@ if (empty($reshook)) {
$objectclass = 'WebsiteAccount';
$objectlabel = 'WebsiteAccount';
$permissiontoread = $user->hasRight('societe', 'lire');
$permissiontodelete = $user->rights->societe->supprimer;
$permissiontodelete = $user->hasRight('societe', 'supprimer');
$uploaddir = $conf->societe->multidir_output[$object->entity];
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
}