FIX WIP avoid warning with php 8.0
This commit is contained in:
parent
4a8e72c997
commit
6e0832fb38
@ -83,7 +83,7 @@ class box_commandes extends ModeleBoxes
|
|||||||
$societestatic = new Societe($this->db);
|
$societestatic = new Societe($this->db);
|
||||||
$userstatic = new User($this->db);
|
$userstatic = new User($this->db);
|
||||||
|
|
||||||
$this->info_box_head = array('text' => $langs->trans("BoxTitleLast".($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE ? "" : "Modified")."CustomerOrders", $max));
|
$this->info_box_head = array('text' => $langs->trans("BoxTitleLast".(!empty($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE) ? "" : "Modified")."CustomerOrders", $max));
|
||||||
|
|
||||||
if ($user->rights->commande->lire)
|
if ($user->rights->commande->lire)
|
||||||
{
|
{
|
||||||
@ -108,7 +108,7 @@ class box_commandes extends ModeleBoxes
|
|||||||
if (!empty($conf->global->ORDER_BOX_LAST_ORDERS_VALIDATED_ONLY)) $sql .= " AND c.fk_statut = 1";
|
if (!empty($conf->global->ORDER_BOX_LAST_ORDERS_VALIDATED_ONLY)) $sql .= " AND c.fk_statut = 1";
|
||||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||||
if ($user->socid) $sql .= " AND s.rowid = ".$user->socid;
|
if ($user->socid) $sql .= " AND s.rowid = ".$user->socid;
|
||||||
if ($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE) $sql .= " ORDER BY c.date_commande DESC, c.ref DESC ";
|
if (!empty($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE)) $sql .= " ORDER BY c.date_commande DESC, c.ref DESC ";
|
||||||
else $sql .= " ORDER BY c.tms DESC, c.ref DESC ";
|
else $sql .= " ORDER BY c.tms DESC, c.ref DESC ";
|
||||||
$sql .= $this->db->plimit($max, 0);
|
$sql .= $this->db->plimit($max, 0);
|
||||||
|
|
||||||
|
|||||||
@ -92,7 +92,7 @@ class box_contracts extends ModeleBoxes
|
|||||||
$sql .= " AND c.entity = ".$conf->entity;
|
$sql .= " AND c.entity = ".$conf->entity;
|
||||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||||
if ($user->socid) $sql .= " AND s.rowid = ".$user->socid;
|
if ($user->socid) $sql .= " AND s.rowid = ".$user->socid;
|
||||||
if ($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE) $sql .= " ORDER BY c.date_contrat DESC, c.ref DESC ";
|
if (! empty($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE)) $sql .= " ORDER BY c.date_contrat DESC, c.ref DESC ";
|
||||||
else $sql .= " ORDER BY c.tms DESC, c.ref DESC ";
|
else $sql .= " ORDER BY c.tms DESC, c.ref DESC ";
|
||||||
$sql .= $this->db->plimit($max, 0);
|
$sql .= $this->db->plimit($max, 0);
|
||||||
|
|
||||||
|
|||||||
@ -81,7 +81,7 @@ class box_factures extends ModeleBoxes
|
|||||||
|
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
|
|
||||||
$text = $langs->trans("BoxTitleLast".($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE ? "" : "Modified")."CustomerBills", $max);
|
$text = $langs->trans("BoxTitleLast".(!empty($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE) ? "" : "Modified")."CustomerBills", $max);
|
||||||
$this->info_box_head = array(
|
$this->info_box_head = array(
|
||||||
'text' => $text,
|
'text' => $text,
|
||||||
'limit'=> dol_strlen($text)
|
'limit'=> dol_strlen($text)
|
||||||
@ -106,7 +106,7 @@ class box_factures extends ModeleBoxes
|
|||||||
$sql .= " AND f.entity IN (".getEntity('invoice').")";
|
$sql .= " AND f.entity IN (".getEntity('invoice').")";
|
||||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||||
if ($user->socid) $sql .= " AND s.rowid = ".$user->socid;
|
if ($user->socid) $sql .= " AND s.rowid = ".$user->socid;
|
||||||
if ($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE) $sql .= " ORDER BY f.datef DESC, f.ref DESC ";
|
if (!empty($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE)) $sql .= " ORDER BY f.datef DESC, f.ref DESC ";
|
||||||
else $sql .= " ORDER BY f.tms DESC, f.ref DESC ";
|
else $sql .= " ORDER BY f.tms DESC, f.ref DESC ";
|
||||||
$sql .= $this->db->plimit($max, 0);
|
$sql .= $this->db->plimit($max, 0);
|
||||||
|
|
||||||
|
|||||||
@ -81,7 +81,7 @@ class box_factures_fourn extends ModeleBoxes
|
|||||||
$thirdpartystatic = new Fournisseur($this->db);
|
$thirdpartystatic = new Fournisseur($this->db);
|
||||||
|
|
||||||
$this->info_box_head = array(
|
$this->info_box_head = array(
|
||||||
'text' => $langs->trans("BoxTitleLast".($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE ? "" : "Modified")."SupplierBills", $max)
|
'text' => $langs->trans("BoxTitleLast".(!empty($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE) ? "" : "Modified")."SupplierBills", $max)
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($user->rights->fournisseur->facture->lire)
|
if ($user->rights->fournisseur->facture->lire)
|
||||||
@ -104,7 +104,7 @@ class box_factures_fourn extends ModeleBoxes
|
|||||||
$sql .= " AND f.entity = ".$conf->entity;
|
$sql .= " AND f.entity = ".$conf->entity;
|
||||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||||
if ($user->socid) $sql .= " AND s.rowid = ".$user->socid;
|
if ($user->socid) $sql .= " AND s.rowid = ".$user->socid;
|
||||||
if ($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE) $sql .= " ORDER BY f.datef DESC, f.ref DESC ";
|
if (!empty($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE)) $sql .= " ORDER BY f.datef DESC, f.ref DESC ";
|
||||||
else $sql .= " ORDER BY f.tms DESC, f.ref DESC ";
|
else $sql .= " ORDER BY f.tms DESC, f.ref DESC ";
|
||||||
$sql .= $this->db->plimit($max, 0);
|
$sql .= $this->db->plimit($max, 0);
|
||||||
|
|
||||||
|
|||||||
@ -112,10 +112,10 @@ class box_graph_invoices_permonth extends ModeleBoxes
|
|||||||
$shownb = GETPOST($param_shownb, 'alpha');
|
$shownb = GETPOST($param_shownb, 'alpha');
|
||||||
$showtot = GETPOST($param_showtot, 'alpha');
|
$showtot = GETPOST($param_showtot, 'alpha');
|
||||||
} else {
|
} else {
|
||||||
$tmparray = json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode], true);
|
$tmparray = (!empty($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode]) ? json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode], true) : array());
|
||||||
$endyear = $tmparray['year'];
|
$endyear = (!empty($tmparray['year']) ? $tmparray['year'] : '');
|
||||||
$shownb = $tmparray['shownb'];
|
$shownb = (!empty($tmparray['shownb']) ? $tmparray['shownb'] : '');
|
||||||
$showtot = $tmparray['showtot'];
|
$showtot = (!empty($tmparray['showtot']) ? $tmparray['showtot'] : '');
|
||||||
}
|
}
|
||||||
if (empty($shownb) && empty($showtot)) { $shownb = 1; $showtot = 1; }
|
if (empty($shownb) && empty($showtot)) { $shownb = 1; $showtot = 1; }
|
||||||
$nowarray = dol_getdate(dol_now(), true);
|
$nowarray = dol_getdate(dol_now(), true);
|
||||||
|
|||||||
@ -109,13 +109,14 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
|
|||||||
$shownb = GETPOST($param_shownb, 'alpha');
|
$shownb = GETPOST($param_shownb, 'alpha');
|
||||||
$showtot = GETPOST($param_showtot, 'alpha');
|
$showtot = GETPOST($param_showtot, 'alpha');
|
||||||
} else {
|
} else {
|
||||||
$tmparray = json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode], true);
|
$tmparray = (!empty($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode]) ? json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode], true) : array());
|
||||||
$endyear = $tmparray['year'];
|
$endyear = (!empty($tmparray['year']) ? $tmparray['year'] : '');
|
||||||
$shownb = $tmparray['shownb'];
|
$shownb = (!empty($tmparray['shownb']) ? $tmparray['shownb'] : '');
|
||||||
$showtot = $tmparray['showtot'];
|
$showtot = (!empty($tmparray['showtot']) ? $tmparray['showtot'] : '');
|
||||||
}
|
}
|
||||||
if (empty($shownb) && empty($showtot)) { $shownb = 1; $showtot = 1; }
|
if (empty($shownb) && empty($showtot)) { $shownb = 1; $showtot = 1; }
|
||||||
$nowarray = dol_getdate(dol_now(), true);
|
$nowarray = dol_getdate(dol_now(), true);
|
||||||
|
if (empty($year)) $year = $nowarray['year'];
|
||||||
if (empty($endyear)) $endyear = $nowarray['year'];
|
if (empty($endyear)) $endyear = $nowarray['year'];
|
||||||
$startyear = $endyear - 1;
|
$startyear = $endyear - 1;
|
||||||
$mode = 'supplier';
|
$mode = 'supplier';
|
||||||
|
|||||||
@ -112,10 +112,10 @@ class box_graph_orders_permonth extends ModeleBoxes
|
|||||||
$shownb = GETPOST($param_shownb, 'alpha');
|
$shownb = GETPOST($param_shownb, 'alpha');
|
||||||
$showtot = GETPOST($param_showtot, 'alpha');
|
$showtot = GETPOST($param_showtot, 'alpha');
|
||||||
} else {
|
} else {
|
||||||
$tmparray = json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode], true);
|
$tmparray = (!empty($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode]) ? json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode], true) : array());
|
||||||
$endyear = $tmparray['year'];
|
$endyear = (!empty($tmparray['year']) ? $tmparray['year'] : '');
|
||||||
$shownb = $tmparray['shownb'];
|
$shownb = (!empty($tmparray['shownb']) ? $tmparray['shownb'] : '');
|
||||||
$showtot = $tmparray['showtot'];
|
$showtot = (!empty($tmparray['showtot']) ? $tmparray['showtot'] : '');
|
||||||
}
|
}
|
||||||
if (empty($shownb) && empty($showtot)) { $shownb = 1; $showtot = 1; }
|
if (empty($shownb) && empty($showtot)) { $shownb = 1; $showtot = 1; }
|
||||||
$nowarray = dol_getdate(dol_now(), true);
|
$nowarray = dol_getdate(dol_now(), true);
|
||||||
|
|||||||
@ -111,10 +111,10 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
|
|||||||
$shownb = GETPOST($param_shownb, 'alpha');
|
$shownb = GETPOST($param_shownb, 'alpha');
|
||||||
$showtot = GETPOST($param_showtot, 'alpha');
|
$showtot = GETPOST($param_showtot, 'alpha');
|
||||||
} else {
|
} else {
|
||||||
$tmparray = json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode], true);
|
$tmparray = (!empty($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode]) ? json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode], true) : array());
|
||||||
$endyear = $tmparray['year'];
|
$endyear = (!empty($tmparray['year']) ? $tmparray['year'] : '');
|
||||||
$shownb = $tmparray['shownb'];
|
$shownb = (!empty($tmparray['shownb']) ? $tmparray['shownb'] : '');
|
||||||
$showtot = $tmparray['showtot'];
|
$showtot = (!empty($tmparray['showtot']) ? $tmparray['showtot'] : '');
|
||||||
}
|
}
|
||||||
if (empty($shownb) && empty($showtot)) { $shownb = 1; $showtot = 1; }
|
if (empty($shownb) && empty($showtot)) { $shownb = 1; $showtot = 1; }
|
||||||
$nowarray = dol_getdate(dol_now(), true);
|
$nowarray = dol_getdate(dol_now(), true);
|
||||||
|
|||||||
@ -95,11 +95,11 @@ class box_graph_product_distribution extends ModeleBoxes
|
|||||||
$showpropalnb = GETPOST($param_showpropalnb, 'alpha');
|
$showpropalnb = GETPOST($param_showpropalnb, 'alpha');
|
||||||
$showordernb = GETPOST($param_showordernb, 'alpha');
|
$showordernb = GETPOST($param_showordernb, 'alpha');
|
||||||
} else {
|
} else {
|
||||||
$tmparray = json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode], true);
|
$tmparray = (!empty($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode]) ? json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode], true) : array());
|
||||||
$year = $tmparray['year'];
|
$year = (!empty($tmparray['year']) ? $tmparray['year'] : '');
|
||||||
$showinvoicenb = $tmparray['showinvoicenb'];
|
$showinvoicenb = (!empty($tmparray['showinvoicenb']) ? $tmparray['showinvoicenb'] : '');
|
||||||
$showpropalnb = $tmparray['showpropalnb'];
|
$showpropalnb = (!empty($tmparray['showpropalnb']) ? $tmparray['showpropalnb'] : '');
|
||||||
$showordernb = $tmparray['showordernb'];
|
$showordernb = (!empty($tmparray['showordernb']) ? $tmparray['showordernb'] : '');
|
||||||
}
|
}
|
||||||
if (empty($showinvoicenb) && empty($showpropalnb) && empty($showordernb)) { $showpropalnb = 1; $showinvoicenb = 1; $showordernb = 1; }
|
if (empty($showinvoicenb) && empty($showpropalnb) && empty($showordernb)) { $showpropalnb = 1; $showinvoicenb = 1; $showordernb = 1; }
|
||||||
if (empty($conf->facture->enabled) || empty($user->rights->facture->lire)) $showinvoicenb = 0;
|
if (empty($conf->facture->enabled) || empty($user->rights->facture->lire)) $showinvoicenb = 0;
|
||||||
|
|||||||
@ -112,10 +112,10 @@ class box_graph_propales_permonth extends ModeleBoxes
|
|||||||
$shownb = GETPOST($param_shownb, 'alpha');
|
$shownb = GETPOST($param_shownb, 'alpha');
|
||||||
$showtot = GETPOST($param_showtot, 'alpha');
|
$showtot = GETPOST($param_showtot, 'alpha');
|
||||||
} else {
|
} else {
|
||||||
$tmparray = json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode], true);
|
$tmparray = (!empty($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode]) ? json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode], true) : array());
|
||||||
$endyear = $tmparray['year'];
|
$endyear = (!empty($tmparray['year']) ? $tmparray['year'] : '');
|
||||||
$shownb = $tmparray['shownb'];
|
$shownb = (!empty($tmparray['shownb']) ? $tmparray['shownb'] : '');
|
||||||
$showtot = $tmparray['showtot'];
|
$showtot = (!empty($tmparray['showtot']) ? $tmparray['showtot'] : '');
|
||||||
}
|
}
|
||||||
if (empty($shownb) && empty($showtot)) { $shownb = 1; $showtot = 1; }
|
if (empty($shownb) && empty($showtot)) { $shownb = 1; $showtot = 1; }
|
||||||
$nowarray = dol_getdate(dol_now(), true);
|
$nowarray = dol_getdate(dol_now(), true);
|
||||||
@ -176,8 +176,10 @@ class box_graph_propales_permonth extends ModeleBoxes
|
|||||||
//$datatype2 = array('lines','bars');
|
//$datatype2 = array('lines','bars');
|
||||||
|
|
||||||
$filenamenb = $dir."/".$prefix."propalsamountinyear-".$endyear.".png";
|
$filenamenb = $dir."/".$prefix."propalsamountinyear-".$endyear.".png";
|
||||||
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=propalsamountinyear-'.$endyear.'.png';
|
if (!empty($mode)) {
|
||||||
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstatssupplier&file=propalsamountinyear-'.$endyear.'.png';
|
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=propalsamountinyear-'.$endyear.'.png';
|
||||||
|
if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstatssupplier&file=propalsamountinyear-'.$endyear.'.png';
|
||||||
|
}
|
||||||
|
|
||||||
$px2 = new DolGraph();
|
$px2 = new DolGraph();
|
||||||
$mesg = $px2->isGraphKo();
|
$mesg = $px2->isGraphKo();
|
||||||
|
|||||||
@ -64,7 +64,7 @@ class box_produits_alerte_stock extends ModeleBoxes
|
|||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
|
|
||||||
$listofmodulesforexternal = explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL);
|
$listofmodulesforexternal = explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL);
|
||||||
$tmpentry = array('enabled'=>((!empty($conf->product->enabled) || !empty($conf->service->enabled)) && !empty($conf->stock->enabled)), 'perms'=>($user->rights->stock->lire), 'module'=>'product|service|stock');
|
$tmpentry = array('enabled'=>((!empty($conf->product->enabled) || !empty($conf->service->enabled)) && !empty($conf->stock->enabled)), 'perms'=>!empty($user->rights->stock->lire), 'module'=>'product|service|stock');
|
||||||
$showmode = isVisibleToUserType(($user->socid > 0 ? 1 : 0), $tmpentry, $listofmodulesforexternal);
|
$showmode = isVisibleToUserType(($user->socid > 0 ? 1 : 0), $tmpentry, $listofmodulesforexternal);
|
||||||
$this->hidden = ($showmode != 1);
|
$this->hidden = ($showmode != 1);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -81,7 +81,7 @@ class box_propales extends ModeleBoxes
|
|||||||
$propalstatic = new Propal($this->db);
|
$propalstatic = new Propal($this->db);
|
||||||
$societestatic = new Societe($this->db);
|
$societestatic = new Societe($this->db);
|
||||||
|
|
||||||
$this->info_box_head = array('text' => $langs->trans("BoxTitleLast".($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE ? "" : "Modified")."Propals", $max));
|
$this->info_box_head = array('text' => $langs->trans("BoxTitleLast".(!empty($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE) ? "" : "Modified")."Propals", $max));
|
||||||
|
|
||||||
if ($user->rights->propale->lire)
|
if ($user->rights->propale->lire)
|
||||||
{
|
{
|
||||||
@ -96,7 +96,7 @@ class box_propales extends ModeleBoxes
|
|||||||
$sql .= " AND p.entity IN (".getEntity('propal').")";
|
$sql .= " AND p.entity IN (".getEntity('propal').")";
|
||||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||||
if ($user->socid) $sql .= " AND s.rowid = ".$user->socid;
|
if ($user->socid) $sql .= " AND s.rowid = ".$user->socid;
|
||||||
if ($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE) $sql .= " ORDER BY p.datep DESC, p.ref DESC ";
|
if (!empty($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE)) $sql .= " ORDER BY p.datep DESC, p.ref DESC ";
|
||||||
else $sql .= " ORDER BY p.tms DESC, p.ref DESC ";
|
else $sql .= " ORDER BY p.tms DESC, p.ref DESC ";
|
||||||
$sql .= $this->db->plimit($max, 0);
|
$sql .= $this->db->plimit($max, 0);
|
||||||
|
|
||||||
|
|||||||
@ -79,7 +79,7 @@ class box_supplier_orders extends ModeleBoxes
|
|||||||
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
|
||||||
$thirdpartystatic = new Fournisseur($this->db);
|
$thirdpartystatic = new Fournisseur($this->db);
|
||||||
|
|
||||||
$this->info_box_head = array('text' => $langs->trans("BoxTitleLatest".($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE ? "" : "Modified")."SupplierOrders", $max));
|
$this->info_box_head = array('text' => $langs->trans("BoxTitleLatest".(!empty($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE) ? "" : "Modified")."SupplierOrders", $max));
|
||||||
|
|
||||||
if ($user->rights->fournisseur->commande->lire)
|
if ($user->rights->fournisseur->commande->lire)
|
||||||
{
|
{
|
||||||
@ -98,7 +98,7 @@ class box_supplier_orders extends ModeleBoxes
|
|||||||
$sql .= " AND c.entity IN (".getEntity('supplier_order').")";
|
$sql .= " AND c.entity IN (".getEntity('supplier_order').")";
|
||||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||||
if ($user->socid) $sql .= " AND s.rowid = ".$user->socid;
|
if ($user->socid) $sql .= " AND s.rowid = ".$user->socid;
|
||||||
if ($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE) $sql .= " ORDER BY c.date_commande DESC, c.ref DESC ";
|
if (!empty($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE)) $sql .= " ORDER BY c.date_commande DESC, c.ref DESC ";
|
||||||
else $sql .= " ORDER BY c.tms DESC, c.ref DESC ";
|
else $sql .= " ORDER BY c.tms DESC, c.ref DESC ";
|
||||||
$sql .= $this->db->plimit($max, 0);
|
$sql .= $this->db->plimit($max, 0);
|
||||||
|
|
||||||
|
|||||||
@ -964,7 +964,7 @@ class DolGraph
|
|||||||
$array_of_ykeys = array_keys($valarray);
|
$array_of_ykeys = array_keys($valarray);
|
||||||
$alabelexists = 1;
|
$alabelexists = 1;
|
||||||
$tmpykey = explode('_', ($array_of_ykeys[$i + ($alabelexists ? 1 : 0)]), 3);
|
$tmpykey = explode('_', ($array_of_ykeys[$i + ($alabelexists ? 1 : 0)]), 3);
|
||||||
if (!empty($tmpykey[2]) || $tmpykey[2] == '0') { // This is a 'Group by' array
|
if (isset($tmpykey[2]) && (!empty($tmpykey[2]) || $tmpykey[2] == '0')) { // This is a 'Group by' array
|
||||||
$tmpvalue = (array_key_exists('y_' . $tmpykey[1] . '_' . $tmpykey[2], $valarray) ? $valarray['y_' . $tmpykey[1] . '_' . $tmpykey[2]] : $valarray[$i + 1]);
|
$tmpvalue = (array_key_exists('y_' . $tmpykey[1] . '_' . $tmpykey[2], $valarray) ? $valarray['y_' . $tmpykey[1] . '_' . $tmpykey[2]] : $valarray[$i + 1]);
|
||||||
$values[$x] = (is_numeric($tmpvalue) ? $tmpvalue : null);
|
$values[$x] = (is_numeric($tmpvalue) ? $tmpvalue : null);
|
||||||
$arrayofgroupslegend[$i] = array(
|
$arrayofgroupslegend[$i] = array(
|
||||||
@ -1203,7 +1203,7 @@ class DolGraph
|
|||||||
$foundnegativecolor = 0;
|
$foundnegativecolor = 0;
|
||||||
$usecolorvariantforgroupby = 0;
|
$usecolorvariantforgroupby = 0;
|
||||||
// We used a 'group by' and we have too many colors so we generated color variants per
|
// We used a 'group by' and we have too many colors so we generated color variants per
|
||||||
if (is_array($arrayofgroupslegend[$i]) && count($arrayofgroupslegend[$i]) > 0) { // If we used a group by.
|
if (!empty($arrayofgroupslegend) && is_array($arrayofgroupslegend[$i]) && count($arrayofgroupslegend[$i]) > 0) { // If we used a group by.
|
||||||
$nbofcolorneeds = count($arrayofgroupslegend);
|
$nbofcolorneeds = count($arrayofgroupslegend);
|
||||||
$nbofcolorsavailable = count($theme_datacolor);
|
$nbofcolorsavailable = count($theme_datacolor);
|
||||||
if ($nbofcolorneeds > $nbofcolorsavailable) {
|
if ($nbofcolorneeds > $nbofcolorsavailable) {
|
||||||
@ -1278,7 +1278,7 @@ class DolGraph
|
|||||||
$this->stringtoshow .= '{';
|
$this->stringtoshow .= '{';
|
||||||
$this->stringtoshow .= 'dolibarrinfo: \'y_' . $i . '\', ';
|
$this->stringtoshow .= 'dolibarrinfo: \'y_' . $i . '\', ';
|
||||||
$this->stringtoshow .= 'label: \'' . dol_escape_js(dol_string_nohtmltag($textoflegend)) . '\', ';
|
$this->stringtoshow .= 'label: \'' . dol_escape_js(dol_string_nohtmltag($textoflegend)) . '\', ';
|
||||||
$this->stringtoshow .= 'pointStyle: \'' . ($this->type[$i] == 'linesnopoint' ? 'line' : 'circle') . '\', ';
|
$this->stringtoshow .= 'pointStyle: \'' . ((!empty($this->type[$i]) && $this->type[$i] == 'linesnopoint') ? 'line' : 'circle') . '\', ';
|
||||||
$this->stringtoshow .= 'fill: ' . ($type == 'bar' ? 'true' : 'false') . ', ';
|
$this->stringtoshow .= 'fill: ' . ($type == 'bar' ? 'true' : 'false') . ', ';
|
||||||
if ($isfunnel) {
|
if ($isfunnel) {
|
||||||
$this->stringtoshow .= 'borderWidth: \'2\', ';
|
$this->stringtoshow .= 'borderWidth: \'2\', ';
|
||||||
@ -1287,7 +1287,7 @@ class DolGraph
|
|||||||
}
|
}
|
||||||
$this->stringtoshow .= 'borderColor: \'' . $bordercolor . '\', ';
|
$this->stringtoshow .= 'borderColor: \'' . $bordercolor . '\', ';
|
||||||
$this->stringtoshow .= 'backgroundColor: \'' . $color . '\', ';
|
$this->stringtoshow .= 'backgroundColor: \'' . $color . '\', ';
|
||||||
if ($arrayofgroupslegend[$i]) $this->stringtoshow .= 'stack: \'' . $arrayofgroupslegend[$i]['stacknum'] . '\', ';
|
if (!empty($arrayofgroupslegend) && !empty($arrayofgroupslegend[$i])) $this->stringtoshow .= 'stack: \'' . $arrayofgroupslegend[$i]['stacknum'] . '\', ';
|
||||||
$this->stringtoshow .='data: [';
|
$this->stringtoshow .='data: [';
|
||||||
if ($isfunnel) {
|
if ($isfunnel) {
|
||||||
$this->stringtoshow .= '['.-$serie[$i].','.$serie[$i].']';
|
$this->stringtoshow .= '['.-$serie[$i].','.$serie[$i].']';
|
||||||
|
|||||||
@ -206,9 +206,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
|
|||||||
$menu_arr[] = array(
|
$menu_arr[] = array(
|
||||||
'name' => 'Projet',
|
'name' => 'Projet',
|
||||||
'link' => '/projet/index.php?mainmenu=project&leftmenu=',
|
'link' => '/projet/index.php?mainmenu=project&leftmenu=',
|
||||||
'title' => (empty($conf->global->PROJECT_USE_OPPORTUNITIES) || $conf->global->PROJECT_USE_OPPORTUNITIES == 2)
|
'title' => (! empty($conf->global->PROJECT_USE_OPPORTUNITIES) && $conf->global->PROJECT_USE_OPPORTUNITIES == 2 ? "Leads" : "Projects"),
|
||||||
? (($conf->global->PROJECT_USE_OPPORTUNITIES == 2) ? "Leads" : "Projects")
|
|
||||||
: "Projects",
|
|
||||||
'level' => 0,
|
'level' => 0,
|
||||||
'enabled' => $showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal),
|
'enabled' => $showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal),
|
||||||
'target' => $atarget,
|
'target' => $atarget,
|
||||||
@ -743,11 +741,11 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
|||||||
$newmenu->add("/admin/pdf.php?mainmenu=home", $langs->trans("PDF"), 1);
|
$newmenu->add("/admin/pdf.php?mainmenu=home", $langs->trans("PDF"), 1);
|
||||||
|
|
||||||
$warnpicto = '';
|
$warnpicto = '';
|
||||||
if ($conf->global->MAIN_MAIL_SENDMODE == 'mail' && empty($conf->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) {
|
if (!empty($conf->global->MAIN_MAIL_SENDMODE) && $conf->global->MAIN_MAIL_SENDMODE == 'mail' && empty($conf->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) {
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
$warnpicto = img_warning($langs->trans("WarningPHPMailD"));
|
$warnpicto = img_warning($langs->trans("WarningPHPMailD"));
|
||||||
}
|
}
|
||||||
if (in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmail')) && empty($conf->global->MAIN_MAIL_SMTP_SERVER)) {
|
if (!empty($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmail')) && empty($conf->global->MAIN_MAIL_SMTP_SERVER)) {
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
$warnpicto = img_warning($langs->trans("ErrorSetupOfEmailsNotComplete"));
|
$warnpicto = img_warning($langs->trans("ErrorSetupOfEmailsNotComplete"));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -312,7 +312,7 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS))
|
|||||||
$boxstatItem .= '<a href="'.$links[$val].'" class="boxstatsindicator thumbstat nobold nounderline">';
|
$boxstatItem .= '<a href="'.$links[$val].'" class="boxstatsindicator thumbstat nobold nounderline">';
|
||||||
$boxstatItem .= '<div class="boxstats">';
|
$boxstatItem .= '<div class="boxstats">';
|
||||||
$boxstatItem .= '<span class="boxstatstext" title="'.dol_escape_htmltag($text).'">'.$text.'</span><br>';
|
$boxstatItem .= '<span class="boxstatstext" title="'.dol_escape_htmltag($text).'">'.$text.'</span><br>';
|
||||||
$boxstatItem .= '<span class="boxstatsindicator">'.img_object("", $board->picto, 'class="inline-block"').' '.($board->nb[$val] ? $board->nb[$val] : 0).'</span>';
|
$boxstatItem .= '<span class="boxstatsindicator">'.img_object("", $board->picto, 'class="inline-block"').' '.(!empty($board->nb[$val]) ? $board->nb[$val] : 0).'</span>';
|
||||||
$boxstatItem .= '</div>';
|
$boxstatItem .= '</div>';
|
||||||
$boxstatItem .= '</a>';
|
$boxstatItem .= '</a>';
|
||||||
|
|
||||||
@ -675,7 +675,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
|
|||||||
// get key index of stats used in $includes, $classes, $keys, $icons, $titres, $links
|
// get key index of stats used in $includes, $classes, $keys, $icons, $titres, $links
|
||||||
$keyIndex = array_search($globalStatsKey, $keys);
|
$keyIndex = array_search($globalStatsKey, $keys);
|
||||||
|
|
||||||
$classe = $classes[$keyIndex];
|
$classe = (!empty($classes[$keyIndex]) ? $classes[$keyIndex] : '');
|
||||||
if (isset($boardloaded[$classe]) && is_object($boardloaded[$classe]))
|
if (isset($boardloaded[$classe]) && is_object($boardloaded[$classe]))
|
||||||
{
|
{
|
||||||
$groupElement['globalStats']['total'] = $boardloaded[$classe]->nb[$globalStatsKey] ? $boardloaded[$classe]->nb[$globalStatsKey] : 0;
|
$groupElement['globalStats']['total'] = $boardloaded[$classe]->nb[$globalStatsKey] ? $boardloaded[$classe]->nb[$globalStatsKey] : 0;
|
||||||
@ -762,7 +762,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($showweather && !empty($isIntopOpenedDashBoard)) {
|
if ($showweather && !empty($isIntopOpenedDashBoard)) {
|
||||||
$appendClass = $conf->global->MAIN_DISABLE_METEO == 2 ? ' hideonsmartphone' : '';
|
$appendClass = (!empty($conf->global->MAIN_DISABLE_METEO) && $conf->global->MAIN_DISABLE_METEO == 2 ? ' hideonsmartphone' : '');
|
||||||
$weather = getWeatherStatus($totallate);
|
$weather = getWeatherStatus($totallate);
|
||||||
|
|
||||||
$text = '';
|
$text = '';
|
||||||
@ -889,7 +889,7 @@ print '<div class="fichecenter fichecenterbis">';
|
|||||||
* Show widgets (boxes)
|
* Show widgets (boxes)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$boxlist .= '<div class="twocolumns">';
|
$boxlist = '<div class="twocolumns">';
|
||||||
|
|
||||||
$boxlist .= '<div class="firstcolumn fichehalfleft boxhalfleft" id="boxhalfleft">';
|
$boxlist .= '<div class="firstcolumn fichehalfleft boxhalfleft" id="boxhalfleft">';
|
||||||
if (!empty($nbworkboardcount))
|
if (!empty($nbworkboardcount))
|
||||||
@ -914,7 +914,7 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS))
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($boxstatFromHook) || !empty($boxstatItems)) {
|
if (!empty($boxstatFromHook) || !empty($boxstatItems)) {
|
||||||
$boxstat .= '<!-- Database statistics -->'."\n";
|
$boxstat = '<!-- Database statistics -->'."\n";
|
||||||
$boxstat .= '<div class="box">';
|
$boxstat .= '<div class="box">';
|
||||||
$boxstat .= '<table summary="'.dol_escape_htmltag($langs->trans("DolibarrStateBoard")).'" class="noborder boxtable boxtablenobottom nohover widgetstats" width="100%">';
|
$boxstat .= '<table summary="'.dol_escape_htmltag($langs->trans("DolibarrStateBoard")).'" class="noborder boxtable boxtablenobottom nohover widgetstats" width="100%">';
|
||||||
$boxstat .= '<tr class="liste_titre box_titre">';
|
$boxstat .= '<tr class="liste_titre box_titre">';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user