Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2015-01-22 18:35:55 +01:00
commit 321e46e596
52 changed files with 1072 additions and 767 deletions

View File

@ -1559,25 +1559,26 @@ class Adherent extends CommonObject
global $langs; global $langs;
$result=''; $result='';
$label=$langs->trans("ShowMember").': '.$this->ref;
$linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
if ($option == 'card') if ($option == 'card')
{ {
$lien = '<a href="'.DOL_URL_ROOT.'/adherents/card.php?rowid='.$this->id.'">'; $lien = '<a href="'.DOL_URL_ROOT.'/adherents/card.php?rowid='.$this->id.$linkclose;
$lienfin='</a>'; $lienfin='</a>';
} }
if ($option == 'subscription') if ($option == 'subscription')
{ {
$lien = '<a href="'.DOL_URL_ROOT.'/adherents/card_subscriptions.php?rowid='.$this->id.'">'; $lien = '<a href="'.DOL_URL_ROOT.'/adherents/card_subscriptions.php?rowid='.$this->id.$linkclose;
$lienfin='</a>'; $lienfin='</a>';
} }
if ($option == 'category') if ($option == 'category')
{ {
$lien = '<a href="'.DOL_URL_ROOT.'/categories/categorie.php?id='.$this->id.'&type=3">'; $lien = '<a href="'.DOL_URL_ROOT.'/categories/categorie.php?id='.$this->id.'&type=3'.$linkclose;
$lienfin='</a>'; $lienfin='</a>';
} }
$picto='user'; $picto='user';
$label=$langs->trans("ShowMember");
if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin); if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin);
if ($withpicto && $withpicto != 2) $result.=' '; if ($withpicto && $withpicto != 2) $result.=' ';

View File

@ -270,12 +270,12 @@ class AdherentType extends CommonObject
global $langs; global $langs;
$result=''; $result='';
$label=$langs->trans("ShowTypeCard",$this->libelle);
$lien = '<a href="'.DOL_URL_ROOT.'/adherents/type.php?rowid='.$this->id.'">'; $lien = '<a href="'.DOL_URL_ROOT.'/adherents/type.php?rowid='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>'; $lienfin='</a>';
$picto='group'; $picto='group';
$label=$langs->trans("ShowTypeCard",$this->libelle);
if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin); if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin);
if ($withpicto && $withpicto != 2) $result.=' '; if ($withpicto && $withpicto != 2) $result.=' ';

View File

@ -264,12 +264,12 @@ class Cotisation extends CommonObject
global $langs; global $langs;
$result=''; $result='';
$label=$langs->trans("ShowSubscription").': '.$this->ref;
$lien = '<a href="'.DOL_URL_ROOT.'/adherents/fiche_subscription.php?rowid='.$this->id.'">'; $lien = '<a href="'.DOL_URL_ROOT.'/adherents/fiche_subscription.php?rowid='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>'; $lienfin='</a>';
$picto='payment'; $picto='payment';
$label=$langs->trans("ShowSubscription");
if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin); if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin);
if ($withpicto && $withpicto != 2) $result.=' '; if ($withpicto && $withpicto != 2) $result.=' ';

View File

@ -1274,9 +1274,9 @@ class Categorie extends CommonObject
global $langs; global $langs;
$result=''; $result='';
$lien = '<a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.$this->id.'&type='.$this->type.'">';
$label=$langs->trans("ShowCategory").': '. ($this->ref?$this->ref:$this->label); $label=$langs->trans("ShowCategory").': '. ($this->ref?$this->ref:$this->label);
$lien = '<a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.$this->id.'&type='.$this->type.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>'; $lienfin='</a>';
$picto='category'; $picto='category';

View File

@ -897,11 +897,12 @@ class ActionComm extends CommonObject
global $conf,$langs; global $conf,$langs;
$result=''; $result='';
if ($option=='birthday') $lien = '<a '.($classname?'class="'.$classname.'" ':'').'href="'.DOL_URL_ROOT.'/contact/perso.php?id='.$this->id.'">';
else $lien = '<a '.($classname?'class="'.$classname.'" ':'').'href="'.DOL_URL_ROOT.'/comm/action/card.php?id='.$this->id.'">';
$lienfin='</a>';
$label=$this->label; $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 = '<a '.($classname?'class="'.$classname.'" ':'').'href="'.DOL_URL_ROOT.'/contact/perso.php?id='.$this->id.$linkclose;
else $lien = '<a '.($classname?'class="'.$classname.'" ':'').'href="'.DOL_URL_ROOT.'/comm/action/card.php?id='.$this->id.$linkclose;
$lienfin='</a>';
//print 'rrr'.$this->libelle.'-'.$withpicto; //print 'rrr'.$this->libelle.'-'.$withpicto;
if ($withpicto == 2) if ($withpicto == 2)

View File

@ -142,7 +142,7 @@ if (! empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire)
*/ */
if (! empty($conf->propal->enabled) && $user->rights->propal->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.= " FROM ".MAIN_DB_PREFIX."propal as p";
$sql.= ", ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."societe as s";
if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; 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 '<tr '.$bc[$var].'><td class="nowrap">'; print '<tr '.$bc[$var].'><td class="nowrap">';
$propalstatic->id=$obj->rowid; $propalstatic->id=$obj->rowid;
$propalstatic->ref=$obj->ref; $propalstatic->ref=$obj->ref;
$propalstatic->ref_client=$obj->ref_client;
print $propalstatic->getNomUrl(1); print $propalstatic->getNomUrl(1);
print '</td>'; print '</td>';
print '<td class="nowrap">'; print '<td class="nowrap">';
@ -209,7 +210,7 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire)
{ {
$langs->load("orders"); $langs->load("orders");
$sql = "SELECT c.rowid, c.ref, c.total_ttc, s.rowid as socid, s.nom as name, s.client, s.canvas"; $sql = "SELECT c.rowid, c.ref, c.ref_client, c.total_ttc, s.rowid as socid, s.nom as name, s.client, s.canvas";
$sql.= " FROM ".MAIN_DB_PREFIX."commande as c"; $sql.= " FROM ".MAIN_DB_PREFIX."commande as c";
$sql.= ", ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."societe as s";
if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -239,6 +240,7 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire)
print '<tr '.$bc[$var].'><td class="nowrap">'; print '<tr '.$bc[$var].'><td class="nowrap">';
$orderstatic->id=$obj->rowid; $orderstatic->id=$obj->rowid;
$orderstatic->ref=$obj->ref; $orderstatic->ref=$obj->ref;
$orderstatic->ref_client=$obj->ref_client;
print $orderstatic->getNomUrl(1); print $orderstatic->getNomUrl(1);
print '</td>'; print '</td>';
print '<td class="nowrap">'; print '<td class="nowrap">';
@ -467,7 +469,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
{ {
$langs->load("propal"); $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.= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql.= ", ".MAIN_DB_PREFIX."propal as p"; $sql.= ", ".MAIN_DB_PREFIX."propal as p";
if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; 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->id=$obj->propalid;
$propalstatic->ref=$obj->ref; $propalstatic->ref=$obj->ref;
$propalstatic->ref_client=$obj->ref_client;
print '<table class="nobordernopadding"><tr class="nocellnopadd">'; print '<table class="nobordernopadding"><tr class="nocellnopadd">';
print '<td class="nobordernopadding nowrap">'; print '<td class="nobordernopadding nowrap">';

View File

@ -2605,29 +2605,31 @@ class Propal extends CommonObject
global $langs; global $langs;
$result=''; $result='';
if ($option == '') $label=$langs->trans("ShowPropal").': '.$this->ref;
{ if (! empty($this->ref_client))
$lien = '<a href="'.DOL_URL_ROOT.'/comm/propal.php?id='.$this->id. $get_params .'">'; $label.= '<br>'.$langs->trans('RefCustomer').': '.$this->ref_client;
$linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
if ($option == '') {
$lien = '<a href="'.DOL_URL_ROOT.'/comm/propal.php?id='.$this->id. $get_params .$linkclose;
} }
if ($option == 'compta') // deprecated if ($option == 'compta') { // deprecated
{ $lien = '<a href="'.DOL_URL_ROOT.'/comm/propal.php?id='.$this->id. $get_params .$linkclose;
$lien = '<a href="'.DOL_URL_ROOT.'/comm/propal.php?id='.$this->id. $get_params .'">';
} }
if ($option == 'expedition') if ($option == 'expedition') {
{ $lien = '<a href="'.DOL_URL_ROOT.'/expedition/propal.php?id='.$this->id. $get_params .$linkclose;
$lien = '<a href="'.DOL_URL_ROOT.'/expedition/propal.php?id='.$this->id. $get_params .'">';
} }
if ($option == 'document') if ($option == 'document') {
{ $lien = '<a href="'.DOL_URL_ROOT.'/comm/propal/document.php?id='.$this->id. $get_params .$linkclose;
$lien = '<a href="'.DOL_URL_ROOT.'/comm/propal/document.php?id='.$this->id. $get_params .'">';
} }
$lienfin='</a>'; $lienfin='</a>';
$picto='propal'; $picto='propal';
$label=$langs->trans("ShowPropal").': '.$this->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; $result.=$lien.$this->ref.$lienfin;
return $result; return $result;
} }

View File

@ -2884,11 +2884,13 @@ class Commande extends CommonOrder
if ($short) return $url; if ($short) return $url;
$linkstart = '<a href="'.$url.'">';
$linkend='</a>';
$picto='order'; $picto='order';
$label=$langs->trans("ShowOrder").': '.$this->ref; $label=$langs->trans("ShowOrder").': '.$this->ref;
if (! empty($this->ref_client))
$label.= '<br>'.$langs->trans('RefCustomer').': '.$this->ref_client;
$linkstart = '<a href="'.$url.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$linkend='</a>';
if ($withpicto) $result.=($linkstart.img_object($label, $picto, 'class="classfortooltip"').$linkend); if ($withpicto) $result.=($linkstart.img_object($label, $picto, 'class="classfortooltip"').$linkend);
if ($withpicto && $withpicto != 2) $result.=' '; if ($withpicto && $withpicto != 2) $result.=' ';

View File

