Skip to content

Commit

Permalink
Fix: label of events
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Oct 20, 2014
1 parent 42a6004 commit 881d338
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
23 changes: 9 additions & 14 deletions htdocs/comm/action/class/actioncomm.class.php
Expand Up @@ -853,8 +853,8 @@ function LibStatut($percent,$mode,$hidenastatus=0)
}

/**
* Renvoie nom clicable (avec eventuellement le picto)
* Utilise $this->id, $this->code et $this->label
* Return URL of event
* 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 $maxlength Nombre de caracteres max dans libelle
Expand All @@ -865,32 +865,27 @@ function LibStatut($percent,$mode,$hidenastatus=0)
*/
function getNomUrl($withpicto=0,$maxlength=0,$classname='',$option='',$overwritepicto='')
{
global $langs;
global $conf,$langs;

$result='';
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.'">';
$lienfin='</a>';
$label=$this->label;
if (empty($label)) $label=$this->libelle; // Fro backward compatibility
//print 'rrr'.$this->libelle;
if (empty($label)) $label=$this->libelle; // For backward compatibility
//print 'rrr'.$this->libelle.'-'.$withpicto;

if ($withpicto == 2)
{
$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='';
}
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
{
$libelle=$label;
$libelleshort=dol_trunc($label,$maxlength);
$libelle=(empty($this->libelle)?$label:$this->libelle.(($label && $label != $this->libelle)?' '.$label:''));
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE) && empty($libelle)) $libelle=$langs->transnoentities("Action".$this->type_code);
$libelleshort=dol_trunc($libelle,$maxlength);
}

if ($withpicto)
Expand Down
2 changes: 1 addition & 1 deletion htdocs/comm/action/index.php
Expand Up @@ -1316,7 +1316,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
print "<br>\n";
}
else
{
{
if ($showinfo)
{
print $langs->trans("EventOnFullDay")."<br>\n";
Expand Down

0 comments on commit 881d338

Please sign in to comment.