update code toward php8 compliance
This commit is contained in:
parent
e73b8983bf
commit
b52bcf191f
@ -137,7 +137,7 @@ if (!empty($canvas)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Permissions
|
// Permissions
|
||||||
$permissiontoread = $user->rights->societe->lire;
|
$permissiontoread = $user->hasRight('societe', 'lire');
|
||||||
$permissiontoadd = $user->rights->societe->creer; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
|
$permissiontoadd = $user->rights->societe->creer; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
|
||||||
$permissiontodelete = $user->rights->societe->supprimer || ($permissiontoadd && isset($object->status) && $object->status == 0);
|
$permissiontodelete = $user->rights->societe->supprimer || ($permissiontoadd && isset($object->status) && $object->status == 0);
|
||||||
$permissionnote = $user->rights->societe->creer; // Used by the include of actions_setnotes.inc.php
|
$permissionnote = $user->rights->societe->creer; // Used by the include of actions_setnotes.inc.php
|
||||||
@ -3277,7 +3277,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
*/
|
*/
|
||||||
$filedir = $conf->societe->multidir_output[$object->entity].'/'.$object->id;
|
$filedir = $conf->societe->multidir_output[$object->entity].'/'.$object->id;
|
||||||
$urlsource = $_SERVER["PHP_SELF"]."?socid=".$object->id;
|
$urlsource = $_SERVER["PHP_SELF"]."?socid=".$object->id;
|
||||||
$genallowed = $user->rights->societe->lire;
|
$genallowed = $user->hasRight('societe', 'lire');
|
||||||
$delallowed = $user->rights->societe->creer;
|
$delallowed = $user->rights->societe->creer;
|
||||||
|
|
||||||
print $formfile->showdocuments('company', $object->id, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 0, 0, 0, 28, 0, 'entity='.$object->entity, 0, '', $object->default_lang);
|
print $formfile->showdocuments('company', $object->id, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 0, 0, 0, 28, 0, 'entity='.$object->entity, 0, '', $object->default_lang);
|
||||||
|
|||||||
@ -124,10 +124,10 @@ $result = $db->query($sql);
|
|||||||
if ($result) {
|
if ($result) {
|
||||||
while ($objp = $db->fetch_object($result)) {
|
while ($objp = $db->fetch_object($result)) {
|
||||||
$found = 0;
|
$found = 0;
|
||||||
if (isModEnabled('societe') && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS) && ($objp->client == 2 || $objp->client == 3)) {
|
if (isModEnabled('societe') && $user->hasRight('societe', 'lire') && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS) && ($objp->client == 2 || $objp->client == 3)) {
|
||||||
$found = 1; $third['prospect']++;
|
$found = 1; $third['prospect']++;
|
||||||
}
|
}
|
||||||
if (isModEnabled('societe') && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS) && ($objp->client == 1 || $objp->client == 3)) {
|
if (isModEnabled('societe') && $user->hasRight('societe', 'lire') && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS) && ($objp->client == 1 || $objp->client == 3)) {
|
||||||
$found = 1; $third['customer']++;
|
$found = 1; $third['customer']++;
|
||||||
}
|
}
|
||||||
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) && $objp->fournisseur) {
|
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) && $objp->fournisseur) {
|
||||||
@ -150,10 +150,10 @@ $thirdpartygraph .= '<tr class="liste_titre"><th colspan="2">'.$langs->trans("St
|
|||||||
if (!empty($conf->use_javascript_ajax) && ((round($third['prospect']) ? 1 : 0) + (round($third['customer']) ? 1 : 0) + (round($third['supplier']) ? 1 : 0) + (round($third['other']) ? 1 : 0) >= 2)) {
|
if (!empty($conf->use_javascript_ajax) && ((round($third['prospect']) ? 1 : 0) + (round($third['customer']) ? 1 : 0) + (round($third['supplier']) ? 1 : 0) + (round($third['other']) ? 1 : 0) >= 2)) {
|
||||||
$thirdpartygraph .= '<tr><td class="center" colspan="2">';
|
$thirdpartygraph .= '<tr><td class="center" colspan="2">';
|
||||||
$dataseries = array();
|
$dataseries = array();
|
||||||
if (isModEnabled('societe') && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS)) {
|
if (isModEnabled('societe') && $user->hasRight('societe', 'lire') && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS)) {
|
||||||
$dataseries[] = array($langs->trans("Prospects"), round($third['prospect']));
|
$dataseries[] = array($langs->trans("Prospects"), round($third['prospect']));
|
||||||
}
|
}
|
||||||
if (isModEnabled('societe') && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS)) {
|
if (isModEnabled('societe') && $user->hasRight('societe', 'lire') && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS)) {
|
||||||
$dataseries[] = array($langs->trans("Customers"), round($third['customer']));
|
$dataseries[] = array($langs->trans("Customers"), round($third['customer']));
|
||||||
}
|
}
|
||||||
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->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)) {
|
||||||
@ -173,12 +173,12 @@ if (!empty($conf->use_javascript_ajax) && ((round($third['prospect']) ? 1 : 0) +
|
|||||||
$thirdpartygraph .= $dolgraph->show();
|
$thirdpartygraph .= $dolgraph->show();
|
||||||
$thirdpartygraph .= '</td></tr>'."\n";
|
$thirdpartygraph .= '</td></tr>'."\n";
|
||||||
} else {
|
} else {
|
||||||
if (isModEnabled('societe') && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS)) {
|
if (isModEnabled('societe') && $user->hasRight('societe', 'lire') && empty($conf->global->SOCIETE_DISABLE_PROSPECTS) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS)) {
|
||||||
$statstring = "<tr>";
|
$statstring = "<tr>";
|
||||||
$statstring .= '<td><a href="'.DOL_URL_ROOT.'/societe/list.php?type=p">'.$langs->trans("Prospects").'</a></td><td class="right">'.round($third['prospect']).'</td>';
|
$statstring .= '<td><a href="'.DOL_URL_ROOT.'/societe/list.php?type=p">'.$langs->trans("Prospects").'</a></td><td class="right">'.round($third['prospect']).'</td>';
|
||||||
$statstring .= "</tr>";
|
$statstring .= "</tr>";
|
||||||
}
|
}
|
||||||
if (isModEnabled('societe') && $user->rights->societe->lire && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS)) {
|
if (isModEnabled('societe') && $user->hasRight('societe', 'lire') && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS)) {
|
||||||
$statstring .= "<tr>";
|
$statstring .= "<tr>";
|
||||||
$statstring .= '<td><a href="'.DOL_URL_ROOT.'/societe/list.php?type=c">'.$langs->trans("Customers").'</a></td><td class="right">'.round($third['customer']).'</td>';
|
$statstring .= '<td><a href="'.DOL_URL_ROOT.'/societe/list.php?type=c">'.$langs->trans("Customers").'</a></td><td class="right">'.round($third['customer']).'</td>';
|
||||||
$statstring .= "</tr>";
|
$statstring .= "</tr>";
|
||||||
|
|||||||
@ -383,7 +383,7 @@ if (empty($reshook)) {
|
|||||||
// Mass actions
|
// Mass actions
|
||||||
$objectclass = 'Societe';
|
$objectclass = 'Societe';
|
||||||
$objectlabel = 'ThirdParty';
|
$objectlabel = 'ThirdParty';
|
||||||
$permissiontoread = $user->rights->societe->lire;
|
$permissiontoread = $user->hasRight('societe', 'lire');
|
||||||
$permissiontodelete = $user->rights->societe->supprimer;
|
$permissiontodelete = $user->rights->societe->supprimer;
|
||||||
$permissiontoadd = $user->rights->societe->creer;
|
$permissiontoadd = $user->rights->societe->creer;
|
||||||
$uploaddir = $conf->societe->dir_output;
|
$uploaddir = $conf->societe->dir_output;
|
||||||
|
|||||||
@ -79,7 +79,7 @@ $extrafields->fetch_name_optionals_label($object->table_element);
|
|||||||
$hookmanager->initHooks(array('thirdpartybancard', 'globalcard'));
|
$hookmanager->initHooks(array('thirdpartybancard', 'globalcard'));
|
||||||
|
|
||||||
// Permissions
|
// Permissions
|
||||||
$permissiontoread = $user->rights->societe->lire;
|
$permissiontoread = $user->hasRight('societe', 'lire');
|
||||||
$permissiontoadd = $user->rights->societe->creer; // Used by the include of actions_addupdatedelete.inc.php and actions_builddoc.inc.php
|
$permissiontoadd = $user->rights->societe->creer; // Used by the include of actions_addupdatedelete.inc.php and actions_builddoc.inc.php
|
||||||
|
|
||||||
$permissiontoaddupdatepaymentinformation = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $permissiontoadd) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->societe->thirdparty_paymentinformation_advance->write)));
|
$permissiontoaddupdatepaymentinformation = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $permissiontoadd) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->societe->thirdparty_paymentinformation_advance->write)));
|
||||||
|
|||||||
@ -161,7 +161,7 @@ if (empty($reshook)) {
|
|||||||
// Mass actions
|
// Mass actions
|
||||||
$objectclass = 'WebsiteAccount';
|
$objectclass = 'WebsiteAccount';
|
||||||
$objectlabel = 'WebsiteAccount';
|
$objectlabel = 'WebsiteAccount';
|
||||||
$permissiontoread = $user->rights->societe->lire;
|
$permissiontoread = $user->hasRight('societe', 'lire');
|
||||||
$permissiontodelete = $user->rights->societe->supprimer;
|
$permissiontodelete = $user->rights->societe->supprimer;
|
||||||
$uploaddir = $conf->societe->multidir_output[$object->entity];
|
$uploaddir = $conf->societe->multidir_output[$object->entity];
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user