diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php
index b7c65c3bbeb..70b0fb00b4c 100644
--- a/htdocs/adherents/class/adherent.class.php
+++ b/htdocs/adherents/class/adherent.class.php
@@ -1559,25 +1559,26 @@ class Adherent extends CommonObject
global $langs;
$result='';
+ $label=$langs->trans("ShowMember").': '.$this->ref;
+ $linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
if ($option == 'card')
{
- $lien = '';
+ $lien = 'id.'">';
+ $lien = 'id.'&type=3">';
+ $lien = 'trans("ShowTypeCard",$this->libelle);
- $lien = '';
+ $lien = '';
$lienfin='';
$picto='group';
- $label=$langs->trans("ShowTypeCard",$this->libelle);
if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin);
if ($withpicto && $withpicto != 2) $result.=' ';
diff --git a/htdocs/adherents/class/cotisation.class.php b/htdocs/adherents/class/cotisation.class.php
index 660be1f397a..c7faf97e748 100644
--- a/htdocs/adherents/class/cotisation.class.php
+++ b/htdocs/adherents/class/cotisation.class.php
@@ -264,12 +264,12 @@ class Cotisation extends CommonObject
global $langs;
$result='';
+ $label=$langs->trans("ShowSubscription").': '.$this->ref;
- $lien = '';
+ $lien = '';
$lienfin='';
$picto='payment';
- $label=$langs->trans("ShowSubscription");
if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin);
if ($withpicto && $withpicto != 2) $result.=' ';
diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php
index 31b08437aef..efcee0d756d 100644
--- a/htdocs/categories/class/categorie.class.php
+++ b/htdocs/categories/class/categorie.class.php
@@ -1274,9 +1274,9 @@ class Categorie extends CommonObject
global $langs;
$result='';
-
- $lien = '';
$label=$langs->trans("ShowCategory").': '. ($this->ref?$this->ref:$this->label);
+
+ $lien = '';
$lienfin='';
$picto='category';
diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php
index 7c828f4fa59..d7f63d31872 100644
--- a/htdocs/comm/action/class/actioncomm.class.php
+++ b/htdocs/comm/action/class/actioncomm.class.php
@@ -897,11 +897,12 @@ class ActionComm extends CommonObject
global $conf,$langs;
$result='';
- if ($option=='birthday') $lien = 'id.'">';
- else $lien = 'id.'">';
- $lienfin='';
$label=$this->label;
- if (empty($label)) $label=$this->libelle; // For backward compatibility
+ if (empty($label)) $label=$this->libelle; // For backward compatibility
+ $linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
+ if ($option=='birthday') $lien = 'id.$linkclose;
+ else $lien = 'id.$linkclose;
+ $lienfin='';
//print 'rrr'.$this->libelle.'-'.$withpicto;
if ($withpicto == 2)
diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php
index 636c8c5c737..5e2cc35e796 100644
--- a/htdocs/comm/index.php
+++ b/htdocs/comm/index.php
@@ -142,7 +142,7 @@ if (! empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire)
*/
if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
{
- $sql = "SELECT p.rowid, p.ref, p.total_ht, s.rowid as socid, s.nom as name, s.client, s.canvas";
+ $sql = "SELECT p.rowid, p.ref, p.ref_client, p.total_ht, s.rowid as socid, s.nom as name, s.client, s.canvas";
$sql.= " FROM ".MAIN_DB_PREFIX."propal as p";
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -172,6 +172,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
print '
| ';
$orderstatic->id=$obj->rowid;
$orderstatic->ref=$obj->ref;
+ $orderstatic->ref_client=$obj->ref_client;
print $orderstatic->getNomUrl(1);
print ' | ';
print '';
@@ -467,7 +469,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
{
$langs->load("propal");
- $sql = "SELECT s.nom as name, s.rowid, p.rowid as propalid, p.total as total_ttc, p.total_ht, p.ref, p.fk_statut, p.datep as dp, p.fin_validite as dfv";
+ $sql = "SELECT s.nom as name, s.rowid, p.rowid as propalid, p.total as total_ttc, p.total_ht, p.ref, p.ref_client, p.fk_statut, p.datep as dp, p.fin_validite as dfv";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql.= ", ".MAIN_DB_PREFIX."propal as p";
if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -503,6 +505,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
$propalstatic->id=$obj->propalid;
$propalstatic->ref=$obj->ref;
+ $propalstatic->ref_client=$obj->ref_client;
print '';
print '';
diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php
index 410b6f2dafb..e8ace86cf73 100644
--- a/htdocs/comm/propal/class/propal.class.php
+++ b/htdocs/comm/propal/class/propal.class.php
@@ -2605,29 +2605,31 @@ class Propal extends CommonObject
global $langs;
$result='';
- if ($option == '')
- {
- $lien = '';
+ $label=$langs->trans("ShowPropal").': '.$this->ref;
+ if (! empty($this->ref_client))
+ $label.= ' '.$langs->trans('RefCustomer').': '.$this->ref_client;
+ $linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
+ if ($option == '') {
+ $lien = 'id. $get_params .'">';
+ if ($option == 'compta') { // deprecated
+ $lien = 'id. $get_params .'">';
+ if ($option == 'expedition') {
+ $lien = 'id. $get_params .'">';
+ if ($option == 'document') {
+ $lien = 'ref;
- if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin);
- if ($withpicto && $withpicto != 2) $result.=' ';
+
+ if ($withpicto)
+ $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin);
+ if ($withpicto && $withpicto != 2)
+ $result.=' ';
$result.=$lien.$this->ref.$lienfin;
return $result;
}
diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php
index 8a7005c9fea..7d8cc3d3de2 100644
--- a/htdocs/commande/class/commande.class.php
+++ b/htdocs/commande/class/commande.class.php
@@ -2884,11 +2884,13 @@ class Commande extends CommonOrder
if ($short) return $url;
- $linkstart = '';
- $linkend='';
-
$picto='order';
$label=$langs->trans("ShowOrder").': '.$this->ref;
+ if (! empty($this->ref_client))
+ $label.= ' '.$langs->trans('RefCustomer').': '.$this->ref_client;
+
+ $linkstart = '';
+ $linkend='';
if ($withpicto) $result.=($linkstart.img_object($label, $picto, 'class="classfortooltip"').$linkend);
if ($withpicto && $withpicto != 2) $result.=' ';
diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php
index 685daadc833..5ecca4047e6 100644
--- a/htdocs/compta/bank/class/account.class.php
+++ b/htdocs/compta/bank/class/account.class.php
@@ -935,15 +935,16 @@ class Account extends CommonObject
global $langs;
$result='';
+ $linkclose = '" title="'.dol_escape_htmltag($this->label, 1).'" class="classfortooltip">';
if (empty($mode))
{
- $lien = '';
+ $lien = 'id.'">';
+ $lien = 'rowid.'">';
+ $label=$langs->trans("ShowTransaction").': '.$this->rowid;
+ $lien = '';
$lienfin='';
- if ($withpicto) $result.=($lien.img_object($langs->trans("ShowTransaction"), 'account', 'class="classfortooltip"').$lienfin.' ');
+ if ($withpicto) $result.=($lien.img_object($label, 'account', 'class="classfortooltip"').$lienfin.' ');
$result.=$lien.$this->rowid.$lienfin;
if ($option == 'showall' || $option == 'showconciliated') $result.=' (';
diff --git a/htdocs/compta/deplacement/class/deplacement.class.php b/htdocs/compta/deplacement/class/deplacement.class.php
index bb0e7d3506b..b54ac75bc23 100644
--- a/htdocs/compta/deplacement/class/deplacement.class.php
+++ b/htdocs/compta/deplacement/class/deplacement.class.php
@@ -357,13 +357,13 @@ class Deplacement extends CommonObject
global $langs;
$result='';
+ $label=$langs->trans("Show").': '.$this->ref;
- $lien = '';
+ $lien = '';
$lienfin='';
$picto='trip';
- $label=$langs->trans("Show").': '.$this->ref;
if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin);
if ($withpicto && $withpicto != 2) $result.=' ';
diff --git a/htdocs/compta/dons/class/don.class.php b/htdocs/compta/dons/class/don.class.php
index 4d7c8931e31..69a84831b90 100644
--- a/htdocs/compta/dons/class/don.class.php
+++ b/htdocs/compta/dons/class/don.class.php
@@ -711,13 +711,13 @@ class Don extends CommonObject
global $langs;
$result='';
+ $label=$langs->trans("ShowDonation").': '.$this->id;
- $lien = '';
+ $lien = '';
$lienfin='';
$picto='generic';
- $label=$langs->trans("ShowDonation").': '.$this->id;
if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin);
if ($withpicto && $withpicto != 2) $result.=' ';
diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php
index 71634aaa3ad..cadce3db632 100644
--- a/htdocs/compta/facture/class/facture-rec.class.php
+++ b/htdocs/compta/facture/class/facture-rec.class.php
@@ -558,13 +558,13 @@ class FactureRec extends Facture
global $langs;
$result='';
+ $label=$langs->trans("ShowInvoice").': '.$this->ref;
- $lien = '';
+ $lien = '';
$lienfin='';
$picto='bill';
- $label=$langs->trans("ShowInvoice").': '.$this->ref;
if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin);
if ($withpicto && $withpicto != 2) $result.=' ';
diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php
index a1fe6ee1c4d..32d7fa13122 100644
--- a/htdocs/compta/facture/class/facture.class.php
+++ b/htdocs/compta/facture/class/facture.class.php
@@ -865,7 +865,7 @@ class Facture extends CommonInvoice
if ($this->type == self::TYPE_SITUATION) $label=$langs->transnoentitiesnoconv("ShowInvoiceSituation").': '.$this->ref;
if ($moretitle) $label.=' - '.$moretitle;
- $linkstart='';
+ $linkstart='';
$linkend='';
if ($withpicto) $result.=($linkstart.img_object(($max?dol_trunc($label,$max):$label), $picto, 'class="classfortooltip"').$linkend);
diff --git a/htdocs/compta/localtax/class/localtax.class.php b/htdocs/compta/localtax/class/localtax.class.php
index 85da8e05476..1512d0d39ac 100644
--- a/htdocs/compta/localtax/class/localtax.class.php
+++ b/htdocs/compta/localtax/class/localtax.class.php
@@ -585,12 +585,12 @@ class Localtax extends CommonObject
global $langs;
$result='';
+ $label=$langs->trans("ShowVatPayment").': '.$this->ref;
- $lien = '';
+ $lien = '';
$lienfin='';
$picto='payment';
- $label=$langs->trans("ShowVatPayment").': '.$this->ref;
if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin);
if ($withpicto && $withpicto != 2) $result.=' ';
diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php
index 9db0591ee33..11a61874e7e 100644
--- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php
+++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php
@@ -769,11 +769,12 @@ class RemiseCheque extends CommonObject
global $langs;
$result='';
+ $label = $langs->trans("ShowCheckReceipt").': '.$this->ref;
- $lien = '';
+ $lien = '';
$lienfin='';
- if ($withpicto) $result.=($lien.img_object($langs->trans("ShowCheckReceipt"), 'payment', 'class="classfortooltip"').$lienfin);
+ if ($withpicto) $result.=($lien.img_object($label, 'payment', 'class="classfortooltip"').$lienfin);
if ($withpicto && $withpicto != 2) $result.=' ';
if ($withpicto != 2) $result.=$lien.$this->ref.$lienfin;
diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php
index d2256926e1a..b73eb490296 100644
--- a/htdocs/compta/paiement/class/paiement.class.php
+++ b/htdocs/compta/paiement/class/paiement.class.php
@@ -748,8 +748,9 @@ class Paiement extends CommonObject
global $langs;
$result='';
+ $label = $langs->trans("ShowPayment").': '.$this->ref;
- $lien = '';
+ $lien = '';
$lienfin='';
if ($withpicto) $result.=($lien.img_object($langs->trans("ShowPayment"), 'payment', 'class="classfortooltip"').$lienfin);
diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php
index db4c436dfa6..22e0a078c23 100644
--- a/htdocs/compta/prelevement/class/bonprelevement.class.php
+++ b/htdocs/compta/prelevement/class/bonprelevement.class.php
@@ -1118,17 +1118,18 @@ class BonPrelevement extends CommonObject
global $langs;
$result='';
+ $label = $langs->trans("ShowWithdraw").': '.$this->ref;
- $lien = '';
+ $lien = '';
$lienfin='';
if ($option == 'xxx')
{
- $lien = '';
+ $lien = '';
$lienfin='';
}
- if ($withpicto) $result.=($lien.img_object($langs->trans("ShowWithdraw"), 'payment', 'class="classfortooltip"').$lienfin.' ');
+ if ($withpicto) $result.=($lien.img_object($label, 'payment', 'class="classfortooltip"').$lienfin.' ');
$result.=$lien.$this->ref.$lienfin;
return $result;
}
diff --git a/htdocs/compta/salaries/class/paymentsalary.class.php b/htdocs/compta/salaries/class/paymentsalary.class.php
index 635ed77541f..83a1c937545 100644
--- a/htdocs/compta/salaries/class/paymentsalary.class.php
+++ b/htdocs/compta/salaries/class/paymentsalary.class.php
@@ -486,12 +486,12 @@ class PaymentSalary extends CommonObject
global $langs;
$result='';
+ $label=$langs->trans("ShowSalaryPayment").': '.$this->ref;
- $lien = '';
+ $lien = '';
$lienfin='';
$picto='payment';
- $label=$langs->trans("ShowSalaryPayment").': '.$this->ref;
if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin);
if ($withpicto && $withpicto != 2) $result.=' ';
diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php
index 4e7211c75b1..af8eedb617c 100644
--- a/htdocs/compta/sociales/class/chargesociales.class.php
+++ b/htdocs/compta/sociales/class/chargesociales.class.php
@@ -420,11 +420,12 @@ class ChargeSociales extends CommonObject
$result='';
if (empty($this->ref)) $this->ref=$this->lib;
+ $label = $langs->trans("ShowSocialContribution").': '.$this->ref;
- $lien = '';
+ $lien = '';
$lienfin='';
- if ($withpicto) $result.=($lien.img_object($langs->trans("ShowSocialContribution").': '.$this->lib, 'bill', 'class="classfortooltip"').$lienfin.' ');
+ if ($withpicto) $result.=($lien.img_object($label, 'bill', 'class="classfortooltip"').$lienfin.' ');
if ($withpicto && $withpicto != 2) $result.=' ';
if ($withpicto != 2) $result.=$lien.($maxlen?dol_trunc($this->ref,$maxlen):$this->ref).$lienfin;
return $result;
diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php
index a94afc98f6e..cf407e091f4 100644
--- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php
+++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php
@@ -585,13 +585,14 @@ class PaymentSocialContribution extends CommonObject
$result='';
if (empty($this->ref)) $this->ref=$this->lib;
+ $label = $langs->trans("ShowPayment").': '.$this->ref;
if (!empty($this->id))
{
- $lien = '';
+ $lien = '';
$lienfin='';
- if ($withpicto) $result.=($lien.img_object($langs->trans("ShowPayment").': '.$this->ref, 'payment', 'class="classfortooltip"').$lienfin.' ');
+ if ($withpicto) $result.=($lien.img_object($label, 'payment', 'class="classfortooltip"').$lienfin.' ');
if ($withpicto && $withpicto != 2) $result.=' ';
if ($withpicto != 2) $result.=$lien.($maxlen?dol_trunc($this->ref,$maxlen):$this->ref).$lienfin;
}
diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php
index 96db35f915b..c32297a7e12 100644
--- a/htdocs/compta/tva/class/tva.class.php
+++ b/htdocs/compta/tva/class/tva.class.php
@@ -638,12 +638,12 @@ class Tva extends CommonObject
global $langs;
$result='';
+ $label=$langs->trans("ShowVatPayment").': '.$this->ref;
- $lien = '';
+ $lien = '';
$lienfin='';
$picto='payment';
- $label=$langs->trans("ShowVatPayment").': '.$this->ref;
if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin);
if ($withpicto && $withpicto != 2) $result.=' ';
diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php
index cbc813968d1..f3cbeccd586 100644
--- a/htdocs/contact/class/contact.class.php
+++ b/htdocs/contact/class/contact.class.php
@@ -887,17 +887,18 @@ class Contact extends CommonObject
global $langs;
$result='';
+ $label = $langs->trans("ShowContact").': '.$this->getFullName($langs);
- $lien = '';
+ $lien = '';
$lienfin='';
if ($option == 'xxx')
{
- $lien = '';
+ $lien = '';
$lienfin='';
}
- if ($withpicto) $result.=($lien.img_object($langs->trans("ShowContact").': '.$this->getFullName($langs), 'contact', 'class="classfortooltip"').$lienfin.' ');
+ if ($withpicto) $result.=($lien.img_object($label, 'contact', 'class="classfortooltip"').$lienfin.' ');
$result.=$lien.($maxlen?dol_trunc($this->getFullName($langs),$maxlen):$this->getFullName($langs)).$lienfin;
return $result;
}
diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php
index 1417047b269..4d455f79369 100644
--- a/htdocs/contrat/class/contrat.class.php
+++ b/htdocs/contrat/class/contrat.class.php
@@ -1682,13 +1682,13 @@ class Contrat extends CommonObject
global $langs;
$result='';
+ $label=$langs->trans("ShowContract").': '.$this->ref;
- $lien = '';
+ $lien = '';
$lienfin='';
$picto='contract';
- $label=$langs->trans("ShowContract").': '.$this->ref;
if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin);
if ($withpicto && $withpicto != 2) $result.=' ';
@@ -2211,13 +2211,13 @@ class ContratLigne extends CommonObject
global $langs;
$result='';
+ $label=$langs->trans("ShowContractOfService").': '.$this->label;
- $lien = '';
+ $lien = '';
$lienfin='';
$picto='contract';
- $label=$langs->trans("ShowContractOfService").': '.$this->label;
if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin);
if ($withpicto && $withpicto != 2) $result.=' ';
diff --git a/htdocs/core/boxes/box_actions.php b/htdocs/core/boxes/box_actions.php
index 89d05b92b79..ed5e731d896 100644
--- a/htdocs/core/boxes/box_actions.php
+++ b/htdocs/core/boxes/box_actions.php
@@ -60,8 +60,7 @@ class box_actions extends ModeleBoxes
$this->info_box_head = array('text' => $langs->trans("BoxTitleLastActionsToDo",$max));
- if ($user->rights->agenda->myactions->read)
- {
+ if ($user->rights->agenda->myactions->read) {
$sql = "SELECT a.id, a.label, a.datep as dp, a.percent as percentage,";
$sql.= " ta.code, ta.libelle as type_label,";
$sql.= " s.nom as name, s.rowid as socid";
@@ -80,15 +79,13 @@ class box_actions extends ModeleBoxes
dol_syslog("Box_actions::loadBox", LOG_DEBUG);
$result = $db->query($sql);
- if ($result)
- {
+ if ($result) {
$now=dol_now();
$delay_warning=$conf->global->MAIN_DELAY_ACTIONS_TODO*24*60*60;
$num = $db->num_rows($result);
$i = 0;
- while ($i < $num)
- {
+ while ($i < $num) {
$late = '';
$objp = $db->fetch_object($result);
$datelimite=$db->jdate($objp->dp);
@@ -98,48 +95,68 @@ 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;
- $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
- 'logo' => ("action"),
- 'url' => DOL_URL_ROOT."/comm/action/card.php?id=".$objp->id);
+ $this->info_box_contents[$i][0] = array(
+ 'td' => 'align="left" width="16"',
+ 'logo' => ("action"),
+ 'tooltip' => $langs->trans('Action'.$objp->code).': '.$label,
+ 'url' => DOL_URL_ROOT."/comm/action/card.php?id=".$objp->id,
+ );
- $this->info_box_contents[$i][1] = array('td' => 'align="left"',
- 'text' => dol_trunc($label,32),
- 'text2'=> $late,
- 'url' => DOL_URL_ROOT."/comm/action/card.php?id=".$objp->id);
+ $this->info_box_contents[$i][1] = array(
+ 'td' => 'align="left"',
+ 'text' => dol_trunc($label,32),
+ 'text2'=> $late,
+ 'tooltip' => $langs->trans('Action'.$objp->code).': '.$label,
+ 'url' => DOL_URL_ROOT."/comm/action/card.php?id=".$objp->id,
+ );
- $this->info_box_contents[$i][2] = array('td' => 'align="left" width="16"',
- 'logo' => ($objp->socid?'company':''),
- 'url' => ($objp->socid?DOL_URL_ROOT."/societe/soc.php?socid=".$objp->socid:''));
+ $this->info_box_contents[$i][2] = array(
+ 'td' => 'align="left" width="16"',
+ 'logo' => ($objp->socid?'company':''),
+ 'tooltip' => $langs->trans('Customer').': '.$objp->name,
+ '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),
- 'url' => 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,
+ 'url' => DOL_URL_ROOT."/societe/soc.php?socid=".$objp->socid,
+ );
- $this->info_box_contents[$i][4] = array('td' => 'align="left" class="nowrap"',
- 'text' => dol_print_date($datelimite, "dayhour"));
+ $this->info_box_contents[$i][4] = array(
+ 'td' => 'align="left" class="nowrap"',
+ 'text' => dol_print_date($datelimite, "dayhour"),
+ );
- $this->info_box_contents[$i][5] = array('td' => 'align="right"',
- 'text' => ($objp->percentage>= 0?$objp->percentage.'%':''));
+ $this->info_box_contents[$i][5] = array(
+ 'td' => 'align="right"',
+ 'text' => ($objp->percentage>= 0?$objp->percentage.'%':''),
+ );
- $this->info_box_contents[$i][6] = array('td' => 'align="right" width="18"',
- 'text' => $actionstatic->LibStatut($objp->percentage,3));
+ $this->info_box_contents[$i][6] = array(
+ 'td' => 'align="right" width="18"',
+ 'text' => $actionstatic->LibStatut($objp->percentage,3),
+ );
- $i++;
- }
+ $i++;
+ }
if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoActionsToDo"));
$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('align' => 'left',
- 'text' => $langs->trans("ReadPermissionNotAllowed"));
+ } 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(
+ 'align' => 'left',
+ 'text' => $langs->trans("ReadPermissionNotAllowed"),
+ );
}
}
diff --git a/htdocs/core/boxes/box_activity.php b/htdocs/core/boxes/box_activity.php
index d118bc8a4bc..9eaeb1d8cb4 100644
--- a/htdocs/core/boxes/box_activity.php
+++ b/htdocs/core/boxes/box_activity.php
@@ -1,6 +1,7 @@
- * Copyright (C) 2005-2013 Laurent Destailleur
+ * Copyright (C) 2005-2013 Laurent Destailleur
+ * Copyright (C) 2014 Frederic France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -17,9 +18,9 @@
*/
/**
- * \file htdocs/core/boxes/box_activity.php
- * \ingroup societes
- * \brief Module to show box of bills, orders & propal of the current year
+ * \file htdocs/core/boxes/box_activity.php
+ * \ingroup societes
+ * \brief Module to show box of bills, orders & propal of the current year
*/
include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php';
@@ -29,275 +30,416 @@ include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php';
*/
class box_activity extends ModeleBoxes
{
- var $boxcode="activity";
- var $boximg="object_bill";
- var $boxlabel='BoxGlobalActivity';
- var $depends = array("facture");
+ var $boxcode="activity";
+ var $boximg="object_bill";
+ var $boxlabel='BoxGlobalActivity';
+ var $depends = array("facture");
- var $db;
- var $param;
- var $enabled = 1;
+ var $db;
+ var $param;
+ var $enabled = 1;
- var $info_box_head = array();
- var $info_box_contents = array();
+ var $info_box_head = array();
+ var $info_box_contents = array();
- /**
- * Constructor
- *
- * @param DoliDB $db Database handler
- * @param string $param More parameters
- */
- function __construct($db,$param)
- {
- global $conf;
+ /**
+ * Constructor
+ *
+ * @param DoliDB $db Database handler
+ * @param string $param More parameters
+ */
+ function __construct($db,$param)
+ {
+ global $conf;
- $this->db=$db;
- // FIXME: Use a cache to save data because this slow down too much main home page. This box slow down too seriously software.
- // FIXME: Removed number_format (not compatible with all languages)
- // FIXME: Pb into some status
- $this->enabled=$conf->global->MAIN_FEATURES_LEVEL; // Not enabled by default due to bugs (see previous comments)
- }
+ $this->db=$db;
+ // FIXME: Pb into some status
+ $this->enabled=$conf->global->MAIN_FEATURES_LEVEL; // Not enabled by default due to bugs (see previous comments)
+ }
- /**
- * Charge les donnees en memoire pour affichage ulterieur
- *
- * @param int $max Maximum number of records to load
- * @return void
- */
- function loadBox($max=5)
- {
- global $conf, $user, $langs, $db;
+ /**
+ * Charge les donnees en memoire pour affichage ulterieur
+ *
+ * @param int $max Maximum number of records to load
+ * @return void
+ */
+ function loadBox($max=5)
+ {
+ global $conf, $user, $langs, $db;
- $totalMnt = 0;
- $totalnb = 0;
- $i = 0;
+ include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
+ include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
- include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
+ $totalMnt = 0;
+ $totalnb = 0;
+ $i = 0;
+ $cachetime = 3600;
+ $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;
- $nbofyears=2;
- if (! empty($conf->global->MAIN_BOX_ACTIVITY_DURATION)) $nbofyears=$conf->global->MAIN_BOX_ACTIVITY_DURATION;
- $textHead = $langs->trans("Activity").' ('.$nbofyears.' '.$langs->trans("DurationYears").')';
- $this->info_box_head = array('text' => $textHead, 'limit'=> dol_strlen($textHead));
+ if (! empty($conf->global->MAIN_BOX_ACTIVITY_DURATION)) $nbofyears=$conf->global->MAIN_BOX_ACTIVITY_DURATION;
+ $textHead = $langs->trans("Activity").' '.$nbofyears.' '.$langs->trans("DurationYears").'';
+ $this->info_box_head = array(
+ 'text' => $textHead,
+ 'limit'=> dol_strlen($textHead),
+ );
- // compute the year limit to show
- $tmpdate= dol_time_plus_duree(dol_now(), -1*$nbofyears, "y");
+ // compute the year limit to show
+ $tmpdate= dol_time_plus_duree(dol_now(), -1*$nbofyears, "y");
- // list the summary of the bills
- if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
- {
- include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
- $facturestatic=new Facture($db);
+ // list the summary of the bills
+ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) {
+ include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
+ $facturestatic=new Facture($db);
- $sql = "SELECT f.fk_statut, SUM(f.total_ttc) as Mnttot, COUNT(*) as nb";
- $sql.= " FROM (".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
- if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
- $sql.= ")";
- $sql.= " WHERE f.entity = ".$conf->entity;
- if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
- if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id;
- $sql.= " AND f.fk_soc = s.rowid";
- $sql.= " AND f.datef >= '".$db->idate($tmpdate)."' AND paye=1";
- $sql.= " GROUP BY f.fk_statut";
- $sql.= " ORDER BY f.fk_statut DESC";
+ $cachefile = DOL_DATA_ROOT.'/facture/temp/boxactivity-invoice'.$fileid;
+ $refresh = !file_exists($cachefile) || ($now-$cachetime) > dol_filemtime($cachefile);
+ $data = array();
+ if ($refresh) {
+ $sql = "SELECT f.fk_statut, SUM(f.total_ttc) as Mnttot, COUNT(*) as nb";
+ $sql.= " FROM (".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
+ if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
+ $sql.= ")";
+ $sql.= " WHERE f.entity = ".$conf->entity;
+ if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
+ if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id;
+ $sql.= " AND f.fk_soc = s.rowid";
+ $sql.= " AND f.datef >= '".$db->idate($tmpdate)."' AND paye=1";
+ $sql.= " GROUP BY f.fk_statut";
+ $sql.= " ORDER BY f.fk_statut DESC";
- $result = $db->query($sql);
- if ($result)
- {
- $num = $db->num_rows($result);
- while ($i < $num)
- {
- $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', 'logo' => 'bill');
- $objp = $db->fetch_object($result);
+ $result = $db->query($sql);
+ if ($result) {
+ $num = $db->num_rows($result);
+ $j=0;
+ while ($j < $num) {
+ $data[$j]=$db->fetch_object($result);
+ $j++;
+ }
+ file_put_contents($cachefile,serialize($data),LOCK_EX);
+ $db->free($result);
+ } else {
+ dol_print_error($db);
+ }
+ } else {
+ $data = unserialize(file_get_contents($cachefile));
+ }
+ if (! empty($data)) {
+ $j=0;
+ while ($i < count($data)) {
+ $billurl="viewstatut=2&paye=1&year=".$data[$j]->annee;
+ $this->info_box_contents[$i][0] = array(
+ 'td' => 'align="left" width="16"',
+ 'tooltip' => $langs->trans('Bills').' '.$facturestatic->LibStatut(1,$data[$j]->fk_statut,0),
+ 'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills",
+ 'logo' => 'bill',
+ );
- $this->info_box_contents[$i][1] = array('td' => 'align="left"', 'text' => $langs->trans("Bills")." ".$facturestatic->LibStatut(1,$objp->fk_statut,0)." ".$objp->annee);
- $billurl="viewstatut=2&paye=1&year=".$objp->annee;
+ $this->info_box_contents[$i][1] = array(
+ 'td' => 'align="left"',
+ 'text' => $langs->trans("Bills")." ".$facturestatic->LibStatut(1,$data[$j]->fk_statut,0)." ".$data[$j]->annee,
+ );
- $this->info_box_contents[$i][2] = array('td' => 'align="right"',
- 'text' => $objp->nb, 'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills"
- );
+ $this->info_box_contents[$i][2] = array(
+ 'td' => 'align="right"',
+ 'tooltip' => $langs->trans('Bills').' '.$facturestatic->LibStatut(1,$data[$j]->fk_statut,0),
+ 'text' => $data[$j]->nb,
+ 'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills",
+ );
- $this->info_box_contents[$i][3] = array('td' => 'align="right"',
- 'text' => price($objp->Mnttot,1,$langs,0,0,-1,$conf->currency)
- );
+ $this->info_box_contents[$i][3] = array(
+ 'td' => 'align="right"',
+ 'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency)
+ );
- // We add only for the current year
- if ($objp->annee == date("Y"))
- {
- $totalnb += $objp->nb;
- $totalMnt += $objp->Mnttot;
- }
- $this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"', 'text' => $facturestatic->LibStatut(1,$objp->fk_statut,3) );
- $i++;
- }
- if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedInvoices"));
+ // We add only for the current year
+ if ($data[$j]->annee == date("Y")) {
+ $totalnb += $data[$j]->nb;
+ $totalMnt += $data[$j]->Mnttot;
+ }
+ $this->info_box_contents[$i][4] = array(
+ 'td' => 'align="right" width="18"',
+ 'text' => $facturestatic->LibStatut(1,$data[$j]->fk_statut,3),
+ );
+ $i++;
+ $j++;
+ }
+ if (count($data)==0)
+ $this->info_box_contents[$i][0] = array(
+ 'td' => 'align="center"',
+ 'text'=>$langs->trans("NoRecordedInvoices"),
+ );
+ }
- $db->free($result);
- }
- else dol_print_error($db);
+ $cachefile = DOL_DATA_ROOT.'/facture/temp/boxactivity-invoice2'.$fileid;
+ $refresh = !file_exists($cachefile) || ($now-$cachetime) > dol_filemtime($cachefile);
- $sql = "SELECT f.fk_statut, SUM(f.total_ttc) as Mnttot, COUNT(*) as nb";
- $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
- $sql.= " WHERE f.entity = ".$conf->entity;
- $sql.= " AND f.fk_soc = s.rowid";
- $sql.= " AND paye=0";
- $sql.= " GROUP BY f.fk_statut";
- $sql.= " ORDER BY f.fk_statut DESC";
+ if ($refresh) {
+ $sql = "SELECT f.fk_statut, SUM(f.total_ttc) as Mnttot, COUNT(*) as nb";
+ $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
+ $sql.= " WHERE f.entity = ".$conf->entity;
+ $sql.= " AND f.fk_soc = s.rowid";
+ $sql.= " AND paye=0";
+ $sql.= " GROUP BY f.fk_statut";
+ $sql.= " ORDER BY f.fk_statut DESC";
- $result = $db->query($sql);
- if ($result)
- {
- $num = $db->num_rows($result) + $i;
- $now=dol_now();
+ $result = $db->query($sql);
+ if ($result) {
+ $num = $db->num_rows($result) + $i;
+ $j=0;
+ while ($j < $num) {
+ $data[$j]=$db->fetch_object($result);
+ $j++;
+ }
+ file_put_contents($cachefile,serialize($data),LOCK_EX);
+ $db->free($result);
+ } else {
+ dol_print_error($db);
+ }
+ } else {
+ $data = unserialize(file_get_contents($cachefile));
+ }
+ if (! empty($data)) {
+ $j=0;
- while ($i < $num)
- {
- $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
- 'logo' => 'bill');
- $objp = $db->fetch_object($result);
+ while ($i < count($data)) {
+ $billurl="viewstatut=".$data[$j]->fk_statut."&paye=0";
+ $this->info_box_contents[$i][0] = array(
+ 'td' => 'align="left" width="16"',
+ 'tooltip' => $langs->trans('Bills').' '.$facturestatic->LibStatut(0,$data[$j]->fk_statut,0),
+ 'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills",
+ 'logo' => 'bill',
+ );
- $this->info_box_contents[$i][1] = array('td' => 'align="left"',
- 'text' => $langs->trans("Bills")." ".$facturestatic->LibStatut(0,$objp->fk_statut,0));
+ $this->info_box_contents[$i][1] = array(
+ 'td' => 'align="left"',
+ 'text' => $langs->trans("Bills")." ".$facturestatic->LibStatut(0,$data[$j]->fk_statut,0),
+ );
- $billurl="viewstatut=".$objp->fk_statut."&paye=0";
- $this->info_box_contents[$i][2] = array('td' => 'align="right"',
- 'text' => $objp->nb, 'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills"
- );
- $totalnb += $objp->nb;
- $this->info_box_contents[$i][3] = array('td' => 'align="right"',
- 'text' => price($objp->Mnttot,1,$langs,0,0,-1,$conf->currency)
- );
- $totalMnt += $objp->Mnttot;
- $this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"',
- 'text' => $facturestatic->LibStatut(0,$objp->fk_statut,3)
- );
- $i++;
- }
- if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedInvoices"));
- } else {
- $this->info_box_contents[0][0] = array( 'td' => 'align="left"', 'maxlength'=>500, 'text' => ($db->error().' sql='.$sql));
- }
- }
+ $this->info_box_contents[$i][2] = array(
+ 'td' => 'align="right"',
+ 'text' => $data[$j]->nb,
+ 'tooltip' => $langs->trans('Bills').' '.$facturestatic->LibStatut(0,$data[$j]->fk_statut,0),
+ 'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills",
+ );
+ $totalnb += $data[$j]->nb;
+ $this->info_box_contents[$i][3] = array(
+ 'td' => 'align="right"',
+ 'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency),
+ );
+ $totalMnt += $objp->Mnttot;
+ $this->info_box_contents[$i][4] = array(
+ 'td' => 'align="right" width="18"',
+ 'text' => $facturestatic->LibStatut(0,$data[$j]->fk_statut,3),
+ );
+ $i++;
+ $j++;
+ }
+ if ($num==0)
+ $this->info_box_contents[$i][0] = array(
+ 'td' => 'align="center"',
+ 'text'=>$langs->trans("NoRecordedInvoices"),
+ );
+ } else {
+ $this->info_box_contents[0][0] = array(
+ 'td' => 'align="left"',
+ 'maxlength'=>500, 'text' => ($db->error().' sql='.$sql),
+ );
+ }
+ }
- // list the summary of the orders
- if (! empty($conf->commande->enabled) && $user->rights->commande->lire)
- {
- include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
- $commandestatic=new Commande($db);
+ // list the summary of the orders
+ if (! empty($conf->commande->enabled) && $user->rights->commande->lire) {
+ include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
+ $commandestatic=new Commande($db);
- $sql = "SELECT c.fk_statut, sum(c.total_ttc) as Mnttot, count(*) as nb";
- $sql.= " FROM (".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as c";
- if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
- $sql.= ")";
- $sql.= " WHERE c.entity = ".$conf->entity;
- $sql.= " AND c.fk_soc = s.rowid";
- if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
- if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id;
- $sql.= " AND c.date_commande >= '".$db->idate($tmpdate)."'";
- $sql.= " AND c.facture=0";
- $sql.= " GROUP BY c.fk_statut";
- $sql.= " ORDER BY c.fk_statut DESC";
+ $cachefile = DOL_DATA_ROOT.'/commande/temp/boxactivity-order'.$fileid;
+ $refresh = !file_exists($cachefile) || ($now-$cachetime) > dol_filemtime($cachefile);
+ $data = array();
+ if ($refresh) {
- $result = $db->query($sql);
+ $sql = "SELECT c.fk_statut, sum(c.total_ttc) as Mnttot, count(*) as nb";
+ $sql.= " FROM (".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as c";
+ if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
+ $sql.= ")";
+ $sql.= " WHERE c.entity = ".$conf->entity;
+ $sql.= " AND c.fk_soc = s.rowid";
+ if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
+ if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id;
+ $sql.= " AND c.date_commande >= '".$db->idate($tmpdate)."'";
+ $sql.= " AND c.facture=0";
+ $sql.= " GROUP BY c.fk_statut";
+ $sql.= " ORDER BY c.fk_statut DESC";
- if ($result)
- {
- $num = $db->num_rows($result) + $i;
- while ($i < $num)
- {
- $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"','logo' => 'object_order');
+ $result = $db->query($sql);
- $objp = $db->fetch_object($result);
- $this->info_box_contents[$i][1] = array('td' => 'align="left"',
- 'text' =>$langs->trans("Orders")." ".$commandestatic->LibStatut($objp->fk_statut,0,0)
- );
+ if ($result) {
+ $num = $db->num_rows($result) + $i;
+ $j=0;
+ while ($j < $num) {
+ $data[$j]=$db->fetch_object($result);
+ $j++;
+ }
+ file_put_contents($cachefile,serialize($data),LOCK_EX);
+ $db->free($result);
+ } else {
+ dol_print_error($db);
+ }
+ } else {
+ $data = unserialize(file_get_contents($cachefile));
+ }
+ if (! empty($data)) {
+ $j=0;
+ while ($i < count($data)) {
+ $this->info_box_contents[$i][0] = array(
+ 'td' => 'align="left" width="16"',
+ 'url' => DOL_URL_ROOT."/commande/list.php?mainmenu=commercial&leftmenu=orders&viewstatut=".$data[$j]->fk_statut,
+ 'tooltip' => $langs->trans("Orders")." ".$commandestatic->LibStatut($data[$j]->fk_statut,0,0),
+ 'logo' => 'object_order',
+ );
- $this->info_box_contents[$i][2] = array('td' => 'align="right"',
- 'text' => $objp->nb,
- 'url' => DOL_URL_ROOT."/commande/list.php?mainmenu=commercial&leftmenu=orders&viewstatut=".$objp->fk_statut
- );
- $totalnb += $objp->nb;
+ $this->info_box_contents[$i][1] = array(
+ 'td' => 'align="left"',
+ 'text' =>$langs->trans("Orders")." ".$commandestatic->LibStatut($data[$j]->fk_statut,0,0),
+ );
- $this->info_box_contents[$i][3] = array('td' => 'align="right"',
- 'text' => price($objp->Mnttot,1,$langs,0,0,-1,$conf->currency)
- );
- $totalMnt += $objp->Mnttot;
- $this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"', 'text' => $commandestatic->LibStatut($objp->fk_statut,0,3));
+ $this->info_box_contents[$i][2] = array(
+ 'td' => 'align="right"',
+ 'text' => $data[$j]->nb,
+ 'tooltip' => $langs->trans("Orders")." ".$commandestatic->LibStatut($data[$j]->fk_statut,0,0),
+ 'url' => DOL_URL_ROOT."/commande/list.php?mainmenu=commercial&leftmenu=orders&viewstatut=".$data[$j]->fk_statut,
+ );
+ $totalnb += $data[$j]->nb;
- $i++;
- }
- }
- else dol_print_error($db);
- }
+ $this->info_box_contents[$i][3] = array(
+ 'td' => 'align="right"',
+ 'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency),
+ );
+ $totalMnt += $data[$j]->Mnttot;
+ $this->info_box_contents[$i][4] = array(
+ 'td' => 'align="right" width="18"',
+ 'text' => $commandestatic->LibStatut($data[$j]->fk_statut,0,3),
+ );
- // list the summary of the propals
- if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
- {
- include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
- $propalstatic=new Propal($db);
+ $i++;
+ $j++;
+ }
+ }
+ }
- $sql = "SELECT p.fk_statut, SUM(p.total) as Mnttot, COUNT(*) as nb";
- $sql.= " FROM (".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p";
- if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
- $sql.= ")";
- $sql.= " WHERE p.entity = ".$conf->entity;
- $sql.= " AND p.fk_soc = s.rowid";
- if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
- if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id;
- $sql.= " AND p.datep >= '".$db->idate($tmpdate)."'";
- $sql.= " AND p.date_cloture IS NULL"; // just unclosed
- $sql.= " GROUP BY p.fk_statut";
- $sql.= " ORDER BY p.fk_statut DESC";
+ // list the summary of the propals
+ if (! empty($conf->propal->enabled) && $user->rights->propal->lire) {
+ include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
+ $propalstatic=new Propal($db);
- $result = $db->query($sql);
+ $cachefile = DOL_DATA_ROOT.'/propale/temp/boxactivity-propal'.$fileid;
+ $refresh = !file_exists($cachefile) || ($now-$cachetime) > dol_filemtime($cachefile);
+ $data = array();
+ if ($refresh) {
+ $sql = "SELECT p.fk_statut, SUM(p.total) as Mnttot, COUNT(*) as nb";
+ $sql.= " FROM (".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p";
+ if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
+ $sql.= ")";
+ $sql.= " WHERE p.entity = ".$conf->entity;
+ $sql.= " AND p.fk_soc = s.rowid";
+ if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
+ if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id;
+ $sql.= " AND p.datep >= '".$db->idate($tmpdate)."'";
+ $sql.= " AND p.date_cloture IS NULL"; // just unclosed
+ $sql.= " GROUP BY p.fk_statut";
+ $sql.= " ORDER BY p.fk_statut DESC";
- if ($result)
- {
- $num = $db->num_rows($result) + $i;
- while ($i < $num)
- {
- $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"','logo' => 'object_propal');
+ $result = $db->query($sql);
- $objp = $db->fetch_object($result);
- $this->info_box_contents[$i][1] = array('td' => 'align="left"',
- 'text' =>$langs->trans("Proposals")." ".$propalstatic->LibStatut($objp->fk_statut,0)
- );
+ if ($result) {
+ $num = $db->num_rows($result) + $i;
+ $j=0;
+ while ($j < $num) {
+ $data[$j]=$db->fetch_object($result);
+ $j++;
+ }
+ file_put_contents($cachefile,serialize($data),LOCK_EX);
+ $db->free($result);
+ } else {
+ dol_print_error($db);
+ }
+ } else {
+ $data = unserialize(file_get_contents($cachefile));
+ }
+ if (! empty($data)) {
+ $j=0;
+ while ($i < count($data)) {
+ $this->info_box_contents[$i][0] = array(
+ 'td' => 'align="left" width="16"',
+ 'url' => DOL_URL_ROOT."/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&viewstatut=".$data[$j]->fk_statut,
+ 'tooltip' => $langs->trans("Proposals")." ".$propalstatic->LibStatut($data[$j]->fk_statut,0),
+ 'logo' => 'object_propal'
+ );
- $this->info_box_contents[$i][2] = array('td' => 'align="right"',
- 'text' => $objp->nb,
- 'url' => DOL_URL_ROOT."/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&viewstatut=".$objp->fk_statut
- );
- $totalnb += $objp->nb;
+ $objp = $db->fetch_object($result);
+ $this->info_box_contents[$i][1] = array(
+ 'td' => 'align="left"',
+ 'text' => $langs->trans("Proposals")." ".$propalstatic->LibStatut($data[$j]->fk_statut,0),
+ );
- $this->info_box_contents[$i][3] = array('td' => 'align="right"',
- 'text' => price($objp->Mnttot,1,$langs,0,0,-1,$conf->currency)
- );
- $totalMnt += $objp->Mnttot;
- $this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"', 'text' => $propalstatic->LibStatut($objp->fk_statut,3));
+ $this->info_box_contents[$i][2] = array(
+ 'td' => 'align="right"',
+ 'text' => $data[$j]->nb,
+ 'tooltip' => $langs->trans("Proposals")." ".$propalstatic->LibStatut($data[$j]->fk_statut,0),
+ 'url' => DOL_URL_ROOT."/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&viewstatut=".$data[$j]->fk_statut,
+ );
+ $totalnb += $data[$j]->nb;
- $i++;
- }
- }
- else dol_print_error($db);
- }
+ $this->info_box_contents[$i][3] = array(
+ 'td' => 'align="right"',
+ 'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency),
+ );
+ $totalMnt += $data[$j]->Mnttot;
+ $this->info_box_contents[$i][4] = array(
+ 'td' => 'align="right" width="18"',
+ 'text' => $propalstatic->LibStatut($data[$j]->fk_statut,3),
+ );
- // Add the sum in the bottom of the boxes
- $this->info_box_contents[$i][1] = array('td' => 'align="left" ', 'text' => $langs->trans("Total")." ".$textHead);
- $this->info_box_contents[$i][2] = array('td' => 'align="right" ', 'text' => $totalnb);
- $this->info_box_contents[$i][3] = array('td' => 'align="right" ', 'text' => price($totalMnt,1,$langs,0,0,-1,$conf->currency));
- $this->info_box_contents[$i][4] = array('td' => 'align="right" ', 'text' => "");
- $this->info_box_contents[$i][5] = array('td' => 'align="right"', 'text' => "");
- }
+ $i++;
+ $j++;
+ }
+ }
+ }
- /**
- * Method to show box
- *
- * @param array $head Array with properties of box title
- * @param array $contents Array with properties of box lines
- * @return void
- */
- function showBox($head = null, $contents = null)
- {
- parent::showBox($this->info_box_head, $this->info_box_contents);
- }
+ // Add the sum in the bottom of the boxes
+ $this->info_box_contents[$i][1] = array(
+ 'td' => 'align="left" ',
+ 'text' => $langs->trans("Total")." ".$textHead,
+ );
+ $this->info_box_contents[$i][2] = array(
+ 'td' => 'align="right" ',
+ 'text' => $totalnb,
+ );
+ $this->info_box_contents[$i][3] = array(
+ 'td' => 'align="right" ',
+ 'text' => price($totalMnt,1,$langs,0,0,-1,$conf->currency)
+ );
+ $this->info_box_contents[$i][4] = array(
+ 'td' => 'align="right" ',
+ 'text' => "",
+ );
+ $this->info_box_contents[$i][5] = array(
+ 'td' => 'align="right"',
+ 'text' => "",
+ );
+ }
+
+ /**
+ * Method to show box
+ *
+ * @param array $head Array with properties of box title
+ * @param array $contents Array with properties of box lines
+ * @return void
+ */
+ function showBox($head = null, $contents = null)
+ {
+ parent::showBox($this->info_box_head, $this->info_box_contents);
+ }
}
diff --git a/htdocs/core/boxes/box_bookmarks.php b/htdocs/core/boxes/box_bookmarks.php
index 968eefef4b9..5250108f76c 100644
--- a/htdocs/core/boxes/box_bookmarks.php
+++ b/htdocs/core/boxes/box_bookmarks.php
@@ -52,10 +52,11 @@ class box_bookmarks extends ModeleBoxes
$this->max=$max;
- $this->info_box_head = array('text' => $langs->trans("BoxMyLastBookmarks",$max),
- 'sublink' => DOL_URL_ROOT.'/bookmarks/list.php');
- if ($user->rights->bookmark->creer)
- {
+ $this->info_box_head = array(
+ 'text' => $langs->trans("BoxMyLastBookmarks",$max),
+ 'sublink' => DOL_URL_ROOT.'/bookmarks/list.php',
+ );
+ if ($user->rights->bookmark->creer) {
$this->info_box_head['subpicto']='object_bookmark';
$this->info_box_head['subtext']=$langs->trans("BookmarksManagement");
}
@@ -81,43 +82,52 @@ class box_bookmarks extends ModeleBoxes
$i = 0;
- while ($i < $num)
- {
- $objp = $db->fetch_object($result);
+ while ($i < $num) {
+ $objp = $db->fetch_object($result);
- $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
- 'logo' => $this->boximg,
- 'url' => $objp->url,
- 'target' => $objp->target?'newtab':'');
- $this->info_box_contents[$i][1] = array('td' => 'align="left"',
- 'text' => $objp->title,
- 'url' => $objp->url,
- 'target' => $objp->target?'newtab':'');
+ $this->info_box_contents[$i][0] = array(
+ 'td' => 'align="left" width="16"',
+ 'logo' => $this->boximg,
+ 'url' => $objp->url,
+ 'tooltip' => $objp->title,
+ 'target' => $objp->target?'newtab':'',
+ );
+ $this->info_box_contents[$i][1] = array(
+ 'td' => 'align="left"',
+ 'text' => $objp->title,
+ 'url' => $objp->url,
+ 'tooltip' => $objp->title,
+ 'target' => $objp->target?'newtab':'',
+ );
- $i++;
- }
+ $i++;
+ }
- if ($num==0)
- {
- $mytxt=$langs->trans("NoRecordedBookmarks");
- if ($user->rights->bookmark->creer) $mytxt.=' '.$langs->trans("ClickToAdd");
- $this->info_box_contents[$i][0] = array('td' => 'align="center" colspan="2"', 'url'=> DOL_URL_ROOT.'/bookmarks/list.php', 'text'=>$mytxt);
- }
+ if ($num==0) {
+ $mytxt=$langs->trans("NoRecordedBookmarks");
+ if ($user->rights->bookmark->creer) $mytxt.=' '.$langs->trans("ClickToAdd");
+ $this->info_box_contents[$i][0] = array(
+ 'td' => 'align="center" colspan="2"',
+ 'tooltip' => $mytxt,
+ 'url'=> DOL_URL_ROOT.'/bookmarks/list.php', 'text'=>$mytxt,
+ );
+ }
- $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('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(
+ 'align' => 'left',
+ 'text' => $langs->trans("ReadPermissionNotAllowed"),
+ );
+ }
+ }
/**
* Method to show box
diff --git a/htdocs/core/boxes/box_clients.php b/htdocs/core/boxes/box_clients.php
index 4e651e8bdcc..01e0dc92635 100644
--- a/htdocs/core/boxes/box_clients.php
+++ b/htdocs/core/boxes/box_clients.php
@@ -104,19 +104,28 @@ class box_clients 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' => $url.$objp->socid);
+ $this->info_box_contents[$i][0] = array(
+ 'td' => 'align="left" width="16"',
+ 'logo' => $this->boximg,
+ 'tooltip' => $langs->trans('Customer').': '.$objp->name,
+ 'url' => $url.$objp->socid
+ );
+ $this->info_box_contents[$i][1] = array(
+ 'td' => 'align="left"',
+ 'text' => $objp->name,
+ 'tooltip' => $langs->trans('Customer').': '.$objp->name,
+ 'url' => $url.$objp->socid
+ );
- $this->info_box_contents[$i][1] = array('td' => 'align="left"',
- 'text' => $objp->name,
- 'url' => $url.$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++;
}
diff --git a/htdocs/core/boxes/box_commandes.php b/htdocs/core/boxes/box_commandes.php
index 1bb6fe9b27a..670a5358d20 100644
--- a/htdocs/core/boxes/box_commandes.php
+++ b/htdocs/core/boxes/box_commandes.php
@@ -80,70 +80,85 @@ class box_commandes extends ModeleBoxes
$sql.= $db->plimit($max, 0);
$result = $db->query($sql);
- if ($result)
- {
+ if ($result) {
$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);
+ $datem=$db->jdate($objp->tms);
- $this->info_box_contents[$i][] = array('td' => 'align="left" width="16"',
- 'logo' => $this->boximg,
- 'url' => DOL_URL_ROOT."/commande/card.php?id=".$objp->rowid);
-
- $this->info_box_contents[$i][] = array('td' => 'align="left"',
- 'text' => $objp->ref,
- 'url' => DOL_URL_ROOT."/commande/card.php?id=".$objp->rowid);
-
- $this->info_box_contents[$i][] = array('td' => 'align="left" width="16"',
- 'logo' => 'company',
- 'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
-
- $this->info_box_contents[$i][] = array('td' => 'align="left"',
- 'text' => $objp->name,
- 'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
-
- $this->info_box_contents[$i][] = array('td' => 'align="right"',
- 'text' => price($objp->total_ht),
- );
-
- if (! empty($conf->global->ORDER_BOX_LAST_ORDERS_SHOW_VALIDATE_USER))
- {
- if ($objp->fk_user_valid > 0) $userstatic->fetch($objp->fk_user_valid);
- $this->info_box_contents[$i][] = array('td' => 'align="right"',
- 'text' => (($objp->fk_user_valid > 0)?$userstatic->getNomUrl(1):''),
- 'url' => (($objp->fk_user_valid > 0)?DOL_URL_ROOT.'/user/card.php?id='.$objp->fk_user_valid:'')
- );
- }
-
- $this->info_box_contents[$i][] = array('td' => 'align="right"',
- 'text' => dol_print_date($date,'day'),
+ $this->info_box_contents[$i][] = array(
+ 'td' => 'align="left" width="16"',
+ 'logo' => $this->boximg,
+ 'tooltip' => $langs->trans('Order').': '.$objp->ref,
+ 'url' => DOL_URL_ROOT."/commande/card.php?id=".$objp->rowid,
);
- $this->info_box_contents[$i][] = array('td' => 'align="right" width="18"',
- 'text' => $commandestatic->LibStatut($objp->fk_statut,$objp->facture,3));
+ $this->info_box_contents[$i][] = array(
+ 'td' => 'align="left"',
+ 'text' => $objp->ref,
+ 'tooltip' => $langs->trans('Order').': '.$objp->ref,
+ 'url' => DOL_URL_ROOT."/commande/card.php?id=".$objp->rowid,
+ );
+ $this->info_box_contents[$i][] = array(
+ 'td' => 'align="left" width="16"',
+ 'logo' => 'company',
+ 'tooltip' => $langs->trans('Customer').': '.$objp->name,
+ 'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid,
+ );
+
+ $this->info_box_contents[$i][] = array(
+ 'td' => 'align="left"',
+ 'text' => $objp->name,
+ 'tooltip' => $langs->trans('Customer').': '.$objp->name,
+ 'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid,
+ );
+
+ $this->info_box_contents[$i][] = array(
+ 'td' => 'align="right"',
+ 'text' => price($objp->total_ht),
+ );
+
+ if (! empty($conf->global->ORDER_BOX_LAST_ORDERS_SHOW_VALIDATE_USER)) {
+ if ($objp->fk_user_valid > 0) $userstatic->fetch($objp->fk_user_valid);
+ $this->info_box_contents[$i][] = array(
+ 'td' => 'align="right"',
+ 'text' => (($objp->fk_user_valid > 0)?$userstatic->getNomUrl(1):''),
+ 'url' => (($objp->fk_user_valid > 0)?DOL_URL_ROOT.'/user/card.php?id='.$objp->fk_user_valid:''),
+ );
+ }
+
+ $this->info_box_contents[$i][] = array(
+ 'td' => 'align="right"',
+ 'text' => dol_print_date($date,'day'),
+ );
+
+ $this->info_box_contents[$i][] = array(
+ 'td' => 'align="right" width="18"',
+ 'text' => $commandestatic->LibStatut($objp->fk_statut,$objp->facture,3),
+ );
$i++;
}
if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedOrders"));
- $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('align' => 'left',
- 'text' => $langs->trans("ReadPermissionNotAllowed"));
+ } else {
+ $this->info_box_contents[0][0] = array(
+ 'align' => 'left',
+ 'text' => $langs->trans("ReadPermissionNotAllowed"),
+ );
}
}
diff --git a/htdocs/core/boxes/box_comptes.php b/htdocs/core/boxes/box_comptes.php
index 45c8f1a4819..5340b06f0dd 100644
--- a/htdocs/core/boxes/box_comptes.php
+++ b/htdocs/core/boxes/box_comptes.php
@@ -2,7 +2,7 @@
/* Copyright (C) 2005 Christophe
* Copyright (C) 2005-2013 Laurent Destailleur
* Copyright (C) 2005-2009 Regis Houssin
- * Copyright (C) 2013 Juanjo Menent
+ * Copyright (C) 2013 Juanjo Menent
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -76,8 +76,7 @@ class box_comptes extends ModeleBoxes
$this->info_box_head = array('text' => $langs->trans("BoxTitleCurrentAccounts"));
- if ($user->rights->banque->lire)
- {
+ if ($user->rights->banque->lire) {
$sql = "SELECT rowid, ref, label, bank, number, courant, clos, rappro, url,";
$sql.= " code_banque, code_guichet, cle_rib, bic, iban_prefix as iban,";
$sql.= " domiciliation, proprio, owner_address,";
@@ -90,76 +89,87 @@ class box_comptes extends ModeleBoxes
$sql.= " ORDER BY label";
$sql.= $db->plimit($max, 0);
- dol_syslog(get_class($this)."::loadBox", LOG_DEBUG);
- $result = $db->query($sql);
- if ($result)
- {
- $num = $db->num_rows($result);
+ dol_syslog(get_class($this)."::loadBox", LOG_DEBUG);
+ $result = $db->query($sql);
+ if ($result) {
+ $num = $db->num_rows($result);
- $i = 0;
- $solde_total = 0;
+ $i = 0;
+ $solde_total = array();
- $listofcurrencies=array();
- $account_static = new Account($db);
- while ($i < $num)
- {
- $objp = $db->fetch_object($result);
+ $account_static = new Account($db);
+ while ($i < $num) {
+ $objp = $db->fetch_object($result);
- $account_static->id = $objp->rowid;
- $solde=$account_static->solde(0);
+ $account_static->id = $objp->rowid;
+ $solde=$account_static->solde(0);
- $solde_total += $solde;
+ $solde_total[$objp->currency_code] += $solde;
- $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
- 'logo' => $this->boximg,
- 'url' => DOL_URL_ROOT."/compta/bank/account.php?account=".$objp->rowid);
+ $this->info_box_contents[$i][0] = array(
+ 'td' => 'align="left" width="16"',
+ 'logo' => $this->boximg,
+ 'tooltip' => $langs->trans('Account').': '.$objp->label,
+ 'url' => DOL_URL_ROOT."/compta/bank/account.php?account=".$objp->rowid,
+ );
- $this->info_box_contents[$i][1] = array('td' => 'align="left"',
- 'text' => $objp->label,
- '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,
+ 'url' => DOL_URL_ROOT."/compta/bank/account.php?account=".$objp->rowid,
+ );
- $this->info_box_contents[$i][2] = array('td' => 'align="left"',
- 'text' => $objp->number
- );
+ $this->info_box_contents[$i][2] = array(
+ 'td' => 'align="left"',
+ 'text' => $objp->number,
+ );
- $this->info_box_contents[$i][3] = array('td' => 'align="right"',
- 'text' => price($solde, 0, $langs, 0, 0, -1, $objp->currency_code)
- );
+ $this->info_box_contents[$i][3] = array(
+ 'td' => 'align="right"',
+ 'text' => price($solde, 0, $langs, 0, 0, -1, $objp->currency_code)
+ );
- $listofcurrencies[$objp->currency_code]=1;
- $i++;
- }
+ $i++;
+ }
- // Total
- if (count($listofcurrencies) <= 1)
- {
- $this->info_box_contents[$i][0] = array('tr' => 'class="liste_total"', 'td' => 'align="right" class="liste_total"',
- 'text' => $langs->trans('Total')
- );
- $this->info_box_contents[$i][1] = array('td' => 'align="right" class="liste_total"',
- 'text' => ' '
- );
- $this->info_box_contents[$i][2] = array('td' => 'align="right" class="liste_total"',
- 'text' => ' '
- );
- $totalamount=price($solde_total,0,$langs,0,0,-1,$conf->currency);
- $this->info_box_contents[$i][3] = array('td' => 'align="right" class="liste_total"',
- 'text' => $totalamount
- );
- }
+ // Total
+ foreach ($solde_total as $key=>$solde) {
+ $this->info_box_contents[$i][0] = array(
+ 'tr' => 'class="liste_total"',
+ 'td' => 'align="right" class="liste_total"',
+ 'text' => ' ',
+ );
+ $this->info_box_contents[$i][1] = array(
+ 'td' => 'align="left" class="liste_total"',
+ 'text' => $langs->trans('Total').' '.$key,
+ );
+ $this->info_box_contents[$i][2] = array(
+ 'td' => 'align="right" class="liste_total"',
+ 'text' => ' '
+ );
+ $totalamount=price($solde,0,$langs,0,0,-1,$key);
+ $this->info_box_contents[$i][3] = array(
+ 'td' => 'align="right" class="liste_total"',
+ 'text' => $totalamount
+ );
+ $i++;
+ }
- $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_contacts.php b/htdocs/core/boxes/box_contacts.php
index e10c9ae7ed9..8ec8bf77b9c 100644
--- a/htdocs/core/boxes/box_contacts.php
+++ b/htdocs/core/boxes/box_contacts.php
@@ -73,65 +73,83 @@ class box_contacts extends ModeleBoxes
$sql.= $db->plimit($max, 0);
$result = $db->query($sql);
- if ($result)
- {
+ if ($result) {
$num = $db->num_rows($result);
$contactstatic=new Contact($db);
$societestatic=new Societe($db);
$i = 0;
- while ($i < $num)
- {
+ while ($i < $num) {
$objp = $db->fetch_object($result);
$datec=$db->jdate($objp->datec);
$datem=$db->jdate($objp->tms);
- $contactstatic->lastname=$objp->lastname;
+ $contactstatic->lastname=$objp->lastname;
$contactstatic->firstname=$objp->firstname;
$contactstatic->civility_id=$objp->civility_id;
$societestatic->id=$objp->fk_soc;
$societestatic->name=$objp->socname;
- $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
- 'logo' => $this->boximg,
- 'url' => DOL_URL_ROOT."/contact/card.php?id=".$objp->rowid);
+ $this->info_box_contents[$i][0] = array(
+ 'td' => 'align="left" width="16"',
+ 'logo' => $this->boximg,
+ 'tooltip' => $langs->trans('Contact').': '.$contactstatic->getFullName($langs,0),
+ 'url' => DOL_URL_ROOT."/contact/card.php?id=".$objp->rowid,
+ );
- $this->info_box_contents[$i][1] = array('td' => 'align="left"',
- 'text' => $contactstatic->getFullName($langs,0),
- 'url' => DOL_URL_ROOT."/contact/card.php?id=".$objp->rowid);
+ $this->info_box_contents[$i][1] = array(
+ 'td' => 'align="left"',
+ 'text' => $contactstatic->getFullName($langs,0),
+ 'tooltip' => $langs->trans('Contact').': '.$contactstatic->getFullName($langs,0),
+ 'url' => DOL_URL_ROOT."/contact/card.php?id=".$objp->rowid,
+ );
- $this->info_box_contents[$i][2] = array('td' => 'align="left" width="16"',
- 'logo' => ($objp->fk_soc > 0?'company':''),
- 'url' => ($objp->fk_soc > 0?DOL_URL_ROOT."/societe/soc.php?socid=".$objp->fk_soc:''));
+ $this->info_box_contents[$i][2] = array(
+ 'td' => 'align="left" width="16"',
+ 'logo' => ($objp->fk_soc > 0?'company':''),
+ 'tooltip' => $societestatic->name,
+ 'url' => ($objp->fk_soc > 0?DOL_URL_ROOT."/societe/soc.php?socid=".$objp->fk_soc:''),
+ );
- $this->info_box_contents[$i][3] = array('td' => 'align="left"',
- 'text' => $societestatic->name,
- 'url' => DOL_URL_ROOT."/societe/soc.php?socid=".$objp->fk_soc);
+ $this->info_box_contents[$i][3] = array(
+ 'td' => 'align="left"',
+ 'text' => $societestatic->name,
+ 'tooltip' => $societestatic->name,
+ 'url' => DOL_URL_ROOT."/societe/soc.php?socid=".$objp->fk_soc,
+ );
- $this->info_box_contents[$i][4] = array('td' => 'align="right"',
- 'text' => dol_print_date($datem, "day"));
+ $this->info_box_contents[$i][4] = array(
+ 'td' => 'align="right"',
+ 'text' => dol_print_date($datem, "day"),
+ );
- $i++;
- }
+ $i++;
+ }
- if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedContacts"));
+ if ($num==0)
+ $this->info_box_contents[$i][0] = array(
+ 'td' => 'align="center"',
+ 'text'=>$langs->trans("NoRecordedContacts"),
+ );
- $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('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(
+ 'align' => 'left',
+ 'text' => $langs->trans("ReadPermissionNotAllowed"),
+ );
+ }
- }
+ }
/**
* Method to show box
diff --git a/htdocs/core/boxes/box_contracts.php b/htdocs/core/boxes/box_contracts.php
index dc0ff8e5382..c980be624da 100644
--- a/htdocs/core/boxes/box_contracts.php
+++ b/htdocs/core/boxes/box_contracts.php
@@ -79,8 +79,7 @@ class box_contracts extends ModeleBoxes
$i = 0;
- while ($i < $num)
- {
+ while ($i < $num) {
$objp = $db->fetch_object($resql);
$datec=$db->jdate($objp->datec);
$dateterm=$db->jdate($objp->fin_validite);
@@ -94,50 +93,69 @@ class box_contracts extends ModeleBoxes
// fin_validite is no more on contract but on services
// if ($objp->fk_statut == 1 && $dateterm < ($now - $conf->contrat->cloture->warning_delay)) { $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."/contrat/card.php?id=".$objp->rowid);
+ $this->info_box_contents[$i][0] = array(
+ 'td' => 'align="left" width="16"',
+ 'logo' => $this->boximg,
+ 'tooltip' => $langs->trans('Contract').': '.($objp->ref?$objp->ref:$objp->rowid),
+ 'url' => DOL_URL_ROOT."/contrat/card.php?id=".$objp->rowid,
+ );
- $this->info_box_contents[$i][1] = array('td' => 'align="left"',
- 'text' => ($objp->ref?$objp->ref:$objp->rowid), // Some contracts have no ref
- 'text2'=> $late,
- 'url' => DOL_URL_ROOT."/contrat/card.php?id=".$objp->rowid);
+ $this->info_box_contents[$i][1] = array(
+ 'td' => 'align="left"',
+ 'text' => ($objp->ref?$objp->ref:$objp->rowid), // Some contracts have no ref
+ 'tooltip' => $langs->trans('Contract').': '.($objp->ref?$objp->ref:$objp->rowid),
+ 'text2'=> $late,
+ 'url' => DOL_URL_ROOT."/contrat/card.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);
+ $this->info_box_contents[$i][2] = array(
+ 'td' => 'align="left" width="16"',
+ 'logo' => 'company',
+ 'tooltip' => $langs->trans('Customer').': '.$objp->name,
+ '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' => $langs->trans('Customer').': '.$objp->name,
+ 'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid,
+ );
- $this->info_box_contents[$i][4] = array('td' => 'align="right"',
- 'text' => dol_print_date($datec,'day'));
+ $this->info_box_contents[$i][4] = array(
+ 'td' => 'align="right"',
+ 'text' => dol_print_date($datec,'day'),
+ );
- $this->info_box_contents[$i][5] = array('td' => 'align="right" class="nowrap"',
- 'text' => $contractstatic->getLibStatut(6),
- 'asis'=>1
- );
+ $this->info_box_contents[$i][5] = array(
+ 'td' => 'align="right" class="nowrap"',
+ 'text' => $contractstatic->getLibStatut(6),
+ 'asis'=>1,
+ );
- $i++;
- }
+ $i++;
+ }
- if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedContracts"));
+ if ($num==0)
+ $this->info_box_contents[$i][0] = array(
+ 'td' => 'align="center"',
+ 'text'=>$langs->trans("NoRecordedContracts"),
+ );
- $db->free($resql);
- }
- 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($resql);
+ } 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_external_rss.php b/htdocs/core/boxes/box_external_rss.php
index 354e79151f1..689efc751c6 100644
--- a/htdocs/core/boxes/box_external_rss.php
+++ b/htdocs/core/boxes/box_external_rss.php
@@ -98,8 +98,12 @@ class box_external_rss extends ModeleBoxes
}
else
{
- $this->info_box_head = array('text' => $title,
- 'sublink' => $link, 'subtext'=>$langs->trans("LastRefreshDate").': '.($rssparser->getLastFetchDate()?dol_print_date($rssparser->getLastFetchDate(),"dayhourtext"):$langs->trans("Unknown")), 'subpicto'=>'object_bookmark');
+ $this->info_box_head = array(
+ 'text' => $title,
+ 'sublink' => $link,
+ 'subtext'=>$langs->trans("LastRefreshDate").': '.($rssparser->getLastFetchDate()?dol_print_date($rssparser->getLastFetchDate(),"dayhourtext"):$langs->trans("Unknown")),
+ 'subpicto'=>'object_bookmark',
+ );
}
// INFO on items
@@ -112,8 +116,8 @@ class box_external_rss extends ModeleBoxes
// Feed common fields
$href = $item['link'];
$title = urldecode($item['title']);
- $date = $item['date_timestamp']; // date will be empty if conversion into timestamp failed
- if ($rssparser->getFormat() == 'rss') // If RSS
+ $date = $item['date_timestamp']; // date will be empty if conversion into timestamp failed
+ if ($rssparser->getFormat() == 'rss') // If RSS
{
if (! $date && isset($item['pubdate'])) $date=$item['pubdate'];
if (! $date && isset($item['dc']['date'])) $date=$item['dc']['date'];
@@ -138,19 +142,27 @@ class box_external_rss extends ModeleBoxes
$title=preg_replace("/^\s+/","",$title); // Supprime espaces de debut
$this->info_box_contents["$href"]="$title";
- $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"',
- 'logo' => $this->boximg,
- 'url' => $href,
- 'target' => 'newrss');
+ $this->info_box_contents[$i][0] = array(
+ 'td' => 'align="left" width="16"',
+ 'logo' => $this->boximg,
+ 'url' => $href,
+ 'tooltip' => $title,
+ 'target' => 'newrss',
+ );
- $this->info_box_contents[$i][1] = array('td' => 'align="left"',
- 'text' => $title,
- 'url' => $href,
- 'maxlength' => 64,
- 'target' => 'newrss');
+ $this->info_box_contents[$i][1] = array(
+ 'td' => 'align="left"',
+ 'text' => $title,
+ 'url' => $href,
+ 'tooltip' => $title,
+ 'maxlength' => 64,
+ 'target' => 'newrss',
+ );
- $this->info_box_contents[$i][2] = array('td' => 'align="right" nowrap="1"',
- 'text' => $date);
+ $this->info_box_contents[$i][2] = array(
+ 'td' => 'align="right" nowrap="1"',
+ 'text' => $date,
+ );
}
}
diff --git a/htdocs/core/boxes/box_factures.php b/htdocs/core/boxes/box_factures.php
index b0fdd6d9d09..84f7e61b315 100644
--- a/htdocs/core/boxes/box_factures.php
+++ b/htdocs/core/boxes/box_factures.php
@@ -101,55 +101,76 @@ class box_factures extends ModeleBoxes
$late = '';
if ($objp->paye == 0 && ($objp->fk_statut != 2 && $objp->fk_statut != 3) && $datelimite < ($now - $conf->facture->client->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' => $picto,
- 'url' => DOL_URL_ROOT."/compta/facture.php?facid=".$objp->facid);
+ $this->info_box_contents[$i][0] = array(
+ 'td' => 'align="left" width="16"',
+ 'logo' => $picto,
+ 'tooltip' => $langs->trans('CustomerInvoice').': '.$objp->facnumber,
+ 'url' => DOL_URL_ROOT."/compta/facture.php?facid=".$objp->facid,
+ );
- $this->info_box_contents[$i][1] = array('td' => 'align="left"',
- 'text' => $objp->facnumber,
- 'text2'=> $late,
- 'url' => DOL_URL_ROOT."/compta/facture.php?facid=".$objp->facid);
+ $this->info_box_contents[$i][1] = array(
+ 'td' => 'align="left"',
+ 'text' => $objp->facnumber,
+ 'text2'=> $late,
+ 'tooltip' => $langs->trans('CustomerInvoice').': '.$objp->facnumber,
+ 'url' => DOL_URL_ROOT."/compta/facture.php?facid=".$objp->facid,
+ );
- $this->info_box_contents[$i][2] = array('td' => 'align="left" width="16"',
- 'logo' => 'company',
- 'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
+ $this->info_box_contents[$i][2] = array(
+ 'td' => 'align="left" width="16"',
+ 'logo' => 'company',
+ 'tooltip' => $langs->trans('Customer').': '.$objp->name,
+ 'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid,
+ );
- $this->info_box_contents[$i][3] = array('td' => 'align="left"',
- 'text' => $objp->name,
- 'maxlength'=>40,
- 'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
+ $this->info_box_contents[$i][3] = array(
+ 'td' => 'align="left"',
+ 'text' => $objp->name,
+ 'maxlength'=>40,
+ 'tooltip' => $langs->trans('Customer').': '.$objp->name,
+ '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' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3));
+ $this->info_box_contents[$i][6] = array(
+ 'td' => 'align="right" width="18"',
+ 'text' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3),
+ );
- $i++;
- }
+ $i++;
+ }
- if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedInvoices"));
+ if ($num==0)
+ $this->info_box_contents[$i][0] = array(
+ 'td' => 'align="center"',
+ 'text'=>$langs->trans("NoRecordedInvoices"),
+ );
- $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"));
- }
- }
+ } 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_factures_fourn.php b/htdocs/core/boxes/box_factures_fourn.php
index 914f442bea4..4e222369949 100644
--- a/htdocs/core/boxes/box_factures_fourn.php
+++ b/htdocs/core/boxes/box_factures_fourn.php
@@ -18,9 +18,9 @@
*/
/**
- * \file htdocs/core/boxes/box_factures_fourn.php
+ * \file htdocs/core/boxes/box_factures_fourn.php
* \ingroup supplier
- * \brief Fichier de gestion d'une box des factures fournisseurs
+ * \brief Fichier de gestion d'une box des factures fournisseurs
*/
include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php';
@@ -89,8 +89,7 @@ class box_factures_fourn extends ModeleBoxes
$i = 0;
$l_due_date = $langs->trans('Late').' ('.$langs->trans('DateEcheance').': %s)';
- while ($i < $num)
- {
+ while ($i < $num) {
$objp = $db->fetch_object($result);
$datelimite=$db->jdate($objp->datelimite);
$date=$db->jdate($objp->df);
@@ -99,54 +98,79 @@ class box_factures_fourn extends ModeleBoxes
$late = '';
if ($objp->paye == 0 && $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);
+ $this->info_box_contents[$i][0] = array(
+ 'td' => 'align="left" width="16"',
+ 'logo' => $this->boximg,
+ 'tooltip' => $langs->trans('SupplierInvoice').': '.($objp->ref?$objp->ref:$objp->facid).' '.$langs->trans('RefSupplier').': '.$objp->ref_supplier,
+ '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' => $langs->trans('SupplierInvoice').': '.($objp->ref?$objp->ref:$objp->facid).' '.$langs->trans('RefSupplier').': '.$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,
- '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' => $langs->trans('SupplierInvoice').': '.($objp->ref?$objp->ref:$objp->facid).' '.$langs->trans('RefSupplier').': '.$objp->ref_supplier,
+ '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);
+ $this->info_box_contents[$i][3] = array(
+ 'td' => 'align="left" width="16"',
+ 'logo' => 'company',
+ 'tooltip' => $langs->trans('Supplier').': '.$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,
- 'url' => DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid);
+ $this->info_box_contents[$i][4] = array(
+ 'td' => 'align="left"',
+ 'text' => $objp->name,
+ 'tooltip' => $langs->trans('Supplier').': '.$objp->name,
+ 'url' => DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid,
+ );
- $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'),
+ );
- $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));
+ $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),
+ );
- $i++;
- }
+ $i++;
+ }
- if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoModifiedSupplierBills"));
+ if ($num==0)
+ $this->info_box_contents[$i][0] = array(
+ 'td' => 'align="center"',
+ 'text'=>$langs->trans("NoModifiedSupplierBills"),
+ );
- $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->transnoentities("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->transnoentities("ReadPermissionNotAllowed"),
+ );
+ }
+ }
/**
* Method to show box
diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php
index c6b6dad7acb..aed954fea97 100644
--- a/htdocs/core/boxes/modules_boxes.php
+++ b/htdocs/core/boxes/modules_boxes.php
@@ -257,8 +257,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty"
// Loop on each TD
$nbcolthisline=count($contents[$i]);
- for ($j=0; $j < $nbcolthisline; $j++)
- {
+ for ($j=0; $j < $nbcolthisline; $j++) {
// Define tdparam
$tdparam='';
if (isset($contents[$i][$j]['td'])) $tdparam.=' '.$contents[$i][$j]['td'];
@@ -270,13 +269,15 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty"
$text2withnotags=preg_replace('/<([^>]+)>/i','',$text2);
$textnoformat=isset($contents[$i][$j]['textnoformat'])?$contents[$i][$j]['textnoformat']:'';
//print "xxx $textwithnotags y";
+ if (empty($contents[$i][$j]['tooltip'])) $contents[$i][$j]['tooltip']="";
+ $tooltip=isset($contents[$i][$j]['tooltip'])?$contents[$i][$j]['tooltip']:'';
- print '';
+ print ' | '."\n";
// Url
- if (! empty($contents[$i][$j]['url']))
+ if (! empty($contents[$i][$j]['url']) && empty($contents[$i][$j]['logo']))
{
- print '"
print isset($contents[$i][$j]['target'])?' target="'.$contents[$i][$j]['target'].'"':'';
print '>';
@@ -286,7 +287,8 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty"
if (! empty($contents[$i][$j]['logo']))
{
$logo=preg_replace("/^object_/i","",$contents[$i][$j]['logo']);
- print img_object($langs->trans("Show"),$logo);
+ print '';
+ print img_object($langs->trans("Show").' '.$tooltip, $logo, 'class="classfortooltip"');
}
$maxlength=$MAXLENGTHBOX;
@@ -304,7 +306,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty"
if (! empty($textnoformat)) print "\n".$textnoformat."\n";
- print " | ";
+ print " | \n";
}
print " \n";
diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php
index 98b1309149e..a8862ab5ed2 100644
--- a/htdocs/core/class/discount.class.php
+++ b/htdocs/core/class/discount.class.php
@@ -433,19 +433,17 @@ class DiscountAbsolute
$result='';
- if ($option == 'invoice')
- {
- $lien = '';
- $lienfin='';
+ if ($option == 'invoice') {
$label=$langs->trans("ShowDiscount").': '.$this->ref_facture_source;
+ $lien = '';
+ $lienfin='';
$ref=$this->ref_facture_source;
$picto='bill';
}
- if ($option == 'discount')
- {
- $lien = '';
- $lienfin='';
+ if ($option == 'discount') {
$label=$langs->trans("Discount");
+ $lien = '';
+ $lienfin='';
$ref=$langs->trans("Discount");
$picto='generic';
}
diff --git a/htdocs/ecm/class/ecmdirectory.class.php b/htdocs/ecm/class/ecmdirectory.class.php
index a4379250914..5edd4c3ce11 100644
--- a/htdocs/ecm/class/ecmdirectory.class.php
+++ b/htdocs/ecm/class/ecmdirectory.class.php
@@ -414,19 +414,20 @@ class EcmDirectory // extends CommonObject
global $langs;
$result='';
+ //$newref=str_replace('_',' ',$this->ref);
+ $newref=$this->ref;
+ $newlabel=$langs->trans("ShowECMSection").': '.$newref;
+ $linkclose='"'.($more?' '.$more:'').' title="'.dol_escape_htmltag($newlabel, 1).'" class="classfortooltip">';
- $lien = '';
- if ($option == 'index') $lien = '';
- if ($option == 'indexexpanded') $lien = '';
- if ($option == 'indexnotexpanded') $lien = '';
- $lienfin='';
+ $lien = 'id.'§ionexpand=true'.$linkclose;
+ if ($option == 'indexexpanded') $lien = 'id.'§ionexpand=true'.$linkclose;
+ $lienfin='';
//$picto=DOL_URL_ROOT.'/theme/common/treemenu/folder.gif';
$picto='dir';
- //$newref=str_replace('_',' ',$this->ref);
- $newref=$this->ref;
- $newlabel=$langs->trans("ShowECMSection").': '.$newref;
if ($withpicto) $result.=($lien.img_object($newlabel, $picto, 'class="classfortooltip"').$lienfin);
if ($withpicto && $withpicto != 2) $result.=' ';
diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php
index 74d5251a191..00105cf967a 100644
--- a/htdocs/expedition/class/expedition.class.php
+++ b/htdocs/expedition/class/expedition.class.php
@@ -1217,16 +1217,16 @@ class Expedition extends CommonObject
global $langs;
$result='';
+ $label=$langs->trans("ShowSending").': '.$this->ref;
$url = DOL_URL_ROOT.'/expedition/card.php?id='.$this->id;
if ($short) return $url;
- $linkstart = '';
+ $linkstart = '';
$linkend='';
$picto='sending';
- $label=$langs->trans("ShowSending").': '.$this->ref;
if ($withpicto) $result.=($linkstart.img_object($label, $picto, 'class="classfortooltip"').$linkend);
if ($withpicto && $withpicto != 2) $result.=' ';
diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php
index 0f91e976da8..58c0efdda9a 100644
--- a/htdocs/fichinter/class/fichinter.class.php
+++ b/htdocs/fichinter/class/fichinter.class.php
@@ -547,13 +547,13 @@ class Fichinter extends CommonObject
global $langs;
$result='';
+ $label=$langs->trans("Show").': '.$this->ref;
- $lien = '';
+ $lien = '';
$lienfin='';
$picto='intervention';
- $label=$langs->trans("Show").': '.$this->ref;
if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin);
if ($withpicto && $withpicto != 2) $result.=' ';
diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php
index 77f131b912b..ef25be9469f 100644
--- a/htdocs/fourn/class/fournisseur.commande.class.php
+++ b/htdocs/fourn/class/fournisseur.commande.class.php
@@ -531,12 +531,12 @@ class CommandeFournisseur extends CommonOrder
global $langs;
$result='';
+ $label=$langs->trans("ShowOrder").': '.$this->ref;
- $lien = '';
+ $lien = '';
$lienfin='';
$picto='order';
- $label=$langs->trans("ShowOrder").': '.$this->ref;
if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin);
if ($withpicto && $withpicto != 2) $result.=' ';
diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php
index 7370bc3769a..842fe9fcf0b 100644
--- a/htdocs/fourn/class/fournisseur.facture.class.php
+++ b/htdocs/fourn/class/fournisseur.facture.class.php
@@ -1472,19 +1472,19 @@ class FactureFournisseur extends CommonInvoice
global $langs;
$result='';
+ $label=$langs->trans("ShowInvoice").': '.$this->ref;
+ if ($this->ref_supplier) $label.=' / '.$this->ref_supplier;
if ($option == 'document')
{
- $lien = '';
+ $lien = '';
$lienfin='';
}
else
{
- $lien = '';
+ $lien = '';
$lienfin='';
}
- $label=$langs->trans("ShowInvoice").': '.$this->ref;
- if ($this->ref_supplier) $label.=' / '.$this->ref_supplier;
$ref=$this->ref;
if (empty($ref)) $ref=$this->id;
diff --git a/htdocs/fourn/class/paiementfourn.class.php b/htdocs/fourn/class/paiementfourn.class.php
index 443216d899d..3cd3ec0496c 100644
--- a/htdocs/fourn/class/paiementfourn.class.php
+++ b/htdocs/fourn/class/paiementfourn.class.php
@@ -487,17 +487,17 @@ class PaiementFourn extends Paiement
global $langs;
$result='';
+ $text=$this->ref; // Sometimes ref contains label
+ if (preg_match('/^\((.*)\)$/i',$text,$reg)) {
+ // Label generique car entre parentheses. On l'affiche en le traduisant
+ if ($reg[1]=='paiement') $reg[1]='Payment';
+ $text=$langs->trans($reg[1]);
+ }
+ $label = $langs->trans("ShowPayment").': '.$text;
- $lien = '';
- $lienfin='';
+ $lien = '';
+ $lienfin='';
- $text=$this->ref; // Sometimes ref contains label
- if (preg_match('/^\((.*)\)$/i',$text,$reg))
- {
- // Label g诩rique car entre parenth粥s. On l'affiche en le traduisant
- if ($reg[1]=='paiement') $reg[1]='Payment';
- $text=$langs->trans($reg[1]);
- }
if ($withpicto) $result.=($lien.img_object($langs->trans("ShowPayment"), 'payment', 'class="classfortooltip"').$lienfin);
if ($withpicto && $withpicto != 2) $result.=' ';
diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php
index 1a3e9f7ecd3..280efd4addc 100644
--- a/htdocs/holiday/class/holiday.class.php
+++ b/htdocs/holiday/class/holiday.class.php
@@ -658,14 +658,13 @@ class Holiday extends CommonObject
global $langs;
$result='';
+ $label=$langs->trans("Show").': '.$this->ref;
- $lien = '';
+ $lien = '';
$lienfin='';
$picto='holiday';
- $label=$langs->trans("Show").': '.$this->ref;
-
if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin);
if ($withpicto && $withpicto != 2) $result.=' ';
if ($withpicto != 2) $result.=$lien.$this->ref.$lienfin;
diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php
index dfad1c7e7b8..ccde9484b0d 100644
--- a/htdocs/livraison/class/livraison.class.php
+++ b/htdocs/livraison/class/livraison.class.php
@@ -660,13 +660,13 @@ class Livraison extends CommonObject
$result='';
$urlOption='';
+ $label=$langs->trans("ShowReceiving").': '.$this->ref;
- $lien = '';
+ $lien = '';
$lienfin='';
$picto='sending';
- $label=$langs->trans("ShowReceiving").': '.$this->ref;
if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin);
if ($withpicto && $withpicto != 2) $result.=' ';
diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index 294c8d1610e..a889136de01 100755
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -2812,33 +2812,27 @@ class Product extends CommonObject
global $langs;
$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;
+ $linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
- if ($option == 'supplier')
- {
- $lien = '';
- $lienfin='';
- }
- else if ($option == 'stock')
- {
- $lien = '';
+ if ($option == 'supplier') {
+ $lien = 'id.$linkclose;
+ $lienfin='';
+ } else if ($option == 'composition') {
+ $lien = 'id.'&type=0'.$linkclose;
+ } else {
+ $lien = 'id.'">';
- $lienfin='';
- }
- else if ($option == 'category')
- {
- $lien = '';
- }
- else
- {
- $lien = '';
- $lienfin='';
- }
- $newref=$this->ref;
- if ($maxlength) $newref=dol_trunc($newref,$maxlength,'middle');
if ($withpicto) {
if ($this->type == 0) $result.=($lien.img_object($langs->trans("ShowProduct").' '.$this->label, 'product', 'class="classfortooltip"').$lienfin.' ');
diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php
index c0627015be3..3bfbbbffbcb 100644
--- a/htdocs/product/stock/class/entrepot.class.php
+++ b/htdocs/product/stock/class/entrepot.class.php
@@ -512,11 +512,12 @@ class Entrepot extends CommonObject
global $langs;
$result='';
+ $label = $langs->trans("ShowStock").': '.$this->libelle;
- $lien='';
- $lienfin='';
+ $lien='';
+ $lienfin='';
- if ($withpicto) $result.=($lien.img_object($langs->trans("ShowStock"), 'stock', 'class="classfortooltip"').$lienfin.' ');
+ if ($withpicto) $result.=($lien.img_object($label, 'stock', 'class="classfortooltip"').$lienfin.' ');
$result.=$lien.$this->libelle.$lienfin;
return $result;
}
diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php
index 4eef74b0dc1..d423bc48ae1 100644
--- a/htdocs/projet/class/project.class.php
+++ b/htdocs/projet/class/project.class.php
@@ -789,25 +789,22 @@ class Project extends CommonObject
$result = '';
$lien = '';
$lienfin = '';
+ $label = $langs->trans("ShowProject") . ': ' . $this->ref . ($this->title ? ' - ' . $this->title : '');
+ $linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
- if ($option != 'nolink')
- {
- if (preg_match('/\.php$/',$option))
- {
- $lien = '';
- $lienfin = '';
- }
- else
- {
- $lien = '';
- $lienfin = '';
- }
+ if ($option != 'nolink') {
+ if (preg_match('/\.php$/',$option)) {
+ $lien = 'id . $linkclose;
+ $lienfin = '';
+ }
}
$picto = 'projectpub';
if (!$this->public) $picto = 'project';
- $label = $langs->trans("ShowProject") . ': ' . $this->ref . ($this->title ? ' - ' . $this->title : '');
if ($withpicto) $result.=($lien . img_object($label, $picto, 'class="classfortooltip"') . $lienfin);
if ($withpicto && $withpicto != 2) $result.=' ';
diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php
index 786caafb7ec..5dde5e21b88 100644
--- a/htdocs/projet/class/task.class.php
+++ b/htdocs/projet/class/task.class.php
@@ -505,13 +505,13 @@ class Task extends CommonObject
global $langs;
$result='';
+ $label=$langs->trans("ShowTask").': '.$this->ref.($this->label?' - '.$this->label:'');
- $lien = '';
+ $lien = '';
$lienfin='';
$picto='projecttask';
- $label=$langs->trans("ShowTask").': '.$this->ref.($this->label?' - '.$this->label:'');
if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin);
if ($withpicto && $withpicto != 2) $result.=' ';
diff --git a/htdocs/resource/class/resource.class.php b/htdocs/resource/class/resource.class.php
index deea00f9c99..498291c1cc1 100644
--- a/htdocs/resource/class/resource.class.php
+++ b/htdocs/resource/class/resource.class.php
@@ -869,10 +869,11 @@ class Resource extends CommonObject
global $langs;
$result='';
+ $label=$langs->trans("ShowResource").': '.$this->ref;
if ($option == '')
{
- $lien = '';
+ $lien = '';
$picto='resource@resource';
$label=$langs->trans("ShowResource").': '.$this->ref;
@@ -880,7 +881,6 @@ class Resource extends CommonObject
$lienfin='';
- $label=$langs->trans("ShowResource").': '.$this->ref;
if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin);
if ($withpicto && $withpicto != 2) $result.=' ';
diff --git a/htdocs/societe/class/address.class.php b/htdocs/societe/class/address.class.php
index 55511922385..06be3f501fb 100644
--- a/htdocs/societe/class/address.class.php
+++ b/htdocs/societe/class/address.class.php
@@ -422,8 +422,9 @@ class Address
global $langs;
$result='';
+ $label = $langs->trans("ShowAddress").': '.$this->label;
- $lien = '';
+ $lien = '';
$lienfin='';
if ($withpicto) $result.=($lien.img_object($langs->trans("ShowAddress").': '.$this->label, 'address', 'class="classfortooltip"').$lienfin.' ');
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index 8f2e64874c6..ab28cace102 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -1749,7 +1749,7 @@ class Societe extends CommonObject
}
// Add type of canvas
- $lien.=(!empty($this->canvas)?'&canvas='.$this->canvas:'').'">';
+ $lien.=(!empty($this->canvas)?'&canvas='.$this->canvas:'').'" title="'.dol_escape_htmltag($name, 1).'" class="classfortooltip">';
$lienfin='';
if ($withpicto) $result.=($lien.img_object($langs->trans("ShowCompany").': '.$name, 'company', 'class="classfortooltip"').$lienfin);
diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php
index 9ea4f3de9c5..11eaa8afb45 100644
--- a/htdocs/user/class/user.class.php
+++ b/htdocs/user/class/user.class.php
@@ -1786,14 +1786,14 @@ class User extends CommonObject
global $langs;
$result='';
+ $label = $langs->trans("ShowUser").': '.$this->getFullName($langs,'','',24);
- $lien = '';
+ $lien = '';
$lienfin='';
- if ($withpicto)
- {
- $result.=($lien.img_object($langs->trans("ShowUser"), 'user', 'class="classfortooltip"').$lienfin);
- if ($withpicto != 2) $result.=' ';
+ if ($withpicto) {
+ $result.=($lien.img_object($label, 'user', 'class="classfortooltip"').$lienfin);
+ if ($withpicto != 2) $result.=' ';
}
$result.=$lien.$this->getFullName($langs,'','',24).$lienfin;
return $result;
|