update code toward php8 compliance
This commit is contained in:
parent
236b86bdd3
commit
1b5465d7d0
@ -481,7 +481,7 @@ if (empty($reshook)) {
|
|||||||
$objectclass = 'Bookkeeping';
|
$objectclass = 'Bookkeeping';
|
||||||
$objectlabel = 'Bookkeeping';
|
$objectlabel = 'Bookkeeping';
|
||||||
$permissiontoread = $user->hasRight('societe', 'lire');
|
$permissiontoread = $user->hasRight('societe', 'lire');
|
||||||
$permissiontodelete = $user->rights->societe->supprimer;
|
$permissiontodelete = $user->hasRight('societe', 'supprimer');
|
||||||
$permissiontoadd = $user->rights->societe->creer;
|
$permissiontoadd = $user->rights->societe->creer;
|
||||||
$uploaddir = $conf->societe->dir_output;
|
$uploaddir = $conf->societe->dir_output;
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||||
|
|||||||
@ -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>
|
<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 } ?>
|
||||||
|
|
||||||
<?php if ($user->rights->societe->supprimer) { ?>
|
<?php if ($user->hasRight('societe', 'supprimer')) { ?>
|
||||||
<?php if ($conf->use_javascript_ajax) { ?>
|
<?php if ($conf->use_javascript_ajax) { ?>
|
||||||
<span id="action-delete" class="butActionDelete"><?php echo $langs->trans('Delete'); ?></span>
|
<span id="action-delete" class="butActionDelete"><?php echo $langs->trans('Delete'); ?></span>
|
||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
|
|||||||
@ -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>
|
<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 } ?>
|
||||||
|
|
||||||
<?php if ($user->rights->societe->supprimer) { ?>
|
<?php if ($user->hasRight('societe', 'supprimer')) { ?>
|
||||||
<?php if ($conf->use_javascript_ajax) { ?>
|
<?php if ($conf->use_javascript_ajax) { ?>
|
||||||
<span id="action-delete" class="butActionDelete"><?php echo $langs->trans('Delete'); ?></span>
|
<span id="action-delete" class="butActionDelete"><?php echo $langs->trans('Delete'); ?></span>
|
||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
|
|||||||
@ -527,7 +527,7 @@ class Thirdparties extends DolibarrApi
|
|||||||
*/
|
*/
|
||||||
public function delete($id)
|
public function delete($id)
|
||||||
{
|
{
|
||||||
if (!DolibarrApiAccess::$user->rights->societe->supprimer) {
|
if (!DolibarrApiAccess::$user->hasRight('societe', 'supprimer')) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
$result = $this->company->fetch($id);
|
$result = $this->company->fetch($id);
|
||||||
|
|||||||
@ -162,7 +162,7 @@ if (empty($reshook)) {
|
|||||||
$objectclass = 'WebsiteAccount';
|
$objectclass = 'WebsiteAccount';
|
||||||
$objectlabel = 'WebsiteAccount';
|
$objectlabel = 'WebsiteAccount';
|
||||||
$permissiontoread = $user->hasRight('societe', 'lire');
|
$permissiontoread = $user->hasRight('societe', 'lire');
|
||||||
$permissiontodelete = $user->rights->societe->supprimer;
|
$permissiontodelete = $user->hasRight('societe', 'supprimer');
|
||||||
$uploaddir = $conf->societe->multidir_output[$object->entity];
|
$uploaddir = $conf->societe->multidir_output[$object->entity];
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user