diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index d7f63d31872..8b93610e85e 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -897,9 +897,11 @@ class ActionComm extends CommonObject global $conf,$langs; $result=''; - $label=$this->label; + $tooltip = '' . $langs->trans('ShowAction'.$objp->code) . ''; + $tooltip .= '
' . $langs->trans('Ref') . ': ' . $this->label; + $label = $this->label; if (empty($label)) $label=$this->libelle; // For backward compatibility - $linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">'; + $linkclose = '" title="'.dol_escape_htmltag($tooltip, 1).'" class="classfortooltip">'; if ($option=='birthday') $lien = 'type_code) != "Action".$this->type_code)?$langs->transnoentities("Action".$this->type_code):$this->type_label; $libelleshort=dol_trunc($libelle,$maxlength); diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 2ad30d3b4b9..d84e45692f5 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -500,8 +500,11 @@ if ($id > 0) { $propal_static = new Propal($db); - $sql = "SELECT s.nom, s.rowid, p.rowid as propalid, p.fk_statut, p.total_ht, p.ref, p.ref_client, p.remise, "; - $sql.= " p.datep as dp, p.fin_validite as datelimite"; + $sql = "SELECT s.nom, s.rowid, p.rowid as propalid, p.fk_statut, p.total_ht"; + $sql.= ", p.tva as total_tva"; + $sql.= ", p.total as total_ttc"; + $sql.= ", p.ref, p.ref_client, p.remise"; + $sql.= ", p.datep as dp, p.fin_validite as datelimite"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p, ".MAIN_DB_PREFIX."c_propalst as c"; $sql.= " WHERE p.fk_soc = s.rowid AND p.fk_statut = c.id"; $sql.= " AND s.rowid = ".$object->id; @@ -532,9 +535,12 @@ if ($id > 0) $var=!$var; print ""; print ''; - $propal_static->id=$objp->propalid; - $propal_static->ref=$objp->ref; - $propal_static->ref_client=$objp->ref_client; + $propal_static->id = $objp->propalid; + $propal_static->ref = $objp->ref; + $propal_static->ref_client = $objp->ref_client; + $propal_static->total_ht = $objp->total_ht; + $propal_static->total_tva = $objp->total_tva; + $propal_static->total_ttc = $objp->total_ttc; print $propal_static->getNomUrl(1); if ( ($db->jdate($objp->dp) < ($now - $conf->propal->cloture->warning_delay)) && $objp->fk_statut == 1 ) { print " ".img_warning(); @@ -561,9 +567,12 @@ if ($id > 0) { $commande_static=new Commande($db); - $sql = "SELECT s.nom, s.rowid,"; - $sql.= " c.rowid as cid, c.total_ht, c.ref, c.ref_client, c.fk_statut, c.facture,"; - $sql.= " c.date_commande as dc"; + $sql = "SELECT s.nom, s.rowid"; + $sql.= ", c.rowid as cid, c.total_ht"; + $sql.= ", c.tva as total_tva"; + $sql.= ", c.total_ttc"; + $sql.= ", c.ref, c.ref_client, c.fk_statut, c.facture"; + $sql.= ", c.date_commande as dc"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as c"; $sql.= " WHERE c.fk_soc = s.rowid "; $sql.= " AND s.rowid = ".$object->id; @@ -610,9 +619,12 @@ if ($id > 0) $var=!$var; print ""; print ''; - $commande_static->id=$objp->cid; - $commande_static->ref=$objp->ref; + $commande_static->id = $objp->cid; + $commande_static->ref = $objp->ref; $commande_static->ref_client=$objp->ref_client; + $commande_static->total_ht = $objp->total_ht; + $commande_static->total_tva = $objp->total_tva; + $commande_static->total_ttc = $objp->total_ttc; print $commande_static->getNomUrl(1); print ''.dol_print_date($db->jdate($objp->dc),'day')."\n"; print ''.price($objp->total_ht).''; @@ -751,15 +763,18 @@ if ($id > 0) { $facturestatic = new Facture($db); - $sql = 'SELECT f.rowid as facid, f.facnumber, f.type, f.amount, f.total, f.total_ttc,'; - $sql.= ' f.datef as df, f.datec as dc, f.paye as paye, f.fk_statut as statut,'; - $sql.= ' s.nom, s.rowid as socid,'; - $sql.= ' SUM(pf.amount) as am'; + $sql = 'SELECT f.rowid as facid, f.facnumber, f.type, f.amount'; + $sql.= ', f.total'; + $sql.= ', f.tva as total_tva'; + $sql.= ', f.total_ttc'; + $sql.= ', f.datef as df, f.datec as dc, f.paye as paye, f.fk_statut as statut'; + $sql.= ', s.nom, s.rowid as socid'; + $sql.= ', SUM(pf.amount) as am'; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f"; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiement_facture as pf ON f.rowid=pf.fk_facture'; $sql.= " WHERE f.fk_soc = s.rowid AND s.rowid = ".$object->id; $sql.= " AND f.entity = ".$conf->entity; - $sql.= ' GROUP BY f.rowid, f.facnumber, f.type, f.amount, f.total, f.total_ttc,'; + $sql.= ' GROUP BY f.rowid, f.facnumber, f.type, f.amount, f.total, f.tva, f.total_ttc,'; $sql.= ' f.datef, f.datec, f.paye, f.fk_statut,'; $sql.= ' s.nom, s.rowid'; $sql.= " ORDER BY f.datef DESC, f.datec DESC"; @@ -788,9 +803,12 @@ if ($id > 0) $var=!$var; print ""; print ''; - $facturestatic->id=$objp->facid; - $facturestatic->ref=$objp->facnumber; - $facturestatic->type=$objp->type; + $facturestatic->id = $objp->facid; + $facturestatic->ref = $objp->facnumber; + $facturestatic->type = $objp->type; + $facturestatic->total_ht = $objp->total; + $facturestatic->total_tva = $objp->total_tva; + $facturestatic->total_ttc = $objp->total_ttc; print $facturestatic->getNomUrl(1); print ''; if ($objp->df > 0) diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 5e2cc35e796..666ce7e355c 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -142,7 +142,7 @@ if (! empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire) */ if (! empty($conf->propal->enabled) && $user->rights->propal->lire) { - $sql = "SELECT p.rowid, p.ref, p.ref_client, 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, p.tva as total_tva, p.total as total_ttc, s.rowid as socid, s.nom as name, s.client, s.canvas"; $sql.= " FROM ".MAIN_DB_PREFIX."propal as p"; $sql.= ", ".MAIN_DB_PREFIX."societe as s"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -173,6 +173,9 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire) $propalstatic->id=$obj->rowid; $propalstatic->ref=$obj->ref; $propalstatic->ref_client=$obj->ref_client; + $propalstatic->total_ht = $obj->total_ht; + $propalstatic->total_tva = $obj->total_tva; + $propalstatic->total_ttc = $obj->total_ttc; print $propalstatic->getNomUrl(1); print ''; print ''; @@ -210,7 +213,7 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire) { $langs->load("orders"); - $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 = "SELECT c.rowid, c.ref, c.ref_client, c.total_ht, c.tva as total_tva, c.total_ttc, s.rowid as socid, s.nom as name, s.client, s.canvas"; $sql.= " FROM ".MAIN_DB_PREFIX."commande as c"; $sql.= ", ".MAIN_DB_PREFIX."societe as s"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -241,6 +244,9 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire) $orderstatic->id=$obj->rowid; $orderstatic->ref=$obj->ref; $orderstatic->ref_client=$obj->ref_client; + $orderstatic->total_ht = $obj->total_ht; + $orderstatic->total_tva = $obj->total_tva; + $orderstatic->total_ttc = $obj->total_ttc; print $orderstatic->getNomUrl(1); print ''; print ''; @@ -469,7 +475,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire) { $langs->load("propal"); - $sql = "SELECT s.nom as name, s.rowid, p.rowid as propalid, p.total as total_ttc, p.total_ht, p.ref, p.ref_client, 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.tva as total_tva, p.ref, p.ref_client, p.fk_statut, p.datep as dp, p.fin_validite as dfv"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."propal as p"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -506,6 +512,9 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire) $propalstatic->id=$obj->propalid; $propalstatic->ref=$obj->ref; $propalstatic->ref_client=$obj->ref_client; + $propalstatic->total_ht = $obj->total_ht; + $propalstatic->total_tva = $obj->total_tva; + $propalstatic->total_ttc = $obj->total_ttc; print ''; print ''; print ''; print ''; @@ -218,8 +227,10 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) */ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire) { - $sql = "SELECT f.ref, f.rowid, f.total_ttc, f.type,"; - $sql.= " s.nom as name, s.rowid as socid"; + $sql = "SELECT f.ref, f.rowid, f.total_ht, f.tva as total_tva, f.total_ttc, f.type"; + $sql.= ", s.nom as name"; + $sql.= ", s.rowid as socid"; + $sql.= ", s.code_fournisseur"; $sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn as f, ".MAIN_DB_PREFIX."societe as s"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE s.rowid = f.fk_soc AND f.fk_statut = 0"; @@ -249,14 +260,19 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture- print ''; print ''; print ''; print ''; @@ -292,10 +308,12 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) $langs->load("boxes"); $facstatic=new Facture($db); - $sql = "SELECT f.rowid, f.facnumber, f.fk_statut, f.type, f.total, f.total_ttc, f.paye, f.tms,"; - $sql.= " f.date_lim_reglement as datelimite,"; - $sql.= " s.nom as name, s.rowid as socid,"; - $sql.= " sum(pf.amount) as am"; + $sql = "SELECT f.rowid, f.facnumber, f.fk_statut, f.type, f.total as total_ht, f.tva as total_tva, f.total_ttc, f.paye, f.tms"; + $sql.= ", f.date_lim_reglement as datelimite"; + $sql.= ", s.nom as name"; + $sql.= ", s.rowid as socid"; + $sql.= ", s.code_client"; + $sql.= ", sum(pf.amount) as am"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf on f.rowid=pf.fk_facture"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -335,6 +353,9 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) print ''; @@ -353,9 +374,11 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) $thirdpartystatic->id=$obj->socid; $thirdpartystatic->name=$obj->name; $thirdpartystatic->client=1; + $thirdpartystatic->code_client = $obj->code_client; + $thirdpartystatic->code_fournisseur = $obj->code_fournisseur; print $thirdpartystatic->getNomUrl(1,'customer',44); print ''; - if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; + if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; print ''; print ''; print ''; @@ -391,8 +414,10 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture- $langs->load("boxes"); $facstatic=new FactureFournisseur($db); - $sql = "SELECT ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.total_ttc, ff.tms, ff.paye"; - $sql.= ", s.nom as name, s.rowid as socid"; + $sql = "SELECT ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.total_tva, ff.total_ttc, ff.tms, ff.paye"; + $sql.= ", s.nom as name"; + $sql.= ", s.rowid as socid"; + $sql.= ", s.code_fournisseur"; $sql.= ", SUM(pf.amount) as am"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as ff"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf on ff.rowid=pf.fk_facturefourn"; @@ -401,7 +426,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture- $sql.= " AND ff.entity = ".$conf->entity; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; if ($socid) $sql.= " AND ff.fk_soc = ".$socid; - $sql.= " GROUP BY ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.total_ttc, ff.tms, ff.paye, s.nom, s.rowid"; + $sql.= " GROUP BY ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.tva, ff.total_ttc, ff.tms, ff.paye, s.nom, s.rowid"; $sql.= " ORDER BY ff.tms DESC "; $sql.= $db->plimit($max, 0); @@ -427,13 +452,18 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture- $obj = $db->fetch_object($resql); print ''; print ''; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; @@ -612,9 +642,11 @@ if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $us $commandestatic=new Commande($db); $langs->load("orders"); - $sql = "SELECT sum(f.total) as tot_fht, sum(f.total_ttc) as tot_fttc,"; - $sql.= " s.nom as name, s.rowid as socid,"; - $sql.= " c.rowid, c.ref, c.facture, c.fk_statut, c.total_ht, c.total_ttc"; + $sql = "SELECT sum(f.total) as tot_fht, sum(f.total_ttc) as tot_fttc"; + $sql.= ", s.nom as name"; + $sql.= ", s.rowid as socid"; + $sql.= ", s.code_client"; + $sql.= ", c.rowid, c.ref, c.facture, c.fk_statut, c.total_ht, c.tva as total_tva, c.total_ttc"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= ", ".MAIN_DB_PREFIX."commande as c"; @@ -677,6 +709,8 @@ if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $us $societestatic->id=$obj->socid; $societestatic->name=$obj->name; $societestatic->client=1; + $societestatic->code_client = $obj->code_client; + $societestatic->code_fournisseur = $obj->code_fournisseur; print $societestatic->getNomUrl(1,'customer',44); print ''; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; @@ -715,10 +749,12 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) { $facstatic=new Facture($db); - $sql = "SELECT f.rowid, f.facnumber, f.fk_statut, f.datef, f.type, f.total, f.total_ttc, f.paye, f.tms,"; - $sql.= " f.date_lim_reglement as datelimite,"; - $sql.= " s.nom as name, s.rowid as socid,"; - $sql.= " sum(pf.amount) as am"; + $sql = "SELECT f.rowid, f.facnumber, f.fk_statut, f.datef, f.type, f.total as total_ht, f.tva as total_tva, f.total_ttc, f.paye, f.tms"; + $sql.= ", f.date_lim_reglement as datelimite"; + $sql.= ", s.nom as name"; + $sql.= ", s.rowid as socid"; + $sql.= ", s.code_client"; + $sql.= ", sum(pf.amount) as am"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf on f.rowid=pf.fk_facture"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -758,6 +794,9 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) print ''; @@ -776,9 +815,11 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) $societestatic->id=$obj->socid; $societestatic->name=$obj->name; $societestatic->client=1; + $societestatic->code_client = $obj->code_client; + $societestatic->code_fournisseur = $obj->code_fournisseur; print $societestatic->getNomUrl(1,'customer',44); print ''; - if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; + if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; print ''; print ''; print ''; @@ -820,9 +861,12 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture- { $facstatic=new FactureFournisseur($db); - $sql = "SELECT ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.total_ttc, ff.paye,"; - $sql.= " s.nom as name, s.rowid as socid,"; - $sql.= " sum(pf.amount) as am"; + $sql = "SELECT ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.total_tva, ff.total_ttc, ff.paye"; + $sql.= ", s.nom as name"; + $sql.= ", s.rowid as socid"; + $sql.= ", s.code_client"; + $sql.= ", s.code_fournisseur"; + $sql.= ", sum(pf.amount) as am"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as ff"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf on ff.rowid=pf.fk_facturefourn"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -832,7 +876,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture- $sql.= " AND ff.fk_statut = 1"; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; if ($socid) $sql.= " AND ff.fk_soc = ".$socid; - $sql.= " GROUP BY ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.total_ttc, ff.paye,"; + $sql.= " GROUP BY ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.tva, ff.total_ttc, ff.paye,"; $sql.= " s.nom, s.rowid"; $resql=$db->query($sql); @@ -859,12 +903,17 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture- print ''; $societestatic->id=$obj->socid; $societestatic->name=$obj->name; $societestatic->client=0; + $societestatic->code_client = $obj->code_client; + $societestatic->code_fournisseur = $obj->code_fournisseur; print ''; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; print ''; diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index f3cbeccd586..baa46bc0356 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -887,7 +887,8 @@ class Contact extends CommonObject global $langs; $result=''; - $label = $langs->trans("ShowContact").': '.$this->getFullName($langs); + $label = '' . $langs->trans("ShowContact") . ''; + $label.= '
' . $langs->trans("Name") . ': '.$this->getFullName($langs); $lien = ''; $lienfin=''; diff --git a/htdocs/core/boxes/box_actions.php b/htdocs/core/boxes/box_actions.php index 06d70d65db0..8ccf34b0f6b 100644 --- a/htdocs/core/boxes/box_actions.php +++ b/htdocs/core/boxes/box_actions.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2014 Charles-Fr BENKE + * Copyright (C) 2015 Frederic France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -55,15 +56,20 @@ class box_actions extends ModeleBoxes $this->max=$max; - include_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; - $actionstatic=new ActionComm($db); + include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; + include_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; + $societestatic = new Societe($db); + $actionstatic = new ActionComm($db); $this->info_box_head = array('text' => $langs->trans("BoxTitleLastActionsToDo",$max)); if ($user->rights->agenda->myactions->read) { - $sql = "SELECT a.id, a.label, a.datep as dp, a.percent as percentage,"; - $sql.= " ta.code, ta.libelle as type_label,"; - $sql.= " s.nom as name, s.rowid as socid"; + $sql = "SELECT a.id, a.label, a.datep as dp, a.percent as percentage"; + $sql.= ", ta.code"; + $sql.= ", ta.libelle as type_label"; + $sql.= ", s.nom as name"; + $sql.= ", s.rowid as socid"; + $sql.= ", s.code_client"; $sql.= " FROM (".MAIN_DB_PREFIX."c_actioncomm AS ta, "; $sql.= MAIN_DB_PREFIX."actioncomm AS a)"; if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc"; @@ -81,62 +87,52 @@ class box_actions extends ModeleBoxes $result = $db->query($sql); if ($result) { $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); $i = 0; while ($i < $num) { $late = ''; $objp = $db->fetch_object($result); - $datelimite=$db->jdate($objp->dp); + $datelimite = $db->jdate($objp->dp); + $actionstatic->label = $objp->label; + $actionstatic->type_label = $objp->type_label; + $actionstatic->code = $objp->code; + $societestatic->id = $objp->socid; + $societestatic->name = $objp->name; + $societestatic->code_client = $objp->code_client; - if ($objp->percentage >= 0 && $objp->percentage < 100 && $datelimite < ($now - $delay_warning)) $late=img_warning($langs->trans("Late")); + if ($objp->percentage >= 0 && $objp->percentage < 100 && $datelimite < ($now - $delay_warning)) + $late=img_warning($langs->trans("Late")); //($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; $tooltip = $langs->trans('Action'.$objp->code).': '.$label; - $this->info_box_contents[$i][0] = array( - 'td' => 'align="left" width="16"', - 'logo' => ("action"), - 'tooltip' => $tooltip, - 'url' => DOL_URL_ROOT."/comm/action/card.php?id=".$objp->id, - ); - - $this->info_box_contents[$i][1] = array( + $this->info_box_contents[$i][] = array( 'td' => 'align="left"', - 'text' => dol_trunc($label,32), + 'text' => $actionstatic->getNomUrl(1), 'text2'=> $late, - 'tooltip' => $tooltip, - 'url' => DOL_URL_ROOT."/comm/action/card.php?id=".$objp->id, + 'asis' => 1, ); - $tooltip = $langs->trans('Customer').': '.$objp->name; - $this->info_box_contents[$i][2] = array( - 'td' => 'align="left" width="16"', - 'logo' => ($objp->socid?'company':''), - 'tooltip' => $tooltip, - 'url' => ($objp->socid?DOL_URL_ROOT."/societe/soc.php?socid=".$objp->socid:''), - ); - - $this->info_box_contents[$i][3] = array( + $this->info_box_contents[$i][] = array( 'td' => 'align="left"', - 'text' => dol_trunc($objp->name,24), - 'tooltip' => $tooltip, - 'url' => DOL_URL_ROOT."/societe/soc.php?socid=".$objp->socid, + 'text' => $societestatic->getNomUrl(1), + 'asis' => 1, ); - $this->info_box_contents[$i][4] = array( + $this->info_box_contents[$i][] = array( 'td' => 'align="left" class="nowrap"', 'text' => dol_print_date($datelimite, "dayhour"), ); - $this->info_box_contents[$i][5] = array( + $this->info_box_contents[$i][] = array( 'td' => 'align="right"', 'text' => ($objp->percentage>= 0?$objp->percentage.'%':''), ); - $this->info_box_contents[$i][6] = array( + $this->info_box_contents[$i][] = array( 'td' => 'align="right" width="18"', 'text' => $actionstatic->LibStatut($objp->percentage,3), ); diff --git a/htdocs/core/boxes/box_activity.php b/htdocs/core/boxes/box_activity.php index dcc2b99c887..882ac65ef11 100644 --- a/htdocs/core/boxes/box_activity.php +++ b/htdocs/core/boxes/box_activity.php @@ -1,7 +1,7 @@ * Copyright (C) 2005-2013 Laurent Destailleur - * Copyright (C) 2014 Frederic France + * Copyright (C) 2014-2015 Frederic France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -75,7 +75,6 @@ class box_activity extends ModeleBoxes $totalnb = 0; $i = 0; $cachetime = 3600; - $cachedir = DOL_DATA_ROOT.'/cache/boxes'; $fileid = '-e'.$conf->entity.'-u'.$user->id.'-s'.$user->societe_id.'-r'.($user->rights->societe->client->voir?'1':'0').'.cache'; $now = dol_now(); $nbofyears=2; @@ -95,6 +94,7 @@ class box_activity extends ModeleBoxes include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $facturestatic=new Facture($db); + $cachedir = DOL_DATA_ROOT.'/facture/temp'; $filename = '/boxactivity-invoice'.$fileid; $refresh = dol_cache_refresh($cachedir, $filename, $cachetime); @@ -177,6 +177,7 @@ class box_activity extends ModeleBoxes ); } + $cachedir = DOL_DATA_ROOT.'/facture/temp'; $filename = '/boxactivity-invoice2'.$fileid; $refresh = dol_cache_refresh($cachedir, $filename, $cachetime); @@ -262,6 +263,7 @@ class box_activity extends ModeleBoxes include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; $commandestatic=new Commande($db); + $cachedir = DOL_DATA_ROOT.'/commande/temp'; $filename = '/boxactivity-order'.$fileid; $refresh = dol_cache_refresh($cachedir, $filename, $cachetime); $data = array(); @@ -344,6 +346,7 @@ class box_activity extends ModeleBoxes include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; $propalstatic=new Propal($db); + $cachedir = DOL_DATA_ROOT.'/propale/temp'; $filename = '/boxactivity-propal'.$fileid; $refresh = dol_cache_refresh($cachedir, $filename, $cachetime); $data = array(); @@ -383,7 +386,7 @@ class box_activity extends ModeleBoxes if (! empty($data)) { $j=0; while ($i < count($data)) { - $this->info_box_contents[$i][0] = array( + $this->info_box_contents[$i][] = array( 'td' => 'align="left" width="16"', 'url' => DOL_URL_ROOT."/comm/propal/list.php?mainmenu=commercial&leftmenu=propals&viewstatut=".$data[$j]->fk_statut, 'tooltip' => $langs->trans("Proposals")." ".$propalstatic->LibStatut($data[$j]->fk_statut,0), @@ -391,12 +394,12 @@ class box_activity extends ModeleBoxes ); $objp = $db->fetch_object($result); - $this->info_box_contents[$i][1] = array( + $this->info_box_contents[$i][] = array( 'td' => 'align="left"', 'text' => $langs->trans("Proposals")." ".$propalstatic->LibStatut($data[$j]->fk_statut,0), ); - $this->info_box_contents[$i][2] = array( + $this->info_box_contents[$i][] = array( 'td' => 'align="right"', 'text' => $data[$j]->nb, 'tooltip' => $langs->trans("Proposals")." ".$propalstatic->LibStatut($data[$j]->fk_statut,0), @@ -404,12 +407,12 @@ class box_activity extends ModeleBoxes ); $totalnb += $data[$j]->nb; - $this->info_box_contents[$i][3] = array( + $this->info_box_contents[$i][] = array( 'td' => 'align="right"', 'text' => price($data[$j]->Mnttot,1,$langs,0,0,-1,$conf->currency), ); $totalMnt += $data[$j]->Mnttot; - $this->info_box_contents[$i][4] = array( + $this->info_box_contents[$i][] = array( 'td' => 'align="right" width="18"', 'text' => $propalstatic->LibStatut($data[$j]->fk_statut,3), ); diff --git a/htdocs/core/boxes/box_bookmarks.php b/htdocs/core/boxes/box_bookmarks.php index 5250108f76c..cc65536ce3f 100644 --- a/htdocs/core/boxes/box_bookmarks.php +++ b/htdocs/core/boxes/box_bookmarks.php @@ -1,5 +1,6 @@ + * Copyright (C) 2015 Frederic France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/htdocs/core/boxes/box_clients.php b/htdocs/core/boxes/box_clients.php index 01e0dc92635..bd331faadae 100644 --- a/htdocs/core/boxes/box_clients.php +++ b/htdocs/core/boxes/box_clients.php @@ -2,6 +2,7 @@ /* Copyright (C) 2003-2007 Rodolphe Quiedeville * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2015 Frederic France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -79,7 +80,13 @@ class box_clients extends ModeleBoxes if ($user->rights->societe->lire) { - $sql = "SELECT s.nom as name, s.rowid as socid, s.datec, s.tms, s.status"; + $sql = "SELECT s.nom as name, s.rowid as socid"; + $sql.= ", s.code_client"; + $sql.= ", s.client"; + $sql.= ", s.code_fournisseur"; + $sql.= ", s.fournisseur"; + $sql.= ", s.logo"; + $sql.= ", s.datec, s.tms, s.status"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE s.client IN (1, 3)"; @@ -103,26 +110,26 @@ class box_clients extends ModeleBoxes $objp = $db->fetch_object($result); $datec=$db->jdate($objp->datec); $datem=$db->jdate($objp->tms); + $thirdpartystatic->id = $objp->socid; + $thirdpartystatic->name = $objp->name; + $thirdpartystatic->code_client = $objp->code_client; + $thirdpartystatic->code_fournisseur = $objp->code_fournisseur; + $thirdpartystatic->client = $objp->client; + $thirdpartystatic->fournisseur = $objp->fournisseur; + $thirdpartystatic->logo = $objp->logo; - $this->info_box_contents[$i][0] = array( - 'td' => 'align="left" width="16"', - 'logo' => $this->boximg, - 'tooltip' => $langs->trans('Customer').': '.$objp->name, - 'url' => $url.$objp->socid - ); - $this->info_box_contents[$i][1] = array( + $this->info_box_contents[$i][] = array( 'td' => 'align="left"', - 'text' => $objp->name, - 'tooltip' => $langs->trans('Customer').': '.$objp->name, - 'url' => $url.$objp->socid + 'text' => $thirdpartystatic->getNomUrl(1), + 'asis' => 1, ); - $this->info_box_contents[$i][2] = array( + $this->info_box_contents[$i][] = array( 'td' => 'align="right"', 'text' => dol_print_date($datem, "day") ); - $this->info_box_contents[$i][3] = array( + $this->info_box_contents[$i][] = array( 'td' => 'align="right" width="18"', 'text' => $thirdpartystatic->LibStatut($objp->status,3) ); diff --git a/htdocs/core/boxes/box_commandes.php b/htdocs/core/boxes/box_commandes.php index 670a5358d20..796cdc53f15 100644 --- a/htdocs/core/boxes/box_commandes.php +++ b/htdocs/core/boxes/box_commandes.php @@ -2,6 +2,7 @@ /* Copyright (C) 2003-2007 Rodolphe Quiedeville * Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2015 Frederic France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -53,20 +54,33 @@ class box_commandes extends ModeleBoxes { global $user, $langs, $db, $conf; - $this->max=$max; + $this->max = $max; - include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; - $commandestatic=new Commande($db); + include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; + include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; + $commandestatic = new Commande($db); + $societestatic = new Societe($db); $userstatic = new User($db); $this->info_box_head = array('text' => $langs->trans("BoxTitleLast".($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE?"":"Modified")."CustomerOrders",$max)); if ($user->rights->commande->lire) { - $sql = "SELECT s.nom as name, s.rowid as socid,"; - $sql.= " c.ref, c.tms, c.rowid, c.date_commande,"; - $sql.= " c.fk_statut, c.fk_user_valid, c.facture, c.total_ht"; + $sql = "SELECT s.nom as name"; + $sql.= ", s.rowid as socid"; + $sql.= ", s.code_client"; + $sql.= ", s.logo"; + $sql.= ", c.ref, c.tms"; + $sql.= ", c.rowid"; + $sql.= ", c.date_commande"; + $sql.= ", c.ref_client"; + $sql.= ", c.fk_statut"; + $sql.= ", c.fk_user_valid"; + $sql.= ", c.facture"; + $sql.= ", c.total_ht"; + $sql.= ", c.tva as total_tva"; + $sql.= ", c.total_ttc"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."commande as c"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -89,32 +103,27 @@ class box_commandes extends ModeleBoxes $objp = $db->fetch_object($result); $date=$db->jdate($objp->date_commande); $datem=$db->jdate($objp->tms); + $commandestatic->id = $objp->rowid; + $commandestatic->ref = $objp->ref; + $commandestatic->ref_client = $objp->ref_client; + $commandestatic->total_ht = $objp->total_ht; + $commandestatic->total_tva = $objp->total_tva; + $commandestatic->total_ttc = $objp->total_ttc; + $societestatic->id = $objp->socid; + $societestatic->name = $objp->name; + $societestatic->code_client = $objp->code_client; + $societestatic->logo = $objp->logo; $this->info_box_contents[$i][] = array( - 'td' => 'align="left" width="16"', - 'logo' => $this->boximg, - 'tooltip' => $langs->trans('Order').': '.$objp->ref, - 'url' => DOL_URL_ROOT."/commande/card.php?id=".$objp->rowid, + 'td' => 'align="left"', + 'text' => $commandestatic->getNomUrl(1), + 'asis' => 1, ); $this->info_box_contents[$i][] = array( 'td' => 'align="left"', - 'text' => $objp->ref, - 'tooltip' => $langs->trans('Order').': '.$objp->ref, - 'url' => DOL_URL_ROOT."/commande/card.php?id=".$objp->rowid, - ); - $this->info_box_contents[$i][] = array( - 'td' => 'align="left" width="16"', - 'logo' => 'company', - 'tooltip' => $langs->trans('Customer').': '.$objp->name, - 'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid, - ); - - $this->info_box_contents[$i][] = array( - 'td' => 'align="left"', - 'text' => $objp->name, - 'tooltip' => $langs->trans('Customer').': '.$objp->name, - 'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid, + 'text' => $societestatic->getNomUrl(1), + 'asis' => 1, ); $this->info_box_contents[$i][] = array( @@ -127,7 +136,7 @@ class box_commandes extends ModeleBoxes $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:''), + 'asis' => 1, ); } diff --git a/htdocs/core/boxes/box_comptes.php b/htdocs/core/boxes/box_comptes.php index da585f7ea71..752ddfafe1f 100644 --- a/htdocs/core/boxes/box_comptes.php +++ b/htdocs/core/boxes/box_comptes.php @@ -3,6 +3,7 @@ * Copyright (C) 2005-2013 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2013 Juanjo Menent + * Copyright (C) 2015 Frederic France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -102,31 +103,24 @@ class box_comptes extends ModeleBoxes $objp = $db->fetch_object($result); $account_static->id = $objp->rowid; + $account_static->label = $objp->label; + $account_static->number = $objp->number; $solde=$account_static->solde(0); $solde_total[$objp->currency_code] += $solde; - $tooltip = $langs->trans('Account').': '.$objp->label . '
' . $langs->trans('AccountNumber').': '.$objp->number; - $this->info_box_contents[$i][0] = array( - 'td' => 'align="left" width="16"', - 'logo' => $this->boximg, - 'tooltip' => $tooltip, - 'url' => DOL_URL_ROOT."/compta/bank/account.php?account=".$objp->rowid, - ); - - $this->info_box_contents[$i][1] = array( + $this->info_box_contents[$i][] = array( 'td' => 'align="left"', - 'text' => $objp->label, - 'tooltip' => $tooltip, - 'url' => DOL_URL_ROOT."/compta/bank/account.php?account=".$objp->rowid, + 'text' => $account_static->getNomUrl(1), + 'asis' => 1, ); - $this->info_box_contents[$i][2] = array( + $this->info_box_contents[$i][] = array( 'td' => 'align="left"', 'text' => $objp->number, ); - $this->info_box_contents[$i][3] = array( + $this->info_box_contents[$i][] = array( 'td' => 'align="right"', 'text' => price($solde, 0, $langs, 0, -1, -1, $objp->currency_code) ); @@ -136,21 +130,17 @@ class box_comptes extends ModeleBoxes // Total foreach ($solde_total as $key=>$solde) { - $this->info_box_contents[$i][0] = array( + $this->info_box_contents[$i][] = array( 'tr' => 'class="liste_total"', - 'td' => 'align="right" class="liste_total"', - 'text' => ' ', - ); - $this->info_box_contents[$i][1] = array( 'td' => 'align="left" class="liste_total"', 'text' => $langs->trans('Total').' '.$key, ); - $this->info_box_contents[$i][2] = array( + $this->info_box_contents[$i][] = array( 'td' => 'align="right" class="liste_total"', 'text' => ' ' ); - $this->info_box_contents[$i][3] = array( + $this->info_box_contents[$i][] = array( 'td' => 'align="right" class="liste_total"', 'text' => price($solde, 0, $langs, 0, -1, -1, $key) ); diff --git a/htdocs/core/boxes/box_contacts.php b/htdocs/core/boxes/box_contacts.php index 8ec8bf77b9c..a7abde7494b 100644 --- a/htdocs/core/boxes/box_contacts.php +++ b/htdocs/core/boxes/box_contacts.php @@ -2,6 +2,7 @@ /* Copyright (C) 2003-2007 Rodolphe Quiedeville * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2015 Frederic France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -92,35 +93,19 @@ class box_contacts extends ModeleBoxes $societestatic->id=$objp->fk_soc; $societestatic->name=$objp->socname; - $this->info_box_contents[$i][0] = array( - 'td' => 'align="left" width="16"', - 'logo' => $this->boximg, - 'tooltip' => $langs->trans('Contact').': '.$contactstatic->getFullName($langs,0), - 'url' => DOL_URL_ROOT."/contact/card.php?id=".$objp->rowid, - ); - - $this->info_box_contents[$i][1] = array( + $this->info_box_contents[$i][] = array( 'td' => 'align="left"', - 'text' => $contactstatic->getFullName($langs,0), - 'tooltip' => $langs->trans('Contact').': '.$contactstatic->getFullName($langs,0), - 'url' => DOL_URL_ROOT."/contact/card.php?id=".$objp->rowid, + 'text' => $contactstatic->getNomUrl(1), + 'asis' => 1, ); - $this->info_box_contents[$i][2] = array( - 'td' => 'align="left" width="16"', - 'logo' => ($objp->fk_soc > 0?'company':''), - 'tooltip' => $societestatic->name, - 'url' => ($objp->fk_soc > 0?DOL_URL_ROOT."/societe/soc.php?socid=".$objp->fk_soc:''), - ); - - $this->info_box_contents[$i][3] = array( + $this->info_box_contents[$i][] = array( 'td' => 'align="left"', - 'text' => $societestatic->name, - 'tooltip' => $societestatic->name, - 'url' => DOL_URL_ROOT."/societe/soc.php?socid=".$objp->fk_soc, + 'text' => $societestatic->getNomUrl(1), + 'asis' => 1, ); - $this->info_box_contents[$i][4] = array( + $this->info_box_contents[$i][] = array( 'td' => 'align="right"', 'text' => dol_print_date($datem, "day"), ); diff --git a/htdocs/core/boxes/box_contracts.php b/htdocs/core/boxes/box_contracts.php index c980be624da..c72916e9f51 100644 --- a/htdocs/core/boxes/box_contracts.php +++ b/htdocs/core/boxes/box_contracts.php @@ -1,5 +1,6 @@ + * Copyright (C) 2015 Frederic France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/htdocs/core/boxes/box_external_rss.php b/htdocs/core/boxes/box_external_rss.php index 689efc751c6..773f98fff70 100644 --- a/htdocs/core/boxes/box_external_rss.php +++ b/htdocs/core/boxes/box_external_rss.php @@ -3,6 +3,7 @@ * Copyright (C) 2003 Eric Seigne * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2005-2011 Regis Houssin + * Copyright (C) 2015 Frederic France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/htdocs/core/boxes/box_factures.php b/htdocs/core/boxes/box_factures.php index 84f7e61b315..dd1059cf9d2 100644 --- a/htdocs/core/boxes/box_factures.php +++ b/htdocs/core/boxes/box_factures.php @@ -2,6 +2,7 @@ /* Copyright (C) 2003-2007 Rodolphe Quiedeville * Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2015 Frederic France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -53,8 +54,11 @@ class box_factures extends ModeleBoxes $this->max=$max; - include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; - $facturestatic=new Facture($db); + include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; + include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; + + $facturestatic=new Facture($db); + $societestatic = new Societe($db); $text = $langs->trans("BoxTitleLast".($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE?"":"Modified")."CustomerBills",$max); $this->info_box_head = array( @@ -62,11 +66,16 @@ class box_factures extends ModeleBoxes 'limit'=> dol_strlen($text) ); - if ($user->rights->facture->lire) - { - $sql = "SELECT f.rowid as facid, f.facnumber, f.type, f.total as total_ht, f.datef as df"; + if ($user->rights->facture->lire) { + $sql = "SELECT f.rowid as facid"; + $sql.= ", f.facnumber, f.type, f.total as total_ht"; + $sql.= ", f.tva as total_tva"; + $sql.= ", f.total_ttc"; + $sql.= ", f.datef as df"; $sql.= ", f.paye, f.fk_statut, f.datec, f.tms"; - $sql.= ", s.nom as name, s.rowid as socid"; + $sql.= ", s.nom as name"; + $sql.= ", s.rowid as socid"; + $sql.= ", s.code_client"; $sql.= ", f.date_lim_reglement as datelimite"; $sql.= " FROM (".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -88,60 +97,48 @@ class box_factures extends ModeleBoxes $i = 0; $l_due_date = $langs->trans('Late').' ('.strtolower($langs->trans('DateEcheance')).': %s)'; - while ($i < $num) - { - $objp = $db->fetch_object($result); - $datelimite=$db->jdate($objp->datelimite); - $date=$db->jdate($objp->df); - $datem=$db->jdate($objp->tms); + while ($i < $num) { + $objp = $db->fetch_object($result); + $datelimite = $db->jdate($objp->datelimite); + $date = $db->jdate($objp->df); + $datem = $db->jdate($objp->tms); + $facturestatic->id = $objp->facid; + $facturestatic->ref = $objp->facnumber; + $facturestatic->type = $objp->type; + $facturestatic->total_ht = $objp->total_ht; + $facturestatic->total_tva = $objp->total_tva; + $facturestatic->total_ttc = $objp->total_ttc; + $societestatic->id = $objp->socid; + $societestatic->name = $objp->name; + $societestatic->code_client = $objp->code_client; - $picto='bill'; - if ($objp->type == 1) $picto.='r'; - if ($objp->type == 2) $picto.='a'; $late = ''; if ($objp->paye == 0 && ($objp->fk_statut != 2 && $objp->fk_statut != 3) && $datelimite < ($now - $conf->facture->client->warning_delay)) { $late = img_warning(sprintf($l_due_date,dol_print_date($datelimite,'day')));} - $this->info_box_contents[$i][0] = array( - 'td' => 'align="left" width="16"', - 'logo' => $picto, - 'tooltip' => $langs->trans('CustomerInvoice').': '.$objp->facnumber, - 'url' => DOL_URL_ROOT."/compta/facture.php?facid=".$objp->facid, - ); - - $this->info_box_contents[$i][1] = array( + $this->info_box_contents[$i][] = array( 'td' => 'align="left"', - 'text' => $objp->facnumber, + 'text' => $facturestatic->getNomUrl(1), 'text2'=> $late, - 'tooltip' => $langs->trans('CustomerInvoice').': '.$objp->facnumber, - 'url' => DOL_URL_ROOT."/compta/facture.php?facid=".$objp->facid, + 'asis' => 1, ); - $this->info_box_contents[$i][2] = array( - 'td' => 'align="left" width="16"', - 'logo' => 'company', - 'tooltip' => $langs->trans('Customer').': '.$objp->name, - 'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid, - ); - - $this->info_box_contents[$i][3] = array( + $this->info_box_contents[$i][] = array( 'td' => 'align="left"', - 'text' => $objp->name, - 'maxlength'=>40, - 'tooltip' => $langs->trans('Customer').': '.$objp->name, - 'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid, + 'text' => $societestatic->getNomUrl(1, '', 40), + 'asis' => 1, ); - $this->info_box_contents[$i][4] = array( + $this->info_box_contents[$i][] = array( 'td' => 'align="right"', 'text' => price($objp->total_ht), ); - $this->info_box_contents[$i][5] = array( + $this->info_box_contents[$i][] = array( 'td' => 'align="right"', 'text' => dol_print_date($date,'day'), ); - $this->info_box_contents[$i][6] = array( + $this->info_box_contents[$i][] = array( 'td' => 'align="right" width="18"', 'text' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3), ); @@ -173,11 +170,11 @@ class box_factures extends ModeleBoxes } /** - * Method to show box + * Method to show box * - * @param array $head Array with properties of box title - * @param array $contents Array with properties of box lines - * @return void + * @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) { diff --git a/htdocs/core/boxes/box_factures_fourn.php b/htdocs/core/boxes/box_factures_fourn.php index 4e222369949..f48d2ab43d3 100644 --- a/htdocs/core/boxes/box_factures_fourn.php +++ b/htdocs/core/boxes/box_factures_fourn.php @@ -2,6 +2,7 @@ /* Copyright (C) 2003 Rodolphe Quiedeville * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2015 Frederic France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -55,7 +56,10 @@ class box_factures_fourn extends ModeleBoxes $this->max=$max; include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; - $facturestatic=new FactureFournisseur($db); + include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; + + $facturestatic = new FactureFournisseur($db); + $societestatic = new Societe($db); $this->info_box_head = array( 'text' => $langs->trans("BoxTitleLast".($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE?"":"Modified")."SupplierBills",$max) @@ -64,7 +68,12 @@ class box_factures_fourn extends ModeleBoxes if ($user->rights->fournisseur->facture->lire) { $sql = "SELECT s.nom as name, s.rowid as socid,"; - $sql.= " f.rowid as facid, f.ref, f.ref_supplier, f.total_ht,"; + $sql.= " s.code_fournisseur,"; + $sql.= " s.logo,"; + $sql.= " f.rowid as facid, f.ref, f.ref_supplier,"; + $sql.= " f.total_ht,"; + $sql.= " f.total_tva,"; + $sql.= " f.total_ttc,"; $sql.= " f.paye, f.fk_statut,"; $sql.= ' f.datef as df,'; $sql.= ' f.datec as datec,'; @@ -94,47 +103,41 @@ class box_factures_fourn extends ModeleBoxes $datelimite=$db->jdate($objp->datelimite); $date=$db->jdate($objp->df); $datem=$db->jdate($objp->tms); + $facturestatic->id = $objp->facid; + $facturestatic->ref = $objp->ref; + $facturestatic->total_ht = $objp->total_ht; + $facturestatic->total_tva = $objp->total_tva; + $facturestatic->total_ttc = $objp->total_ttc; + $societestatic->id = $objp->socid; + $societestatic->name = $objp->name; + $societestatic->fournisseur = 1; + $societestatic->code_fournisseur = $objp->code_fournisseur; + $societestatic->logo = $objp->logo; $late = ''; if ($objp->paye == 0 && $datelimite && $datelimite < ($now - $conf->facture->fournisseur->warning_delay)) $late=img_warning(sprintf($l_due_date, dol_print_date($datelimite,'day'))); - $this->info_box_contents[$i][0] = array( - 'td' => 'align="left" width="16"', - 'logo' => $this->boximg, - 'tooltip' => $langs->trans('SupplierInvoice').': '.($objp->ref?$objp->ref:$objp->facid).'
'.$langs->trans('RefSupplier').': '.$objp->ref_supplier, - 'url' => DOL_URL_ROOT."/fourn/facture/card.php?facid=".$objp->facid, - ); - - $this->info_box_contents[$i][1] = array( + $this->info_box_contents[$i][] = array( 'td' => 'align="left"', - 'text' => ($objp->ref?$objp->ref:$objp->facid), + 'text' => $facturestatic->getNomUrl(1), 'text2'=> $late, - 'tooltip' => $langs->trans('SupplierInvoice').': '.($objp->ref?$objp->ref:$objp->facid).'
'.$langs->trans('RefSupplier').': '.$objp->ref_supplier, - 'url' => DOL_URL_ROOT."/fourn/facture/card.php?facid=".$objp->facid, + 'asis' => 1, ); - $this->info_box_contents[$i][2] = array( + $this->info_box_contents[$i][] = array( 'td' => 'align="left"', 'text' => $objp->ref_supplier, 'tooltip' => $langs->trans('SupplierInvoice').': '.($objp->ref?$objp->ref:$objp->facid).'
'.$langs->trans('RefSupplier').': '.$objp->ref_supplier, 'url' => DOL_URL_ROOT."/fourn/facture/card.php?facid=".$objp->facid, ); - $this->info_box_contents[$i][3] = array( - 'td' => 'align="left" width="16"', - 'logo' => 'company', - 'tooltip' => $langs->trans('Supplier').': '.$objp->name, - 'url' => DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid, - ); - - $this->info_box_contents[$i][4] = array( + $this->info_box_contents[$i][] = array( 'td' => 'align="left"', - 'text' => $objp->name, - 'tooltip' => $langs->trans('Supplier').': '.$objp->name, - 'url' => DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid, + 'text' => $societestatic->getNomUrl(1, 'supplier'), + 'asis' => 1, ); - $this->info_box_contents[$i][5] = array( + $this->info_box_contents[$i][] = array( 'td' => 'align="right"', 'text' => dol_print_date($date,'day'), ); diff --git a/htdocs/core/boxes/box_factures_fourn_imp.php b/htdocs/core/boxes/box_factures_fourn_imp.php index 37b42f70cfa..a82af75332a 100644 --- a/htdocs/core/boxes/box_factures_fourn_imp.php +++ b/htdocs/core/boxes/box_factures_fourn_imp.php @@ -1,6 +1,7 @@ * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2015 Frederic France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/htdocs/core/boxes/box_factures_imp.php b/htdocs/core/boxes/box_factures_imp.php index e6df1530f8d..d7817d134d3 100644 --- a/htdocs/core/boxes/box_factures_imp.php +++ b/htdocs/core/boxes/box_factures_imp.php @@ -2,6 +2,7 @@ /* Copyright (C) 2003-2007 Rodolphe Quiedeville * Copyright (C) 2004-2007 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2015 Frederic France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -57,15 +58,24 @@ class box_factures_imp extends ModeleBoxes $this->max=$max; include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; - $facturestatic=new Facture($db); + include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; + + $facturestatic = new Facture($db); + $societestatic = new Societe($db); $this->info_box_head = array('text' => $langs->trans("BoxTitleOldestUnpaidCustomerBills",$max)); if ($user->rights->facture->lire) { $sql = "SELECT s.nom as name, s.rowid as socid,"; + $sql.= " s.code_client,"; + $sql.= " s.logo,"; $sql.= " f.facnumber, f.date_lim_reglement as datelimite,"; + $sql.= " f.type,"; $sql.= " f.amount, f.datef as df,"; + $sql.= " f.total as total_ht,"; + $sql.= " f.tva as total_tva,"; + $sql.= " f.total_ttc,"; $sql.= " f.paye, f.fk_statut, f.rowid as facid"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -92,34 +102,43 @@ class box_factures_imp extends ModeleBoxes { $objp = $db->fetch_object($result); $datelimite=$db->jdate($objp->datelimite); + $facturestatic->id = $objp->facid; + $facturestatic->ref = $objp->facnumber; + $facturestatic->type = $objp->type; + $facturestatic->total_ht = $objp->total_ht; + $facturestatic->total_tva = $objp->total_tva; + $facturestatic->total_ttc = $objp->total_ttc; + $societestatic->id = $objp->socid; + $societestatic->name = $objp->name; + $societestatic->client = 1; + $societestatic->code_client = $objp->code_client; + $societestatic->logo = $objp->logo; $late=''; if ($datelimite < ($now - $conf->facture->client->warning_delay)) $late = img_warning(sprintf($l_due_date,dol_print_date($datelimite,'day'))); - $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', - 'logo' => $this->boximg, - 'url' => DOL_URL_ROOT."/compta/facture.php?facid=".$objp->facid); + $this->info_box_contents[$i][] = array( + 'td' => 'align="left"', + 'text' => $facturestatic->getNomUrl(1), + 'text2'=> $late, + 'asis' => 1, + ); - $this->info_box_contents[$i][1] = array('td' => 'align="left"', - 'text' => $objp->facnumber, - 'text2'=> $late, - 'url' => DOL_URL_ROOT."/compta/facture.php?facid=".$objp->facid); + $this->info_box_contents[$i][] = array( + 'td' => 'align="left"', + 'text' => $societestatic->getNomUrl(1, '', 44), + 'asis' => 1, + ); - $this->info_box_contents[$i][2] = array('td' => 'align="left" width="16"', - 'logo' => 'company', - 'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid); + $this->info_box_contents[$i][] = array( + 'td' => 'align="right"', + 'text' => dol_print_date($datelimite,'day'), + ); - $this->info_box_contents[$i][3] = array('td' => 'align="left"', - 'text' => $objp->name, - 'maxlength'=>44, - 'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid); - - $this->info_box_contents[$i][4] = array('td' => 'align="right"', - 'text' => dol_print_date($datelimite,'day'), - ); - - $this->info_box_contents[$i][5] = array('td' => 'align="right" width="18"', - 'text' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3)); + $this->info_box_contents[$i][] = array( + 'td' => 'align="right" width="18"', + 'text' => $facturestatic->LibStatut($objp->paye,$objp->fk_statut,3), + ); $i++; } @@ -130,14 +149,18 @@ class box_factures_imp extends ModeleBoxes } else { - $this->info_box_contents[0][0] = array( 'td' => 'align="left"', - 'maxlength'=>500, - 'text' => ($db->error().' sql='.$sql)); + $this->info_box_contents[0][0] = array( + 'td' => 'align="left"', + 'maxlength'=>500, + 'text' => ($db->error().' sql='.$sql), + ); } } else { - $this->info_box_contents[0][0] = array('td' => 'align="left"', - 'text' => $langs->trans("ReadPermissionNotAllowed")); + $this->info_box_contents[0][0] = array( + 'td' => 'align="left"', + 'text' => $langs->trans("ReadPermissionNotAllowed"), + ); } } diff --git a/htdocs/core/boxes/box_ficheinter.php b/htdocs/core/boxes/box_ficheinter.php index 9cce737eb9a..decf5e564f0 100644 --- a/htdocs/core/boxes/box_ficheinter.php +++ b/htdocs/core/boxes/box_ficheinter.php @@ -1,20 +1,21 @@ * Copyright (C) 2013 Juanjo Menent + * Copyright (C) 2015 Frederic France * -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -*/ + * 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ /** * \file htdocs/core/boxes/box_ficheinter.php diff --git a/htdocs/core/boxes/box_fournisseurs.php b/htdocs/core/boxes/box_fournisseurs.php index 19850598505..e9c21da739f 100644 --- a/htdocs/core/boxes/box_fournisseurs.php +++ b/htdocs/core/boxes/box_fournisseurs.php @@ -1,6 +1,7 @@ * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2015 Frederic France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/htdocs/core/boxes/box_members.php b/htdocs/core/boxes/box_members.php index 1e87995203a..46de6175354 100644 --- a/htdocs/core/boxes/box_members.php +++ b/htdocs/core/boxes/box_members.php @@ -2,6 +2,7 @@ /* Copyright (C) 2003-2007 Rodolphe Quiedeville * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2015 Frederic France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/htdocs/core/boxes/box_produits.php b/htdocs/core/boxes/box_produits.php index ac1d3d9ec19..3c379687291 100644 --- a/htdocs/core/boxes/box_produits.php +++ b/htdocs/core/boxes/box_produits.php @@ -2,6 +2,7 @@ /* Copyright (C) 2003 Rodolphe Quiedeville * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2015 Frederic France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/htdocs/core/boxes/box_produits_alerte_stock.php b/htdocs/core/boxes/box_produits_alerte_stock.php index 5a1b898fc1f..843207f883a 100644 --- a/htdocs/core/boxes/box_produits_alerte_stock.php +++ b/htdocs/core/boxes/box_produits_alerte_stock.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2005-2012 Maxime Kohlhaas + * Copyright (C) 2015 Frederic France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php index b765c99c836..703d35b408b 100644 --- a/htdocs/core/boxes/box_project.php +++ b/htdocs/core/boxes/box_project.php @@ -1,6 +1,8 @@ * Copyright (C) 2014 Marcos García + * Copyright (C) 2015 Frederic France + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or diff --git a/htdocs/core/boxes/box_propales.php b/htdocs/core/boxes/box_propales.php index 07bf074665f..7bec6849ac7 100644 --- a/htdocs/core/boxes/box_propales.php +++ b/htdocs/core/boxes/box_propales.php @@ -2,6 +2,7 @@ /* Copyright (C) 2003-2007 Rodolphe Quiedeville * Copyright (C) 2004-2007 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2015 Frederic France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/htdocs/core/boxes/box_prospect.php b/htdocs/core/boxes/box_prospect.php index 73d5cf0f70e..ef9585202b0 100644 --- a/htdocs/core/boxes/box_prospect.php +++ b/htdocs/core/boxes/box_prospect.php @@ -2,6 +2,7 @@ /* Copyright (C) 2003-2007 Rodolphe Quiedeville * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2015 Frederic France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/htdocs/core/boxes/box_supplier_orders.php b/htdocs/core/boxes/box_supplier_orders.php index 7fb66608840..d435e5ca3dc 100644 --- a/htdocs/core/boxes/box_supplier_orders.php +++ b/htdocs/core/boxes/box_supplier_orders.php @@ -3,6 +3,7 @@ /* Copyright (C) 2004-2006 Destailleur Laurent * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2012 Raphaël Doursenaud + * Copyright (C) 2015 Frederic France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/htdocs/core/boxes/box_task.php b/htdocs/core/boxes/box_task.php index d20ee2017d6..eb9c26b416a 100644 --- a/htdocs/core/boxes/box_task.php +++ b/htdocs/core/boxes/box_task.php @@ -1,5 +1,6 @@ + * Copyright (C) 2015 Frederic France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -99,13 +100,13 @@ class box_task extends ModeleBoxes $objp = $db->fetch_object($result); $this->info_box_contents[$i][1] = array( 'td' => 'align="left"', - 'text' =>$langs->trans("Task")." ".$taskstatic->LibStatut($objp->fk_statut,0) + 'text' =>$langs->trans("Task")." ".$taskstatic->LibStatut($objp->fk_statut,0), ); $this->info_box_contents[$i][2] = array( 'td' => 'align="right"', 'text' => $objp->nb." ".$langs->trans("Tasks"), - 'url' => DOL_URL_ROOT."/projet/tasks/index.php?leftmenu=projects&viewstatut=".$objp->fk_statut + 'url' => DOL_URL_ROOT."/projet/tasks/index.php?leftmenu=projects&viewstatut=".$objp->fk_statut, ); $totalnb += $objp->nb; $this->info_box_contents[$i][3] = array('td' => 'align="right"', 'text' => ConvertSecondToTime($objp->plannedtot,'all',25200,5)); diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php index faaaaff2ec6..dfe83012acf 100644 --- a/htdocs/core/boxes/modules_boxes.php +++ b/htdocs/core/boxes/modules_boxes.php @@ -2,6 +2,7 @@ /* Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2014 Raphaël Doursenaud + * Copyright (C) 2015 Frederic France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -183,13 +184,13 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" require_once DOL_DOCUMENT_ROOT .'/core/lib/files.lib.php'; $MAXLENGTHBOX=60; // Mettre 0 pour pas de limite - $bcx=array(); + $bcx = array(); $bcx[0] = 'class="box_pair"'; $bcx[1] = 'class="box_impair"'; $var = false; $cachetime = 900; // 900 : 15mn - $cachedir = DOL_DATA_ROOT.'/cache/boxes'; + $cachedir = DOL_DATA_ROOT.'/boxes/temp'; $fileid = get_class($this).'id-'.$this->box_id.'-e'.$conf->entity.'-u'.$user->id.'-s'.$user->societe_id.'.cache'; $filename = '/box-'.$fileid; $refresh = dol_cache_refresh($cachedir, $filename, $cachetime); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index dc39692f08e..f3deab3eb04 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2691,6 +2691,8 @@ abstract class CommonObject $product_static->type=$line->fk_product_type; $product_static->id=$line->fk_product; $product_static->ref=$line->ref; + if (! empty($line->entity)) + $product_static->entity=$line->entity; $text=$product_static->getNomUrl(1); // Define output language and label diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index e78ea2ae7cd..9d3a236fb11 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -2,11 +2,12 @@ /* Copyright (C) 2006-2011 Laurent Destailleur * Copyright (C) 2006 Rodolphe Quiedeville * Copyright (C) 2007 Patrick Raguin - * Copyright (C) 2010-2012 Regis Houssin + * Copyright (C) 2010-2012 Regis Houssin * Copyright (C) 2013-2014 Florian Henry * Copyright (C) 2013-2014 Juanjo Menent * Copyright (C) 2013 Christophe Battarel - * Copyright (C) 2013 Alexandre Spangaro + * Copyright (C) 2013 Alexandre Spangaro + * Copyright (C) 2015 Frederic France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -988,9 +989,11 @@ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0) } $out.='
'; // Statut @@ -1235,22 +1238,36 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0) { if ($histo[$key]['elementtype'] == 'propal' && ! empty($conf->propal->enabled)) { - $propalstatic->ref=$langs->trans("ProposalShort"); - $propalstatic->id=$histo[$key]['fk_element']; - $out.=$propalstatic->getNomUrl(1); - } + //$propalstatic->ref=$langs->trans("ProposalShort"); + //$propalstatic->id=$histo[$key]['fk_element']; + if ($propalstatic->fetch($histo[$key]['fk_element'])>0) { + $propalstatic->type=$histo[$key]['ftype']; + $out.=$propalstatic->getNomUrl(1); + } else { + $out.= $langs->trans("ProposalDeleted"); + } + } elseif (($histo[$key]['elementtype'] == 'order' || $histo[$key]['elementtype'] == 'commande') && ! empty($conf->commande->enabled)) { - $orderstatic->ref=$langs->trans("Order"); - $orderstatic->id=$histo[$key]['fk_element']; - $out.=$orderstatic->getNomUrl(1); - } + //$orderstatic->ref=$langs->trans("Order"); + //$orderstatic->id=$histo[$key]['fk_element']; + if ($orderstatic->fetch($histo[$key]['fk_element'])>0) { + $orderstatic->type=$histo[$key]['ftype']; + $out.=$orderstatic->getNomUrl(1); + } else { + $out.= $langs->trans("OrderDeleted"); + } + } elseif (($histo[$key]['elementtype'] == 'invoice' || $histo[$key]['elementtype'] == 'facture') && ! empty($conf->facture->enabled)) { - $facturestatic->ref=$langs->trans("Invoice"); - $facturestatic->id=$histo[$key]['fk_element']; - $facturestatic->type=$histo[$key]['ftype']; - $out.=$facturestatic->getNomUrl(1,'compta'); + //$facturestatic->ref=$langs->trans("Invoice"); + //$facturestatic->id=$histo[$key]['fk_element']; + if ($facturestatic->fetch($histo[$key]['fk_element'])>0) { + $facturestatic->type=$histo[$key]['ftype']; + $out.=$facturestatic->getNomUrl(1,'compta'); + } else { + $out.= $langs->trans("InvoiceDeleted"); + } } else $out.=' '; } @@ -1272,9 +1289,11 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0) // Auteur $out.=''; // Statut diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 00105cf967a..4dc14ea37b5 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -1217,7 +1217,9 @@ class Expedition extends CommonObject global $langs; $result=''; - $label=$langs->trans("ShowSending").': '.$this->ref; + $label = '' . $langs->trans("ShowSending") . ''; + if (! empty($this->ref)) + $label .= '
' . $langs->trans('Ref') . ': '.$this->ref; $url = DOL_URL_ROOT.'/expedition/card.php?id='.$this->id; diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index 2468c9084d2..d9e26368a74 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -69,7 +69,7 @@ $shipment=new Expedition($db); $helpurl='EN:Module_Shipments|FR:Module_Expéditions|ES:Módulo_Expediciones'; llxHeader('',$langs->trans('ListOfSendings'),$helpurl); -$sql = "SELECT e.rowid, e.ref, e.date_delivery as date_expedition, l.date_delivery as date_livraison, e.fk_statut"; +$sql = "SELECT e.rowid, e.ref, e.date_expedition as date_expedition, e.date_delivery as date_livraison, l.date_delivery as date_reception, e.fk_statut"; $sql.= ", s.nom as socname, s.rowid as socid"; $sql.= " FROM (".MAIN_DB_PREFIX."expedition as e"; if (!$user->rights->societe->client->voir && !$socid) // Internal user with no permission to see all @@ -120,8 +120,10 @@ if ($resql) print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"],"e.ref","",$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Company"), $_SERVER["PHP_SELF"],"s.nom", "", $param,'align="left"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateDeliveryPlanned"), $_SERVER["PHP_SELF"],"e.date_delivery","",$param, 'align="center"',$sortfield,$sortorder); - if($conf->livraison_bon->enabled) { + if($conf->expedition_bon->enabled) { print_liste_field_titre($langs->trans("DeliveryOrder"), $_SERVER["PHP_SELF"],"e.date_expedition","",$param, '',$sortfield,$sortorder); + } + if($conf->livraison_bon->enabled) { print_liste_field_titre($langs->trans("DateReceived"), $_SERVER["PHP_SELF"],"e.date_expedition","",$param, 'align="center"',$sortfield,$sortorder); } print_liste_field_titre($langs->trans("Status"), $_SERVER["PHP_SELF"],"e.fk_statut","",$param,'align="right"',$sortfield,$sortorder); @@ -137,10 +139,12 @@ if ($resql) print ''; print ''; print ''; - if($conf->livraison_bon->enabled) { + if($conf->expedition_bon->enabled) { print ''; } print '\n"; - if($conf->livraison_bon->enabled) { + if($conf->expedition_bon->enabled) { // Date real - print "\n"; + print ''."\n"; + } + if($conf->livraison_bon->enabled) { + print ''."\n"; } print ''; diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index bce365447e1..a4e4e57fe94 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -380,7 +380,7 @@ if ($id > 0 || ! empty($ref)) $sql.= " cd.qty,"; $sql.= ' cd.date_start,'; $sql.= ' cd.date_end,'; - $sql.= ' p.label as product_label, p.ref, p.fk_product_type, p.rowid as prodid,'; + $sql.= ' p.label as product_label, p.entity, p.ref, p.fk_product_type, p.rowid as prodid,'; $sql.= ' p.description as product_desc, p.fk_product_type as product_type'; $sql.= " FROM ".MAIN_DB_PREFIX."commandedet as cd"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON cd.fk_product = p.rowid"; @@ -436,7 +436,8 @@ if ($id > 0 || ! empty($ref)) $commande->fetch_thirdparty(); $prod = new Product($db); - $prod->id=$objp->fk_product; + $prod->id = $objp->fk_product; + $prod->entity = $objp->entity; $prod->getMultiLangs(); $outputlangs = $langs; @@ -461,9 +462,11 @@ if ($id > 0 || ! empty($ref)) $product_static->type=$objp->fk_product_type; $product_static->id=$objp->fk_product; $product_static->ref=$objp->ref; + $product_static->entity = $objp->entity; $text=$product_static->getNomUrl(1); $text.= ' - '.$label; - $description=($conf->global->PRODUIT_DESC_IN_FORM?'':dol_htmlentitiesbr($objp->description)); + $description=($conf->global->PRODUIT_DESC_IN_FORM?'':dol_htmlentitiesbr($objp->description)).'
'; + $description.= $product_static->show_photos($conf->product->multidir_output[$product_static->entity],1,1,0,0,0,80); print $form->textwithtooltip($text,$description,3,'','',$i); // Show range diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 58c0efdda9a..10a50947bba 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -547,7 +547,9 @@ class Fichinter extends CommonObject global $langs; $result=''; - $label=$langs->trans("Show").': '.$this->ref; + $label = '' . $langs->trans("ShowIntervention") . ''; + if (! empty($this->ref)) + $label .= '
' . $langs->trans('Ref') . ': '.$this->ref; $lien = ''; $lienfin=''; diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 0fefa8d4555..af379d633e7 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -336,7 +336,7 @@ if ($object->id > 0) } // TODO move to DAO class - $sql = "SELECT p.rowid,p.ref, p.date_commande as dc, p.fk_statut"; + $sql = "SELECT p.rowid,p.ref, p.date_commande as dc, p.fk_statut, p.total_ht, p.tva as total_tva, p.total_ttc"; $sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as p "; $sql.= " WHERE p.fk_soc =".$object->id; $sql.= " AND p.entity =".$conf->entity; @@ -368,8 +368,11 @@ if ($object->id > 0) print ""; print ''; print ''; } - // Author - $userstatic->id=$obj->fk_user_author; - $userstatic->login=$obj->login; + // Author + $userstatic->id = $obj->fk_user_author; + $userstatic->lastname = $obj->lastname; + $userstatic->firstname = $obj->firstname; + $userstatic->login = $obj->login; + $userstatic->photo = $obj->photo; print ""; diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index b6244802318..a5eecd998e3 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1401,6 +1401,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a $form=new Form($db); // Define link to login card + /* $loginhtmltext=''; $logintext=''; if ($user->societe_id) { @@ -1421,9 +1422,9 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a $loginhtmltext.='
'.$langs->trans("Administrator").': '.yn($user->admin); $type=($user->societe_id?$langs->trans("External").$company:$langs->trans("Internal")); $loginhtmltext.='
'.$langs->trans("Type").': '.$type; - $loginhtmltext.='
'.$langs->trans("IPAddress").': '.$_SERVER["REMOTE_ADDR"]; $loginhtmltext.='
'; $loginhtmltext.='
'.$langs->trans("Connection").''; + $loginhtmltext.='
'.$langs->trans("IPAddress").': '.$_SERVER["REMOTE_ADDR"]; if (! empty($conf->global->MAIN_MODULE_MULTICOMPANY)) $loginhtmltext.='
'.$langs->trans("ConnectedOnMultiCompany").': '.$conf->entity.' (user entity '.$user->entity.')'; $loginhtmltext.='
'.$langs->trans("AuthenticationMode").': '.$_SESSION["dol_authmode"].(empty($dolibarr_main_demo)?'':' (demo)'); $loginhtmltext.='
'.$langs->trans("ConnectedSince").': '.dol_print_date($user->datelastlogin,"dayhour"); @@ -1435,6 +1436,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a $loginhtmltext.='
'.$langs->trans("Browser").': '.$conf->browser->name.($conf->browser->version?' '.$conf->browser->version:'').' ('.$_SERVER['HTTP_USER_AGENT'].')'; if (! empty($conf->browser->phone)) $loginhtmltext.='
'.$langs->trans("Phone").': '.$conf->browser->phone; if (! empty($_SESSION["disablemodules"])) $loginhtmltext.='
'.$langs->trans("DisabledModules").':
'.join(', ',explode(',',$_SESSION["disablemodules"])); + */ $appli='Dolibarr'; if (! empty($conf->global->MAIN_APPLICATION_TITLE)) @@ -1468,7 +1470,8 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a $toprightmenu.='
'; // Add login user link - $toprightmenu.=$form->textwithtooltip('',$loginhtmltext,2,1,$logintext,'login_block_elem2',2); // This include div class="login" + //$toprightmenu.=$form->textwithtooltip('',$loginhtmltext,2,1,$logintext,'login_block_elem2',2); // This include div class="login" + $toprightmenu.= $user->getNomurl(0, '', 1); $toprightmenu.='
'; $toprightmenu.='
'; diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 434ff255de5..d0c08d5a16d 100755 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -2809,7 +2809,7 @@ class Product extends CommonObject */ function getNomUrl($withpicto=0,$option='',$maxlength=0) { - global $langs; + global $conf, $langs; $result=''; $newref=$this->ref; @@ -2817,10 +2817,13 @@ class Product extends CommonObject if ($this->type == 0) $label = '' . $langs->trans("ShowProduct") . ''; if ($this->type == 1) $label = '' . $langs->trans("ShowService") . ''; if (! empty($this->ref)) - $label .= '
' . $langs->trans('Ref') . ': ' . $this->ref; + $label .= '
' . $langs->trans('ProductRef') . ': ' . $this->ref; if (! empty($this->label)) - $label .= '
' . $langs->trans('Label') . ': ' . $this->label; - $linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">'; + $label .= '
' . $langs->trans('ProductLabel') . ': ' . $this->label; + if (! empty($this->entity)) + $label .= '
' . $this->show_photos($conf->product->multidir_output[$this->entity],1,1,0,0,0,80); + + $linkclose = '" title="'.str_replace('\n', '', dol_escape_htmltag($label, 1)).'" class="classfortooltip">'; if ($option == 'supplier') { $lien = '
'; */ $max=15; $sql = "SELECT p.rowid, p.label, p.price, p.ref, p.fk_product_type, p.tosell, p.tobuy,"; +$sql.= " p.entity,"; $sql.= " p.tms as datem"; $sql.= " FROM ".MAIN_DB_PREFIX."product as p"; $sql.= " WHERE p.entity IN (".getEntity($product_static->element, 1).")"; @@ -288,7 +289,9 @@ if ($result) print '
\n"; print ''; diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index c8480d6e65a..ab184cdf943 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -306,6 +306,7 @@ if ($resql) print '"; print "'; diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php index 1bac6b9fef5..f525457e1c5 100644 --- a/htdocs/product/stock/mouvement.php +++ b/htdocs/product/stock/mouvement.php @@ -119,7 +119,7 @@ $formother=new FormOther($db); $formproduct=new FormProduct($db); $sql = "SELECT p.rowid, p.ref as product_ref, p.label as produit, p.fk_product_type as type,"; -$sql.= " e.label as stock, e.rowid as entrepot_id,"; +$sql.= " e.label as stock, e.rowid as entrepot_id, e.lieu,"; $sql.= " m.rowid as mid, m.value, m.datem, m.fk_user_author, m.label, m.fk_origin, m.origintype,"; $sql.= " u.login"; $sql.= " FROM (".MAIN_DB_PREFIX."entrepot as e,"; @@ -501,6 +501,7 @@ if ($resql) print '\n"; @@ -515,6 +516,7 @@ if ($resql) print '\n"; // Author diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 352750295af..435fca794de 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -751,7 +751,7 @@ if ( (! empty($conf->productbatch->enabled)) && $product->hasbatch()) { print ''; } -$sql = "SELECT e.rowid, e.label, ps.reel, ps.pmp, ps.rowid as product_stock_id"; +$sql = "SELECT e.rowid, e.label, e.lieu, ps.reel, ps.pmp, ps.rowid as product_stock_id"; $sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e,"; $sql.= " ".MAIN_DB_PREFIX."product_stock as ps"; $sql.= " WHERE ps.reel != 0"; @@ -775,6 +775,7 @@ if ($resql) $obj = $db->fetch_object($resql); $entrepotstatic->id=$obj->rowid; $entrepotstatic->libelle=$obj->label; + $entrepotstatic->lieu=$obj->lieu; print ''; print ''; print ''; diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 1d24076df27..93c0e6cf7f0 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -789,7 +789,11 @@ class Project extends CommonObject $result = ''; $lien = ''; $lienfin = ''; - $label = $langs->trans("ShowProject") . ': ' . $this->ref . ($this->title ? ' - ' . $this->title : ''); + $label = '' . $langs->trans("ShowProject") . ''; + if (! empty($this->ref)) + $label .= '
' . $langs->trans('Ref') . ': ' . $this->ref; + if (! empty($this->title)) + $label .= '
' . $langs->trans('Name') . ': ' . $this->title; $linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">'; if ($option != 'nolink') { diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index e1f2e424dee..35450a206ef 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1720,35 +1720,56 @@ class Societe extends CommonObject $result=''; $lien=$lienfin=''; + $label = '
'; diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index e8ace86cf73..f18f02b60d8 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -2605,9 +2605,17 @@ class Propal extends CommonObject global $langs; $result=''; - $label=$langs->trans("ShowPropal").': '.$this->ref; + $label = '' . $langs->trans("ShowPropal") . ''; + if (! empty($this->ref)) + $label.= '
'.$langs->trans('Ref').': '.$this->ref; if (! empty($this->ref_client)) - $label.= '
'.$langs->trans('RefCustomer').': '.$this->ref_client; + $label.= '
'.$langs->trans('RefCustomer').': '.$this->ref_client; + if (! empty($this->total_ht)) + $label.= '
' . $langs->trans('AmountHT') . ': ' . price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency); + if (! empty($this->total_tva)) + $label.= '
' . $langs->trans('TVA') . ': ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency); + if (! empty($this->total_ttc)) + $label.= '
' . $langs->trans('AmountTTC') . ': ' . price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency); $linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">'; if ($option == '') { $lien = ''; + $label = '' . $langs->trans("ShowAccount") . ''; + if (! empty($this->label)) + $label .= '
' . $langs->trans('Account') . ': ' . $this->label; + if (! empty($this->number)) + $label .= '
' . $langs->trans('AccountNumber') . ': ' . $this->number; + $linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">'; if (empty($mode)) { @@ -948,7 +953,7 @@ class Account extends CommonObject $lienfin='
'; } - if ($withpicto) $result.=($lien.img_object($langs->trans("ShowAccount").': '.$this->label, 'account', 'class="classfortooltip"').$lienfin.' '); + if ($withpicto) $result.=($lien.img_object($label, 'account', 'class="classfortooltip"').$lienfin.' '); $result.=$lien.$this->label.$lienfin; return $result; } diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index e4afe6f2b25..902495bc6aa 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -391,10 +391,9 @@ else } } elseif ($links[$key]['type']=='company') { - print ''; - print img_object($langs->trans('ShowCustomer'),'company').' '; - print dol_trunc($links[$key]['label'],24); - print ''; + $societestatic->id = $links[$key]['url_id']; + $societestatic->name = $links[$key]['label']; + print $societestatic->getNomUrl(1, 'company', 24); $newline=0; } elseif ($links[$key]['type']=='member') { diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index d30a19cd040..d8357b15d14 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -858,9 +858,17 @@ class Facture extends CommonInvoice if ($this->type == self::TYPE_CREDIT_NOTE) $picto.='a'; // Credit note if ($this->type == self::TYPE_DEPOSIT) $picto.='d'; // Deposit invoice - $label=$langs->trans("ShowInvoice").': '.$this->ref; + $label = '' . $langs->trans("ShowInvoice") . ''; + if (! empty($this->ref)) + $label .= '
'.$langs->trans('Ref') . ': ' . $this->ref; if (! empty($this->ref_client)) - $label.= '
' . $langs->trans('RefCustomer') . $this->ref_client; + $label .= '
' . $langs->trans('RefCustomer') . ': ' . $this->ref_client; + if (! empty($this->total_ht)) + $label.= '
' . $langs->trans('AmountHT') . ': ' . price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency); + if (! empty($this->total_tva)) + $label.= '
' . $langs->trans('TVA') . ': ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency); + if (! empty($this->total_ttc)) + $label.= '
' . $langs->trans('AmountTTC') . ': ' . price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency); if ($this->type == self::TYPE_REPLACEMENT) $label=$langs->transnoentitiesnoconv("ShowInvoiceReplace").': '.$this->ref; if ($this->type == self::TYPE_CREDIT_NOTE) $label=$langs->transnoentitiesnoconv("ShowInvoiceAvoir").': '.$this->ref; if ($this->type == self::TYPE_DEPOSIT) $label=$langs->transnoentitiesnoconv("ShowInvoiceDeposit").': '.$this->ref; @@ -3330,7 +3338,8 @@ class Facture extends CommonInvoice $sql.= ' l.total_ht, l.total_tva, l.total_ttc, l.fk_product_fournisseur_price as fk_fournprice, l.buy_price_ht as pa_ht,'; $sql.= ' l.date_start, l.date_end,'; $sql.= ' p.ref as product_ref, p.fk_product_type, p.label as product_label,'; - $sql.= ' p.description as product_desc'; + $sql.= ' p.description as product_desc,'; + $sql.= ' p.entity'; $sql.= ' FROM '.MAIN_DB_PREFIX.'facturedet as l'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product=p.rowid'; $sql.= ' WHERE l.fk_facture = '.$this->id; @@ -3353,6 +3362,7 @@ class Facture extends CommonInvoice $this->lines[$i]->description = $obj->description; $this->lines[$i]->fk_product = $obj->fk_product; $this->lines[$i]->ref = $obj->product_ref; + $this->lines[$i]->entity = $obj->entity; // Product entity $this->lines[$i]->product_label = $obj->product_label; $this->lines[$i]->product_desc = $obj->product_desc; $this->lines[$i]->fk_product_type = $obj->fk_product_type; diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 9265c9ee463..b1d32083a8a 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -144,8 +144,12 @@ if (! empty($conf->don->enabled) && $user->rights->don->lire) */ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) { - $sql = "SELECT f.facnumber, f.rowid, f.total_ttc, f.type,"; - $sql.= " s.nom as name, s.rowid as socid"; + $sql = "SELECT f.facnumber"; + $sql.= ", f.rowid, f.total as total_ht, f.tva as total_tva, f.total_ttc"; + $sql.= ", f.type"; + $sql.= ", s.nom as name"; + $sql.= ", s.rowid as socid"; + $sql.= ",s.code_client"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user "; $sql.= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."societe as s"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -180,13 +184,18 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) print '
'; $facturestatic->ref=$obj->facnumber; $facturestatic->id=$obj->rowid; + $facturestatic->total_ht=$obj->total_ht; + $facturestatic->total_tva=$obj->total_tva; + $facturestatic->total_ttc=$obj->total_ttc; $facturestatic->type=$obj->type; print $facturestatic->getNomUrl(1,''); print ''; $companystatic->id=$obj->socid; $companystatic->name=$obj->name; - $companystatic->client=1; + $companystatic->client = 1; + $companystatic->code_client = $obj->code_client; + $companystatic->code_fournisseur = $obj->code_fournisseur; print $companystatic->getNomUrl(1,'',16); print ''.price($obj->total_ttc).'
'; $facturesupplierstatic->ref=$obj->ref; $facturesupplierstatic->id=$obj->rowid; + $facturesupplierstatic->total_ht=$obj->total_ht; + $facturesupplierstatic->total_tva=$obj->total_tva; + $facturesupplierstatic->total_ttc=$obj->total_ttc; $facturesupplierstatic->type=$obj->type; print $facturesupplierstatic->getNomUrl(1,'',16); print ''; $companystatic->id=$obj->socid; $companystatic->name=$obj->name; - $companystatic->client=1; - print $companystatic->getNomUrl(1,'',16); + $companystatic->fournisseur = 1; + $companystatic->code_client = $obj->code_client; + $companystatic->code_fournisseur = $obj->code_fournisseur; + print $companystatic->getNomUrl(1,'supplier',16); print ''.price($obj->total_ttc).'
'; $facturestatic->ref=$obj->facnumber; $facturestatic->id=$obj->rowid; + $facturestatic->total_ht=$obj->total_ht; + $facturestatic->total_tva=$obj->total_tva; + $facturestatic->total_ttc=$obj->total_ttc; $facturestatic->type=$obj->type; print $facturestatic->getNomUrl(1,''); print ''.price($obj->total).''.price($obj->total_ht).''.price($obj->total_ttc).''.dol_print_date($db->jdate($obj->tms),'day').''.$facstatic->LibStatut($obj->paye,$obj->fk_statut,3,$obj->am).'
'; $facstatic->ref=$obj->ref; - $facstatic->id=$obj->rowid; + $facstatic->id = $obj->rowid; + $facstatic->total_ht = $obj->total_ht; + $facstatic->total_tva = $obj->total_tva; + $facstatic->total_ttc = $obj->total_ttc; print $facstatic->getNomUrl(1,''); print ''; $thirdpartystatic->id=$obj->socid; $thirdpartystatic->name=$obj->name; $thirdpartystatic->fournisseur=1; + $thirdpartystatic->code_client = $obj->code_client; + $thirdpartystatic->code_fournisseur = $obj->code_fournisseur; print $thirdpartystatic->getNomUrl(1,'supplier',44); print ''.price($obj->total_ht).''.price($obj->total_ht).''; $facturestatic->ref=$obj->facnumber; $facturestatic->id=$obj->rowid; + $facturestatic->total_ht=$obj->total_ht; + $facturestatic->total_tva=$obj->total_tva; + $facturestatic->total_ttc=$obj->total_ttc; $facturestatic->type=$obj->type; print $facturestatic->getNomUrl(1,''); print ''.price($obj->total).''.price($obj->total_ht).''.price($obj->total_ttc).''.price($obj->am).''.$facstatic->LibStatut($obj->paye,$obj->fk_statut,3,$obj->am).'
'; $facstatic->ref=$obj->ref; - $facstatic->id=$obj->rowid; + $facstatic->id = $obj->rowid; + $facstatic->total_ht = $obj->total_ht; + $facstatic->total_tva = $obj->total_tva; + $facstatic->total_ttc = $obj->total_ttc; print $facstatic->getNomUrl(1,''); print ''.$societestatic->getNomUrl(1, 'supplier', 44).''.price($obj->total_ht).''.price($obj->total_ttc).''; - $userstatic->id=$obj->fk_user_author; - $userstatic->login=$obj->login; - $out.=$userstatic->getLoginUrl(1); + //$userstatic->id=$obj->fk_user_author; + //$userstatic->login=$obj->login; + //$out.=$userstatic->getLoginUrl(1); + $userstatic->fetch($obj->fk_user_author); + $out.=$userstatic->getNomUrl(1); $out.=''; - $userstatic->id=$histo[$key]['userid']; - $userstatic->login=$histo[$key]['login']; - $out.=$userstatic->getLoginUrl(1); + //$userstatic->id=$histo[$key]['userid']; + //$userstatic->login=$histo[$key]['login']; + //$out.=$userstatic->getLoginUrl(1); + $userstatic->fetch($histo[$key]['userid']); + $out.=$userstatic->getNomUrl(1); $out.=' '; print ''; + } + if($conf->livraison_bon->enabled) { print ' '; @@ -178,17 +182,22 @@ if ($resql) // Date delivery planed print ""; - print dol_print_date($db->jdate($objp->date_expedition),"day"); + print dol_print_date($db->jdate($objp->date_livraison),"day"); /*$now = time(); if ( ($now - $db->jdate($objp->date_expedition)) > $conf->warnings->lim && $objp->statutid == 1 ) { }*/ print ""; - print dol_print_date($db->jdate($objp->date_livraison),"day"); - print "'; + print dol_print_date($db->jdate($objp->date_expedition),"day"); + print ''; + print dol_print_date($db->jdate($objp->date_reception),"day"); + print ''.$expedition->LibStatut($objp->fk_statut,5).'
'; - $orderstatic->id=$obj->rowid; - $orderstatic->ref=$obj->ref; + $orderstatic->id = $obj->rowid; + $orderstatic->ref = $obj->ref; + $orderstatic->total_ht = $obj->total_ht; + $orderstatic->total_tva = $obj->total_tva; + $orderstatic->total_ttc = $obj->total_ttc; print $orderstatic->getNomUrl(1); print ''; @@ -407,7 +410,7 @@ if ($object->id > 0) if ($user->rights->fournisseur->facture->lire) { // TODO move to DAO class - $sql = 'SELECT f.rowid,f.libelle,f.ref,f.ref_supplier,f.fk_statut,f.datef as df,f.total_ttc as amount,f.paye,'; + $sql = 'SELECT f.rowid,f.libelle,f.ref,f.ref_supplier,f.fk_statut,f.datef as df, f.total_ht, f.total_tva, f.total_ttc as amount,f.paye,'; $sql.= ' SUM(pf.amount) as am'; $sql.= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as f'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON f.rowid=pf.fk_facturefourn'; @@ -440,6 +443,10 @@ if ($object->id > 0) print ''; $facturestatic->id=$obj->rowid; $facturestatic->ref=($obj->ref?$obj->ref:$obj->rowid).($obj->ref_supplier?' - '.$obj->ref_supplier:''); + $facturestatic->ref_supplier = $obj->ref_supplier; + $facturestatic->total_ht = $obj->total_ht; + $facturestatic->total_tva = $obj->total_tva; + $facturestatic->total_ttc = $obj->total_ttc; //$facturestatic->ref_supplier=$obj->ref_supplier; print $facturestatic->getNomUrl(1); //print img_object($langs->trans('ShowBill'),'bill').' '.($obj->ref?$obj->ref:$obj->rowid).' - '.$obj->ref_supplier.''; diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 842fe9fcf0b..8ba3a8d53e9 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -1472,8 +1472,17 @@ class FactureFournisseur extends CommonInvoice global $langs; $result=''; - $label=$langs->trans("ShowInvoice").': '.$this->ref; - if ($this->ref_supplier) $label.=' / '.$this->ref_supplier; + $label = '' . $langs->trans("ShowSupplierInvoice") . ''; + if (! empty($this->ref)) + $label .= '
' . $langs->trans('Ref') . ': ' . $this->ref; + if (! empty($this->ref_supplier)) + $label.= '
' . $langs->trans('RefSupplier') . ': ' . $this->ref_supplier; + if (! empty($this->total_ht)) + $label.= '
' . $langs->trans('AmountHT') . ': ' . price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency); + if (! empty($this->total_tva)) + $label.= '
' . $langs->trans('TVA') . ': ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency); + if (! empty($this->total_ttc)) + $label.= '
' . $langs->trans('AmountTTC') . ': ' . price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency); if ($option == 'document') { diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index b94a746a7b9..548e9b674c2 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -98,10 +98,14 @@ $offset = $conf->liste_limit * $page ; * Mode Liste */ -$sql = "SELECT s.rowid as socid, s.nom as name, cf.date_commande as dc,"; -$sql.= " cf.rowid,cf.ref, cf.ref_supplier, cf.fk_statut, cf.total_ht, cf.tva as total_tva, cf.total_ttc, cf.fk_user_author,cf.date_livraison,"; -$sql.= " p.rowid as project_id, p.ref as project_ref,"; -$sql.= " u.login"; +$sql = "SELECT s.rowid as socid, s.nom as name, cf.date_commande as dc"; +$sql.= ", cf.rowid,cf.ref, cf.ref_supplier, cf.fk_statut, cf.total_ht, cf.tva as total_tva, cf.total_ttc, cf.fk_user_author,cf.date_livraison"; +$sql.= ", p.rowid as project_id"; +$sql.= ", p.ref as project_ref"; +$sql.= ", u.firstname"; +$sql.= ", u.lastname"; +$sql.= ", u.photo"; +$sql.= ", u.login"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,"; $sql.= " ".MAIN_DB_PREFIX."commande_fournisseur as cf"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON cf.fk_user_author = u.rowid"; @@ -257,11 +261,14 @@ if ($resql) print '
"; - if ($userstatic->id) print $userstatic->getLoginUrl(1); + if ($userstatic->id) print $userstatic->getNomUrl(1); else print " "; print "'; $product_static->id=$objp->rowid; $product_static->ref=$objp->ref; + $product_static->label = $objp->label; $product_static->type=$objp->fk_product_type; + $product_static->entity = $objp->entity; print $product_static->getNomUrl(1,'',16); print "'.dol_trunc($objp->label,32).'
'; $product_static->ref=$objp->ref; $product_static->id=$objp->rowid; + $product_static->label = $objp->label; $product_static->type=$objp->fk_product_type; print $product_static->getNomUrl(1,'',16); //if ($objp->stock_theorique < $objp->seuil_stock_alerte) print ' '.img_warning($langs->trans("StockTooLow")); diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index b31305b448b..0d21b91d109 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -435,7 +435,8 @@ else print "
"; $productstatic->id=$objp->rowid; - $productstatic->ref=$objp->ref; + $productstatic->ref = $objp->ref; + $productstatic->label = $objp->produit; $productstatic->type=$objp->type; print $productstatic->getNomUrl(1,'stock',16); print ''; $productstatic->id=$objp->rowid; $productstatic->ref=$objp->product_ref; + $productstatic->label=$objp->produit; $productstatic->type=$objp->type; print $productstatic->getNomUrl(1,'',16); print "'; $warehousestatic->id=$objp->entrepot_id; $warehousestatic->libelle=$objp->stock; + $warehousestatic->lieu=$objp->lieu; print $warehousestatic->getNomUrl(1); print "
'.$entrepotstatic->getNomUrl(1).''.$obj->reel.($obj->reel<0?' '.img_warning():'').'
'; + $label.= ''; + $label.= ''; + if (! empty($this->logo)) { + $form = new Form($db); + $label .= ''; + } + $label.= '
'; if ($option == 'customer' || $option == 'compta') { + $label.= '' . $langs->trans("ShowCustomer") . ''; $lien = ''; $lien = ''; $lien = ''; $lien = ''; $lien = ''; $lien = 'name)) + $label.= '
' . $langs->trans('Name') . ': '. $this->name; + if (! empty($this->code_client)) + $label.= '
' . $langs->trans('CustomerCode') . ': '. $this->code_client; + if (! empty($this->code_fournisseur)) + $label.= '
' . $langs->trans('SupplierCode') . ': '. $this->code_fournisseur; + + $label.= '
  ' . $form->showphoto('societe', $this, 80) . '
