From 1172b6a396a171075f41430fcbf5795918b0f6d6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 28 Mar 2007 12:17:28 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20Date=20sur=20page=20des=20actions=20mal?= =?UTF-8?q?=20align=E9es.=20Mutualisation=20code=20par=20utilisation=20des?= =?UTF-8?q?=20fonctions=20getNomUrl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/actioncomm.class.php | 8 ++++---- htdocs/comm/action/index.php | 26 ++++++++++++++------------ htdocs/comm/fiche.php | 13 +++++++++++-- htdocs/contact.class.php | 2 +- htdocs/societe.class.php | 2 +- 5 files changed, 31 insertions(+), 20 deletions(-) diff --git a/htdocs/actioncomm.class.php b/htdocs/actioncomm.class.php index 9fe48176e7b..74f6cae1585 100644 --- a/htdocs/actioncomm.class.php +++ b/htdocs/actioncomm.class.php @@ -379,11 +379,11 @@ class ActionComm /** * \brief Renvoie nom clicable (avec eventuellement le picto) * \param withpicto Inclut le picto dans le lien - * \param option Nombre de caractères max dans libellé + * \param maxlength Nombre de caractères max dans libellé * \return string Chaine avec URL * \remarks Utilise $this->id, $this->code et $this->libelle */ - function getNomUrl($withpicto=0,$option) + function getNomUrl($withpicto=0,$maxlength) { global $langs; @@ -394,12 +394,12 @@ class ActionComm if ($langs->trans("Action".$this->code) != "Action".$this->code) { $libelle=$langs->trans("Action".$this->code); - $libelleshort=$langs->trans("Action".$this->code,'','','','',$option); + $libelleshort=$langs->trans("Action".$this->code,'','','','',$maxlength); } else { $libelle=$this->libelle; - $libelleshort=dolibarr_trunc($this->libelle,$option); + $libelleshort=dolibarr_trunc($this->libelle,$maxlength); } if ($withpicto) $result.=($lien.img_object($langs->trans("ShowTask").': '.$libelle,'task').$lienfin.' '); diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index c49dcd7c8a4..229fec784c8 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -80,7 +80,7 @@ if ($_GET["time"] == "today") } if ($socid) { - $sql .= " AND s.idp = $socid"; + $sql .= " AND s.idp = ".$socid; } if (!$user->rights->commercial->client->voir && !$socid) //restriction { @@ -95,6 +95,7 @@ $resql=$db->query($sql); if ($resql) { $actionstatic=new ActionComm($db); + $societestatic=new Societe($db); $num = $db->num_rows($resql); $title="DoneAndToDoActions"; @@ -116,7 +117,6 @@ if ($resql) $i = 0; print ""; print ''; -// print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"a.datep",$param,'','colspan="4"',$sortfield); print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"a.datep",$param,'','',$sortfield); print_liste_field_titre($langs->trans("Action"),$_SERVER["PHP_SELF"],"acode",$param,"","",$sortfield); print_liste_field_titre($langs->trans("Title"),$_SERVER["PHP_SELF"],"a.label",$param,"","",$sortfield); @@ -134,7 +134,7 @@ if ($resql) print ""; - print '\n"; // Action (type) - print ''; + print ''; // Titre print ''; + $societestatic->rowid=$obj->socid; + $societestatic->client=$obj->client; + $societestatic->nom=$obj->societe; + print $societestatic->getNomUrl(1,'',16); + print ''; // Contact print ''; } - print ''; + print ''; // Statut print ''; @@ -977,7 +982,11 @@ if ($socid > 0) } // Auteur - print ''; + print ''; // Statut print ''; diff --git a/htdocs/contact.class.php b/htdocs/contact.class.php index d85b92fb7e6..946d4605acc 100644 --- a/htdocs/contact.class.php +++ b/htdocs/contact.class.php @@ -671,7 +671,7 @@ class Contact $lienfin=''; } - if ($withpicto) $result.=($lien.img_object($langs->trans("ShowContact"),'contact').$lienfin.' '); + if ($withpicto) $result.=($lien.img_object($langs->trans("ShowContact").': '.$this->name.' '.$this->firstname,'contact').$lienfin.' '); $result.=$lien.$this->name.' '.$this->firstname.$lienfin; return $result; } diff --git a/htdocs/societe.class.php b/htdocs/societe.class.php index 22c3832d610..bd4f69eb155 100644 --- a/htdocs/societe.class.php +++ b/htdocs/societe.class.php @@ -1126,7 +1126,7 @@ class Societe $lienfin=''; } - if ($withpicto) $result.=($lien.img_object($langs->trans("ShowCompany"),'company').$lienfin.' '); + if ($withpicto) $result.=($lien.img_object($langs->trans("ShowCompany").': '.$this->nom,'company').$lienfin.' '); $result.=$lien.($maxlen?dolibarr_trunc($this->nom,$maxlen):$this->nom).$lienfin; return $result; }
'; + print ''; if ($oldyear == strftime("%Y",$obj->dp) ) { } @@ -168,11 +168,12 @@ if ($resql) // print ''.dolibarr_print_date($obj->dp)."'.img_object($langs->trans("ShowTask"),"task").' '; - $transcode=$langs->trans("Action".$obj->acode); - $libelle=($transcode!="Action".$obj->acode?$transcode:$obj->libelle); - print dolibarr_trunc($libelle,16); - print ''; + $actionstatic->id=$obj->id; + $actionstatic->code=$obj->acode; + $actionstatic->libelle=$obj->libelle; + print $actionstatic->getNomUrl(1,12); + print ''; @@ -181,10 +182,11 @@ if ($resql) // Société print ''; - if ($obj->client == 1) $url=DOL_URL_ROOT.'/comm/fiche.php?socid='; - elseif ($obj->client == 2) $url=DOL_URL_ROOT.'/comm/prospect/fiche.php?id='; - else $url=DOL_URL_ROOT.'/soc.php?socid='; - print ' '.img_object($langs->trans("ShowCompany"),"company").' '.dolibarr_trunc($obj->societe,24).''; diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index 2e1d6a0e2c9..164197cd261 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -182,6 +182,7 @@ llxHeader('',$langs->trans('CustomerCard')); $actionstatic=new ActionComm($db); $facturestatic=new Facture($db); $contactstatic = new Contact($db); +$userstatic=new User($db); if ($socid > 0) { @@ -844,7 +845,11 @@ if ($socid > 0) print ' '.img_object($langs->trans("ShowUser"),"user").' '.$obj->login.''; + $userstatic->id=$obj->fk_user_author; + $userstatic->login=$obj->login; + print $userstatic->getLoginUrl(1); + print ''.$actionstatic->LibStatut($obj->percent,3).''.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.''; + $userstatic->id=$obj->rowid; + $userstatic->login=$obj->login; + print $userstatic->getLoginUrl(1); + print ''.$actionstatic->LibStatut($obj->percent,3).'