Fix warning
This commit is contained in:
parent
41256352fe
commit
7d2804bd32
@ -32,18 +32,6 @@ require_once DOL_DOCUMENT_ROOT.'/margin/lib/margins.lib.php';
|
|||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array('companies', 'bills', 'products', 'margins'));
|
$langs->loadLangs(array('companies', 'bills', 'products', 'margins'));
|
||||||
|
|
||||||
// Security check
|
|
||||||
$socid = GETPOST('socid', 'int');
|
|
||||||
$TSelectedProducts = GETPOST('products', 'array');
|
|
||||||
$TSelectedCats = GETPOST('categories', 'array');
|
|
||||||
|
|
||||||
if (!empty($user->socid)) {
|
|
||||||
$socid = $user->socid;
|
|
||||||
}
|
|
||||||
$result = restrictedArea($user, 'societe', '', '');
|
|
||||||
$result = restrictedArea($user, 'margins');
|
|
||||||
|
|
||||||
|
|
||||||
// Load variable for pagination
|
// Load variable for pagination
|
||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||||
@ -74,6 +62,17 @@ if (GETPOST('enddatemonth')) {
|
|||||||
$object = new Societe($db);
|
$object = new Societe($db);
|
||||||
$hookmanager->initHooks(array('margincustomerlist'));
|
$hookmanager->initHooks(array('margincustomerlist'));
|
||||||
|
|
||||||
|
// Security check
|
||||||
|
$socid = GETPOST('socid', 'int');
|
||||||
|
$TSelectedProducts = GETPOST('products', 'array');
|
||||||
|
$TSelectedCats = GETPOST('categories', 'array');
|
||||||
|
|
||||||
|
if (!empty($user->socid)) {
|
||||||
|
$socid = $user->socid;
|
||||||
|
}
|
||||||
|
$result = restrictedArea($user, 'societe', '', '');
|
||||||
|
$result = restrictedArea($user, 'margins');
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
@ -157,7 +156,7 @@ print img_picto('', 'product').$form->multiselectarray('products', $TProducts, $
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Categories
|
// Categories
|
||||||
$TCats = $form->select_all_categories(0, array(), '', 64, 0, 1);
|
$TCats = $form->select_all_categories('product', array(), '', 64, 0, 1);
|
||||||
|
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td class="titlefield">'.$langs->trans('Category').'</td>';
|
print '<td class="titlefield">'.$langs->trans('Category').'</td>';
|
||||||
|
|||||||
@ -38,17 +38,7 @@ $ref = GETPOST('ref', 'alpha');
|
|||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$confirm = GETPOST('confirm', 'alpha');
|
$confirm = GETPOST('confirm', 'alpha');
|
||||||
$TSelectedCats = GETPOST('categories', 'array');
|
$TSelectedCats = GETPOST('categories', 'array');
|
||||||
|
$socid = 0;
|
||||||
// Security check
|
|
||||||
$fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : ''));
|
|
||||||
$fieldtype = (!empty($ref) ? 'ref' : 'rowid');
|
|
||||||
if (!empty($user->socid)) {
|
|
||||||
$socid = $user->socid;
|
|
||||||
}
|
|
||||||
$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
|
|
||||||
if (empty($user->rights->margins->liretous)) {
|
|
||||||
accessforbidden();
|
|
||||||
}
|
|
||||||
|
|
||||||
$mesg = '';
|
$mesg = '';
|
||||||
|
|
||||||
@ -85,6 +75,17 @@ if (GETPOST('enddatemonth')) {
|
|||||||
$object = new Product($db);
|
$object = new Product($db);
|
||||||
$hookmanager->initHooks(array('marginproductlist'));
|
$hookmanager->initHooks(array('marginproductlist'));
|
||||||
|
|
||||||
|
// Security check
|
||||||
|
$fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : ''));
|
||||||
|
$fieldtype = (!empty($ref) ? 'ref' : 'rowid');
|
||||||
|
if (!empty($user->socid)) {
|
||||||
|
$socid = $user->socid;
|
||||||
|
}
|
||||||
|
$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
|
||||||
|
if (empty($user->rights->margins->liretous)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
@ -119,7 +120,7 @@ print img_picto('', 'product').$form->select_produits(($id > 0 ? $id : ''), 'id'
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Categories
|
// Categories
|
||||||
$TCats = $form->select_all_categories(0, array(), '', 64, 0, 1);
|
$TCats = $form->select_all_categories('product', array(), '', 64, 0, 1);
|
||||||
|
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td class="titlefield">'.$langs->trans('Category').'</td>';
|
print '<td class="titlefield">'.$langs->trans('Category').'</td>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user