'; // Add type of canvas $lien.=(!empty($this->canvas)?'&canvas='.$this->canvas:'').'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">'; diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index a6a00bb0046..d92a28a08f1 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -245,7 +245,9 @@ print '
'; * Last third parties modified */ $max=15; -$sql = "SELECT s.rowid, s.nom as name, s.client, s.fournisseur, s.canvas, s.tms as datem, s.status as status"; +$sql = "SELECT s.rowid, s.nom as name, s.client, s.fournisseur"; +$sql.= ", s.logo"; +$sql.= ", s.canvas, s.tms as datem, s.status as status"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= ' WHERE s.entity IN ('.getEntity('societe', 1).')'; @@ -289,29 +291,49 @@ if ($result) $thirdparty_static->name=$objp->name; $thirdparty_static->client=$objp->client; $thirdparty_static->fournisseur=$objp->fournisseur; + $thirdparty_static->logo = $objp->logo; $thirdparty_static->datem=$db->jdate($objp->datem); $thirdparty_static->status=$objp->status; $thirdparty_static->canvas=$objp->canvas; - print $thirdparty_static->getNomUrl(1); - print "\n"; + //print $thirdparty_static->getNomUrl(1); + //print "\n"; // Type - print ''; + //print ''; if ($thirdparty_static->client==1 || $thirdparty_static->client==3) { - $thirdparty_static->name=$langs->trans("Customer"); - print $thirdparty_static->getNomUrl(0,'customer'); + print $thirdparty_static->getNomUrl(1, 'customer'); + print "\n"; + // Type + print ''; + print $langs->trans("Customer"); + } + if ($thirdparty_static->client == 3 && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) { + print $thirdparty_static->getNomUrl(1); + print "\n"; + // Type + print ''; + print " / "; } - if ($thirdparty_static->client == 3 && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) print " / "; if (($thirdparty_static->client==2 || $thirdparty_static->client==3) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) { - $thirdparty_static->name=$langs->trans("Prospect"); - print $thirdparty_static->getNomUrl(0,'prospect'); + print $thirdparty_static->getNomUrl(1, 'prospect'); + print "\n"; + // Type + print ''; + print $langs->trans("Prospect"); } if (! empty($conf->fournisseur->enabled) && $thirdparty_static->fournisseur) { - if ($thirdparty_static->client) print " / "; - $thirdparty_static->name=$langs->trans("Supplier"); - print $thirdparty_static->getNomUrl(0,'supplier'); + if (! $thirdparty_static->client) { + print $thirdparty_static->getNomUrl(1, 'supplier'); + print "\n"; + print ''; + print $langs->trans("Supplier"); + } else { + // Type + print " / "; + print $langs->trans("Supplier"); + } } print ''; // Last modified date diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 11eaa8afb45..70349b1db83 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1781,12 +1781,58 @@ class User extends CommonObject * @param string $option On what the link point to * @return string String with URL */ - function getNomUrl($withpicto=0,$option='') + function getNomUrl($withpicto=0, $option='', $infologin=0) { - global $langs; + global $langs, $conf, $db; + global $dolibarr_main_authentication, $dolibarr_main_demo; + + + $result = ''; + $companylink = ''; + + $label = '' . $langs->trans("User") . ''; + $label.= ''; + $label.= ''; + $label.= ''; + } + $label.= ''; + + // Info Login + if ($infologin) { + $label.= '
'; + $label.= '
'.$langs->trans("Connection").''; + $label.= '
'.$langs->trans("IPAddress").': '.$_SERVER["REMOTE_ADDR"]; + if (! empty($conf->global->MAIN_MODULE_MULTICOMPANY)) $label.= '
'.$langs->trans("ConnectedOnMultiCompany").': '.$conf->entity.' (user entity '.$this->entity.')'; + $label.= '
'.$langs->trans("AuthenticationMode").': '.$_SESSION["dol_authmode"].(empty($dolibarr_main_demo)?'':' (demo)'); + $label.= '
'.$langs->trans("ConnectedSince").': '.dol_print_date($this->datelastlogin,"dayhour"); + $label.= '
'.$langs->trans("PreviousConnexion").': '.dol_print_date($this->datepreviouslogin,"dayhour"); + $label.= '
'.$langs->trans("CurrentTheme").': '.$conf->theme; + $label.= '
'.$langs->trans("CurrentMenuManager").': '.$menumanager->name; + $s=picto_from_langcode($langs->getDefaultLang()); + $label.= '
'.$langs->trans("CurrentUserLanguage").': '.($s?$s.' ':'').$langs->getDefaultLang(); + $label.= '
'.$langs->trans("Browser").': '.$conf->browser->name.($conf->browser->version?' '.$conf->browser->version:'').' ('.$_SERVER['HTTP_USER_AGENT'].')'; + if (! empty($conf->browser->phone)) $label.= '
'.$langs->trans("Phone").': '.$conf->browser->phone; + if (! empty($_SESSION["disablemodules"])) $label.= '
'.$langs->trans("DisabledModules").':
'.join(', ',explode(',',$_SESSION["disablemodules"])); + } - $result=''; - $label = $langs->trans("ShowUser").': '.$this->getFullName($langs,'','',24); $lien = '
'; $lienfin=''; @@ -1795,7 +1841,7 @@ class User extends CommonObject $result.=($lien.img_object($label, 'user', 'class="classfortooltip"').$lienfin); if ($withpicto != 2) $result.=' '; } - $result.=$lien.$this->getFullName($langs,'','',24).$lienfin; + $result.= $lien . $this->getFullName($langs,'','',24) . $companylink . $lienfin; return $result; } diff --git a/htdocs/user/home.php b/htdocs/user/home.php index c9b3693f1ac..72e9b124ae0 100644 --- a/htdocs/user/home.php +++ b/htdocs/user/home.php @@ -98,8 +98,16 @@ print '
'; */ $max=10; -$sql = "SELECT u.rowid, u.lastname, u.firstname, u.admin, u.login, u.fk_societe, u.datec, u.statut, u.entity, u.ldap_sid,"; -$sql.= " s.nom as name, s.canvas"; +$sql = "SELECT u.rowid, u.lastname, u.firstname, u.admin, u.login, u.fk_societe, u.datec, u.statut"; +$sql.= ", u.entity"; +$sql.= ", u.ldap_sid"; +$sql.= ", u.photo"; +$sql.= ", u.admin"; +$sql.= ", u.email"; +$sql.= ", u.skype"; +$sql.= ", s.nom as name"; +$sql.= ", s.code_client"; +$sql.= ", s.canvas"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON u.fk_societe = s.rowid"; if (! empty($conf->multicompany->enabled) && $conf->entity == 1 && ($conf->multicompany->transverse_mode || ($user->admin && ! $user->entity))) @@ -129,7 +137,18 @@ if ($resql) $var=!$var; print ""; - print ''.img_object($langs->trans("ShowUser"),"user").' '.dolGetFirstLastname($obj->firstname,$obj->lastname).''; + print ''; + $fuserstatic->id = $obj->rowid; + $fuserstatic->statut = $obj->statut; + $fuserstatic->lastname = $obj->lastname; + $fuserstatic->firstname = $obj->firstname; + $fuserstatic->login = $obj->login; + $fuserstatic->photo = $obj->photo; + $fuserstatic->admin = $obj->admin; + $fuserstatic->email = $obj->email; + $fuserstatic->skype = $obj->skype; + $fuserstatic->societe_id = $obj->fk_societe; + print $fuserstatic->getNomUrl(1); if (! empty($conf->multicompany->enabled) && $obj->admin && ! $obj->entity) { print img_picto($langs->trans("SuperAdministrator"),'redstar'); @@ -145,6 +164,7 @@ if ($resql) { $companystatic->id=$obj->fk_societe; $companystatic->name=$obj->name; + $companystatic->code_client = $obj->code_client; $companystatic->canvas=$obj->canvas; print $companystatic->getNomUrl(1); } @@ -175,8 +195,6 @@ if ($resql) print ''; print ''.dol_print_date($db->jdate($obj->datec),'dayhour').''; print ''; - $fuserstatic->id=$obj->rowid; - $fuserstatic->statut=$obj->statut; print $fuserstatic->getLibStatut(3); print '';