update code toward php8 compliance
This commit is contained in:
parent
c8a70ba221
commit
236b86bdd3
@ -396,7 +396,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';
|
||||||
|
|||||||
@ -313,7 +313,7 @@ if (empty($reshook)) {
|
|||||||
$objectclass = 'Contact';
|
$objectclass = 'Contact';
|
||||||
$objectlabel = 'Contact';
|
$objectlabel = 'Contact';
|
||||||
$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';
|
||||||
@ -690,7 +690,7 @@ $arrayofmassactions = array(
|
|||||||
// 'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
|
// 'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
|
||||||
);
|
);
|
||||||
//if($user->rights->societe->creer) $arrayofmassactions['createbills']=$langs->trans("CreateInvoiceForThisCustomer");
|
//if($user->rights->societe->creer) $arrayofmassactions['createbills']=$langs->trans("CreateInvoiceForThisCustomer");
|
||||||
if ($user->rights->societe->supprimer) {
|
if ($user->hasRight('societe', 'supprimer')) {
|
||||||
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
||||||
}
|
}
|
||||||
if ($user->rights->societe->creer) {
|
if ($user->rights->societe->creer) {
|
||||||
|
|||||||
@ -139,7 +139,7 @@ if (!empty($canvas)) {
|
|||||||
// Permissions
|
// Permissions
|
||||||
$permissiontoread = $user->hasRight('societe', 'lire');
|
$permissiontoread = $user->hasRight('societe', 'lire');
|
||||||
$permissiontoadd = $user->rights->societe->creer; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
|
$permissiontoadd = $user->rights->societe->creer; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
|
||||||
$permissiontodelete = $user->rights->societe->supprimer || ($permissiontoadd && isset($object->status) && $object->status == 0);
|
$permissiontodelete = $user->hasRight('societe', 'supprimer') || ($permissiontoadd && isset($object->status) && $object->status == 0);
|
||||||
$permissionnote = $user->rights->societe->creer; // Used by the include of actions_setnotes.inc.php
|
$permissionnote = $user->rights->societe->creer; // Used by the include of actions_setnotes.inc.php
|
||||||
$permissiondellink = $user->rights->societe->creer; // Used by the include of actions_dellink.inc.php
|
$permissiondellink = $user->rights->societe->creer; // Used by the include of actions_dellink.inc.php
|
||||||
$upload_dir = $conf->societe->multidir_output[isset($object->entity) ? $object->entity : 1];
|
$upload_dir = $conf->societe->multidir_output[isset($object->entity) ? $object->entity : 1];
|
||||||
@ -914,7 +914,7 @@ if (empty($reshook)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Delete third party
|
// Delete third party
|
||||||
if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->societe->supprimer) {
|
if ($action == 'confirm_delete' && $confirm == 'yes' && $user->hasRight('societe', 'supprimer')) {
|
||||||
$object->fetch($socid);
|
$object->fetch($socid);
|
||||||
$object->oldcopy = clone $object;
|
$object->oldcopy = clone $object;
|
||||||
$result = $object->delete($socid, $user);
|
$result = $object->delete($socid, $user);
|
||||||
@ -3247,7 +3247,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
|
|
||||||
print dolGetButtonAction($langs->trans('MergeThirdparties'), $langs->trans('Merge'), 'danger', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=merge&token='.newToken(), '', $permissiontodelete);
|
print dolGetButtonAction($langs->trans('MergeThirdparties'), $langs->trans('Merge'), 'danger', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=merge&token='.newToken(), '', $permissiontodelete);
|
||||||
|
|
||||||
if ($user->rights->societe->supprimer) {
|
if ($user->hasRight('societe', 'supprimer')) {
|
||||||
$deleteUrl = $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=delete&token='.newToken();
|
$deleteUrl = $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=delete&token='.newToken();
|
||||||
$buttonId = 'action-delete-no-ajax';
|
$buttonId = 'action-delete-no-ajax';
|
||||||
if ($conf->use_javascript_ajax && empty($conf->dol_use_jmobile)) { // We can't use preloaded confirm form with jmobile
|
if ($conf->use_javascript_ajax && empty($conf->dol_use_jmobile)) { // We can't use preloaded confirm form with jmobile
|
||||||
|
|||||||
@ -384,7 +384,7 @@ if (empty($reshook)) {
|
|||||||
$objectclass = 'Societe';
|
$objectclass = 'Societe';
|
||||||
$objectlabel = 'ThirdParty';
|
$objectlabel = 'ThirdParty';
|
||||||
$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';
|
||||||
@ -898,7 +898,7 @@ if ($user->rights->societe->creer) {
|
|||||||
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete', 'preaffecttag', 'preenable', 'preclose'))) {
|
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete', 'preaffecttag', 'preenable', 'preclose'))) {
|
||||||
$arrayofmassactions = array();
|
$arrayofmassactions = array();
|
||||||
}
|
}
|
||||||
if ($user->rights->societe->supprimer) {
|
if ($user->hasRight('societe', 'supprimer')) {
|
||||||
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
||||||
}
|
}
|
||||||
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
|
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user