update code toward php8 compliance

This commit is contained in:
Philippe GRAND 2022-09-25 18:00:07 +02:00
parent 7d018797d0
commit 7732fabd80
3 changed files with 6 additions and 6 deletions

View File

@ -64,7 +64,7 @@ if (!isModEnabled('accounting')) {
if ($user->socid > 0) {
accessforbidden();
}
if (empty($user->rights->accounting->fiscalyear->write)) {
if (!$user->hasRight('accounting', 'fiscalyear', 'write')) {
accessforbidden();
}

View File

@ -44,7 +44,7 @@ if (!isModEnabled('accounting')) {
if ($user->socid > 0) {
accessforbidden();
}
if (empty($user->rights->accounting->mouvements->lire)) {
if (!$user->hasRight('accounting', 'mouvements', 'lire')) {
accessforbidden();
}
@ -54,7 +54,7 @@ if (empty($user->rights->accounting->mouvements->lire)) {
* Actions
*/
if ($action == 'ventil' && $user->rights->accounting->bind->write) {
if ($action == 'ventil' && $user->hasRight('accounting', 'bind', 'write')) {
if (!$cancel) {
if ($codeventil < 0) {
$codeventil = 0;

View File

@ -47,7 +47,7 @@ if (!isModEnabled('accounting')) {
if ($user->socid > 0) {
accessforbidden();
}
if (empty($user->rights->accounting->bind->write)) {
if ($user->hasRight('accounting', 'bind', 'write')) {
accessforbidden();
}
@ -84,7 +84,7 @@ if (!isModEnabled('accounting')) {
if ($user->socid > 0) {
accessforbidden();
}
if (empty($user->rights->accounting->mouvements->lire)) {
if (!$user->hasRight('accounting', 'mouvements', 'lire')) {
accessforbidden();
}
@ -93,7 +93,7 @@ if (empty($user->rights->accounting->mouvements->lire)) {
* Actions
*/
if (($action == 'clean' || $action == 'validatehistory') && $user->rights->accounting->bind->write) {
if (($action == 'clean' || $action == 'validatehistory') && $user->hasRight('accounting', 'bind', 'write')) {
// Clean database by removing binding done on non existing or no more existing accounts
$db->begin();
$sql1 = "UPDATE ".MAIN_DB_PREFIX."facturedet as fd";