Minor enhancement in agenda module

This commit is contained in:
Laurent Destailleur 2010-11-21 21:34:14 +00:00
parent ff24fd67e2
commit ff8124844d
2 changed files with 9 additions and 5 deletions

View File

@ -561,12 +561,12 @@ class ActionComm extends CommonObject
/** /**
* Renvoie nom clicable (avec eventuellement le picto) * Renvoie nom clicable (avec eventuellement le picto)
* Utilise $this->id, $this->code et $this->libelle
* @param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul * @param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
* @param maxlength Nombre de caracteres max dans libelle * @param maxlength Nombre de caracteres max dans libelle
* @param class Force style class on a link * @param class Force style class on a link
* @param option ''=Link to action,'birthday'=Link to contact * @param option ''=Link to action,'birthday'=Link to contact
* @return string Chaine avec URL * @return string Chaine avec URL
* @remarks Utilise $this->id, $this->code et $this->libelle
*/ */
function getNomUrl($withpicto=0,$maxlength=0,$classname='',$option='',$overwritepicto='') function getNomUrl($withpicto=0,$maxlength=0,$classname='',$option='',$overwritepicto='')
{ {
@ -576,8 +576,8 @@ class ActionComm extends CommonObject
if ($option=='birthday') $lien = '<a '.($classname?'class="'.$classname.'" ':'').'href="'.DOL_URL_ROOT.'/contact/perso.php?id='.$this->id.'">'; if ($option=='birthday') $lien = '<a '.($classname?'class="'.$classname.'" ':'').'href="'.DOL_URL_ROOT.'/contact/perso.php?id='.$this->id.'">';
else $lien = '<a '.($classname?'class="'.$classname.'" ':'').'href="'.DOL_URL_ROOT.'/comm/action/fiche.php?id='.$this->id.'">'; else $lien = '<a '.($classname?'class="'.$classname.'" ':'').'href="'.DOL_URL_ROOT.'/comm/action/fiche.php?id='.$this->id.'">';
$lienfin='</a>'; $lienfin='</a>';
//print $this->libelle;
if ($langs->trans("Action".$this->type_code) != "Action".$this->type_code || ! $this->libelle) if (empty($this->libelle))
{ {
$libelle=$langs->trans("Action".$this->type_code); $libelle=$langs->trans("Action".$this->type_code);
$libelleshort=$langs->trans("Action".$this->type_code,'','','','',$maxlength); $libelleshort=$langs->trans("Action".$this->type_code,'','','','',$maxlength);
@ -588,7 +588,11 @@ class ActionComm extends CommonObject
$libelleshort=dol_trunc($this->libelle,$maxlength); $libelleshort=dol_trunc($this->libelle,$maxlength);
} }
if ($withpicto) $result.=($lien.img_object($langs->trans("ShowAction").': '.$libelle,($overwritepicto?$overwritepicto:'task')).$lienfin); if ($withpicto)
{
$libelle.=(($this->type_code && $libelle!=$langs->trans("Action".$this->type_code) && $langs->trans("Action".$this->type_code)!="Action".$this->type_code)?' ('.$langs->trans("Action".$this->type_code).')':'');
$result.=$lien.img_object($langs->trans("ShowAction").': '.$libelle,($overwritepicto?$overwritepicto:'task')).$lienfin;
}
if ($withpicto==1) $result.=' '; if ($withpicto==1) $result.=' ';
$result.=$lien.$libelleshort.$lienfin; $result.=$lien.$libelleshort.$lienfin;
return $result; return $result;

View File

@ -218,7 +218,7 @@ if ($resql)
// Action (type) // Action (type)
print '<td>'; print '<td>';
$actionstatic->id=$obj->id; $actionstatic->id=$obj->id;
$actionstatic->code=$obj->acode; $actionstatic->type_code=$obj->acode;
$actionstatic->libelle=$obj->label; $actionstatic->libelle=$obj->label;
print $actionstatic->getNomUrl(1,12); print $actionstatic->getNomUrl(1,12);
print '</td>'; print '</td>';