@ -935,15 +935,16 @@ class Account extends CommonObject
global $langs; global $langs;
$result=''; $result='';
$linkclose = '" title="'.dol_escape_htmltag($this->label, 1).'" class="classfortooltip">';
if (empty($mode)) if (empty($mode))
{ {
$lien = '<a href="'.DOL_URL_ROOT.'/compta/bank/card.php?id='.$this->id.'">'; $lien = '<a href="'.DOL_URL_ROOT.'/compta/bank/card.php?id='.$this->id.$linkclose;
$lienfin='</a>'; $lienfin='</a>';
} }
else if ($mode == 'transactions') else if ($mode == 'transactions')
{ {
$lien = '<a href="'.DOL_URL_ROOT.'/compta/bank/account.php?account='.$this->id.'">'; $lien = '<a href="'.DOL_URL_ROOT.'/compta/bank/account.php?account='.$this->id.$linkclose;
$lienfin='</a>'; $lienfin='</a>';
} }
@ -1483,11 +1484,11 @@ class AccountLine extends CommonObject
global $langs; global $langs;
$result=''; $result='';
$label=$langs->trans("ShowTransaction").': '.$this->rowid;
$lien = '<a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$this->rowid.'">'; $lien = '<a href="'.DOL_URL_ROOT.'/compta/bank/ligne.php?rowid='.$this->rowid.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>'; $lienfin='</a>';
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; $result.=$lien.$this->rowid.$lienfin;
if ($option == 'showall' || $option == 'showconciliated') $result.=' ('; if ($option == 'showall' || $option == 'showconciliated') $result.=' (';

View File

@ -357,13 +357,13 @@ class Deplacement extends CommonObject
global $langs; global $langs;
$result=''; $result='';
$label=$langs->trans("Show").': '.$this->ref;
$lien = '<a href="'.DOL_URL_ROOT.'/compta/deplacement/card.php?id='.$this->id.'">'; $lien = '<a href="'.DOL_URL_ROOT.'/compta/deplacement/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>'; $lienfin='</a>';
$picto='trip'; $picto='trip';
$label=$langs->trans("Show").': '.$this->ref;
if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin); if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin);
if ($withpicto && $withpicto != 2) $result.=' '; if ($withpicto && $withpicto != 2) $result.=' ';

View File

@ -711,13 +711,13 @@ class Don extends CommonObject
global $langs; global $langs;
$result=''; $result='';
$label=$langs->trans("ShowDonation").': '.$this->id;
$lien = '<a href="'.DOL_URL_ROOT.'/compta/dons/card.php?rowid='.$this->id.'">'; $lien = '<a href="'.DOL_URL_ROOT.'/compta/dons/card.php?rowid='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>'; $lienfin='</a>';
$picto='generic'; $picto='generic';
$label=$langs->trans("ShowDonation").': '.$this->id;
if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin); if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin);
if ($withpicto && $withpicto != 2) $result.=' '; if ($withpicto && $withpicto != 2) $result.=' ';

View File

@ -558,13 +558,13 @@ class FactureRec extends Facture
global $langs; global $langs;
$result=''; $result='';
$label=$langs->trans("ShowInvoice").': '.$this->ref;
$lien = '<a href="'.DOL_URL_ROOT.'/compta/facture/fiche-rec.php?facid='.$this->id.'">'; $lien = '<a href="'.DOL_URL_ROOT.'/compta/facture/fiche-rec.php?facid='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>'; $lienfin='</a>';
$picto='bill'; $picto='bill';
$label=$langs->trans("ShowInvoice").': '.$this->ref;
if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin); if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin);
if ($withpicto && $withpicto != 2) $result.=' '; if ($withpicto && $withpicto != 2) $result.=' ';

View File

@ -865,7 +865,7 @@ class Facture extends CommonInvoice
if ($this->type == self::TYPE_SITUATION) $label=$langs->transnoentitiesnoconv("ShowInvoiceSituation").': '.$this->ref; if ($this->type == self::TYPE_SITUATION) $label=$langs->transnoentitiesnoconv("ShowInvoiceSituation").': '.$this->ref;
if ($moretitle) $label.=' - '.$moretitle; if ($moretitle) $label.=' - '.$moretitle;
$linkstart='<a href="'.$url.'">'; $linkstart='<a href="'.$url.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$linkend='</a>'; $linkend='</a>';
if ($withpicto) $result.=($linkstart.img_object(($max?dol_trunc($label,$max):$label), $picto, 'class="classfortooltip"').$linkend); if ($withpicto) $result.=($linkstart.img_object(($max?dol_trunc($label,$max):$label), $picto, 'class="classfortooltip"').$linkend);

View File

@ -585,12 +585,12 @@ class Localtax extends CommonObject
global $langs; global $langs;
$result=''; $result='';
$label=$langs->trans("ShowVatPayment").': '.$this->ref;
$lien = '<a href="'.DOL_URL_ROOT.'/compta/localtax/card.php?id='.$this->id.'">'; $lien = '<a href="'.DOL_URL_ROOT.'/compta/localtax/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>'; $lienfin='</a>';
$picto='payment'; $picto='payment';
$label=$langs->trans("ShowVatPayment").': '.$this->ref;
if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin); if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin);
if ($withpicto && $withpicto != 2) $result.=' '; if ($withpicto && $withpicto != 2) $result.=' ';

View File

@ -769,11 +769,12 @@ class RemiseCheque extends CommonObject
global $langs; global $langs;
$result=''; $result='';
$label = $langs->trans("ShowCheckReceipt").': '.$this->ref;
$lien = '<a href="'.DOL_URL_ROOT.'/compta/paiement/cheque/card.php?id='.$this->id.'">'; $lien = '<a href="'.DOL_URL_ROOT.'/compta/paiement/cheque/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>'; $lienfin='</a>';
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 && $withpicto != 2) $result.=' ';
if ($withpicto != 2) $result.=$lien.$this->ref.$lienfin; if ($withpicto != 2) $result.=$lien.$this->ref.$lienfin;

View File

@ -748,8 +748,9 @@ class Paiement extends CommonObject
global $langs; global $langs;
$result=''; $result='';
$label = $langs->trans("ShowPayment").': '.$this->ref;
$lien = '<a href="'.DOL_URL_ROOT.'/compta/paiement/card.php?id='.$this->id.'">'; $lien = '<a href="'.DOL_URL_ROOT.'/compta/paiement/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>'; $lienfin='</a>';
if ($withpicto) $result.=($lien.img_object($langs->trans("ShowPayment"), 'payment', 'class="classfortooltip"').$lienfin); if ($withpicto) $result.=($lien.img_object($langs->trans("ShowPayment"), 'payment', 'class="classfortooltip"').$lienfin);

View File

@ -1118,17 +1118,18 @@ class BonPrelevement extends CommonObject
global $langs; global $langs;
$result=''; $result='';
$label = $langs->trans("ShowWithdraw").': '.$this->ref;
$lien = '<a href="'.DOL_URL_ROOT.'/compta/prelevement/card.php?id='.$this->id.'">'; $lien = '<a href="'.DOL_URL_ROOT.'/compta/prelevement/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>'; $lienfin='</a>';
if ($option == 'xxx') if ($option == 'xxx')
{ {
$lien = '<a href="'.DOL_URL_ROOT.'/compta/prelevement/card.php?id='.$this->id.'">'; $lien = '<a href="'.DOL_URL_ROOT.'/compta/prelevement/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>'; $lienfin='</a>';
} }
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; $result.=$lien.$this->ref.$lienfin;
return $result; return $result;
} }

View File

@ -486,12 +486,12 @@ class PaymentSalary extends CommonObject
global $langs; global $langs;
$result=''; $result='';
$label=$langs->trans("ShowSalaryPayment").': '.$this->ref;
$lien = '<a href="'.DOL_URL_ROOT.'/compta/salaries/card.php?id='.$this->id.'">'; $lien = '<a href="'.DOL_URL_ROOT.'/compta/salaries/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>'; $lienfin='</a>';
$picto='payment'; $picto='payment';
$label=$langs->trans("ShowSalaryPayment").': '.$this->ref;
if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin); if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin);
if ($withpicto && $withpicto != 2) $result.=' '; if ($withpicto && $withpicto != 2) $result.=' ';

View File

@ -420,11 +420,12 @@ class ChargeSociales extends CommonObject
$result=''; $result='';
if (empty($this->ref)) $this->ref=$this->lib; if (empty($this->ref)) $this->ref=$this->lib;
$label = $langs->trans("ShowSocialContribution").': '.$this->ref;
$lien = '<a href="'.DOL_URL_ROOT.'/compta/sociales/charges.php?id='.$this->id.'">'; $lien = '<a href="'.DOL_URL_ROOT.'/compta/sociales/charges.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>'; $lienfin='</a>';
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 && $withpicto != 2) $result.=' ';
if ($withpicto != 2) $result.=$lien.($maxlen?dol_trunc($this->ref,$maxlen):$this->ref).$lienfin; if ($withpicto != 2) $result.=$lien.($maxlen?dol_trunc($this->ref,$maxlen):$this->ref).$lienfin;
return $result; return $result;

View File

@ -585,13 +585,14 @@ class PaymentSocialContribution extends CommonObject
$result=''; $result='';
if (empty($this->ref)) $this->ref=$this->lib; if (empty($this->ref)) $this->ref=$this->lib;
$label = $langs->trans("ShowPayment").': '.$this->ref;
if (!empty($this->id)) if (!empty($this->id))
{ {
$lien = '<a href="'.DOL_URL_ROOT.'/compta/payment_sc/card.php?id='.$this->id.'">'; $lien = '<a href="'.DOL_URL_ROOT.'/compta/payment_sc/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>'; $lienfin='</a>';
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 && $withpicto != 2) $result.=' ';
if ($withpicto != 2) $result.=$lien.($maxlen?dol_trunc($this->ref,$maxlen):$this->ref).$lienfin; if ($withpicto != 2) $result.=$lien.($maxlen?dol_trunc($this->ref,$maxlen):$this->ref).$lienfin;
} }

View File

@ -638,12 +638,12 @@ class Tva extends CommonObject
global $langs; global $langs;
$result=''; $result='';
$label=$langs->trans("ShowVatPayment").': '.$this->ref;
$lien = '<a href="'.DOL_URL_ROOT.'/compta/tva/card.php?id='.$this->id.'">'; $lien = '<a href="'.DOL_URL_ROOT.'/compta/tva/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>'; $lienfin='</a>';
$picto='payment'; $picto='payment';
$label=$langs->trans("ShowVatPayment").': '.$this->ref;
if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin); if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin);
if ($withpicto && $withpicto != 2) $result.=' '; if ($withpicto && $withpicto != 2) $result.=' ';

View File

@ -887,17 +887,18 @@ class Contact extends CommonObject
global $langs; global $langs;
$result=''; $result='';
$label = $langs->trans("ShowContact").': '.$this->getFullName($langs);
$lien = '<a href="'.DOL_URL_ROOT.'/contact/card.php?id='.$this->id.$moreparam.'">'; $lien = '<a href="'.DOL_URL_ROOT.'/contact/card.php?id='.$this->id.$moreparam.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>'; $lienfin='</a>';
if ($option == 'xxx') if ($option == 'xxx')
{ {
$lien = '<a href="'.DOL_URL_ROOT.'/contact/card.php?id='.$this->id.$moreparam.'">'; $lien = '<a href="'.DOL_URL_ROOT.'/contact/card.php?id='.$this->id.$moreparam.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>'; $lienfin='</a>';
} }
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; $result.=$lien.($maxlen?dol_trunc($this->getFullName($langs),$maxlen):$this->getFullName($langs)).$lienfin;
return $result; return $result;
} }

