mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
fix warnings
This commit is contained in:
parent
ad2d411793
commit
9bd31d2b85
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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))),
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ class FormMargin
|
|||
return;
|
||||
}
|
||||
|
||||
if (!$user->rights->margins->liretous) {
|
||||
if (empty($user->rights->margins->liretous)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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)) {
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user