fix warnings

This commit is contained in:
Frédéric FRANCE 2021-10-23 07:13:08 +02:00
parent ad2d411793
commit 9bd31d2b85
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
17 changed files with 23 additions and 23 deletions

View File

@ -52,7 +52,7 @@ $langs->loadLangs(array("admin", "compta"));
if ($user->socid > 0) {
accessforbidden();
}
if (!$user->rights->accounting->fiscalyear->write) { // If we can read accounting records, we should be able to see fiscal year.
if (empty($user->rights->accounting->fiscalyear->write)) { // If we can read accounting records, we should be able to see fiscal year.
accessforbidden();
}

View File

@ -33,7 +33,7 @@ $langs->loadLangs(array("admin", "compta"));
if ($user->socid > 0) {
accessforbidden();
}
if (!$user->rights->accounting->fiscalyear->write) {
if (empty($user->rights->accounting->fiscalyear->write)) {
accessforbidden();
}

View File

@ -63,7 +63,7 @@ if (empty($conf->accounting->enabled)) {
if ($user->socid > 0) {
accessforbidden();
}
if (!$user->rights->accounting->fiscalyear->write) {
if (empty($user->rights->accounting->fiscalyear->write)) {
accessforbidden();
}

View File

@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
// Load translation files required by the page
$langs->loadLangs(array("admin", "other", "blockedlog", "bills"));
if ((!$user->admin && !$user->rights->blockedlog->read) || empty($conf->blockedlog->enabled)) {
if ((!$user->admin && empty($user->rights->blockedlog->read)) || empty($conf->blockedlog->enabled)) {
accessforbidden();
}

View File

@ -43,7 +43,7 @@ require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/blockedlog.class.php';
$id = GETPOST('id', 'int');
$block = new BlockedLog($db);
if ((!$user->admin && !$user->rights->blockedlog->read) || empty($conf->blockedlog->enabled)) {
if ((!$user->admin && empty($user->rights->blockedlog->read)) || empty($conf->blockedlog->enabled)) {
accessforbidden();
}

View File

@ -42,7 +42,7 @@ $mode = GETPOSTISSET("mode") ? GETPOST("mode", 'aZ09') : 'customer';
if ($mode == 'customer' && !$user->rights->commande->lire) {
accessforbidden();
}
if ($mode == 'supplier' && !$user->rights->fournisseur->commande->lire) {
if ($mode == 'supplier' && empty($user->rights->fournisseur->commande->lire)) {
accessforbidden();
}

View File

@ -242,10 +242,10 @@ $arrayfields = array(
'f.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>292),
'multicurrency_dynamount_payed'=>array('label'=>'MulticurrencyAlreadyPaid', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>295),
'multicurrency_rtp'=>array('label'=>'MulticurrencyRemainderToPay', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>296), // Not enabled by default because slow
'total_pa' => array('label' => ($conf->global->MARGIN_TYPE == '1' ? 'BuyingPrice' : 'CostPrice'), 'checked' => 0, 'position' => 300, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous ? 0 : 1)),
'total_margin' => array('label' => 'Margin', 'checked' => 0, 'position' => 301, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous ? 0 : 1)),
'total_margin_rate' => array('label' => 'MarginRate', 'checked' => 0, 'position' => 302, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous || empty($conf->global->DISPLAY_MARGIN_RATES) ? 0 : 1)),
'total_mark_rate' => array('label' => 'MarkRate', 'checked' => 0, 'position' => 303, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous || empty($conf->global->DISPLAY_MARK_RATES) ? 0 : 1)),
'total_pa' => array('label' => ($conf->global->MARGIN_TYPE == '1' ? 'BuyingPrice' : 'CostPrice'), 'checked' => 0, 'position' => 300, 'enabled' => (empty($conf->margin->enabled) || empty($user->rights->margins->liretous) ? 0 : 1)),
'total_margin' => array('label' => 'Margin', 'checked' => 0, 'position' => 301, 'enabled' => (empty($conf->margin->enabled) || empty($user->rights->margins->liretous) ? 0 : 1)),
'total_margin_rate' => array('label' => 'MarginRate', 'checked' => 0, 'position' => 302, 'enabled' => (empty($conf->margin->enabled) || empty($user->rights->margins->liretous) || empty($conf->global->DISPLAY_MARGIN_RATES) ? 0 : 1)),
'total_mark_rate' => array('label' => 'MarkRate', 'checked' => 0, 'position' => 303, 'enabled' => (empty($conf->margin->enabled) || empty($user->rights->margins->liretous) || empty($conf->global->DISPLAY_MARK_RATES) ? 0 : 1)),
'f.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500),
'f.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>502),
'f.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'position'=>510, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PUBLIC_NOTES))),

View File

@ -71,7 +71,7 @@ $hookmanager->initHooks(array('directdebitcard', 'globalcard'));
if ($type == 'bank-transfer') {
$result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture', 'fk_soc', $fieldid, $isdraft);
if (!$user->rights->fournisseur->facture->lire) {
if (empty($user->rights->fournisseur->facture->lire)) {
accessforbidden();
}
} else {

View File

@ -46,7 +46,7 @@ $mode = GETPOST("mode") ? GETPOST("mode") : 'customer';
if ($mode == 'customer' && !$user->rights->facture->lire) {
accessforbidden();
}
if ($mode == 'supplier' && !$user->rights->fournisseur->facture->lire) {
if ($mode == 'supplier' && empty($user->rights->fournisseur->facture->lire)) {
accessforbidden();
}

View File

@ -291,7 +291,7 @@ class Fiscalyear extends CommonObject
$url = DOL_URL_ROOT.'/accountancy/admin/fiscalyear_card.php?id='.$this->id;
if (!$user->rights->accounting->fiscalyear->write) {
if (empty($user->rights->accounting->fiscalyear->write)) {
$option = 'nolink';
}

View File

@ -207,7 +207,7 @@ class FormMargin
return;
}
if (!$user->rights->margins->liretous) {
if (empty($user->rights->margins->liretous)) {
return;
}

View File

@ -279,7 +279,7 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
}
if ($feature == 'societe') {
if (empty($user->rights->societe->lire) && !$user->rights->fournisseur->lire) {
if (empty($user->rights->societe->lire) && empty($user->rights->fournisseur->lire)) {
$readok = 0;
$nbko++;
}
@ -314,7 +314,7 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
$nbko++;
}
} elseif ($feature == 'payment_supplier') {
if (!$user->rights->fournisseur->facture->lire) {
if (empty($user->rights->fournisseur->facture->lire)) {
$readok = 0;
$nbko++;
}

View File

@ -98,7 +98,7 @@ if ($modulepart == 'produit' || $modulepart == 'product' || $modulepart == 'serv
$accessallowed = 1;
} elseif ($modulepart == 'facture_fourn' || $modulepart == 'facture_fournisseur') {
$result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture');
if (!$user->rights->fournisseur->facture->lire) {
if (empty($user->rights->fournisseur->facture->lire)) {
accessforbidden();
}
$accessallowed = 1;

View File

@ -74,7 +74,7 @@ if ($user->socid) {
}
$result = restrictedArea($user, 'fournisseur', $id, 'commande_fournisseur', 'commande');
if (!$user->rights->fournisseur->commande->lire) {
if (empty($user->rights->fournisseur->commande->lire)) {
accessforbidden();
}

View File

@ -418,10 +418,10 @@ if ($result || empty($id)) {
if ($graphfiles == 'proposals_suppliers' && !$user->rights->supplier_proposal->lire) {
continue;
}
if ($graphfiles == 'invoices_suppliers' && !$user->rights->fournisseur->facture->lire) {
if ($graphfiles == 'invoices_suppliers' && empty($user->rights->fournisseur->facture->lire)) {
continue;
}
if ($graphfiles == 'orders_suppliers' && !$user->rights->fournisseur->commande->lire) {
if ($graphfiles == 'orders_suppliers' && empty($user->rights->fournisseur->commande->lire)) {
continue;
}
if ($graphfiles == 'mrp' && empty($user->rights->mrp->mo->read)) {

View File

@ -104,7 +104,7 @@ if (empty($user->rights->societe->client->voir) && !$socid) {
if ($socid > 0) {
$sql .= " AND s.rowid = ".((int) $socid);
}
if (!$user->rights->fournisseur->lire) {
if (empty($user->rights->fournisseur->lire)) {
$sql .= " AND (s.fournisseur <> 1 OR s.client <> 0)"; // client=0, fournisseur=0 must be visible
}
//print $sql;
@ -287,7 +287,7 @@ if (empty($user->rights->societe->client->voir) && !$socid) {
if ($socid) {
$sql .= " AND s.rowid = ".((int) $socid);
}
if (!$user->rights->fournisseur->lire) {
if (empty($user->rights->fournisseur->lire)) {
$sql .= " AND (s.fournisseur != 1 OR s.client != 0)";
}
$sql .= $db->order("s.tms", "DESC");

View File

@ -520,7 +520,7 @@ if (empty($user->rights->societe->client->voir) && !$socid) {
if ($search_sale && $search_sale != '-1' && $search_sale != '-2') {
$sql .= " AND s.rowid = sc.fk_soc"; // Join for the needed table to filter by sale
}
if (!$user->rights->fournisseur->lire) {
if (empty($user->rights->fournisseur->lire)) {
$sql .= " AND (s.fournisseur <> 1 OR s.client <> 0)"; // client=0, fournisseur=0 must be visible
}
if ($search_sale == -2) {