diff --git a/htdocs/cactioncomm.class.php b/htdocs/cactioncomm.class.php index 5dbe808135a..7d02ee66aad 100644 --- a/htdocs/cactioncomm.class.php +++ b/htdocs/cactioncomm.class.php @@ -158,51 +158,18 @@ class CActionComm { /* - * \brief Renvoie le nom sous forme d'un libellé traduit d'un type d'action - * \param id id ou code du type d'action - * \return string libelle du type d'action + * \brief Renvoie le nom sous forme d'un libellé traduit d'un type d'action + * \param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul + * \param option Sur quoi pointe le lien + * \return string Libelle du type d'action */ - function getNom() + function getNomUrl($withpicto=0) { global $langs; // Check if translation available $transcode=$langs->trans("Action".$this->code); if ($transcode != "Action".$this->code) return $transcode; - - // Check if available in cach - if (isset($this->type_actions[$this->code])) - { - // Si valeur disponible en cache - return $this->type_actions[$this->code]; - } - - // If no translation and no cache available - $sql = 'SELECT id, code, libelle'; - $sql.= ' FROM '.MAIN_DB_PREFIX.'c_actioncomm'; - if (is_numeric($id)) $sql.= " WHERE id=".$this->code; - else $sql.= " WHERE code='".$this->code."'"; - - dolibarr_syslog("CActionComm::getNom sql=".$sql); - $result = $this->db->query($sql); - if ($result) - { - if ($this->db->num_rows($result)) - { - $obj = $this->db->fetch_object($result); - - $transcode=$langs->trans("Action".$obj->code); - $libelle=($transcode!="Action".$obj->code?$transcode:$obj->libelle); - - $this->type_actions[$obj->code]=$libelle; // Put in cache - return $libelle; - } - $this->db->free($result); - } - else - { - dolibarr_print_error($db); - } } } diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index c85799ab7fd..c66642609c4 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2006 Laurent Destailleur + * Copyright (C) 2004-2007 Laurent Destailleur * Copyright (C) 2004 Eric Seigne * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2005-2007 Regis Houssin @@ -273,7 +273,7 @@ if ($socid > 0) print ''; // multiprix - if($conf->global->PRODUIT_MULTIPRICES == 1) + if ($conf->global->PRODUIT_MULTIPRICES) { print ''; print '"; + print ''; + print ''; // Lien click to dial @@ -716,13 +714,17 @@ if ($socid > 0) $sql.= " ".$db->pdate("a.datep")." as dp,"; $sql.= " ".$db->pdate("a.datea")." as da,"; $sql.= " a.percent,"; - $sql.= " c.code as acode, c.libelle, a.propalrowid, a.fk_user_author, fk_contact, u.login, u.rowid "; - $sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u "; + $sql.= " c.code as acode, c.libelle, a.propalrowid, a.fk_user_author, a.fk_contact,"; + $sql.= " u.login, u.rowid,"; + $sql.= " sp.name, sp.firstname"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u, ".MAIN_DB_PREFIX."actioncomm as a"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid"; $sql.= " WHERE a.fk_soc = ".$objsoc->id; $sql.= " AND u.rowid = a.fk_user_author"; $sql.= " AND c.id=a.fk_action AND a.percent < 100"; $sql.= " ORDER BY a.datep DESC, a.id DESC"; + dolibarr_syslog("comm/fiche.php sql=".$sql); $result=$db->query($sql); if ($result) { @@ -774,9 +776,9 @@ if ($socid > 0) if ($obj->propalrowid) { print ''; } else @@ -791,9 +793,10 @@ if ($socid > 0) // Contact pour cette action if ($obj->fk_contact > 0) { - $contact = new Contact($db); - $contact->fetch($obj->fk_contact); - print ''; + $contactstatic->name=$obj->name; + $contactstatic->firstname=$obj->firstname; + $contactstatic->id=$obj->fk_contact; + print ''; } else { @@ -843,13 +846,16 @@ if ($socid > 0) $sql.= " a.percent,"; $sql.= " a.propalrowid, a.fk_facture, a.fk_user_author, a.fk_contact,"; $sql.= " c.code as acode, c.libelle,"; - $sql.= " u.login, u.rowid"; - $sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u "; + $sql.= " u.login, u.rowid,"; + $sql.= " sp.name, sp.firstname"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u, ".MAIN_DB_PREFIX."actioncomm as a"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid"; $sql.= " WHERE a.fk_soc = ".$objsoc->id; $sql.= " AND u.rowid = a.fk_user_author"; $sql.= " AND c.id=a.fk_action AND a.percent = 100"; $sql.= " ORDER BY a.datea DESC, a.id DESC"; + dolibarr_syslog("comm/fiche.php sql=".$sql); $result=$db->query($sql); if ($result) { @@ -927,9 +933,10 @@ if ($socid > 0) // Contact pour cette action if ($obj->fk_contact > 0) { - $contact = new Contact($db); - $contact->fetch($obj->fk_contact); - print ''; + $contactstatic->name=$obj->name; + $contactstatic->firstname=$obj->firstname; + $contactstatic->id=$obj->fk_contact; + print ''; } else { diff --git a/htdocs/compta/fiche.php b/htdocs/compta/fiche.php index cfdbd65bd87..60d6a004223 100644 --- a/htdocs/compta/fiche.php +++ b/htdocs/compta/fiche.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2006 Laurent Destailleur + * Copyright (C) 2004-2007 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,7 +17,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ - * $Source$ */ /** @@ -456,13 +455,17 @@ if ($socid > 0) print ''; $sql = "SELECT a.id, a.label, ".$db->pdate("a.datea")." as da, a.percent,"; - $sql.= " c.code as acode, c.libelle, u.login, a.propalrowid, a.fk_user_author, fk_contact, u.rowid "; - $sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u "; + $sql.= " c.code as acode, c.libelle, u.login, a.propalrowid, a.fk_user_author, a.fk_contact,"; + $sql.= " u.login, u.rowid,"; + $sql.= " sp.name, sp.firstname"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u, ".MAIN_DB_PREFIX."actioncomm as a"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid"; $sql.= " WHERE a.fk_soc = ".$societe->id; $sql.= " AND u.rowid = a.fk_user_author"; $sql.= " AND c.id=a.fk_action AND a.percent < 100"; $sql.= " ORDER BY a.datea DESC, a.id DESC"; + dolibarr_syslog("compta/fiche.php sql=".$sql); $result=$db->query($sql); if ($result) { @@ -530,9 +533,10 @@ if ($socid > 0) // Contact pour cette action if ($obj->fk_contact > 0) { - $contact = new Contact($db); - $contact->fetch($obj->fk_contact); - print ''; + $contactstatic->name=$obj->name; + $contactstatic->firstname=$obj->firstname; + $contactstatic->id=$obj->fk_contact; + print ''; } else { @@ -568,13 +572,16 @@ if ($socid > 0) $sql = "SELECT a.id, a.label, ".$db->pdate("a.datea")." as da, a.percent,"; $sql.= " a.propalrowid, a.fk_facture, a.fk_user_author, a.fk_contact,"; $sql.= " c.code as acode, c.libelle,"; - $sql.= " u.login, u.rowid"; - $sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u "; + $sql.= " u.login, u.rowid,"; + $sql.= " sp.name, sp.firstname"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u, ".MAIN_DB_PREFIX."actioncomm as a"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid"; $sql.= " WHERE a.fk_soc = ".$societe->id; $sql.= " AND u.rowid = a.fk_user_author"; $sql.= " AND c.id=a.fk_action AND a.percent = 100"; $sql.= " ORDER BY a.datea DESC, a.id DESC"; + dolibarr_syslog("compta/fiche.php sql=".$sql); $result=$db->query($sql); if ($result) { @@ -644,9 +651,10 @@ if ($socid > 0) // Contact pour cette action if ($obj->fk_contact > 0) { - $contact = new Contact($db); - $contact->fetch($obj->fk_contact); - print ''; + $contactstatic->name=$obj->name; + $contactstatic->firstname=$obj->firstname; + $contactstatic->id=$obj->fk_contact; + print ''; } else { @@ -679,5 +687,4 @@ $db->close(); llxFooter('$Date$ - $Revision$'); - ?> diff --git a/htdocs/propal.class.php b/htdocs/propal.class.php index eb58ff35268..5b332ad3edf 100644 --- a/htdocs/propal.class.php +++ b/htdocs/propal.class.php @@ -2153,7 +2153,7 @@ class Propal extends CommonObject } /** - \brief Renvoie nom clicable (avec eventuellement le picto) + \brief Renvoie nom clicable (avec eventuellement le picto) \param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul \param option Sur quoi pointe le lien \param get_param Parametres ajouté ŕ l'url
'; @@ -653,18 +653,16 @@ if ($socid > 0) { $obj = $db->fetch_object($result); $var = !$var; + print "
'; $contactstatic->id = $obj->rowid; $contactstatic->name = $obj->name; $contactstatic->firstname = $obj->firstname; - print ''; print $contactstatic->getNomUrl(1); - if (trim($obj->note)) - { - print '
'.nl2br(trim($obj->note)); - } print '
'.$obj->poste.' '.img_object($langs->trans("ShowAction"),"task"); - $transcode=$langs->trans("Action".$obj->acode); - $libelle=($transcode!="Action".$obj->acode?$transcode:$obj->libelle); - print $libelle; + $transcode=$langs->trans("Action".$obj->acode); + $libelle=($transcode!="Action".$obj->acode?$transcode:$obj->libelle); + print $libelle; print ''.$contact->getNomUrl(1).''.$contactstatic->getNomUrl(1).''.$contact->getNomUrl(1).''.$contactstatic->getNomUrl(1).'
'.$contact->getNomUrl(1).''.$contactstatic->getNomUrl(1).''.$contact->getNomUrl(1).''.$contactstatic->getNomUrl(1).'