Fix: label of events

This commit is contained in:
Laurent Destailleur 2014-10-20 13:07:54 +02:00
parent 42a600412d
commit 881d338fca
2 changed files with 10 additions and 15 deletions

View File

@ -853,8 +853,8 @@ class ActionComm extends CommonObject
} }
/** /**
* Renvoie nom clicable (avec eventuellement le picto) * Return URL of event
* Utilise $this->id, $this->code et $this->label * Use $this->id, $this->type_code and $this->label
* *
* @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul * @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
* @param int $maxlength Nombre de caracteres max dans libelle * @param int $maxlength Nombre de caracteres max dans libelle
@ -865,32 +865,27 @@ class ActionComm extends CommonObject
*/ */
function getNomUrl($withpicto=0,$maxlength=0,$classname='',$option='',$overwritepicto='') function getNomUrl($withpicto=0,$maxlength=0,$classname='',$option='',$overwritepicto='')
{ {
global $langs; global $conf,$langs;
$result=''; $result='';
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/card.php?id='.$this->id.'">'; else $lien = '<a '.($classname?'class="'.$classname.'" ':'').'href="'.DOL_URL_ROOT.'/comm/action/card.php?id='.$this->id.'">';
$lienfin='</a>'; $lienfin='</a>';
$label=$this->label; $label=$this->label;
if (empty($label)) $label=$this->libelle; // Fro backward compatibility if (empty($label)) $label=$this->libelle; // For backward compatibility
//print 'rrr'.$this->libelle; //print 'rrr'.$this->libelle.'-'.$withpicto;
if ($withpicto == 2) if ($withpicto == 2)
{ {
$libelle=$label; $libelle=$label;
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) $libelle=$langs->trans("Action".$this->type_code); if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) $libelle=$langs->transnoentities("Action".$this->type_code);
$libelleshort=''; $libelleshort='';
} }
else if (empty($this->libelle))
{
$libelle=$label;
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) $libelle=$langs->trans("Action".$this->type_code);
$libelleshort=dol_trunc($label, $maxlength);
}
else else
{ {
$libelle=$label; $libelle=(empty($this->libelle)?$label:$this->libelle.(($label && $label != $this->libelle)?' '.$label:''));
$libelleshort=dol_trunc($label,$maxlength); if (! empty($conf->global->AGENDA_USE_EVENT_TYPE) && empty($libelle)) $libelle=$langs->transnoentities("Action".$this->type_code);
$libelleshort=dol_trunc($libelle,$maxlength);
} }
if ($withpicto) if ($withpicto)

View File

@ -1316,7 +1316,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
print "<br>\n"; print "<br>\n";
} }
else else
{ {
if ($showinfo) if ($showinfo)
{ {
print $langs->trans("EventOnFullDay")."<br>\n"; print $langs->trans("EventOnFullDay")."<br>\n";