View File

@ -1682,13 +1682,13 @@ class Contrat extends CommonObject
global $langs; global $langs;
$result=''; $result='';
$label=$langs->trans("ShowContract").': '.$this->ref;
$lien = '<a href="'.DOL_URL_ROOT.'/contrat/card.php?id='.$this->id.'">'; $lien = '<a href="'.DOL_URL_ROOT.'/contrat/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>'; $lienfin='</a>';
$picto='contract'; $picto='contract';
$label=$langs->trans("ShowContract").': '.$this->ref;
if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin); if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin);
if ($withpicto && $withpicto != 2) $result.=' '; if ($withpicto && $withpicto != 2) $result.=' ';
@ -2211,13 +2211,13 @@ class ContratLigne extends CommonObject
global $langs; global $langs;
$result=''; $result='';
$label=$langs->trans("ShowContractOfService").': '.$this->label;
$lien = '<a href="'.DOL_URL_ROOT.'/contrat/card.php?id='.$this->fk_contrat.'">'; $lien = '<a href="'.DOL_URL_ROOT.'/contrat/card.php?id='.$this->fk_contrat.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>'; $lienfin='</a>';
$picto='contract'; $picto='contract';
$label=$langs->trans("ShowContractOfService").': '.$this->label;
if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin); if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin);
if ($withpicto && $withpicto != 2) $result.=' '; if ($withpicto && $withpicto != 2) $result.=' ';

View File

@ -60,8 +60,7 @@ class box_actions extends ModeleBoxes
$this->info_box_head = array('text' => $langs->trans("BoxTitleLastActionsToDo",$max)); $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 = "SELECT a.id, a.label, a.datep as dp, a.percent as percentage,";
$sql.= " ta.code, ta.libelle as type_label,"; $sql.= " ta.code, ta.libelle as type_label,";
$sql.= " s.nom as name, s.rowid as socid"; $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); dol_syslog("Box_actions::loadBox", LOG_DEBUG);
$result = $db->query($sql); $result = $db->query($sql);
if ($result) if ($result) {
{
$now=dol_now(); $now=dol_now();
$delay_warning=$conf->global->MAIN_DELAY_ACTIONS_TODO*24*60*60; $delay_warning=$conf->global->MAIN_DELAY_ACTIONS_TODO*24*60*60;
$num = $db->num_rows($result); $num = $db->num_rows($result);
$i = 0; $i = 0;
while ($i < $num) while ($i < $num) {
{
$late = ''; $late = '';
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
$datelimite=$db->jdate($objp->dp); $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) //($langs->transnoentities("Action".$objp->code)!=("Action".$objp->code) ? $langs->transnoentities("Action".$objp->code) : $objp->label)
$label=empty($objp->label)?$objp->type_label:$objp->label; $label=empty($objp->label)?$objp->type_label:$objp->label;
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', $this->info_box_contents[$i][0] = array(
'logo' => ("action"), 'td' => 'align="left" width="16"',
'url' => DOL_URL_ROOT."/comm/action/card.php?id=".$objp->id); '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"', $this->info_box_contents[$i][1] = array(
'text' => dol_trunc($label,32), 'td' => 'align="left"',
'text2'=> $late, 'text' => dol_trunc($label,32),
'url' => DOL_URL_ROOT."/comm/action/card.php?id=".$objp->id); '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"', $this->info_box_contents[$i][2] = array(
'logo' => ($objp->socid?'company':''), 'td' => 'align="left" width="16"',
'url' => ($objp->socid?DOL_URL_ROOT."/societe/soc.php?socid=".$objp->socid:'')); '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"', $this->info_box_contents[$i][3] = array(
'text' => dol_trunc($objp->name,24), 'td' => 'align="left"',
'url' => DOL_URL_ROOT."/societe/soc.php?socid=".$objp->socid); '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"', $this->info_box_contents[$i][4] = array(
'text' => dol_print_date($datelimite, "dayhour")); 'td' => 'align="left" class="nowrap"',
'text' => dol_print_date($datelimite, "dayhour"),
);
$this->info_box_contents[$i][5] = array('td' => 'align="right"', $this->info_box_contents[$i][5] = array(
'text' => ($objp->percentage>= 0?$objp->percentage.'%':'')); 'td' => 'align="right"',
'text' => ($objp->percentage>= 0?$objp->percentage.'%':''),
);
$this->info_box_contents[$i][6] = array('td' => 'align="right" width="18"', $this->info_box_contents[$i][6] = array(
'text' => $actionstatic->LibStatut($objp->percentage,3)); '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")); if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoActionsToDo"));
$db->free($result); $db->free($result);
} } else {
else { $this->info_box_contents[0][0] = array(
$this->info_box_contents[0][0] = array( 'td' => 'align="left"', 'td' => 'align="left"',
'maxlength'=>500, 'maxlength'=>500,
'text' => ($db->error().' sql='.$sql)); 'text' => ($db->error().' sql='.$sql),
} );
} }
else { } else {
$this->info_box_contents[0][0] = array('align' => 'left', $this->info_box_contents[0][0] = array(
'text' => $langs->trans("ReadPermissionNotAllowed")); 'align' => 'left',
'text' => $langs->trans("ReadPermissionNotAllowed"),
);
} }
} }

View File

