Fix: php 8.1 warnings

This commit is contained in:
hystepik 2022-12-15 14:46:29 +01:00
parent 6ca84ff554
commit 27cb4b4d86
14 changed files with 69 additions and 67 deletions

View File

@ -134,7 +134,7 @@ if ($tmp) {
* Draft customer proposals
*/
if (isModEnabled("propal") && $user->rights->propal->lire) {
if (isModEnabled("propal") && $user->hasRight("propal", "lire")) {
$sql = "SELECT p.rowid, p.ref, p.ref_client, p.total_ht, p.total_tva, p.total_ttc, p.fk_statut as status";
$sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
$sql .= ", s.code_client, s.code_compta, s.client";
@ -232,7 +232,7 @@ if (isModEnabled("propal") && $user->rights->propal->lire) {
* Draft supplier proposals
*/
if (isModEnabled('supplier_proposal') && $user->rights->supplier_proposal->lire) {
if (isModEnabled('supplier_proposal') && $user->hasRight("supplier_proposal", "lire")) {
$sql = "SELECT p.rowid, p.ref, p.total_ht, p.total_tva, p.total_ttc, p.fk_statut as status";
$sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
$sql .= ", s.code_client, s.code_compta, s.client";
@ -427,7 +427,7 @@ if (isModEnabled('commande') && $user->rights->commande->lire) {
* Draft purchase orders
*/
if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->commande->lire) || (isModEnabled("supplier_order") && $user->rights->supplier_order->lire)) {
if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "commande", "lire")) || (isModEnabled("supplier_order") && $user->hasRight("supplier_order", "lire"))) {
$sql = "SELECT cf.rowid, cf.ref, cf.ref_supplier, cf.total_ht, cf.total_tva, cf.total_ttc, cf.fk_statut as status";
$sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
$sql .= ", s.code_client, s.code_compta, s.client";
@ -819,7 +819,7 @@ if (((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERM
/*
* Latest contracts
*/
if (isModEnabled('contrat') && $user->rights->contrat->lire && 0) { // TODO A REFAIRE DEPUIS NOUVEAU CONTRAT
if (isModEnabled('contrat') && $user->hasRight("contrat", "lire") && 0) { // TODO A REFAIRE DEPUIS NOUVEAU CONTRAT
$staticcontrat = new Contrat($db);
$sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias";
@ -897,7 +897,7 @@ if (isModEnabled('contrat') && $user->rights->contrat->lire && 0) { // TODO A RE
/*
* Opened (validated) proposals
*/
if (isModEnabled("propal") && $user->rights->propal->lire) {
if (isModEnabled("propal") && $user->hasRight("propal", "lire")) {
$sql = "SELECT p.rowid as propalid, p.entity, p.total_ttc, p.total_ht, p.total_tva, p.ref, p.ref_client, p.fk_statut, p.datep as dp, p.fin_validite as dfv";
$sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
$sql .= ", s.code_client, s.code_compta, s.client";

View File

@ -1868,7 +1868,7 @@ if ($action == 'create' && $usercancreate) {
// Incoterms
if (isModEnabled('incoterm')) {
print '<tr>';
print '<td><label for="incoterm_id">'.$form->textwithpicto($langs->trans("IncotermLabel"), $objectsrc->label_incoterms, 1).'</label></td>';
print '<td><label for="incoterm_id">'.$form->textwithpicto($langs->trans("IncotermLabel"), !empty($objectsrc->fk_incoterms) ? $objectsrc->fk_incoterms : $soc->fk_incoterms, 1).'</label></td>';
print '<td class="maxwidthonsmartphone">';
$incoterm_id = GETPOST('incoterm_id');
$incoterm_location = GETPOST('location_incoterms');

View File

@ -201,10 +201,10 @@ $arrayfields = array(
'c.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1), 'position'=>110),
'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>115),
'sale_representative'=>array('label'=>"SaleRepresentativesOfThirdParty", 'checked'=>0, 'position'=>116),
'total_pa' => array('label' => (getDolGlobalString('MARGIN_TYPE') == '1' ? 'BuyingPrice' : 'CostPrice'), 'checked' => 0, 'position' => 300, 'enabled' => (!isModEnabled('margin') || !$user->rights->margins->liretous ? 0 : 1)),
'total_margin' => array('label' => 'Margin', 'checked' => 0, 'position' => 301, 'enabled' => (!isModEnabled('margin') || !$user->rights->margins->liretous ? 0 : 1)),
'total_margin_rate' => array('label' => 'MarginRate', 'checked' => 0, 'position' => 302, 'enabled' => (!isModEnabled('margin') || !$user->rights->margins->liretous || empty($conf->global->DISPLAY_MARGIN_RATES) ? 0 : 1)),
'total_mark_rate' => array('label' => 'MarkRate', 'checked' => 0, 'position' => 303, 'enabled' => (!isModEnabled('margin') || !$user->rights->margins->liretous || empty($conf->global->DISPLAY_MARK_RATES) ? 0 : 1)),
'total_pa' => array('label' => (getDolGlobalString('MARGIN_TYPE') == '1' ? 'BuyingPrice' : 'CostPrice'), 'checked' => 0, 'position' => 300, 'enabled' => (!isModEnabled('margin') || !$user->hasRight("margins", "liretous") ? 0 : 1)),
'total_margin' => array('label' => 'Margin', 'checked' => 0, 'position' => 301, 'enabled' => (!isModEnabled('margin') || !$user->hasRight("margins", "liretous") ? 0 : 1)),
'total_margin_rate' => array('label' => 'MarginRate', 'checked' => 0, 'position' => 302, 'enabled' => (!isModEnabled('margin') || !$user->hasRight("margins", "liretous") || empty($conf->global->DISPLAY_MARGIN_RATES) ? 0 : 1)),
'total_mark_rate' => array('label' => 'MarkRate', 'checked' => 0, 'position' => 303, 'enabled' => (!isModEnabled('margin') || !$user->hasRight("margins", "liretous") || empty($conf->global->DISPLAY_MARK_RATES) ? 0 : 1)),
'c.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>120),
'c.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>125),
'c.date_cloture'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>130),
@ -298,19 +298,19 @@ if (empty($reshook)) {
// Mass actions
$objectclass = 'Commande';
$objectlabel = 'Orders';
$permissiontoread = $user->rights->commande->lire;
$permissiontoadd = $user->rights->commande->creer;
$permissiontodelete = $user->rights->commande->supprimer;
$permissiontoread = $user->hasRight("commande", "lire");
$permissiontoadd = $user->hasRight("commande", "creer");
$permissiontodelete = $user->hasRight("commande", "supprimer");
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
$permissiontovalidate = $user->rights->commande->order_advance->validate;
$permissiontoclose = $user->rights->commande->order_advance->close;
$permissiontocancel = $user->rights->commande->order_advance->annuler;
$permissiontosendbymail = $user->rights->commande->order_advance->send;
$permissiontovalidate = $user->hasRight("commande", "order_advance", "validate");
$permissiontoclose = $user->hasRight("commande", "order_advance", "close");
$permissiontocancel = $user->hasRight("commande", "order_advance", "annuler");
$permissiontosendbymail = $user->hasRight("commande", "order_advance", "send");
} else {
$permissiontovalidate = $user->rights->commande->creer;
$permissiontoclose = $user->rights->commande->creer;
$permissiontocancel = $user->rights->commande->creer;
$permissiontosendbymail = $user->rights->commande->creer;
$permissiontovalidate = $user->hasRight("commande", "creer");
$permissiontoclose = $user->hasRight("commande", "creer");
$permissiontocancel = $user->hasRight("commande", "creer");
$permissiontosendbymail = $user->hasRight("commande", "creer");
}
$uploaddir = $conf->commande->multidir_output[$conf->entity];
$triggersendname = 'ORDER_SENTBYMAIL';
@ -1287,7 +1287,7 @@ if ($resql) {
if ($permissiontocancel) {
$arrayofmassactions['cancelorders'] = img_picto('', 'close_title', 'class="pictofixedwidth"').$langs->trans("Cancel");
}
if (isModEnabled('facture') && $user->rights->facture->creer) {
if (isModEnabled('facture') && $user->hasRight("facture", "creer")) {
$arrayofmassactions['createbills'] = img_picto('', 'bill', 'class="pictofixedwidth"').$langs->trans("CreateInvoiceForThisCustomer");
}
if ($permissiontoclose) {
@ -1394,7 +1394,7 @@ if ($resql) {
$moreforfilter = '';
// If the user can view prospects? sales other than his own
if ($user->rights->user->user->lire) {
if ($user->hasRight("user", "user", "lire")) {
$langs->load("commercial");
$moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('ThirdPartiesOfSaleRepresentative');
@ -1402,7 +1402,7 @@ if ($resql) {
$moreforfilter .= '</div>';
}
// If the user can view other users
if ($user->rights->user->user->lire) {
if ($user->hasRight("user", "user", "lire")) {
$moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('LinkedToSpecificUsers');
$moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_user, 'search_user', $tmptitle, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth250 widthcentpercentminusx');
@ -1410,7 +1410,7 @@ if ($resql) {
}
// If the user can view other products/services than his own
if (isModEnabled('categorie') && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) {
if (isModEnabled('categorie') && $user->hasRight("categorie", "lire") && ($user->hasRight("produit", "lire") || $user->hasRight("service", "lire"))) {
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('IncludingProductWithTag');
@ -1419,7 +1419,7 @@ if ($resql) {
$moreforfilter .= '</div>';
}
// If Categories are enabled & user has rights to see
if (isModEnabled('categorie') && $user->rights->categorie->lire) {
if (isModEnabled('categorie') && $user->hasRight("categorie", "lire")) {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('CustomersProspectsCategoriesShort');

View File

@ -376,9 +376,9 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter',
if (empty($reshook)) {
$objectclass = 'Facture';
$objectlabel = 'Invoices';
$permissiontoread = $user->rights->facture->lire;
$permissiontoadd = $user->rights->facture->creer;
$permissiontodelete = $user->rights->facture->supprimer;
$permissiontoread = $user->hasRight("facture", "lire");
$permissiontoadd = $user->hasRight("facture", "creer");
$permissiontodelete = $user->hasRight("facture", "supprimer");
$uploaddir = $conf->facture->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
}
@ -1185,7 +1185,7 @@ if ($resql) {
if (!empty($socid)) {
$url .= '&socid='.$socid;
}
$newcardbutton = dolGetButtonTitle($langs->trans('NewBill'), '', 'fa fa-plus-circle', $url, '', $user->rights->facture->creer);
$newcardbutton = dolGetButtonTitle($langs->trans('NewBill'), '', 'fa fa-plus-circle', $url, '', $user->hasRight("facture", "creer"));
}
$i = 0;
@ -1237,7 +1237,7 @@ if ($resql) {
// If the user can view prospects other than his'
$moreforfilter = '';
if ($user->rights->user->user->lire) {
if ($user->hasRight("user", "user", "lire")) {
$langs->load("commercial");
$moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('ThirdPartiesOfSaleRepresentative');
@ -1245,14 +1245,14 @@ if ($resql) {
$moreforfilter .= '</div>';
}
// If the user can view prospects other than his'
if ($user->rights->user->user->lire) {
if ($user->hasRight("user", "user", "lire")) {
$moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('LinkedToSpecificUsers');
$moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_user, 'search_user', $tmptitle, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth250');
$moreforfilter .= '</div>';
}
// Filter on product tags
if (isModEnabled('categorie') && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) {
if (isModEnabled('categorie') && $user->hasRight("categorie", "lire") && ($user->hasRight("produit", "lire") || $user->hasRight("service", "lire"))) {
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('IncludingProductWithTag');
@ -1260,7 +1260,7 @@ if ($resql) {
$moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmptitle, 0, 0, '', 0, 0, 0, 0, 'maxwidth250', 1);
$moreforfilter .= '</div>';
}
if (isModEnabled('categorie') && $user->rights->categorie->lire) {
if (isModEnabled('categorie') && $user->hasRight("categorie", "lire")) {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('CustomersProspectsCategoriesShort');
@ -2574,8 +2574,8 @@ if ($resql) {
$urlsource .= str_replace('&amp;', '&', $param);
$filedir = $diroutputmassaction;
$genallowed = $user->rights->facture->lire;
$delallowed = $user->rights->facture->creer;
$genallowed = $user->hasRight("facture", "lire");
$delallowed = $user->hasRight("facture", "creer");
$title = '';
print $formfile->showdocuments('massfilesarea_invoices', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty);

View File

@ -281,7 +281,7 @@ if (isModEnabled('facture') && !empty($user->rights->facture->lire)) {
// Last modified supplier invoices
if ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire) || (isModEnabled('supplier_invoice') && $user->rights->supplier_invoice->lire)) {
if ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire")) || (isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) {
$langs->load("boxes");
$facstatic = new FactureFournisseur($db);
@ -590,7 +590,7 @@ if (isModEnabled('tax') && !empty($user->rights->tax->charges->lire)) {
/*
* Customers orders to be billed
*/
if (isModEnabled('facture') && isModEnabled('commande') && $user->rights->commande->lire && empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) {
if (isModEnabled('facture') && isModEnabled('commande') && $user->hasRight("commande", "lire") && empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) {
$commandestatic = new Commande($db);
$langs->load("orders");

View File

@ -362,31 +362,31 @@ if ($type == 'directory') {
if ($module == 'medias') {
$useinecm = 6;
$modulepart = 'medias';
$perm = ($user->rights->website->write || $user->rights->emailing->creer);
$perm = ($user->hasRight("website", "write") || $user->hasRight("emailing", "creer"));
$title = 'none';
} elseif ($module == 'ecm') { // DMS/ECM -> manual structure
if ($user->rights->ecm->read) {
if ($user->hasRight("ecm", "read")) {
// Buttons: Preview
$useinecm = 2;
}
if ($user->rights->ecm->upload) {
if ($user->hasRight("ecm", "upload")) {
// Buttons: Preview + Delete
$useinecm = 4;
}
if ($user->rights->ecm->setup) {
if ($user->hasRight("ecm", "setup")) {
// Buttons: Preview + Delete + Edit
$useinecm = 5;
}
$perm = $user->rights->ecm->upload;
$perm = $user->hasRight("ecm", "upload");
$modulepart = 'ecm';
$title = ''; // Use default
} else {
$useinecm = 5;
$modulepart = 'ecm';
$perm = $user->rights->ecm->upload;
$perm = $user->hasRight("ecm", "upload");
$title = ''; // Use default
}

View File

@ -84,7 +84,7 @@ class box_activity extends ModeleBoxes
$totalnb = 0;
$line = 0;
$cachetime = 3600;
$fileid = '-e'.$conf->entity.'-u'.$user->id.'-s'.$user->socid.'-r'.($user->rights->societe->client->voir ? '1' : '0').'.cache';
$fileid = '-e'.$conf->entity.'-u'.$user->id.'-s'.$user->socid.'-r'.($user->hasRight("societe", "client", "voir") ? '1' : '0').'.cache';
$now = dol_now();
$nbofperiod = 3;
@ -102,7 +102,7 @@ class box_activity extends ModeleBoxes
// list the summary of the propals
if (isModEnabled("propal") && $user->rights->propal->lire) {
if (isModEnabled("propal") && $user->hasRight("propal", "lire")) {
include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
$propalstatic = new Propal($this->db);
@ -189,7 +189,7 @@ class box_activity extends ModeleBoxes
}
// list the summary of the orders
if (isModEnabled('commande') && $user->rights->commande->lire) {
if (isModEnabled('commande') && $user->hasRight("commande", "lire")) {
include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
$commandestatic = new Commande($this->db);
@ -278,7 +278,7 @@ class box_activity extends ModeleBoxes
// list the summary of the bills
if (isModEnabled('facture') && $user->rights->facture->lire) {
if (isModEnabled('facture') && $user->hasRight("facture", "lire")) {
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$facturestatic = new Facture($this->db);

View File

@ -5047,9 +5047,9 @@ class Form
$morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : '');
if ($input['type'] == 'text') {
$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd"><input type="text" class="flat'.$morecss.'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$size.' value="'.$input['value'].'"'.$moreattr.' /></div></div>'."\n";
$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd"><input type="text" class="flat'.$morecss.'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$size.' value="'.(empty($input['value']) ? '' : $input['value']).'"'.$moreattr.' /></div></div>'."\n";
} elseif ($input['type'] == 'password') {
$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd"><input type="password" class="flat'.$morecss.'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$size.' value="'.$input['value'].'"'.$moreattr.' /></div></div>'."\n";
$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd"><input type="password" class="flat'.$morecss.'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$size.' value="'.(empty($input['value']) ? '' : $input['value']).'"'.$moreattr.' /></div></div>'."\n";
} elseif ($input['type'] == 'textarea') {
/*$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd">';
$more .= '<textarea name="'.$input['name'].'" class="'.$morecss.'"'.$moreattr.'>';

View File

@ -44,13 +44,13 @@ $permtoadd = 0;
$permtoupload = 0;
$showroot = 0;
if ($module == 'ecm') {
$permtoadd = $user->rights->ecm->setup;
$permtoupload = $user->rights->ecm->upload;
$permtoadd = $user->hasRight("ecm", "setup");
$permtoupload = $user->hasRight("ecm", "upload");
$showroot = 0;
}
if ($module == 'medias') {
$permtoadd = ($user->rights->mailing->creer || $user->rights->website->write);
$permtoupload = ($user->rights->mailing->creer || $user->rights->website->write);
$permtoadd = ($user->hasRight("mailing", "creer") || $user->hasRight("website", "write"));
$permtoupload = ($user->hasRight("mailing", "creer") || $user->hasRight("website", "write"));
$showroot = 1;
}

View File

@ -94,14 +94,14 @@ $permissiontoread = 0;
$permissiontoadd = 0;
$permissiontoupload = 0;
if ($module == 'ecm') {
$permissiontoread = $user->rights->ecm->read;
$permissiontoadd = $user->rights->ecm->setup;
$permissiontoupload = $user->rights->ecm->upload;
$permissiontoread = $user->hasRight("ecm", "read");
$permissiontoadd = $user->hasRight("ecm", "setup");
$permissiontoupload = $user->hasRight("ecm", "upload");
}
if ($module == 'medias') {
$permissiontoread = ($user->rights->mailing->lire || $user->rights->website->read);
$permissiontoadd = ($user->rights->mailing->creer || $user->rights->website->write);
$permissiontoupload = ($user->rights->mailing->creer || $user->rights->website->write);
$permissiontoread = ($user->hasRight("mailing", "lire") || $user->hasRight("website", "read"));
$permissiontoadd = ($user->hasRight("mailing", "creer") || $user->hasRight("website", "write"));
$permissiontoupload = ($user->hasRight("mailing", "creer") || $user->hasRight("website", "write"));
}
if (!$permissiontoread) {

View File

@ -37,6 +37,7 @@ $langs->loadLangs(array('ecm', 'companies', 'other', 'users', 'orders', 'propal'
// Get parameters
$action = GETPOST('action', 'aZ09');
$backtopage = GETPOST('backtopage', 'alpha');
$socid = GETPOST('socid', 'int');
$file_manager = GETPOST('file_manager', 'alpha');
@ -50,6 +51,7 @@ $overwritefile = GETPOST('overwritefile', 'int');
if (empty($action) && $file_manager) {
$action = 'file_manager';
}
$pageid = GETPOST('pageid', 'int');
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');

View File

@ -184,7 +184,7 @@ if (!empty($conf->use_javascript_ajax) && ((round($third['prospect']) ? 1 : 0) +
$statstring .= "</tr>";
}
$statstring2 = '';
if (((isModEnabled('fournisseur') && $user->rights->fournisseur->facture->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (isModEnabled('supplier_order') && $user->rights->supplier_order->lire) || (isModEnabled('supplier_invoice') && $user->rights->supplier_invoice->lire)) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS)) {
if (((isModEnabled('fournisseur') && $user->hasRight('fournisseur', 'facture', 'lire') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (isModEnabled('supplier_order') && $user->hasRight('supplier_order', 'lire')) || (isModEnabled('supplier_invoice') && $user->hasRight('supplier_invoice', 'lire'))) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS)) {
$statstring2 = "<tr>";
$statstring2 .= '<td><a href="'.DOL_URL_ROOT.'/societe/list.php?type=f">'.$langs->trans("Suppliers").'</a></td><td class="right">'.round($third['supplier']).'</td>';
$statstring2 .= "</tr>";

View File

@ -1026,7 +1026,7 @@ if ($search_all) {
// Filter on categories
$moreforfilter = '';
if (empty($type) || $type == 'c' || $type == 'p') {
if (isModEnabled('categorie') && $user->rights->categorie->lire) {
if (isModEnabled('categorie') && $user->hasRight("categorie", "lire")) {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('Categories');
@ -1037,7 +1037,7 @@ if (empty($type) || $type == 'c' || $type == 'p') {
}
if (empty($type) || $type == 'f') {
if (isModEnabled("fournisseur") && isModEnabled('categorie') && $user->rights->categorie->lire) {
if (isModEnabled("fournisseur") && isModEnabled('categorie') && $user->hasRight("categorie", "lire")) {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('Categories');
@ -1048,7 +1048,7 @@ if (empty($type) || $type == 'f') {
}
// If the user can view prospects other than his'
if ($user->rights->societe->client->voir || $socid) {
if ($user->hasRight("societe", "client", "voir") || $socid) {
$moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('SalesRepresentatives');
$moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"');

View File

@ -71,7 +71,7 @@ if ($id > 0 || $ref) {
}
$selectedvariant = !empty($_SESSION['addvariant_'.$object->id]) ? $_SESSION['addvariant_'.$object->id] : array();
$selected = "";
// Security check
if (!isModEnabled('variants')) {
accessforbidden('Module not enabled');
@ -140,7 +140,7 @@ $productCombination2ValuePairs1 = array();
if (($action == 'add' || $action == 'create') && empty($massaction) && !GETPOST('selectvariant', 'alpha') && empty($subaction)) { // We click on Create all defined combinations
//$features = GETPOST('features', 'array');
$features = $_SESSION['addvariant_'.$object->id];
$features = !empty($_SESSION['addvariant_'.$object->id]) ? $_SESSION['addvariant_'.$object->id] : array();
if (!$features) {
if ($action == 'create') {
@ -474,7 +474,7 @@ if (!empty($id) || !empty($ref)) {
if ($action == 'add') {
$title = $langs->trans('NewProductCombination');
// print dol_get_fiche_head();
$features = $_SESSION['addvariant_'.$object->id];
$features = !empty($_SESSION['addvariant_'.$object->id]) ? $_SESSION['addvariant_'.$object->id] : array();
//First, sanitize
$listofvariantselected = '<div id="parttoaddvariant">';
if (!empty($features)) {