diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php
index f4459adec9f..6ecb4045386 100644
--- a/htdocs/adherents/class/adherent.class.php
+++ b/htdocs/adherents/class/adherent.class.php
@@ -1563,7 +1563,8 @@ class Adherent extends CommonObject
global $langs;
$result='';
- $label=$langs->trans("ShowMember").': '.$this->ref;
+ $label = '' . $langs->trans("ShowMember") . '';
+ $label.= '
' . $langs->trans('Ref') . ': ' . $this->ref;
$linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
if ($option == 'card')
diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php
index 6ebf107ffbe..fb685b3d74b 100644
--- a/htdocs/admin/ihm.php
+++ b/htdocs/admin/ihm.php
@@ -63,6 +63,7 @@ if ($action == 'update')
dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_HOURS", $_POST["MAIN_DEFAULT_WORKING_HOURS"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_SHOW_LOGO", $_POST["MAIN_SHOW_LOGO"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_ACTIVATE_HTML5", $_POST["MAIN_ACTIVATE_HTML5"],'chaine',0,'',$conf->entity);
+ dolibarr_set_const($db, "MAIN_ACTIVATE_FILECACHE", $_POST["MAIN_ACTIVATE_FILECACHE"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", $_POST["MAIN_FIRSTNAME_NAME_POSITION"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_THEME", $_POST["main_theme"],'chaine',0,'',$conf->entity);
@@ -173,7 +174,7 @@ if ($action == 'edit') // Edit
print '';
print '
>
+ | getNomUrl(1); ?> |
ref_client; ?> |
date,'day'); ?> |
trans("ShowOrder").': '.$this->ref;
+ $picto = 'order';
+ $label = '' . $langs->trans("ShowOrder") . '';
+ if (! empty($this->ref))
+ $label .= ' ' . $langs->trans('Ref') . ': ' . $this->ref;
if (! empty($this->ref_client))
- $label.= ' '.$langs->trans('RefCustomer').': '.$this->ref_client;
+ $label.= ' ' . $langs->trans('RefCustomer') . ': ' . $this->ref_client;
+ if (! empty($this->total_ht))
+ $label.= ' ' . $langs->trans('AmountHT') . ': ' . price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
+ if (! empty($this->total_tva))
+ $label.= ' ' . $langs->trans('TVA') . ': ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
+ if (! empty($this->total_ttc))
+ $label.= ' ' . $langs->trans('AmountTTC') . ': ' . price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
$linkstart = '';
$linkend='';
diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php
index 2c30f4128c6..a0a38d50800 100644
--- a/htdocs/commande/list.php
+++ b/htdocs/commande/list.php
@@ -109,7 +109,7 @@ $companystatic = new Societe($db);
$help_url="EN:Module_Customers_Orders|FR:Module_Commandes_Clients|ES:Módulo_Pedidos_de_clientes";
llxHeader('',$langs->trans("Orders"),$help_url);
-$sql = 'SELECT s.nom as name, s.rowid as socid, s.client, c.rowid, c.ref, c.total_ht, c.ref_client,';
+$sql = 'SELECT s.nom as name, s.rowid as socid, s.client, c.rowid, c.ref, c.total_ht, c.tva as total_tva, c.total_ttc, c.ref_client,';
$sql.= ' c.date_valid, c.date_commande, c.note_private, c.date_livraison, c.fk_statut, c.facture as facturee';
$sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s';
$sql.= ', '.MAIN_DB_PREFIX.'commande as c';
@@ -334,6 +334,10 @@ if ($resql)
$generic_commande->id=$objp->rowid;
$generic_commande->ref=$objp->ref;
+ $generic_commande->ref_client = $objp->ref_client;
+ $generic_commande->total_ht = $objp->total_ht;
+ $generic_commande->total_tva = $objp->total_tva;
+ $generic_commande->total_ttc = $objp->total_ttc;
$generic_commande->lines=array();
$generic_commande->getLinesArray();
diff --git a/htdocs/commande/tpl/linkedobjectblock.tpl.php b/htdocs/commande/tpl/linkedobjectblock.tpl.php
index c47aefe0958..cabb63aa2b1 100644
--- a/htdocs/commande/tpl/linkedobjectblock.tpl.php
+++ b/htdocs/commande/tpl/linkedobjectblock.tpl.php
@@ -36,6 +36,7 @@ print_titre($langs->trans('RelatedOrders'));
| trans("Ref"); ?> |
+ trans("RefCustomer"); ?> |
trans("Date"); ?> |
trans("AmountHTShort"); ?> |
trans("Status"); ?> |
@@ -47,8 +48,9 @@ foreach($linkedObjectBlock as $object)
{
$var=!$var;
?>
- >|
- trans("ShowOrder"),"order").' '.$object->ref; ?> |
+ >
+ | getNomUrl(1); ?> |
+ ref_client; ?> |
date,'day'); ?> |
rights->commande->lire) {
@@ -62,7 +64,7 @@ foreach($linkedObjectBlock as $object)
?>
|
- | trans('TotalHT'); ?> |
+ trans('TotalHT'); ?> |
rights->commande->lire) {
echo price($total);
diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php
index 32d7fa13122..d30a19cd040 100644
--- a/htdocs/compta/facture/class/facture.class.php
+++ b/htdocs/compta/facture/class/facture.class.php
@@ -859,6 +859,8 @@ class Facture extends CommonInvoice
if ($this->type == self::TYPE_DEPOSIT) $picto.='d'; // Deposit invoice
$label=$langs->trans("ShowInvoice").': '.$this->ref;
+ if (! empty($this->ref_client))
+ $label.= ' ' . $langs->trans('RefCustomer') . $this->ref_client;
if ($this->type == self::TYPE_REPLACEMENT) $label=$langs->transnoentitiesnoconv("ShowInvoiceReplace").': '.$this->ref;
if ($this->type == self::TYPE_CREDIT_NOTE) $label=$langs->transnoentitiesnoconv("ShowInvoiceAvoir").': '.$this->ref;
if ($this->type == self::TYPE_DEPOSIT) $label=$langs->transnoentitiesnoconv("ShowInvoiceDeposit").': '.$this->ref;
diff --git a/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php b/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php
index ae3038a6021..12f40f8ef97 100644
--- a/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php
+++ b/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php
@@ -36,6 +36,7 @@ else print_titre($langs->trans("RelatedBill"));
| trans("Ref"); ?> |
+ trans("RefCustomer"); ?> |
trans("Date"); ?> |
trans("AmountHTShort"); ?> |
trans("Status"); ?> |
@@ -47,8 +48,9 @@ foreach($linkedObjectBlock as $object)
{
$var=!$var;
?>
- >|
- trans("ShowBill"),"bill").' '.$object->ref; ?> |
+ >
+ | getNomUrl(1); ?> |
+ ref_client; ?> |
date,'day'); ?> |
rights->facture->lire) {
@@ -61,7 +63,7 @@ foreach($linkedObjectBlock as $object)
}
?>
|
- | trans("TotalHT"); ?> |
+ trans("TotalHT"); ?> |
rights->facture->lire) {
echo price($total);
diff --git a/htdocs/contrat/tpl/linkedobjectblock.tpl.php b/htdocs/contrat/tpl/linkedobjectblock.tpl.php
index d94d45489fd..f7f840dce13 100644
--- a/htdocs/contrat/tpl/linkedobjectblock.tpl.php
+++ b/htdocs/contrat/tpl/linkedobjectblock.tpl.php
@@ -42,8 +42,8 @@ foreach($linkedObjectBlock as $object)
$object->fetch_lines();
$var=!$var;
?>
- | >|
- trans("ShowContract"),"contract").' '.$object->ref; ?> |
+ >
+ | getNomUrl(1); ?> |
date_contrat,'day'); ?> |
|
getLibStatut(6); ?> |
diff --git a/htdocs/core/boxes/box_actions.php b/htdocs/core/boxes/box_actions.php
index ed5e731d896..06d70d65db0 100644
--- a/htdocs/core/boxes/box_actions.php
+++ b/htdocs/core/boxes/box_actions.php
@@ -95,10 +95,11 @@ class box_actions extends ModeleBoxes
//($langs->transnoentities("Action".$objp->code)!=("Action".$objp->code) ? $langs->transnoentities("Action".$objp->code) : $objp->label)
$label=empty($objp->label)?$objp->type_label:$objp->label;
+ $tooltip = $langs->trans('Action'.$objp->code).': '.$label;
$this->info_box_contents[$i][0] = array(
'td' => 'align="left" width="16"',
'logo' => ("action"),
- 'tooltip' => $langs->trans('Action'.$objp->code).': '.$label,
+ 'tooltip' => $tooltip,
'url' => DOL_URL_ROOT."/comm/action/card.php?id=".$objp->id,
);
@@ -106,21 +107,22 @@ class box_actions extends ModeleBoxes
'td' => 'align="left"',
'text' => dol_trunc($label,32),
'text2'=> $late,
- 'tooltip' => $langs->trans('Action'.$objp->code).': '.$label,
+ 'tooltip' => $tooltip,
'url' => DOL_URL_ROOT."/comm/action/card.php?id=".$objp->id,
);
+ $tooltip = $langs->trans('Customer').': '.$objp->name;
$this->info_box_contents[$i][2] = array(
'td' => 'align="left" width="16"',
'logo' => ($objp->socid?'company':''),
- 'tooltip' => $langs->trans('Customer').': '.$objp->name,
+ 'tooltip' => $tooltip,
'url' => ($objp->socid?DOL_URL_ROOT."/societe/soc.php?socid=".$objp->socid:''),
);
$this->info_box_contents[$i][3] = array(
'td' => 'align="left"',
'text' => dol_trunc($objp->name,24),
- 'tooltip' => $langs->trans('Customer').': '.$objp->name,
+ 'tooltip' => $tooltip,
'url' => DOL_URL_ROOT."/societe/soc.php?socid=".$objp->socid,
);
@@ -142,9 +144,13 @@ class box_actions extends ModeleBoxes
$i++;
}
- if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoActionsToDo"));
+ if ($num==0)
+ $this->info_box_contents[$i][0] = array(
+ 'td' => 'align="center"',
+ 'text'=>$langs->trans("NoActionsToDo"),
+ );
- $db->free($result);
+ $db->free($result);
} else {
$this->info_box_contents[0][0] = array(
'td' => 'align="left"',
@@ -171,8 +177,7 @@ class box_actions extends ModeleBoxes
{
global $langs, $conf;
parent::showBox($this->info_box_head, $this->info_box_contents);
- if ($conf->global->SHOW_DIALOG_HOMEPAGE)
- {
+ if ($conf->global->SHOW_DIALOG_HOMEPAGE) {
$actioncejour=false;
$contents=$this->info_box_contents;
$nblines=count($contents);
diff --git a/htdocs/core/boxes/box_activity.php b/htdocs/core/boxes/box_activity.php
index e1f67ffc88e..dcc2b99c887 100644
--- a/htdocs/core/boxes/box_activity.php
+++ b/htdocs/core/boxes/box_activity.php
@@ -75,6 +75,7 @@ class box_activity extends ModeleBoxes
$totalnb = 0;
$i = 0;
$cachetime = 3600;
+ $cachedir = DOL_DATA_ROOT.'/cache/boxes';
$fileid = '-e'.$conf->entity.'-u'.$user->id.'-s'.$user->societe_id.'-r'.($user->rights->societe->client->voir?'1':'0').'.cache';
$now = dol_now();
$nbofyears=2;
@@ -94,8 +95,9 @@ class box_activity extends ModeleBoxes
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$facturestatic=new Facture($db);
- $cachefile = DOL_DATA_ROOT.'/cache/boxes/boxactivity-invoice'.$fileid;
- $refresh = !file_exists($cachefile) || ($now-$cachetime) > dol_filemtime($cachefile);
+ $filename = '/boxactivity-invoice'.$fileid;
+
+ $refresh = dol_cache_refresh($cachedir, $filename, $cachetime);
$data = array();
if ($refresh) {
$sql = "SELECT f.fk_statut, SUM(f.total_ttc) as Mnttot, COUNT(*) as nb";
@@ -118,13 +120,15 @@ class box_activity extends ModeleBoxes
$data[$j]=$db->fetch_object($result);
$j++;
}
- file_put_contents($cachefile,serialize($data),LOCK_EX);
+ if (! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) {
+ dol_filecache($cachedir, $filename, $data);
+ }
$db->free($result);
} else {
dol_print_error($db);
}
} else {
- $data = unserialize(file_get_contents($cachefile));
+ $data = dol_readcachefile($cachedir, $filename);
}
if (! empty($data)) {
$j=0;
@@ -173,8 +177,9 @@ class box_activity extends ModeleBoxes
);
}
- $cachefile = DOL_DATA_ROOT.'/cache/boxes/boxactivity-invoice2'.$fileid;
- $refresh = !file_exists($cachefile) || ($now-$cachetime) > dol_filemtime($cachefile);
+ $filename = '/boxactivity-invoice2'.$fileid;
+
+ $refresh = dol_cache_refresh($cachedir, $filename, $cachetime);
if ($refresh) {
$sql = "SELECT f.fk_statut, SUM(f.total_ttc) as Mnttot, COUNT(*) as nb";
@@ -193,13 +198,15 @@ class box_activity extends ModeleBoxes
$data[$j]=$db->fetch_object($result);
$j++;
}
- file_put_contents($cachefile,serialize($data),LOCK_EX);
+ if (! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) {
+ dol_filecache($cachedir, $filename, $data);
+ }
$db->free($result);
} else {
dol_print_error($db);
}
} else {
- $data = unserialize(file_get_contents($cachefile));
+ $data = dol_readcachefile($cachedir, $filename);
}
if (! empty($data)) {
$j=0;
@@ -255,9 +262,10 @@ class box_activity extends ModeleBoxes
include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
$commandestatic=new Commande($db);
- $cachefile = DOL_DATA_ROOT.'/cache/boxes/boxactivity-order'.$fileid;
- $refresh = !file_exists($cachefile) || ($now-$cachetime) > dol_filemtime($cachefile);
+ $filename = '/boxactivity-order'.$fileid;
+ $refresh = dol_cache_refresh($cachedir, $filename, $cachetime);
$data = array();
+
if ($refresh) {
$sql = "SELECT c.fk_statut, sum(c.total_ttc) as Mnttot, count(*) as nb";
@@ -282,13 +290,15 @@ class box_activity extends ModeleBoxes
$data[$j]=$db->fetch_object($result);
$j++;
}
- file_put_contents($cachefile,serialize($data),LOCK_EX);
+ if (! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) {
+ dol_filecache($cachedir, $filename, $data);
+ }
$db->free($result);
} else {
dol_print_error($db);
}
} else {
- $data = unserialize(file_get_contents($cachefile));
+ $data = dol_readcachefile($cachedir, $filename);
}
if (! empty($data)) {
$j=0;
@@ -334,8 +344,8 @@ class box_activity extends ModeleBoxes
include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
$propalstatic=new Propal($db);
- $cachefile = DOL_DATA_ROOT.'/cache/boxes/boxactivity-propal'.$fileid;
- $refresh = !file_exists($cachefile) || ($now-$cachetime) > dol_filemtime($cachefile);
+ $filename = '/boxactivity-propal'.$fileid;
+ $refresh = dol_cache_refresh($cachedir, $filename, $cachetime);
$data = array();
if ($refresh) {
$sql = "SELECT p.fk_statut, SUM(p.total) as Mnttot, COUNT(*) as nb";
@@ -360,13 +370,15 @@ class box_activity extends ModeleBoxes
$data[$j]=$db->fetch_object($result);
$j++;
}
- file_put_contents($cachefile,serialize($data),LOCK_EX);
+ if (! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) {
+ dol_filecache($cachedir, $filename, $data);
+ }
$db->free($result);
} else {
dol_print_error($db);
}
} else {
- $data = unserialize(file_get_contents($cachefile));
+ $data = dol_readcachefile($cachedir, $filename);
}
if (! empty($data)) {
$j=0;
diff --git a/htdocs/core/boxes/box_comptes.php b/htdocs/core/boxes/box_comptes.php
index 6a6f12e502d..da585f7ea71 100644
--- a/htdocs/core/boxes/box_comptes.php
+++ b/htdocs/core/boxes/box_comptes.php
@@ -106,17 +106,18 @@ class box_comptes extends ModeleBoxes
$solde_total[$objp->currency_code] += $solde;
+ $tooltip = $langs->trans('Account').': '.$objp->label . ' ' . $langs->trans('AccountNumber').': '.$objp->number;
$this->info_box_contents[$i][0] = array(
'td' => 'align="left" width="16"',
'logo' => $this->boximg,
- 'tooltip' => $langs->trans('Account').': '.$objp->label,
+ 'tooltip' => $tooltip,
'url' => DOL_URL_ROOT."/compta/bank/account.php?account=".$objp->rowid,
);
$this->info_box_contents[$i][1] = array(
'td' => 'align="left"',
'text' => $objp->label,
- 'tooltip' => $langs->trans('Account').': '.$objp->label,
+ 'tooltip' => $tooltip,
'url' => DOL_URL_ROOT."/compta/bank/account.php?account=".$objp->rowid,
);
@@ -151,7 +152,7 @@ class box_comptes extends ModeleBoxes
$this->info_box_contents[$i][3] = array(
'td' => 'align="right" class="liste_total"',
- 'text' => price($solde, 0, $langs, 0, 0, -1, $key)
+ 'text' => price($solde, 0, $langs, 0, -1, -1, $key)
);
$i++;
}
diff --git a/htdocs/core/boxes/box_factures_fourn_imp.php b/htdocs/core/boxes/box_factures_fourn_imp.php
index aa217f1c436..37b42f70cfa 100644
--- a/htdocs/core/boxes/box_factures_fourn_imp.php
+++ b/htdocs/core/boxes/box_factures_fourn_imp.php
@@ -17,9 +17,9 @@
*/
/**
- * \file htdocs/core/boxes/box_factures_fourn_imp.php
+ * \file htdocs/core/boxes/box_factures_fourn_imp.php
* \ingroup fournisseur
- * \brief Fichier de gestion d'une box des factures fournisseurs impayees
+ * \brief Fichier de gestion d'une box des factures fournisseurs impayees
*/
include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php';
@@ -29,9 +29,9 @@ include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php';
*/
class box_factures_fourn_imp extends ModeleBoxes
{
- var $boxcode="oldestunpaidsupplierbills";
- var $boximg="object_bill";
- var $boxlabel="BoxOldestUnpaidSupplierBills";
+ var $boxcode = "oldestunpaidsupplierbills";
+ var $boximg = "object_bill";
+ var $boxlabel = "BoxOldestUnpaidSupplierBills";
var $depends = array("facture","fournisseur");
var $db;
@@ -93,55 +93,82 @@ class box_factures_fourn_imp extends ModeleBoxes
$late='';
if ($datelimite && $datelimite < ($now - $conf->facture->fournisseur->warning_delay)) $late=img_warning(sprintf($l_due_date,dol_print_date($datelimite,'day')));
- $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
- 'logo' => $this->boximg,
- 'url' => DOL_URL_ROOT."/fourn/facture/card.php?facid=".$objp->facid);
+ $tooltip = $langs->trans('SupplierInvoice') . ': ' . ($objp->ref?$objp->ref:$objp->facid) . ' ' . $langs->trans('RefSupplier') . ': ' . $objp->ref_supplier;
+ $this->info_box_contents[$i][0] = array(
+ 'td' => 'align="left" width="16"',
+ 'logo' => $this->boximg,
+ 'tooltip' => $tooltip,
+ 'url' => DOL_URL_ROOT."/fourn/facture/card.php?facid=".$objp->facid,
+ );
- $this->info_box_contents[$i][1] = array('td' => 'align="left"',
- 'text' => ($objp->ref?$objp->ref:$objp->facid),
- 'text2'=> $late,
- 'url' => DOL_URL_ROOT."/fourn/facture/card.php?facid=".$objp->facid);
+ $this->info_box_contents[$i][1] = array(
+ 'td' => 'align="left"',
+ 'text' => ($objp->ref?$objp->ref:$objp->facid),
+ 'text2'=> $late,
+ 'tooltip' => $tooltip,
+ 'url' => DOL_URL_ROOT."/fourn/facture/card.php?facid=".$objp->facid,
+ );
- $this->info_box_contents[$i][2] = array('td' => 'align="left"',
- 'text' => $objp->ref_supplier,
- 'url' => DOL_URL_ROOT."/fourn/facture/card.php?facid=".$objp->facid);
+ $this->info_box_contents[$i][2] = array(
+ 'td' => 'align="left"',
+ 'text' => $objp->ref_supplier,
+ 'tooltip' => $tooltip,
+ 'url' => DOL_URL_ROOT."/fourn/facture/card.php?facid=".$objp->facid,
+ );
- $this->info_box_contents[$i][3] = array('td' => 'align="left" width="16"',
- 'logo' => 'company',
- 'url' => DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid);
+ $tooltip = $langs->trans('Supplier') . ': '. $objp->name;
+ $this->info_box_contents[$i][3] = array(
+ 'td' => 'align="left" width="16"',
+ 'logo' => 'company',
+ 'tooltip' => $tooltip,
+ 'url' => DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid,
+ );
- $this->info_box_contents[$i][4] = array('td' => 'align="left"',
- 'text' => $objp->name,
- 'url' => DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid);
+ $this->info_box_contents[$i][4] = array(
+ 'td' => 'align="left"',
+ 'text' => $objp->name,
+ 'tooltip' => $tooltip,
+ 'url' => DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid,
+ );
- $this->info_box_contents[$i][5] = array('td' => 'align="right"',
- 'text' => dol_print_date($datelimite,'day'));
+ $this->info_box_contents[$i][5] = array(
+ 'td' => 'align="right"',
+ 'text' => dol_print_date($datelimite,'day'),
+ );
$fac = new FactureFournisseur($db);
$fac->fetch($objp->facid);
$alreadypaid=$fac->getSommePaiement();
- $this->info_box_contents[$i][6] = array('td' => 'align="right" width="18"',
- 'text' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3,$alreadypaid,$objp->type));
+ $this->info_box_contents[$i][6] = array(
+ 'td' => 'align="right" width="18"',
+ 'text' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3,$alreadypaid,$objp->type),
+ );
- $i++;
- }
+ $i++;
+ }
- if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoUnpaidSupplierBills"));
+ if ($num==0)
+ $this->info_box_contents[$i][0] = array(
+ 'td' => 'align="center"',
+ 'text'=>$langs->trans("NoUnpaidSupplierBills"),
+ );
- $db->free($result);
- }
- else {
- $this->info_box_contents[0][0] = array( 'td' => 'align="left"',
- 'maxlength'=>500,
- 'text' => ($db->error().' sql='.$sql));
- }
- }
- else {
- $this->info_box_contents[0][0] = array('td' => 'align="left"',
- 'text' => $langs->trans("ReadPermissionNotAllowed"));
- }
+ $db->free($result);
+ } else {
+ $this->info_box_contents[0][0] = array(
+ 'td' => 'align="left"',
+ 'maxlength'=>500,
+ 'text' => ($db->error().' sql='.$sql),
+ );
+ }
+ } else {
+ $this->info_box_contents[0][0] = array(
+ 'td' => 'align="left"',
+ 'text' => $langs->trans("ReadPermissionNotAllowed"),
+ );
+ }
- }
+ }
/**
* Method to show box
diff --git a/htdocs/core/boxes/box_fournisseurs.php b/htdocs/core/boxes/box_fournisseurs.php
index f233221ccaa..19850598505 100644
--- a/htdocs/core/boxes/box_fournisseurs.php
+++ b/htdocs/core/boxes/box_fournisseurs.php
@@ -84,36 +84,52 @@ class box_fournisseurs extends ModeleBoxes
$datec=$db->jdate($objp->datec);
$datem=$db->jdate($objp->tms);
- $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
- 'logo' => $this->boximg,
- 'url' => DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid);
+ $tooltip = $langs->trans('Supplier') . ': ' . $objp->name;
+ $this->info_box_contents[$i][0] = array(
+ 'td' => 'align="left" width="16"',
+ 'logo' => $this->boximg,
+ 'tooltip' => $tooltip,
+ 'url' => DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid,
+ );
- $this->info_box_contents[$i][1] = array('td' => 'align="left"',
- 'text' => $objp->name,
- 'url' => DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid);
+ $this->info_box_contents[$i][1] = array(
+ 'td' => 'align="left"',
+ 'text' => $objp->name,
+ 'tooltip' => $tooltip,
+ 'url' => DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid,
+ );
- $this->info_box_contents[$i][2] = array('td' => 'align="right"',
- 'text' => dol_print_date($datem, "day"));
+ $this->info_box_contents[$i][2] = array(
+ 'td' => 'align="right"',
+ 'text' => dol_print_date($datem, "day"),
+ );
- $this->info_box_contents[$i][3] = array('td' => 'align="right" width="18"',
- 'text' => $thirdpartystatic->LibStatut($objp->status,3));
+ $this->info_box_contents[$i][3] = array(
+ 'td' => 'align="right" width="18"',
+ 'text' => $thirdpartystatic->LibStatut($objp->status,3),
+ );
$i++;
}
- if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedSuppliers"));
+ if ($num==0) $this->info_box_contents[$i][0] = array(
+ 'td' => 'align="center"',
+ 'text'=>$langs->trans("NoRecordedSuppliers"),
+ );
- $db->free($result);
+ $db->free($result);
+ } else {
+ $this->info_box_contents[0][0] = array(
+ 'td' => 'align="left"',
+ 'maxlength'=>500,
+ 'text' => ($db->error().' sql='.$sql),
+ );
}
- else {
- $this->info_box_contents[0][0] = array( 'td' => 'align="left"',
- 'maxlength'=>500,
- 'text' => ($db->error().' sql='.$sql));
- }
- }
- else {
- $this->info_box_contents[0][0] = array('td' => 'align="left"',
- 'text' => $langs->trans("ReadPermissionNotAllowed"));
+ } else {
+ $this->info_box_contents[0][0] = array(
+ 'td' => 'align="left"',
+ 'text' => $langs->trans("ReadPermissionNotAllowed"),
+ );
}
}
diff --git a/htdocs/core/boxes/box_produits_alerte_stock.php b/htdocs/core/boxes/box_produits_alerte_stock.php
index 1079f623492..5a1b898fc1f 100644
--- a/htdocs/core/boxes/box_produits_alerte_stock.php
+++ b/htdocs/core/boxes/box_produits_alerte_stock.php
@@ -83,8 +83,7 @@ class box_produits_alerte_stock extends ModeleBoxes
$langs->load("stocks");
$num = $db->num_rows($result);
$i = 0;
- while ($i < $num)
- {
+ while ($i < $num) {
$objp = $db->fetch_object($result);
$datem=$db->jdate($objp->tms);
@@ -106,13 +105,20 @@ class box_produits_alerte_stock extends ModeleBoxes
}
}
- $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
- 'logo' => ($objp->fk_product_type==1?'object_service':'object_product'),
- 'url' => DOL_URL_ROOT."/product/card.php?id=".$objp->rowid);
+ $tooltip = $langs->trans('Product') . ': ' . $objp->label;
+ $this->info_box_contents[$i][0] = array(
+ 'td' => 'align="left" width="16"',
+ 'logo' => ($objp->fk_product_type==1?'object_service':'object_product'),
+ 'tooltip' => $tooltip,
+ 'url' => DOL_URL_ROOT."/product/card.php?id=".$objp->rowid,
+ );
- $this->info_box_contents[$i][1] = array('td' => 'align="left"',
- 'text' => $objp->label,
- 'url' => DOL_URL_ROOT."/product/card.php?id=".$objp->rowid);
+ $this->info_box_contents[$i][1] = array(
+ 'td' => 'align="left"',
+ 'text' => $objp->label,
+ 'tooltip' => $tooltip,
+ 'url' => DOL_URL_ROOT."/product/card.php?id=".$objp->rowid,
+ );
if ($objp->price_base_type == 'HT')
{
@@ -124,33 +130,49 @@ class box_produits_alerte_stock extends ModeleBoxes
$price=price($objp->price_ttc);
$price_base_type=$langs->trans("TTC");
}
- $this->info_box_contents[$i][2] = array('td' => 'align="right"',
- 'text' => $price);
+ $this->info_box_contents[$i][2] = array(
+ 'td' => 'align="right"',
+ 'text' => $price,
+ );
- $this->info_box_contents[$i][3] = array('td' => 'align="left" class="nowrap"',
- 'text' => $price_base_type);
+ $this->info_box_contents[$i][3] = array(
+ 'td' => 'align="left" class="nowrap"',
+ 'text' => $price_base_type,
+ );
- $this->info_box_contents[$i][4] = array('td' => 'align="center"',
- 'text' => $objp->total_stock . ' / '.$objp->seuil_stock_alerte,
- 'text2'=>img_warning($langs->transnoentitiesnoconv("StockLowerThanLimit")));
+ $this->info_box_contents[$i][4] = array(
+ 'td' => 'align="center"',
+ 'text' => $objp->total_stock . ' / '.$objp->seuil_stock_alerte,
+ 'text2'=>img_warning($langs->transnoentitiesnoconv("StockLowerThanLimit")),
+ );
- $this->info_box_contents[$i][5] = array('td' => 'align="right" width="18"',
- 'text' => $productstatic->LibStatut($objp->tosell,3,0));
+ $this->info_box_contents[$i][5] = array(
+ 'td' => 'align="right" width="18"',
+ 'text' => $productstatic->LibStatut($objp->tosell,3,0),
+ );
- $this->info_box_contents[$i][6] = array('td' => 'align="right" width="18"',
- 'text' => $productstatic->LibStatut($objp->tobuy,3,1));
+ $this->info_box_contents[$i][6] = array(
+ 'td' => 'align="right" width="18"',
+ 'text' => $productstatic->LibStatut($objp->tobuy,3,1),
+ );
$i++;
- }
- if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoTooLowStockProducts"));
+ }
+ if ($num==0)
+ $this->info_box_contents[$i][0] = array(
+ 'td' => 'align="center"',
+ 'text'=>$langs->trans("NoTooLowStockProducts"),
+ );
$db->free($result);
}
else
{
- $this->info_box_contents[0][0] = array( 'td' => 'align="left"',
- 'maxlength'=>500,
- 'text' => ($db->error().' sql='.$sql));
+ $this->info_box_contents[0][0] = array(
+ 'td' => 'align="left"',
+ 'maxlength'=>500,
+ 'text' => ($db->error().' sql='.$sql),
+ );
}
}
else {
diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php
index ef38a2537e6..b765c99c836 100644
--- a/htdocs/core/boxes/box_project.php
+++ b/htdocs/core/boxes/box_project.php
@@ -90,21 +90,24 @@ class box_project extends ModeleBoxes
while ($i < $num) {
$objp = $db->fetch_object($result);
+ $tooltip = $langs->trans('Project') . ': ' . $objp->ref;
$this->info_box_contents[$i][0] = array(
'td' => 'align="left" width="16"',
'logo' => 'object_project',
- 'url' => DOL_URL_ROOT."/projet/card.php?id=".$objp->rowid
+ 'tooltip' => $tooltip,
+ 'url' => DOL_URL_ROOT."/projet/card.php?id=".$objp->rowid,
);
$this->info_box_contents[$i][1] = array(
'td' => 'align="left"',
'text' => $objp->ref,
- 'url' => DOL_URL_ROOT."/product/card.php?id=".$objp->rowid
+ 'tooltip' => $tooltip,
+ 'url' => DOL_URL_ROOT."/product/card.php?id=".$objp->rowid,
);
$this->info_box_contents[$i][2] = array(
'td' => 'align="left"',
- 'text' => $objp->title
+ 'text' => $objp->title,
);
$sql ="SELECT count(*) as nb, sum(progress) as totprogress";
@@ -114,9 +117,15 @@ class box_project extends ModeleBoxes
$resultTask = $db->query($sql);
if ($resultTask) {
$objTask = $db->fetch_object($resultTask);
- $this->info_box_contents[$i][3] = array('td' => 'align="right"', 'text' => number_format($objTask->nb, 0, ',', ' ')." ".$langs->trans("Tasks"));
+ $this->info_box_contents[$i][3] = array(
+ 'td' => 'align="right"',
+ 'text' => number_format($objTask->nb, 0, ',', ' ')." ".$langs->trans("Tasks"),
+ );
if ($objTask->nb > 0 )
- $this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => number_format(($objTask->totprogress/$objTask->nb), 0, ',', ' ')."%");
+ $this->info_box_contents[$i][4] = array(
+ 'td' => 'align="right"',
+ 'text' => number_format(($objTask->totprogress/$objTask->nb), 0, ',', ' ')."%",
+ );
else
$this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => "N/A ");
$totalnbTask += $objTask->nb;
@@ -132,11 +141,28 @@ class box_project extends ModeleBoxes
// Add the sum à the bottom of the boxes
- $this->info_box_contents[$i][0] = array('tr' => 'class="liste_total"', 'td' => 'align="left" ', 'text' => $langs->trans("Total")." ".$textHead);
- $this->info_box_contents[$i][1] = array('td' => '', 'text' => "");
- $this->info_box_contents[$i][2] = array('td' => 'align="right" ', 'text' => number_format($num, 0, ',', ' ')." ".$langs->trans("Projects"));
- $this->info_box_contents[$i][3] = array('td' => 'align="right" ', 'text' => number_format($totalnbTask, 0, ',', ' ')." ".$langs->trans("Tasks"));
- $this->info_box_contents[$i][4] = array('td' => '', 'text' => "");
+ $this->info_box_contents[$i][0] = array(
+ 'tr' => 'class="liste_total"',
+ 'td' => 'align="left" ',
+ 'text' => " ",
+ );
+ $this->info_box_contents[$i][1] = array(
+ 'td' => '',
+ 'text' => $langs->trans("Total")." ".$textHead,
+ 'text' => " ",
+ );
+ $this->info_box_contents[$i][2] = array(
+ 'td' => 'align="right" ',
+ 'text' => number_format($num, 0, ',', ' ')." ".$langs->trans("Projects"),
+ );
+ $this->info_box_contents[$i][3] = array(
+ 'td' => 'align="right" ',
+ 'text' => number_format($totalnbTask, 0, ',', ' ')." ".$langs->trans("Tasks"),
+ );
+ $this->info_box_contents[$i][4] = array(
+ 'td' => '',
+ 'text' => " ",
+ );
}
diff --git a/htdocs/core/boxes/box_propales.php b/htdocs/core/boxes/box_propales.php
index e9bd47b2a9e..07bf074665f 100644
--- a/htdocs/core/boxes/box_propales.php
+++ b/htdocs/core/boxes/box_propales.php
@@ -58,7 +58,7 @@ class box_propales extends ModeleBoxes
include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
$propalstatic=new Propal($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".($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE?"":"Modified")."Propals",$max));
if ($user->rights->propale->lire)
{
@@ -83,8 +83,7 @@ class box_propales extends ModeleBoxes
$i = 0;
- while ($i < $num)
- {
+ while ($i < $num) {
$objp = $db->fetch_object($result);
$date=$db->jdate($objp->dp);
$datec=$db->jdate($objp->datec);
@@ -97,52 +96,75 @@ class box_propales extends ModeleBoxes
$late = img_warning($langs->trans("Late"));
}
- $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
- 'logo' => $this->boximg,
- 'url' => DOL_URL_ROOT."/comm/propal.php?id=".$objp->rowid);
+ $tooltip = $langs->trans('Proposal') . ': ' . $objp->ref;
+ $this->info_box_contents[$i][0] = array(
+ 'td' => 'align="left" width="16"',
+ 'logo' => $this->boximg,
+ 'tooltip' => $tooltip,
+ 'url' => DOL_URL_ROOT."/comm/propal.php?id=".$objp->rowid,
+ );
- $this->info_box_contents[$i][1] = array('td' => 'align="left"',
- 'text' => $objp->ref,
- 'text2'=> $late,
- 'url' => DOL_URL_ROOT."/comm/propal.php?id=".$objp->rowid);
+ $this->info_box_contents[$i][1] = array(
+ 'td' => 'align="left"',
+ 'text' => $objp->ref,
+ 'text2'=> $late,
+ 'tooltip' => $tooltip,
+ 'url' => DOL_URL_ROOT."/comm/propal.php?id=".$objp->rowid,
+ );
- $this->info_box_contents[$i][2] = array('td' => 'align="left" width="16"',
- 'logo' => 'company',
- 'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
+ $tooltip = $langs->trans('Customer') . ': ' . $objp->name;
+ $this->info_box_contents[$i][2] = array(
+ 'td' => 'align="left" width="16"',
+ 'logo' => 'company',
+ 'tooltip' => $tooltip,
+ 'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid,
+ );
- $this->info_box_contents[$i][3] = array('td' => 'align="left"',
- 'text' => dol_trunc($objp->name,40),
- 'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
+ $this->info_box_contents[$i][3] = array(
+ 'td' => 'align="left"',
+ 'text' => dol_trunc($objp->name,40),
+ 'tooltip' => $tooltip,
+ 'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid,
+ );
- $this->info_box_contents[$i][4] = array('td' => 'align="right"',
- 'text' => price($objp->total_ht),
- );
+ $this->info_box_contents[$i][4] = array(
+ 'td' => 'align="right"',
+ 'text' => price($objp->total_ht),
+ );
- $this->info_box_contents[$i][5] = array('td' => 'align="right"',
- 'text' => dol_print_date($date,'day'));
+ $this->info_box_contents[$i][5] = array(
+ 'td' => 'align="right"',
+ 'text' => dol_print_date($date,'day'),
+ );
- $this->info_box_contents[$i][6] = array('td' => 'align="right" width="18"',
- 'text' => $propalstatic->LibStatut($objp->fk_statut,3));
+ $this->info_box_contents[$i][6] = array(
+ 'td' => 'align="right" width="18"',
+ 'text' => $propalstatic->LibStatut($objp->fk_statut,3),
+ );
- $i++;
- }
+ $i++;
+ }
- if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedProposals"));
+ if ($num==0)
+ $this->info_box_contents[$i][0] = array(
+ 'td' => 'align="center"',
+ 'text'=>$langs->trans("NoRecordedProposals"),
+ );
- $db->free($result);
- }
- else
- {
- $this->info_box_contents[0][0] = array( 'td' => 'align="left"',
- 'maxlength'=>500,
- 'text' => ($db->error().' sql='.$sql));
- }
- }
- else
- {
- $this->info_box_contents[0][0] = array('td' => 'align="left"',
- 'text' => $langs->trans("ReadPermissionNotAllowed"));
- }
+ $db->free($result);
+ } else {
+ $this->info_box_contents[0][0] = array(
+ 'td' => 'align="left"',
+ 'maxlength'=>500,
+ 'text' => ($db->error().' sql='.$sql),
+ );
+ }
+ } else {
+ $this->info_box_contents[0][0] = array(
+ 'td' => 'align="left"',
+ 'text' => $langs->trans("ReadPermissionNotAllowed"),
+ );
+ }
}
/**
diff --git a/htdocs/core/boxes/box_prospect.php b/htdocs/core/boxes/box_prospect.php
index 3020f12f0c4..73d5cf0f70e 100644
--- a/htdocs/core/boxes/box_prospect.php
+++ b/htdocs/core/boxes/box_prospect.php
@@ -104,41 +104,58 @@ class box_prospect extends ModeleBoxes
$datec=$db->jdate($objp->datec);
$datem=$db->jdate($objp->tms);
- $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
- 'logo' => $this->boximg,
- 'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
+ $this->info_box_contents[$i][0] = array(
+ 'td' => 'align="left" width="16"',
+ 'logo' => $this->boximg,
+ 'tooltip' => $objp->name,
+ 'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid,
+ );
- $this->info_box_contents[$i][1] = array('td' => 'align="left"',
- 'text' => $objp->name,
- 'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
+ $this->info_box_contents[$i][1] = array(
+ 'td' => 'align="left"',
+ 'text' => $objp->name,
+ 'tooltip' => $objp->name,
+ 'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid,
+ );
- $this->info_box_contents[$i][2] = array('td' => 'align="right"',
- 'text' => dol_print_date($datem, "day"));
+ $this->info_box_contents[$i][2] = array(
+ 'td' => 'align="right"',
+ 'text' => dol_print_date($datem, "day"),
+ );
- $this->info_box_contents[$i][3] = array('td' => 'align="right" width="18"',
- 'text' => str_replace('img ','img height="14" ',$prospectstatic->LibProspStatut($objp->fk_stcomm,3)));
+ $this->info_box_contents[$i][3] = array(
+ 'td' => 'align="right" width="18"',
+ 'text' => str_replace('img ','img height="14" ',$prospectstatic->LibProspStatut($objp->fk_stcomm,3)),
+ );
- $this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"',
- 'text' => $thirdpartystatic->LibStatut($objp->status,3));
+ $this->info_box_contents[$i][4] = array(
+ 'td' => 'align="right" width="18"',
+ 'text' => $thirdpartystatic->LibStatut($objp->status,3),
+ );
$i++;
- }
+ }
- if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedProspects"));
+ if ($num==0)
+ $this->info_box_contents[$i][0] = array(
+ 'td' => 'align="center"',
+ 'text'=>$langs->trans("NoRecordedProspects"),
+ );
- $db->free($resql);
- }
- else
- {
- $this->info_box_contents[0][0] = array( 'td' => 'align="left"',
- 'maxlength'=>500,
- 'text' => ($db->error().' sql='.$sql));
- }
- }
- else {
+ $db->free($resql);
+ } else {
+ $this->info_box_contents[0][0] = array(
+ 'td' => 'align="left"',
+ 'maxlength'=>500,
+ 'text' => ($db->error().' sql='.$sql),
+ );
+ }
+ } else {
dol_syslog("box_prospect::loadBox not allowed de read this box content",LOG_ERR);
- $this->info_box_contents[0][0] = array('td' => 'align="left"',
- 'text' => $langs->trans("ReadPermissionNotAllowed"));
+ $this->info_box_contents[0][0] = array(
+ 'td' => 'align="left"',
+ 'text' => $langs->trans("ReadPermissionNotAllowed"),
+ );
}
}
diff --git a/htdocs/core/boxes/box_supplier_orders.php b/htdocs/core/boxes/box_supplier_orders.php
index d14bf1a539f..7fb66608840 100644
--- a/htdocs/core/boxes/box_supplier_orders.php
+++ b/htdocs/core/boxes/box_supplier_orders.php
@@ -82,8 +82,7 @@ class box_supplier_orders extends ModeleBoxes
$num = $db->num_rows($result);
$i = 0;
- while ($i < $num)
- {
+ while ($i < $num) {
$objp = $db->fetch_object($result);
$date=$db->jdate($objp->date_commande);
$datem=$db->jdate($objp->tms);
@@ -91,48 +90,70 @@ class box_supplier_orders extends ModeleBoxes
$urlo = DOL_URL_ROOT."/fourn/commande/card.php?id=".$objp->rowid;
$urls = DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid;
- $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
- 'logo' => $this->boximg,
- 'url' => $urlo);
-
- $this->info_box_contents[$i][1] = array('td' => 'align="left"',
- 'text' => $objp->ref,
- 'url' => $urlo);
-
- $this->info_box_contents[$i][2] = array('td' => 'align="left" width="16"',
- 'logo' => 'company',
- 'url' => $urls);
-
- $this->info_box_contents[$i][3] = array('td' => 'align="left"',
- 'text' => $objp->name,
- 'url' => $urls);
-
- $this->info_box_contents[$i][4] = array('td' => 'align="right"',
- 'text' => dol_print_date($date,'day'),
+ $tooltip = $langs->trans('SupplierOrder') . ': ' . $objp->ref;
+ $this->info_box_contents[$i][0] = array(
+ 'td' => 'align="left" width="16"',
+ 'logo' => $this->boximg,
+ 'tooltip' => $tooltip,
+ 'url' => $urlo,
);
- $this->info_box_contents[$i][5] = array('td' => 'align="right" width="18"',
- 'text' => $supplierorderstatic->LibStatut($objp->fk_statut,3));
+ $this->info_box_contents[$i][1] = array(
+ 'td' => 'align="left"',
+ 'text' => $objp->ref,
+ 'tooltip' => $tooltip,
+ 'url' => $urlo,
+ );
+
+ $tooltip = $langs->trans('Supplier') . ': ' . $objp->name;
+ $this->info_box_contents[$i][2] = array(
+ 'td' => 'align="left" width="16"',
+ 'logo' => 'company',
+ 'tooltip' => $tooltip,
+ 'url' => $urls,
+ );
+
+ $this->info_box_contents[$i][3] = array(
+ 'td' => 'align="left"',
+ 'text' => $objp->name,
+ 'tooltip' => $tooltip,
+ 'url' => $urls,
+ );
+
+ $this->info_box_contents[$i][4] = array(
+ 'td' => 'align="right"',
+ 'text' => dol_print_date($date,'day'),
+ );
+
+ $this->info_box_contents[$i][5] = array(
+ 'td' => 'align="right" width="18"',
+ 'text' => $supplierorderstatic->LibStatut($objp->fk_statut,3),
+ );
$i++;
}
if ($num == 0)
- $this->info_box_contents[$i][0] = array('td' => 'align="center"', 'text' => $langs->trans("NoSupplierOrder"));
+ $this->info_box_contents[$i][0] = array(
+ 'td' => 'align="center"',
+ 'text' => $langs->trans("NoSupplierOrder"),
+ );
- $db->free($result);
- }
- else
- {
- $this->info_box_contents[0][0] = array( 'td' => 'align="left"',
- 'maxlength'=>500,
- 'text' => ($db->error().' sql='.$sql));
+ $db->free($result);
+ } else {
+ $this->info_box_contents[0][0] = array(
+ 'td' => 'align="left"',
+ 'maxlength'=>500,
+ 'text' => ($db->error().' sql='.$sql),
+ );
}
}
else
{
- $this->info_box_contents[0][0] = array('td' => 'align="left"',
- 'text' => $langs->trans("ReadPermissionNotAllowed"));
+ $this->info_box_contents[0][0] = array(
+ 'td' => 'align="left"',
+ 'text' => $langs->trans("ReadPermissionNotAllowed"),
+ );
}
}
diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php
index ec1565943c7..faaaaff2ec6 100644
--- a/htdocs/core/boxes/modules_boxes.php
+++ b/htdocs/core/boxes/modules_boxes.php
@@ -187,13 +187,12 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty"
$bcx[0] = 'class="box_pair"';
$bcx[1] = 'class="box_impair"';
$var = false;
- $now = dol_now();
+
$cachetime = 900; // 900 : 15mn
- $fileid = get_class($this).'id-'.$this->box_id.'-e'.$conf->entity.'-u'.$user->id.'-s'.$user->societe_id.'.cache';
$cachedir = DOL_DATA_ROOT.'/cache/boxes';
- if (! dol_is_dir($cachedir)) dol_mkdir($cachedir);
- $cachefile = $cachedir.'/box-'.$fileid;
- $refresh = !file_exists($cachefile) || ($now-$cachetime) > dol_filemtime($cachefile);
+ $fileid = get_class($this).'id-'.$this->box_id.'-e'.$conf->entity.'-u'.$user->id.'-s'.$user->societe_id.'.cache';
+ $filename = '/box-'.$fileid;
+ $refresh = dol_cache_refresh($cachedir, $filename, $cachetime);
$out = '';
if ($refresh) {
@@ -335,10 +334,12 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty"
$out.= "\n";
$out.= "\n\n";
- file_put_contents($cachefile,serialize($out),LOCK_EX);
+ if (! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) {
+ dol_filecache($cachedir, $filename, $out);
+ }
} else {
dol_syslog(get_class($this).'::showBoxCached');
- $out = unserialize(file_get_contents($cachefile));
+ $out = dol_readcachefile($cachedir, $filename);
print "";
}
diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php
index 4b9e7eb520f..8cf4bb3473e 100644
--- a/htdocs/core/lib/files.lib.php
+++ b/htdocs/core/lib/files.lib.php
@@ -1876,3 +1876,49 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
return $ret;
}
+
+/**
+ * Store object in file
+ *
+ * @param string $directory Directory of cache
+ * @param string $filename Name of filecache
+ * @param mixed $object Object to store in cachefile
+ * @return void
+ */
+function dol_filecache($directory, $filename, $object)
+{
+ if (! dol_is_dir($directory)) dol_mkdir($directory);
+ $cachefile = $directory . $filename;
+ file_put_contents($cachefile, serialize($object), LOCK_EX);
+ @chmod($cachefile, 0644);
+}
+
+/**
+ * Test if Refresh needed
+ *
+ * @param string $directory Directory of cache
+ * @param string $filename Name of filecache
+ * @param int $cachetime Cachetime delay
+ * @return boolean 0 no refresh 1 if refresh needed
+ */
+function dol_cache_refresh($directory, $filename, $cachetime)
+{
+ $now = dol_now();
+ $cachefile = $directory . $filename;
+ $refresh = !file_exists($cachefile) || ($now-$cachetime) > dol_filemtime($cachefile);
+ return $refresh;
+}
+
+/**
+ * Read object from cachefile
+ *
+ * @param string $directory Directory of cache
+ * @param string $filename Name of filecache
+ * @return mixed Unserialise from file
+ */
+function dol_readcachefile($directory, $filename)
+{
+ $cachefile = $directory . $filename;
+ $object = unserialize(file_get_contents($cachefile));
+ return $object;
+}
diff --git a/htdocs/expedition/tpl/linkedobjectblock.tpl.php b/htdocs/expedition/tpl/linkedobjectblock.tpl.php
index 72206c13e2b..9c6d2c7679a 100644
--- a/htdocs/expedition/tpl/linkedobjectblock.tpl.php
+++ b/htdocs/expedition/tpl/linkedobjectblock.tpl.php
@@ -46,8 +46,8 @@ foreach($linkedObjectBlock as $object)
{
$var=!$var;
?>
- >|
- trans("ShowShipping"),"sending").' '.$object->ref; ?> |
+ >
+ | getNomUrl(1); ?> |
date_creation,'day'); ?> |
date_delivery,'day'); ?> |
- | >|
- trans("ShowIntervention"),"intervention").' '.$object->ref; ?> |
+ >
+ | getNomUrl(1); ?> |
datev,'day'); ?> |
getLibStatut(3); ?> |
diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php
index ef25be9469f..24aaa1952aa 100644
--- a/htdocs/fourn/class/fournisseur.commande.class.php
+++ b/htdocs/fourn/class/fournisseur.commande.class.php
@@ -531,7 +531,17 @@ class CommandeFournisseur extends CommonOrder
global $langs;
$result='';
- $label=$langs->trans("ShowOrder").': '.$this->ref;
+ $label = '' . $langs->trans("ShowOrder") . '';
+ if (! empty($this->ref))
+ $label .= ' ' . $langs->trans('Ref') . ': ' . $this->ref;
+ if (! empty($this->ref_supplier))
+ $label.= ' ' . $langs->trans('RefSupplier') . ': ' . $this->ref_supplier;
+ if (! empty($this->total_ht))
+ $label.= ' ' . $langs->trans('AmountHT') . ': ' . price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
+ if (! empty($this->total_tva))
+ $label.= ' ' . $langs->trans('TVA') . ': ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
+ if (! empty($this->total_ttc))
+ $label.= ' ' . $langs->trans('AmountTTC') . ': ' . price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
$lien = '';
$lienfin='';
diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php
index 4f0974abd10..a64ee006fe6 100644
--- a/htdocs/fourn/commande/list.php
+++ b/htdocs/fourn/commande/list.php
@@ -99,7 +99,7 @@ $offset = $conf->liste_limit * $page ;
*/
$sql = "SELECT s.rowid as socid, s.nom as name, cf.date_commande as dc,";
-$sql.= " cf.rowid,cf.ref, cf.ref_supplier, cf.fk_statut, cf.total_ttc, cf.fk_user_author,cf.date_livraison,";
+$sql.= " cf.rowid,cf.ref, cf.ref_supplier, cf.fk_statut, cf.total_ht, cf.tva as total_tva, cf.total_ttc, cf.fk_user_author,cf.date_livraison,";
$sql.= " u.login";
$sql.= " FROM (".MAIN_DB_PREFIX."societe as s,";
$sql.= " ".MAIN_DB_PREFIX."commande_fournisseur as cf";
@@ -213,11 +213,18 @@ if ($resql)
{
$obj = $db->fetch_object($resql);
$var=!$var;
+ $objectstatic->id=$obj->rowid;
+ $objectstatic->ref=$obj->ref;
+ $objectstatic->ref_supplier = $obj->ref_supplier;
+ $objectstatic->total_ht = $obj->total_ht;
+ $objectstatic->total_tva = $obj->total_tva;
+ $objectstatic->total_ttc = $obj->total_ttc;
print "";
// Ref
- print '| '.img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref.'';
+ print ' | ';
+ print $objectstatic->getNomUrl(1);
$filename=dol_sanitizeFileName($obj->ref);
$filedir=$conf->fournisseur->dir_output.'/commande' . '/' . dol_sanitizeFileName($obj->ref);
print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
diff --git a/htdocs/langs/en_US/sendings.lang b/htdocs/langs/en_US/sendings.lang
index f6111bac684..f39fcc06574 100644
--- a/htdocs/langs/en_US/sendings.lang
+++ b/htdocs/langs/en_US/sendings.lang
@@ -4,6 +4,7 @@ Sending=Shipment
Sendings=Shipments
Shipment=Shipment
Shipments=Shipments
+ShowSending=Show Sending
Receivings=Receivings
SendingsArea=Shipments area
ListOfSendings=List of shipments
diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index a889136de01..434ff255de5 100755
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -2814,8 +2814,12 @@ class Product extends CommonObject
$result='';
$newref=$this->ref;
if ($maxlength) $newref=dol_trunc($newref,$maxlength,'middle');
- if ($this->type == 0) $label = $langs->trans("ShowProduct").': '.$this->ref.' '.$this->label;
- if ($this->type == 1) $label = $langs->trans("ShowService").': '.$this->ref.' '.$this->label;
+ if ($this->type == 0) $label = '' . $langs->trans("ShowProduct") . '';
+ if ($this->type == 1) $label = '' . $langs->trans("ShowService") . '';
+ if (! empty($this->ref))
+ $label .= ' ' . $langs->trans('Ref') . ': ' . $this->ref;
+ if (! empty($this->label))
+ $label .= ' ' . $langs->trans('Label') . ': ' . $this->label;
$linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
if ($option == 'supplier') {
diff --git a/htdocs/product/list.php b/htdocs/product/list.php
index a5cc97defa7..fb724c252ab 100644
--- a/htdocs/product/list.php
+++ b/htdocs/product/list.php
@@ -420,6 +420,7 @@ else
print ' | ';
$product_static->id = $objp->rowid;
$product_static->ref = $objp->ref;
+ $product_static->label = $objp->label;
$product_static->type = $objp->fk_product_type;
print $product_static->getNomUrl(1,'',24);
print " | \n";
diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php
index 3bfbbbffbcb..3c3d127223e 100644
--- a/htdocs/product/stock/class/entrepot.class.php
+++ b/htdocs/product/stock/class/entrepot.class.php
@@ -512,7 +512,10 @@ class Entrepot extends CommonObject
global $langs;
$result='';
- $label = $langs->trans("ShowStock").': '.$this->libelle;
+ $label = '' . $langs->trans("ShowWarehouse").'';
+ $label.= ' ' . $langs->trans('Ref') . ': ' . $this->libelle;
+ if (! empty($this->lieu))
+ $label.= ' ' . $langs->trans('LocationSummary').': '.$this->lieu;
$lien='';
$lienfin='';
diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php
index c85c501fa58..f6417b389e1 100644
--- a/htdocs/product/stock/list.php
+++ b/htdocs/product/stock/list.php
@@ -103,9 +103,12 @@ if ($result)
while ($i < min($num,$limit))
{
$objp = $db->fetch_object($result);
+ $entrepot->id = $objp->rowid;
+ $entrepot->libelle = $objp->ref;
+ $entrepot->lieu = $objp->lieu;
print " ";
- print '| '.img_object($langs->trans("ShowWarehouse"),'stock').' '.$objp->ref.' | ';
- // Location
+ print '' . $entrepot->getNomUrl(1) . ' | ';
+ // Location
print ''.$objp->lieu.' | ';
// PMP value
print '';
| | |