@ -1,6 +1,7 @@
<?php <?php
/* Copyright (C) 2012 Charles-François BENKE <charles.fr@benke.fr> /* Copyright (C) 2012 Charles-François BENKE <charles.fr@benke.fr>
* Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2014 Frederic France <frederic.france@free.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -17,9 +18,9 @@
*/ */
/** /**
* \file htdocs/core/boxes/box_activity.php * \file htdocs/core/boxes/box_activity.php
* \ingroup societes * \ingroup societes
* \brief Module to show box of bills, orders & propal of the current year * \brief Module to show box of bills, orders & propal of the current year
*/ */
include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php'; 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 class box_activity extends ModeleBoxes
{ {
var $boxcode="activity"; var $boxcode="activity";
var $boximg="object_bill"; var $boximg="object_bill";
var $boxlabel='BoxGlobalActivity'; var $boxlabel='BoxGlobalActivity';
var $depends = array("facture"); var $depends = array("facture");
var $db; var $db;
var $param; var $param;
var $enabled = 1; var $enabled = 1;
var $info_box_head = array(); var $info_box_head = array();
var $info_box_contents = array(); var $info_box_contents = array();
/** /**
* Constructor * Constructor
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param string $param More parameters * @param string $param More parameters
*/ */
function __construct($db,$param) function __construct($db,$param)
{ {
global $conf; global $conf;
$this->db=$db; $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: Pb into some status
// FIXME: Removed number_format (not compatible with all languages) $this->enabled=$conf->global->MAIN_FEATURES_LEVEL; // Not enabled by default due to bugs (see previous comments)
// 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 * Charge les donnees en memoire pour affichage ulterieur
* *
* @param int $max Maximum number of records to load * @param int $max Maximum number of records to load
* @return void * @return void
*/ */
function loadBox($max=5) function loadBox($max=5)
{ {
global $conf, $user, $langs, $db; global $conf, $user, $langs, $db;
$totalMnt = 0; include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
$totalnb = 0; include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$i = 0;
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;
if (! empty($conf->global->MAIN_BOX_ACTIVITY_DURATION)) $nbofyears=$conf->global->MAIN_BOX_ACTIVITY_DURATION; $textHead = $langs->trans("Activity").' <span class="badge">'.$nbofyears.' '.$langs->trans("DurationYears").'</span>';
$textHead = $langs->trans("Activity").' ('.$nbofyears.' '.$langs->trans("DurationYears").')'; $this->info_box_head = array(
$this->info_box_head = array('text' => $textHead, 'limit'=> dol_strlen($textHead)); 'text' => $textHead,
'limit'=> dol_strlen($textHead),
);
// compute the year limit to show // compute the year limit to show
$tmpdate= dol_time_plus_duree(dol_now(), -1*$nbofyears, "y"); $tmpdate= dol_time_plus_duree(dol_now(), -1*$nbofyears, "y");
// list the summary of the bills // list the summary of the bills
if (! empty($conf->facture->enabled) && $user->rights->facture->lire) if (! empty($conf->facture->enabled) && $user->rights->facture->lire) {
{ include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $facturestatic=new Facture($db);
$facturestatic=new Facture($db);
$sql = "SELECT f.fk_statut, SUM(f.total_ttc) as Mnttot, COUNT(*) as nb"; $cachefile = DOL_DATA_ROOT.'/facture/temp/boxactivity-invoice'.$fileid;
$sql.= " FROM (".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f"; $refresh = !file_exists($cachefile) || ($now-$cachetime) > dol_filemtime($cachefile);
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $data = array();
$sql.= ")"; if ($refresh) {
$sql.= " WHERE f.entity = ".$conf->entity; $sql = "SELECT f.fk_statut, SUM(f.total_ttc) as Mnttot, COUNT(*) as nb";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; $sql.= " FROM (".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
if($user->societe_id) $sql.= " AND s.rowid = ".$user->societe_id; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " AND f.fk_soc = s.rowid"; $sql.= ")";
$sql.= " AND f.datef >= '".$db->idate($tmpdate)."' AND paye=1"; $sql.= " WHERE f.entity = ".$conf->entity;
$sql.= " GROUP BY f.fk_statut"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
$sql.= " ORDER BY f.fk_statut DESC"; 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); $result = $db->query($sql);
if ($result) if ($result) {
{ $num = $db->num_rows($result);
$num = $db->num_rows($result); $j=0;
while ($i < $num) while ($j < $num) {
{ $data[$j]=$db->fetch_object($result);
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', 'logo' => 'bill'); $j++;
$objp = $db->fetch_object($result); }
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&amp;paye=1&amp;year=".$data[$j]->annee;
$this->info_box_contents[$i][0] = array(
'td' => 'align="left" width="16"',
'tooltip' => $langs->trans('Bills').'&nbsp;'.$facturestatic->LibStatut(1,$data[$j]->fk_statut,0),
'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&amp;mainmenu=accountancy&amp;leftmenu=customers_bills",
'logo' => 'bill',
);
$this->info_box_contents[$i][1] = array('td' => 'align="left"', 'text' => $langs->trans("Bills")."&nbsp;".$facturestatic->LibStatut(1,$objp->fk_statut,0)." ".$objp->annee); $this->info_box_contents[$i][1] = array(
$billurl="viewstatut=2&paye=1&year=".$objp->annee; 'td' => 'align="left"',
'text' => $langs->trans("Bills")."&nbsp;".$facturestatic->LibStatut(1,$data[$j]->fk_statut,0)." ".$data[$j]->annee,
);
$this->info_box_contents[$i][2] = array('td' => 'align="right"', $this->info_box_contents[$i][2] = array(
'text' => $objp->nb, 'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills" 'td' => 'align="right"',
); 'tooltip' => $langs->trans('Bills').'&nbsp;'.$facturestatic->LibStatut(1,$data[$j]->fk_statut,0),
'text' => $data[$j]->nb,
'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&amp;mainmenu=accountancy&amp;leftmenu=customers_bills",
);
$this->info_box_contents[$i][3] = array('td' => 'align="right"', $this->info_box_contents[$i][3] = array(
'text' => price($objp->Mnttot,1,$langs,0,0,-1,$conf->currency) 'td' => 'align="right"',
); 'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency)
);
// We add only for the current year // We add only for the current year
if ($objp->annee == date("Y")) if ($data[$j]->annee == date("Y")) {
{ $totalnb += $data[$j]->nb;
$totalnb += $objp->nb; $totalMnt += $data[$j]->Mnttot;
$totalMnt += $objp->Mnttot; }
} $this->info_box_contents[$i][4] = array(
$this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"', 'text' => $facturestatic->LibStatut(1,$objp->fk_statut,3) ); 'td' => 'align="right" width="18"',
$i++; 'text' => $facturestatic->LibStatut(1,$data[$j]->fk_statut,3),
} );
if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedInvoices")); $i++;
$j++;
}
if (count($data)==0)
$this->info_box_contents[$i][0] = array(
'td' => 'align="center"',
'text'=>$langs->trans("NoRecordedInvoices"),
);
}
$db->free($result); $cachefile = DOL_DATA_ROOT.'/facture/temp/boxactivity-invoice2'.$fileid;
} $refresh = !file_exists($cachefile) || ($now-$cachetime) > dol_filemtime($cachefile);
else dol_print_error($db);
$sql = "SELECT f.fk_statut, SUM(f.total_ttc) as Mnttot, COUNT(*) as nb"; if ($refresh) {
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f"; $sql = "SELECT f.fk_statut, SUM(f.total_ttc) as Mnttot, COUNT(*) as nb";
$sql.= " WHERE f.entity = ".$conf->entity; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
$sql.= " AND f.fk_soc = s.rowid"; $sql.= " WHERE f.entity = ".$conf->entity;
$sql.= " AND paye=0"; $sql.= " AND f.fk_soc = s.rowid";
$sql.= " GROUP BY f.fk_statut"; $sql.= " AND paye=0";
$sql.= " ORDER BY f.fk_statut DESC"; $sql.= " GROUP BY f.fk_statut";
$sql.= " ORDER BY f.fk_statut DESC";
$result = $db->query($sql); $result = $db->query($sql);
if ($result) if ($result) {
{ $num = $db->num_rows($result) + $i;
$num = $db->num_rows($result) + $i; $j=0;
$now=dol_now(); 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) while ($i < count($data)) {
{ $billurl="viewstatut=".$data[$j]->fk_statut."&amp;paye=0";
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', $this->info_box_contents[$i][0] = array(
'logo' => 'bill'); 'td' => 'align="left" width="16"',
$objp = $db->fetch_object($result); 'tooltip' => $langs->trans('Bills').'&nbsp;'.$facturestatic->LibStatut(0,$data[$j]->fk_statut,0),
'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&amp;mainmenu=accountancy&amp;leftmenu=customers_bills",
'logo' => 'bill',
);
$this->info_box_contents[$i][1] = array('td' => 'align="left"', $this->info_box_contents[$i][1] = array(
'text' => $langs->trans("Bills")."&nbsp;".$facturestatic->LibStatut(0,$objp->fk_statut,0)); 'td' => 'align="left"',
'text' => $langs->trans("Bills")."&nbsp;".$facturestatic->LibStatut(0,$data[$j]->fk_statut,0),
);
$billurl="viewstatut=".$objp->fk_statut."&paye=0"; $this->info_box_contents[$i][2] = array(
$this->info_box_contents[$i][2] = array('td' => 'align="right"', 'td' => 'align="right"',
'text' => $objp->nb, 'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&mainmenu=accountancy&leftmenu=customers_bills" 'text' => $data[$j]->nb,
); 'tooltip' => $langs->trans('Bills').'&nbsp;'.$facturestatic->LibStatut(0,$data[$j]->fk_statut,0),
$totalnb += $objp->nb; 'url' => DOL_URL_ROOT."/compta/facture/list.php?".$billurl."&amp;mainmenu=accountancy&amp;leftmenu=customers_bills",
$this->info_box_contents[$i][3] = array('td' => 'align="right"', );
'text' => price($objp->Mnttot,1,$langs,0,0,-1,$conf->currency) $totalnb += $data[$j]->nb;
); $this->info_box_contents[$i][3] = array(
$totalMnt += $objp->Mnttot; 'td' => 'align="right"',
$this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"', 'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency),
'text' => $facturestatic->LibStatut(0,$objp->fk_statut,3) );
); $totalMnt += $objp->Mnttot;
$i++; $this->info_box_contents[$i][4] = array(
} 'td' => 'align="right" width="18"',
if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedInvoices")); 'text' => $facturestatic->LibStatut(0,$data[$j]->fk_statut,3),
} else { );
$this->info_box_contents[0][0] = array( 'td' => 'align="left"', 'maxlength'=>500, 'text' => ($db->error().' sql='.$sql)); $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 // list the summary of the orders
if (! empty($conf->commande->enabled) && $user->rights->commande->lire) if (! empty($conf->commande->enabled) && $user->rights->commande->lire) {
{ include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; $commandestatic=new Commande($db);
$commandestatic=new Commande($db);
$sql = "SELECT c.fk_statut, sum(c.total_ttc) as Mnttot, count(*) as nb"; $cachefile = DOL_DATA_ROOT.'/commande/temp/boxactivity-order'.$fileid;
$sql.= " FROM (".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as c"; $refresh = !file_exists($cachefile) || ($now-$cachetime) > dol_filemtime($cachefile);
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $data = array();
$sql.= ")"; if ($refresh) {
$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";
$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) $result = $db->query($sql);
{
$num = $db->num_rows($result) + $i;
while ($i < $num)
{
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"','logo' => 'object_order');
$objp = $db->fetch_object($result); if ($result) {
$this->info_box_contents[$i][1] = array('td' => 'align="left"', $num = $db->num_rows($result) + $i;
'text' =>$langs->trans("Orders")."&nbsp;".$commandestatic->LibStatut($objp->fk_statut,0,0) $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&amp;leftmenu=orders&amp;viewstatut=".$data[$j]->fk_statut,
'tooltip' => $langs->trans("Orders")."&nbsp;".$commandestatic->LibStatut($data[$j]->fk_statut,0,0),
'logo' => 'object_order',
);
$this->info_box_contents[$i][2] = array('td' => 'align="right"', $this->info_box_contents[$i][1] = array(
'text' => $objp->nb, 'td' => 'align="left"',
'url' => DOL_URL_ROOT."/commande/list.php?mainmenu=commercial&leftmenu=orders&viewstatut=".$objp->fk_statut 'text' =>$langs->trans("Orders")."&nbsp;".$commandestatic->LibStatut($data[$j]->fk_statut,0,0),
); );
$totalnb += $objp->nb;
$this->info_box_contents[$i][3] = array('td' => 'align="right"', $this->info_box_contents[$i][2] = array(
'text' => price($objp->Mnttot,1,$langs,0,0,-1,$conf->currency) 'td' => 'align="right"',
); 'text' => $data[$j]->nb,
$totalMnt += $objp->Mnttot; 'tooltip' => $langs->trans("Orders")."&nbsp;".$commandestatic->LibStatut($data[$j]->fk_statut,0,0),
$this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"', 'text' => $commandestatic->LibStatut($objp->fk_statut,0,3)); 'url' => DOL_URL_ROOT."/commande/list.php?mainmenu=commercial&amp;leftmenu=orders&amp;viewstatut=".$data[$j]->fk_statut,
);
$totalnb += $data[$j]->nb;
$i++; $this->info_box_contents[$i][3] = array(
} 'td' => 'align="right"',
} 'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency),
else dol_print_error($db); );
} $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 $i++;
if (! empty($conf->propal->enabled) && $user->rights->propal->lire) $j++;
{ }
include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; }
$propalstatic=new Propal($db); }
$sql = "SELECT p.fk_statut, SUM(p.total) as Mnttot, COUNT(*) as nb"; // list the summary of the propals
$sql.= " FROM (".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p"; if (! empty($conf->propal->enabled) && $user->rights->propal->lire) {
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
$sql.= ")"; $propalstatic=new Propal($db);
$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";
$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) $result = $db->query($sql);
{
$num = $db->num_rows($result) + $i;
while ($i < $num)
{
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"','logo' => 'object_propal');
$objp = $db->fetch_object($result); if ($result) {
$this->info_box_contents[$i][1] = array('td' => 'align="left"', $num = $db->num_rows($result) + $i;
'text' =>$langs->trans("Proposals")."&nbsp;".$propalstatic->LibStatut($objp->fk_statut,0) $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&amp;leftmenu=propals&amp;viewstatut=".$data[$j]->fk_statut,
'tooltip' => $langs->trans("Proposals")."&nbsp;".$propalstatic->LibStatut($data[$j]->fk_statut,0),
'logo' => 'object_propal'
);
$this->info_box_contents[$i][2] = array('td' => 'align="right"', $objp = $db->fetch_object($result);
'text' => $objp->nb, $this->info_box_contents[$i][1] = array(
'url' => DOL_URL_ROOT."/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&viewstatut=".$objp->fk_statut 'td' => 'align="left"',
); 'text' => $langs->trans("Proposals")."&nbsp;".$propalstatic->LibStatut($data[$j]->fk_statut,0),
$totalnb += $objp->nb; );
$this->info_box_contents[$i][3] = array('td' => 'align="right"', $this->info_box_contents[$i][2] = array(
'text' => price($objp->Mnttot,1,$langs,0,0,-1,$conf->currency) 'td' => 'align="right"',
); 'text' => $data[$j]->nb,
$totalMnt += $objp->Mnttot; 'tooltip' => $langs->trans("Proposals")."&nbsp;".$propalstatic->LibStatut($data[$j]->fk_statut,0),
$this->info_box_contents[$i][4] = array('td' => 'align="right" width="18"', 'text' => $propalstatic->LibStatut($objp->fk_statut,3)); 'url' => DOL_URL_ROOT."/comm/propal/list.php?mainmenu=commercial&amp;leftmenu=propals&amp;viewstatut=".$data[$j]->fk_statut,
);
$totalnb += $data[$j]->nb;
$i++; $this->info_box_contents[$i][3] = array(
} 'td' => 'align="right"',
} 'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency),
else dol_print_error($db); );
} $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 $i++;
$this->info_box_contents[$i][1] = array('td' => 'align="left" ', 'text' => $langs->trans("Total")."&nbsp;".$textHead); $j++;
$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' => "");
}
/** // Add the sum in the bottom of the boxes
* Method to show box $this->info_box_contents[$i][1] = array(
* 'td' => 'align="left" ',
* @param array $head Array with properties of box title 'text' => $langs->trans("Total")."&nbsp;".$textHead,
* @param array $contents Array with properties of box lines );
* @return void $this->info_box_contents[$i][2] = array(
*/ 'td' => 'align="right" ',
function showBox($head = null, $contents = null) 'text' => $totalnb,
{ );
parent::showBox($this->info_box_head, $this->info_box_contents); $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);
}
} }

View File

@ -52,10 +52,11 @@ class box_bookmarks extends ModeleBoxes
$this->max=$max; $this->max=$max;
$this->info_box_head = array('text' => $langs->trans("BoxMyLastBookmarks",$max), $this->info_box_head = array(
'sublink' => DOL_URL_ROOT.'/bookmarks/list.php'); 'text' => $langs->trans("BoxMyLastBookmarks",$max),
if ($user->rights->bookmark->creer) 'sublink' => DOL_URL_ROOT.'/bookmarks/list.php',
{ );
if ($user->rights->bookmark->creer) {
$this->info_box_head['subpicto']='object_bookmark'; $this->info_box_head['subpicto']='object_bookmark';
$this->info_box_head['subtext']=$langs->trans("BookmarksManagement"); $this->info_box_head['subtext']=$langs->trans("BookmarksManagement");
} }
@ -81,43 +82,52 @@ class box_bookmarks extends ModeleBoxes
$i = 0; $i = 0;
while ($i < $num) while ($i < $num) {
{ $objp = $db->fetch_object($result);
$objp = $db->fetch_object($result);
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', $this->info_box_contents[$i][0] = array(
'logo' => $this->boximg, 'td' => 'align="left" width="16"',
'url' => $objp->url, 'logo' => $this->boximg,
'target' => $objp->target?'newtab':''); 'url' => $objp->url,
$this->info_box_contents[$i][1] = array('td' => 'align="left"', 'tooltip' => $objp->title,
'text' => $objp->title, 'target' => $objp->target?'newtab':'',
'url' => $objp->url, );
'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) if ($num==0) {
{ $mytxt=$langs->trans("NoRecordedBookmarks");
$mytxt=$langs->trans("NoRecordedBookmarks"); if ($user->rights->bookmark->creer) $mytxt.=' '.$langs->trans("ClickToAdd");
if ($user->rights->bookmark->creer) $mytxt.=' '.$langs->trans("ClickToAdd"); $this->info_box_contents[$i][0] = array(
$this->info_box_contents[$i][0] = array('td' => 'align="center" colspan="2"', 'url'=> DOL_URL_ROOT.'/bookmarks/list.php', 'text'=>$mytxt); 'td' => 'align="center" colspan="2"',
} 'tooltip' => $mytxt,
'url'=> DOL_URL_ROOT.'/bookmarks/list.php', 'text'=>$mytxt,
);
}
$db->free($result); $db->free($result);
} } else {
else $this->info_box_contents[0][0] = array(
{ 'td' => 'align="left"',
$this->info_box_contents[0][0] = array( 'td' => 'align="left"', 'maxlength'=>500,
'maxlength'=>500, 'text' => ($db->error().' sql='.$sql),
'text' => ($db->error().' sql='.$sql)); );
} }
} } else {
else { $this->info_box_contents[0][0] = array(
$this->info_box_contents[0][0] = array('align' => 'left', 'align' => 'left',
'text' => $langs->trans("ReadPermissionNotAllowed")); 'text' => $langs->trans("ReadPermissionNotAllowed"),
} );
} }
}
/** /**
* Method to show box * Method to show box

View File

@ -104,19 +104,28 @@ class box_clients extends ModeleBoxes
$datec=$db->jdate($objp->datec); $datec=$db->jdate($objp->datec);
$datem=$db->jdate($objp->tms); $datem=$db->jdate($objp->tms);
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', $this->info_box_contents[$i][0] = array(
'logo' => $this->boximg, 'td' => 'align="left" width="16"',
'url' => $url.$objp->socid); '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"', $this->info_box_contents[$i][2] = array(
'text' => $objp->name, 'td' => 'align="right"',
'url' => $url.$objp->socid); 'text' => dol_print_date($datem, "day")
);
$this->info_box_contents[$i][2] = array('td' => 'align="right"', $this->info_box_contents[$i][3] = array(
'text' => dol_print_date($datem, "day")); '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++; $i++;
} }

View File

@ -80,70 +80,85 @@ class box_commandes extends ModeleBoxes
$sql.= $db->plimit($max, 0); $sql.= $db->plimit($max, 0);
$result = $db->query($sql); $result = $db->query($sql);
if ($result) if ($result) {
{
$num = $db->num_rows($result); $num = $db->num_rows($result);
$i = 0; $i = 0;
while ($i < $num) while ($i < $num) {
{
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
$date=$db->jdate($objp->date_commande); $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"', $this->info_box_contents[$i][] = array(
'logo' => $this->boximg, 'td' => 'align="left" width="16"',
'url' => DOL_URL_ROOT."/commande/card.php?id=".$objp->rowid); 'logo' => $this->boximg,
'tooltip' => $langs->trans('Order').': '.$objp->ref,
$this->info_box_contents[$i][] = array('td' => 'align="left"', 'url' => DOL_URL_ROOT."/commande/card.php?id=".$objp->rowid,
'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="right" width="18"', $this->info_box_contents[$i][] = array(
'text' => $commandestatic->LibStatut($objp->fk_statut,$objp->facture,3)); '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++; $i++;
} }
if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedOrders")); 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 { } else {
$this->info_box_contents[0][0] = array( 'td' => 'align="left"', $this->info_box_contents[0][0] = array(
'maxlength'=>500, 'align' => 'left',
'text' => ($db->error().' sql='.$sql)); 'text' => $langs->trans("ReadPermissionNotAllowed"),
} );
}
else {
$this->info_box_contents[0][0] = array('align' => 'left',
'text' => $langs->trans("ReadPermissionNotAllowed"));
} }
} }

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2005 Christophe /* Copyright (C) 2005 Christophe
* Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * 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 * 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")); $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 = "SELECT rowid, ref, label, bank, number, courant, clos, rappro, url,";
$sql.= " code_banque, code_guichet, cle_rib, bic, iban_prefix as iban,"; $sql.= " code_banque, code_guichet, cle_rib, bic, iban_prefix as iban,";
$sql.= " domiciliation, proprio, owner_address,"; $sql.= " domiciliation, proprio, owner_address,";
@ -90,76 +89,87 @@ class box_comptes extends ModeleBoxes
$sql.= " ORDER BY label"; $sql.= " ORDER BY label";
$sql.= $db->plimit($max, 0); $sql.= $db->plimit($max, 0);
dol_syslog(get_class($this)."::loadBox", LOG_DEBUG); dol_syslog(get_class($this)."::loadBox", LOG_DEBUG);
$result = $db->query($sql); $result = $db->query($sql);
if ($result) if ($result) {
{ $num = $db->num_rows($result);
$num = $db->num_rows($result);
$i = 0; $i = 0;
$solde_total = 0; $solde_total = array();
$listofcurrencies=array(); $account_static = new Account($db);
$account_static = new Account($db); while ($i < $num) {
while ($i < $num) $objp = $db->fetch_object($result);
{
$objp = $db->fetch_object($result);
$account_static->id = $objp->rowid; $account_static->id = $objp->rowid;
$solde=$account_static->solde(0); $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"', $this->info_box_contents[$i][0] = array(
'logo' => $this->boximg, 'td' => 'align="left" width="16"',
'url' => DOL_URL_ROOT."/compta/bank/account.php?account=".$objp->rowid); '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"', $this->info_box_contents[$i][1] = array(
'text' => $objp->label, 'td' => 'align="left"',
'url' => DOL_URL_ROOT."/compta/bank/account.php?account=".$objp->rowid); '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"', $this->info_box_contents[$i][2] = array(
'text' => $objp->number 'td' => 'align="left"',
); 'text' => $objp->number,
);
$this->info_box_contents[$i][3] = array('td' => 'align="right"', $this->info_box_contents[$i][3] = array(
'text' => price($solde, 0, $langs, 0, 0, -1, $objp->currency_code) 'td' => 'align="right"',
); 'text' => price($solde, 0, $langs, 0, 0, -1, $objp->currency_code)
);
$listofcurrencies[$objp->currency_code]=1; $i++;
$i++; }
}
// Total // Total
if (count($listofcurrencies) <= 1) foreach ($solde_total as $key=>$solde) {
{ $this->info_box_contents[$i][0] = array(
$this->info_box_contents[$i][0] = array('tr' => 'class="liste_total"', 'td' => 'align="right" class="liste_total"', 'tr' => 'class="liste_total"',
'text' => $langs->trans('Total') 'td' => 'align="right" class="liste_total"',
); 'text' => '&nbsp;',
$this->info_box_contents[$i][1] = array('td' => 'align="right" class="liste_total"', );
'text' => '&nbsp;' $this->info_box_contents[$i][1] = array(
); 'td' => 'align="left" class="liste_total"',
$this->info_box_contents[$i][2] = array('td' => 'align="right" class="liste_total"', 'text' => $langs->trans('Total').' '.$key,
'text' => '&nbsp;' );
); $this->info_box_contents[$i][2] = array(
$totalamount=price($solde_total,0,$langs,0,0,-1,$conf->currency); 'td' => 'align="right" class="liste_total"',
$this->info_box_contents[$i][3] = array('td' => 'align="right" class="liste_total"', 'text' => '&nbsp;'
'text' => $totalamount );
); $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); $db->free($result);
} } else {
else { $this->info_box_contents[0][0] = array(
$this->info_box_contents[0][0] = array( 'td' => 'align="left"', 'td' => 'align="left"',
'maxlength'=>500, 'maxlength'=>500,
'text' => ($db->error().' sql='.$sql)); 'text' => ($db->error().' sql='.$sql),
} );
} }
else { } else {
$this->info_box_contents[0][0] = array('td' => 'align="left"', $this->info_box_contents[0][0] = array(
'text' => $langs->trans("ReadPermissionNotAllowed")); 'td' => 'align="left"',
} 'text' => $langs->trans("ReadPermissionNotAllowed"),
);
}
} }

View File

@ -73,65 +73,83 @@ class box_contacts extends ModeleBoxes
$sql.= $db->plimit($max, 0); $sql.= $db->plimit($max, 0);
$result = $db->query($sql); $result = $db->query($sql);
if ($result) if ($result) {
{
$num = $db->num_rows($result); $num = $db->num_rows($result);
$contactstatic=new Contact($db); $contactstatic=new Contact($db);
$societestatic=new Societe($db); $societestatic=new Societe($db);
$i = 0; $i = 0;
while ($i < $num) while ($i < $num) {
{
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
$datec=$db->jdate($objp->datec); $datec=$db->jdate($objp->datec);
$datem=$db->jdate($objp->tms); $datem=$db->jdate($objp->tms);
$contactstatic->lastname=$objp->lastname; $contactstatic->lastname=$objp->lastname;
$contactstatic->firstname=$objp->firstname; $contactstatic->firstname=$objp->firstname;
$contactstatic->civility_id=$objp->civility_id; $contactstatic->civility_id=$objp->civility_id;
$societestatic->id=$objp->fk_soc; $societestatic->id=$objp->fk_soc;
$societestatic->name=$objp->socname; $societestatic->name=$objp->socname;
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', $this->info_box_contents[$i][0] = array(
'logo' => $this->boximg, 'td' => 'align="left" width="16"',
'url' => DOL_URL_ROOT."/contact/card.php?id=".$objp->rowid); '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"', $this->info_box_contents[$i][1] = array(
'text' => $contactstatic->getFullName($langs,0), 'td' => 'align="left"',
'url' => DOL_URL_ROOT."/contact/card.php?id=".$objp->rowid); '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"', $this->info_box_contents[$i][2] = array(
'logo' => ($objp->fk_soc > 0?'company':''), 'td' => 'align="left" width="16"',
'url' => ($objp->fk_soc > 0?DOL_URL_ROOT."/societe/soc.php?socid=".$objp->fk_soc:'')); '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"', $this->info_box_contents[$i][3] = array(
'text' => $societestatic->name, 'td' => 'align="left"',
'url' => DOL_URL_ROOT."/societe/soc.php?socid=".$objp->fk_soc); '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"', $this->info_box_contents[$i][4] = array(
'text' => dol_print_date($datem, "day")); '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); $db->free($result);
} } else {
else { $this->info_box_contents[0][0] = array(
$this->info_box_contents[0][0] = array( 'td' => 'align="left"', 'td' => 'align="left"',
'maxlength'=>500, 'maxlength'=>500,
'text' => ($db->error().' sql='.$sql)); 'text' => ($db->error().' sql='.$sql),
} );
} }
else { } else {
$this->info_box_contents[0][0] = array('align' => 'left', $this->info_box_contents[0][0] = array(
'text' => $langs->trans("ReadPermissionNotAllowed")); 'align' => 'left',
} 'text' => $langs->trans("ReadPermissionNotAllowed"),
);
}
} }
/** /**
* Method to show box * Method to show box

View File

@ -79,8 +79,7 @@ class box_contracts extends ModeleBoxes
$i = 0; $i = 0;
while ($i < $num) while ($i < $num) {
{
$objp = $db->fetch_object($resql); $objp = $db->fetch_object($resql);
$datec=$db->jdate($objp->datec); $datec=$db->jdate($objp->datec);
$dateterm=$db->jdate($objp->fin_validite); $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 // 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")); } // 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"', $this->info_box_contents[$i][0] = array(
'logo' => $this->boximg, 'td' => 'align="left" width="16"',
'url' => DOL_URL_ROOT."/contrat/card.php?id=".$objp->rowid); '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"', $this->info_box_contents[$i][1] = array(
'text' => ($objp->ref?$objp->ref:$objp->rowid), // Some contracts have no ref 'td' => 'align="left"',
'text2'=> $late, 'text' => ($objp->ref?$objp->ref:$objp->rowid), // Some contracts have no ref
'url' => DOL_URL_ROOT."/contrat/card.php?id=".$objp->rowid); '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"', $this->info_box_contents[$i][2] = array(
'logo' => 'company', 'td' => 'align="left" width="16"',
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid); '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"', $this->info_box_contents[$i][3] = array(
'text' => dol_trunc($objp->name,40), 'td' => 'align="left"',
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid); '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"', $this->info_box_contents[$i][4] = array(
'text' => dol_print_date($datec,'day')); 'td' => 'align="right"',
'text' => dol_print_date($datec,'day'),
);
$this->info_box_contents[$i][5] = array('td' => 'align="right" class="nowrap"', $this->info_box_contents[$i][5] = array(
'text' => $contractstatic->getLibStatut(6), 'td' => 'align="right" class="nowrap"',
'asis'=>1 '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); $db->free($resql);
} } else {
else $this->info_box_contents[0][0] = array(
{ 'td' => 'align="left"',
$this->info_box_contents[0][0] = array( 'td' => 'align="left"', 'maxlength'=>500,
'maxlength'=>500, 'text' => ($db->error().' sql='.$sql),
'text' => ($db->error().' sql='.$sql)); );
} }
} } else {
else $this->info_box_contents[0][0] = array(
{ 'td' => 'align="left"',
$this->info_box_contents[0][0] = array('td' => 'align="left"', 'text' => $langs->trans("ReadPermissionNotAllowed"),
'text' => $langs->trans("ReadPermissionNotAllowed")); );
} }
} }
/** /**

View File

@ -98,8 +98,12 @@ class box_external_rss extends ModeleBoxes
} }
else else
{ {
$this->info_box_head = array('text' => $title, $this->info_box_head = array(
'sublink' => $link, 'subtext'=>$langs->trans("LastRefreshDate").': '.($rssparser->getLastFetchDate()?dol_print_date($rssparser->getLastFetchDate(),"dayhourtext"):$langs->trans("Unknown")), 'subpicto'=>'object_bookmark'); '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 // INFO on items
@ -112,8 +116,8 @@ class box_external_rss extends ModeleBoxes
// Feed common fields // Feed common fields
$href = $item['link']; $href = $item['link'];
$title = urldecode($item['title']); $title = urldecode($item['title']);
$date = $item['date_timestamp']; // date will be empty if conversion into timestamp failed $date = $item['date_timestamp']; // date will be empty if conversion into timestamp failed
if ($rssparser->getFormat() == 'rss') // If RSS if ($rssparser->getFormat() == 'rss') // If RSS
{ {
if (! $date && isset($item['pubdate'])) $date=$item['pubdate']; if (! $date && isset($item['pubdate'])) $date=$item['pubdate'];
if (! $date && isset($item['dc']['date'])) $date=$item['dc']['date']; 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 $title=preg_replace("/^\s+/","",$title); // Supprime espaces de debut
$this->info_box_contents["$href"]="$title"; $this->info_box_contents["$href"]="$title";
$this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', $this->info_box_contents[$i][0] = array(
'logo' => $this->boximg, 'td' => 'align="left" width="16"',
'url' => $href, 'logo' => $this->boximg,
'target' => 'newrss'); 'url' => $href,
'tooltip' => $title,
'target' => 'newrss',
);
$this->info_box_contents[$i][1] = array('td' => 'align="left"', $this->info_box_contents[$i][1] = array(
'text' => $title, 'td' => 'align="left"',
'url' => $href, 'text' => $title,
'maxlength' => 64, 'url' => $href,
'target' => 'newrss'); 'tooltip' => $title,
'maxlength' => 64,
'target' => 'newrss',
);
$this->info_box_contents[$i][2] = array('td' => 'align="right" nowrap="1"', $this->info_box_contents[$i][2] = array(
'text' => $date); 'td' => 'align="right" nowrap="1"',
'text' => $date,
);
} }
} }

View File

@ -101,55 +101,76 @@ class box_factures extends ModeleBoxes
$late = ''; $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')));} 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"', $this->info_box_contents[$i][0] = array(
'logo' => $picto, 'td' => 'align="left" width="16"',
'url' => DOL_URL_ROOT."/compta/facture.php?facid=".$objp->facid); '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"', $this->info_box_contents[$i][1] = array(
'text' => $objp->facnumber, 'td' => 'align="left"',
'text2'=> $late, 'text' => $objp->facnumber,
'url' => DOL_URL_ROOT."/compta/facture.php?facid=".$objp->facid); '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"', $this->info_box_contents[$i][2] = array(
'logo' => 'company', 'td' => 'align="left" width="16"',
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid); '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"', $this->info_box_contents[$i][3] = array(
'text' => $objp->name, 'td' => 'align="left"',
'maxlength'=>40, 'text' => $objp->name,
'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid); '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"', $this->info_box_contents[$i][4] = array(
'text' => price($objp->total_ht), 'td' => 'align="right"',
); 'text' => price($objp->total_ht),
);
$this->info_box_contents[$i][5] = array('td' => 'align="right"', $this->info_box_contents[$i][5] = array(
'text' => dol_print_date($date,'day'), 'td' => 'align="right"',
); 'text' => dol_print_date($date,'day'),
);
$this->info_box_contents[$i][6] = array('td' => 'align="right" width="18"', $this->info_box_contents[$i][6] = array(
'text' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3)); '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); $db->free($result);
} } else {
else $this->info_box_contents[0][0] = array(
{ 'td' => 'align="left"',
$this->info_box_contents[0][0] = array( 'td' => 'align="left"', 'maxlength'=>500,
'maxlength'=>500, 'text' => ($db->error().' sql='.$sql),
'text' => ($db->error().' sql='.$sql)); );
} }
} } else {
else { $this->info_box_contents[0][0] = array(
$this->info_box_contents[0][0] = array('td' => 'align="left"', 'td' => 'align="left"',
'text' => $langs->trans("ReadPermissionNotAllowed")); 'text' => $langs->trans("ReadPermissionNotAllowed"),
} );
} }
}
/** /**
* Method to show box * Method to show box

View File

@ -18,9 +18,9 @@
*/ */
/** /**
* \file htdocs/core/boxes/box_factures_fourn.php * \file htdocs/core/boxes/box_factures_fourn.php
* \ingroup supplier * \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'; include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php';
@ -89,8 +89,7 @@ class box_factures_fourn extends ModeleBoxes
$i = 0; $i = 0;
$l_due_date = $langs->trans('Late').' ('.$langs->trans('DateEcheance').': %s)'; $l_due_date = $langs->trans('Late').' ('.$langs->trans('DateEcheance').': %s)';
while ($i < $num) while ($i < $num) {
{
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
$datelimite=$db->jdate($objp->datelimite); $datelimite=$db->jdate($objp->datelimite);
$date=$db->jdate($objp->df); $date=$db->jdate($objp->df);
@ -99,54 +98,79 @@ class box_factures_fourn extends ModeleBoxes
$late = ''; $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'))); 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"', $this->info_box_contents[$i][0] = array(
'logo' => $this->boximg, 'td' => 'align="left" width="16"',
'url' => DOL_URL_ROOT."/fourn/facture/card.php?facid=".$objp->facid); 'logo' => $this->boximg,
'tooltip' => $langs->trans('SupplierInvoice').': '.($objp->ref?$objp->ref:$objp->facid).'<br>'.$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"', $this->info_box_contents[$i][1] = array(
'text' => ($objp->ref?$objp->ref:$objp->facid), 'td' => 'align="left"',
'text2'=> $late, 'text' => ($objp->ref?$objp->ref:$objp->facid),
'url' => DOL_URL_ROOT."/fourn/facture/card.php?facid=".$objp->facid); 'text2'=> $late,
'tooltip' => $langs->trans('SupplierInvoice').': '.($objp->ref?$objp->ref:$objp->facid).'<br>'.$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"', $this->info_box_contents[$i][2] = array(
'text' => $objp->ref_supplier, 'td' => 'align="left"',
'url' => DOL_URL_ROOT."/fourn/facture/card.php?facid=".$objp->facid); 'text' => $objp->ref_supplier,
'tooltip' => $langs->trans('SupplierInvoice').': '.($objp->ref?$objp->ref:$objp->facid).'<br>'.$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"', $this->info_box_contents[$i][3] = array(
'logo' => 'company', 'td' => 'align="left" width="16"',
'url' => DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid); '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"', $this->info_box_contents[$i][4] = array(
'text' => $objp->name, 'td' => 'align="left"',
'url' => DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid); '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"', $this->info_box_contents[$i][5] = array(
'text' => dol_print_date($date,'day')); 'td' => 'align="right"',
'text' => dol_print_date($date,'day'),
);
$fac = new FactureFournisseur($db); $fac = new FactureFournisseur($db);
$fac->fetch($objp->facid); $fac->fetch($objp->facid);
$alreadypaid=$fac->getSommePaiement(); $alreadypaid=$fac->getSommePaiement();
$this->info_box_contents[$i][6] = array('td' => 'align="right" width="18"', $this->info_box_contents[$i][6] = array(
'text' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3,$alreadypaid,$objp->type)); '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); $db->free($result);
} } else {
else { $this->info_box_contents[0][0] = array(
$this->info_box_contents[0][0] = array( 'td' => 'align="left"', 'td' => 'align="left"',
'maxlength'=>500, 'maxlength'=>500,
'text' => ($db->error().' sql='.$sql)); 'text' => ($db->error().' sql='.$sql),
} );
} }
else { } else {
$this->info_box_contents[0][0] = array('td' => 'align="left"', $this->info_box_contents[0][0] = array(
'text' => $langs->transnoentities("ReadPermissionNotAllowed")); 'td' => 'align="left"',
} 'text' => $langs->transnoentities("ReadPermissionNotAllowed"),
} );
}
}
/** /**
* Method to show box * Method to show box

View File

@ -257,8 +257,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty"
// Loop on each TD // Loop on each TD
$nbcolthisline=count($contents[$i]); $nbcolthisline=count($contents[$i]);
for ($j=0; $j < $nbcolthisline; $j++) for ($j=0; $j < $nbcolthisline; $j++) {
{
// Define tdparam // Define tdparam
$tdparam=''; $tdparam='';
if (isset($contents[$i][$j]['td'])) $tdparam.=' '.$contents[$i][$j]['td']; 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); $text2withnotags=preg_replace('/<([^>]+)>/i','',$text2);
$textnoformat=isset($contents[$i][$j]['textnoformat'])?$contents[$i][$j]['textnoformat']:''; $textnoformat=isset($contents[$i][$j]['textnoformat'])?$contents[$i][$j]['textnoformat']:'';
//print "xxx $textwithnotags y"; //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 '<td'.$tdparam.'>'; print '<td'.$tdparam.'>'."\n";
// Url // Url
if (! empty($contents[$i][$j]['url'])) if (! empty($contents[$i][$j]['url']) && empty($contents[$i][$j]['logo']))
{ {
print '<a href="'.$contents[$i][$j]['url'].'" title="'.$textwithnotags.'"'; print '<a href="'.$contents[$i][$j]['url'].'" title="'.dol_escape_htmltag($langs->trans("Show").' '.$tooltip, 1).'" class="classfortooltip"';
//print ' alt="'.$textwithnotags.'"'; // Pas de alt sur un "<a href>" //print ' alt="'.$textwithnotags.'"'; // Pas de alt sur un "<a href>"
print isset($contents[$i][$j]['target'])?' target="'.$contents[$i][$j]['target'].'"':''; print isset($contents[$i][$j]['target'])?' target="'.$contents[$i][$j]['target'].'"':'';
print '>'; print '>';
@ -286,7 +287,8 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty"
if (! empty($contents[$i][$j]['logo'])) if (! empty($contents[$i][$j]['logo']))
{ {
$logo=preg_replace("/^object_/i","",$contents[$i][$j]['logo']); $logo=preg_replace("/^object_/i","",$contents[$i][$j]['logo']);
print img_object($langs->trans("Show"),$logo); print '<a href="'.$contents[$i][$j]['url'].'">';
print img_object($langs->trans("Show").' '.$tooltip, $logo, 'class="classfortooltip"');
} }
$maxlength=$MAXLENGTHBOX; $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"; if (! empty($textnoformat)) print "\n".$textnoformat."\n";
print "</td>"; print "</td>\n";
} }
print "</tr>\n"; print "</tr>\n";

View File

@ -433,19 +433,17 @@ class DiscountAbsolute
$result=''; $result='';
if ($option == 'invoice') if ($option == 'invoice') {
{
$lien = '<a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$this->fk_facture_source.'">';
$lienfin='</a>';
$label=$langs->trans("ShowDiscount").': '.$this->ref_facture_source; $label=$langs->trans("ShowDiscount").': '.$this->ref_facture_source;
$lien = '<a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$this->fk_facture_source.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>';
$ref=$this->ref_facture_source; $ref=$this->ref_facture_source;
$picto='bill'; $picto='bill';
} }
if ($option == 'discount') if ($option == 'discount') {
{
$lien = '<a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$this->fk_soc.'">';
$lienfin='</a>';
$label=$langs->trans("Discount"); $label=$langs->trans("Discount");
$lien = '<a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$this->fk_soc.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>';
$ref=$langs->trans("Discount"); $ref=$langs->trans("Discount");
$picto='generic'; $picto='generic';
} }

View File

@ -414,19 +414,20 @@ class EcmDirectory // extends CommonObject
global $langs; global $langs;
$result=''; $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 = '<a href="'.DOL_URL_ROOT.'/ecm/docmine.php?section='.$this->id.'"'.($more?' '.$more:'').'>'; $lien = '<a href="'.DOL_URL_ROOT.'/ecm/docmine.php?section='.$this->id.$linkclose;
if ($option == 'index') $lien = '<a href="'.DOL_URL_ROOT.'/ecm/index.php?section='.$this->id.'&amp;sectionexpand=true"'.($more?' '.$more:'').'>'; if ($option == 'index') $lien = '<a href="'.DOL_URL_ROOT.'/ecm/index.php?section='.$this->id.'&amp;sectionexpand=true'.$linkclose;
if ($option == 'indexexpanded') $lien = '<a href="'.DOL_URL_ROOT.'/ecm/index.php?section='.$this->id.'&amp;sectionexpand=false"'.($more?' '.$more:'').'>'; if ($option == 'indexexpanded') $lien = '<a href="'.DOL_URL_ROOT.'/ecm/index.php?section='.$this->id.'&amp;sectionexpand=false'.$linkclose;
if ($option == 'indexnotexpanded') $lien = '<a href="'.DOL_URL_ROOT.'/ecm/index.php?section='.$this->id.'&amp;sectionexpand=true"'.($more?' '.$more:'').'>'; if ($option == 'indexnotexpanded') $lien = '<a href="'.DOL_URL_ROOT.'/ecm/index.php?section='.$this->id.'&amp;sectionexpand=true'.$linkclose;
$lienfin='</a>'; $lienfin='</a>';
//$picto=DOL_URL_ROOT.'/theme/common/treemenu/folder.gif'; //$picto=DOL_URL_ROOT.'/theme/common/treemenu/folder.gif';
$picto='dir'; $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) $result.=($lien.img_object($newlabel, $picto, 'class="classfortooltip"').$lienfin);
if ($withpicto && $withpicto != 2) $result.=' '; if ($withpicto && $withpicto != 2) $result.=' ';

View File

@ -1217,16 +1217,16 @@ class Expedition extends CommonObject
global $langs; global $langs;
$result=''; $result='';
$label=$langs->trans("ShowSending").': '.$this->ref;
$url = DOL_URL_ROOT.'/expedition/card.php?id='.$this->id; $url = DOL_URL_ROOT.'/expedition/card.php?id='.$this->id;
if ($short) return $url; if ($short) return $url;
$linkstart = '<a href="'.$url.'">'; $linkstart = '<a href="'.$url.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$linkend='</a>'; $linkend='</a>';
$picto='sending'; $picto='sending';
$label=$langs->trans("ShowSending").': '.$this->ref;
if ($withpicto) $result.=($linkstart.img_object($label, $picto, 'class="classfortooltip"').$linkend); if ($withpicto) $result.=($linkstart.img_object($label, $picto, 'class="classfortooltip"').$linkend);
if ($withpicto && $withpicto != 2) $result.=' '; if ($withpicto && $withpicto != 2) $result.=' ';

View File

@ -547,13 +547,13 @@ class Fichinter extends CommonObject
global $langs; global $langs;
$result=''; $result='';
$label=$langs->trans("Show").': '.$this->ref;
$lien = '<a href="'.DOL_URL_ROOT.'/fichinter/card.php?id='.$this->id.'">'; $lien = '<a href="'.DOL_URL_ROOT.'/fichinter/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>'; $lienfin='</a>';
$picto='intervention'; $picto='intervention';
$label=$langs->trans("Show").': '.$this->ref;
if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin); if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin);
if ($withpicto && $withpicto != 2) $result.=' '; if ($withpicto && $withpicto != 2) $result.=' ';

View File

@ -531,12 +531,12 @@ class CommandeFournisseur extends CommonOrder
global $langs; global $langs;
$result=''; $result='';
$label=$langs->trans("ShowOrder").': '.$this->ref;
$lien = '<a href="'.DOL_URL_ROOT.'/fourn/commande/card.php?id='.$this->id.'">'; $lien = '<a href="'.DOL_URL_ROOT.'/fourn/commande/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>'; $lienfin='</a>';
$picto='order'; $picto='order';
$label=$langs->trans("ShowOrder").': '.$this->ref;
if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin); if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin);
if ($withpicto && $withpicto != 2) $result.=' '; if ($withpicto && $withpicto != 2) $result.=' ';

View File

@ -1472,19 +1472,19 @@ class FactureFournisseur extends CommonInvoice
global $langs; global $langs;
$result=''; $result='';
$label=$langs->trans("ShowInvoice").': '.$this->ref;
if ($this->ref_supplier) $label.=' / '.$this->ref_supplier;
if ($option == 'document') if ($option == 'document')
{ {
$lien = '<a href="'.DOL_URL_ROOT.'/fourn/facture/document.php?facid='.$this->id.'">'; $lien = '<a href="'.DOL_URL_ROOT.'/fourn/facture/document.php?facid='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>'; $lienfin='</a>';
} }
else else
{ {
$lien = '<a href="'.DOL_URL_ROOT.'/fourn/facture/card.php?facid='.$this->id.'">'; $lien = '<a href="'.DOL_URL_ROOT.'/fourn/facture/card.php?facid='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>'; $lienfin='</a>';
} }
$label=$langs->trans("ShowInvoice").': '.$this->ref;
if ($this->ref_supplier) $label.=' / '.$this->ref_supplier;
$ref=$this->ref; $ref=$this->ref;
if (empty($ref)) $ref=$this->id; if (empty($ref)) $ref=$this->id;

View File

@ -487,17 +487,17 @@ class PaiementFourn extends Paiement
global $langs; global $langs;
$result=''; $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 = '<a href="'.DOL_URL_ROOT.'/fourn/paiement/card.php?id='.$this->id.'">'; $lien = '<a href="'.DOL_URL_ROOT.'/fourn/paiement/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>'; $lienfin='</a>';
$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) $result.=($lien.img_object($langs->trans("ShowPayment"), 'payment', 'class="classfortooltip"').$lienfin);
if ($withpicto && $withpicto != 2) $result.=' '; if ($withpicto && $withpicto != 2) $result.=' ';

View File

@ -658,14 +658,13 @@ class Holiday extends CommonObject
global $langs; global $langs;
$result=''; $result='';
$label=$langs->trans("Show").': '.$this->ref;
$lien = '<a href="'.DOL_URL_ROOT.'/holiday/card.php?id='.$this->id.'">'; $lien = '<a href="'.DOL_URL_ROOT.'/holiday/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>'; $lienfin='</a>';
$picto='holiday'; $picto='holiday';
$label=$langs->trans("Show").': '.$this->ref;
if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin); if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin);
if ($withpicto && $withpicto != 2) $result.=' '; if ($withpicto && $withpicto != 2) $result.=' ';
if ($withpicto != 2) $result.=$lien.$this->ref.$lienfin; if ($withpicto != 2) $result.=$lien.$this->ref.$lienfin;

View File

@ -660,13 +660,13 @@ class Livraison extends CommonObject
$result=''; $result='';
$urlOption=''; $urlOption='';
$label=$langs->trans("ShowReceiving").': '.$this->ref;
$lien = '<a href="'.DOL_URL_ROOT.'/livraison/card.php?id='.$this->id.'">'; $lien = '<a href="'.DOL_URL_ROOT.'/livraison/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>'; $lienfin='</a>';
$picto='sending'; $picto='sending';
$label=$langs->trans("ShowReceiving").': '.$this->ref;
if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin); if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin);
if ($withpicto && $withpicto != 2) $result.=' '; if ($withpicto && $withpicto != 2) $result.=' ';

View File

@ -2812,33 +2812,27 @@ class Product extends CommonObject
global $langs; global $langs;
$result=''; $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') if ($option == 'supplier') {
{ $lien = '<a href="'.DOL_URL_ROOT.'/product/fournisseurs.php?id='.$this->id.$linkclose;
$lien = '<a href="'.DOL_URL_ROOT.'/product/fournisseurs.php?id='.$this->id.'">'; $lienfin='</a>';
$lienfin='</a>'; } else if ($option == 'stock') {
} $lien = '<a href="'.DOL_URL_ROOT.'/product/stock/product.php?id='.$this->id.$linkclose;
else if ($option == 'stock') $lienfin='</a>';
{ } else if ($option == 'composition') {
$lien = '<a href="'.DOL_URL_ROOT.'/product/stock/product.php?id='.$this->id.'">'; $lien = '<a href="'.DOL_URL_ROOT.'/product/composition/card.php?id='.$this->id.$linkclose;
$lienfin='</a>';
} else if ($option == 'category') {
$lien = '<a href="'.DOL_URL_ROOT.'/categories/categorie.php?id='.$this->id.'&amp;type=0'.$linkclose;
} else {
$lien = '<a href="'.DOL_URL_ROOT.'/product/card.php?id='.$this->id.$linkclose;
$lienfin='</a>'; $lienfin='</a>';
} }
else if ($option == 'composition')
{
$lien = '<a href="'.DOL_URL_ROOT.'/product/composition/card.php?id='.$this->id.'">';
$lienfin='</a>';
}
else if ($option == 'category')
{
$lien = '<a href="'.DOL_URL_ROOT.'/categories/categorie.php?id='.$this->id.'&type=0">';
}
else
{
$lien = '<a href="'.DOL_URL_ROOT.'/product/card.php?id='.$this->id.'">';
$lienfin='</a>';
}
$newref=$this->ref;
if ($maxlength) $newref=dol_trunc($newref,$maxlength,'middle');
if ($withpicto) { if ($withpicto) {
if ($this->type == 0) $result.=($lien.img_object($langs->trans("ShowProduct").' '.$this->label, 'product', 'class="classfortooltip"').$lienfin.' '); if ($this->type == 0) $result.=($lien.img_object($langs->trans("ShowProduct").' '.$this->label, 'product', 'class="classfortooltip"').$lienfin.' ');

View File

@ -512,11 +512,12 @@ class Entrepot extends CommonObject
global $langs; global $langs;
$result=''; $result='';
$label = $langs->trans("ShowStock").': '.$this->libelle;
$lien='<a href="'.DOL_URL_ROOT.'/product/stock/card.php?id='.$this->id.'">'; $lien='<a href="'.DOL_URL_ROOT.'/product/stock/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>'; $lienfin='</a>';
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; $result.=$lien.$this->libelle.$lienfin;
return $result; return $result;
} }

View File

@ -789,25 +789,22 @@ class Project extends CommonObject
$result = ''; $result = '';
$lien = ''; $lien = '';
$lienfin = ''; $lienfin = '';
$label = $langs->trans("ShowProject") . ': ' . $this->ref . ($this->title ? ' - ' . $this->title : '');
$linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
if ($option != 'nolink') if ($option != 'nolink') {
{ if (preg_match('/\.php$/',$option)) {
if (preg_match('/\.php$/',$option)) $lien = '<a href="' . dol_buildpath($option,1) . '?id=' . $this->id . $linkclose;
{ $lienfin = '</a>';
$lien = '<a href="' . dol_buildpath($option,1) . '?id=' . $this->id . '">'; } else {
$lienfin = '</a>'; $lien = '<a href="' . DOL_URL_ROOT . '/projet/card.php?id=' . $this->id . $linkclose;
} $lienfin = '</a>';
else }
{
$lien = '<a href="' . DOL_URL_ROOT . '/projet/card.php?id=' . $this->id . '">';
$lienfin = '</a>';
}
} }
$picto = 'projectpub'; $picto = 'projectpub';
if (!$this->public) $picto = 'project'; 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) $result.=($lien . img_object($label, $picto, 'class="classfortooltip"') . $lienfin);
if ($withpicto && $withpicto != 2) $result.=' '; if ($withpicto && $withpicto != 2) $result.=' ';

View File

@ -505,13 +505,13 @@ class Task extends CommonObject
global $langs; global $langs;
$result=''; $result='';
$label=$langs->trans("ShowTask").': '.$this->ref.($this->label?' - '.$this->label:'');
$lien = '<a href="'.DOL_URL_ROOT.'/projet/tasks/'.$mode.'.php?id='.$this->id.($option=='withproject'?'&withproject=1':'').'">'; $lien = '<a href="'.DOL_URL_ROOT.'/projet/tasks/'.$mode.'.php?id='.$this->id.($option=='withproject'?'&withproject=1':'').'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>'; $lienfin='</a>';
$picto='projecttask'; $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) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin);
if ($withpicto && $withpicto != 2) $result.=' '; if ($withpicto && $withpicto != 2) $result.=' ';

View File

@ -869,10 +869,11 @@ class Resource extends CommonObject
global $langs; global $langs;
$result=''; $result='';
$label=$langs->trans("ShowResource").': '.$this->ref;
if ($option == '') if ($option == '')
{ {
$lien = '<a href="'.dol_buildpath('/resource/card.php',1).'?id='.$this->id. $get_params .'">'; $lien = '<a href="'.dol_buildpath('/resource/card.php',1).'?id='.$this->id. $get_params .'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$picto='resource@resource'; $picto='resource@resource';
$label=$langs->trans("ShowResource").': '.$this->ref; $label=$langs->trans("ShowResource").': '.$this->ref;
@ -880,7 +881,6 @@ class Resource extends CommonObject
$lienfin='</a>'; $lienfin='</a>';
$label=$langs->trans("ShowResource").': '.$this->ref;
if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin); if ($withpicto) $result.=($lien.img_object($label, $picto, 'class="classfortooltip"').$lienfin);
if ($withpicto && $withpicto != 2) $result.=' '; if ($withpicto && $withpicto != 2) $result.=' ';

View File

@ -422,8 +422,9 @@ class Address
global $langs; global $langs;
$result=''; $result='';
$label = $langs->trans("ShowAddress").': '.$this->label;
$lien = '<a href="'.DOL_URL_ROOT.'/comm/address.php?id='.$this->id.'&socid='.$this->socid.'">'; $lien = '<a href="'.DOL_URL_ROOT.'/comm/address.php?id='.$this->id.'&socid='.$this->socid.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>'; $lienfin='</a>';
if ($withpicto) $result.=($lien.img_object($langs->trans("ShowAddress").': '.$this->label, 'address', 'class="classfortooltip"').$lienfin.' '); if ($withpicto) $result.=($lien.img_object($langs->trans("ShowAddress").': '.$this->label, 'address', 'class="classfortooltip"').$lienfin.' ');

View File

@ -1749,7 +1749,7 @@ class Societe extends CommonObject
} }
// Add type of canvas // 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='</a>'; $lienfin='</a>';
if ($withpicto) $result.=($lien.img_object($langs->trans("ShowCompany").': '.$name, 'company', 'class="classfortooltip"').$lienfin); if ($withpicto) $result.=($lien.img_object($langs->trans("ShowCompany").': '.$name, 'company', 'class="classfortooltip"').$lienfin);

View File

@ -1786,14 +1786,14 @@ class User extends CommonObject
global $langs; global $langs;
$result=''; $result='';
$label = $langs->trans("ShowUser").': '.$this->getFullName($langs,'','',24);
$lien = '<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$this->id.'">'; $lien = '<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
$lienfin='</a>'; $lienfin='</a>';
if ($withpicto) if ($withpicto) {
{ $result.=($lien.img_object($label, 'user', 'class="classfortooltip"').$lienfin);
$result.=($lien.img_object($langs->trans("ShowUser"), 'user', 'class="classfortooltip"').$lienfin); if ($withpicto != 2) $result.=' ';
if ($withpicto != 2) $result.=' ';
} }
$result.=$lien.$this->getFullName($langs,'','',24).$lienfin; $result.=$lien.$this->getFullName($langs,'','',24).$lienfin;
return $result; return $result;