diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index bc5bf9da9e3..b4336936181 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1041,9 +1041,9 @@ class ActionComm extends CommonObject * Use $this->id, $this->type_code, $this->label and $this->type_label * * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto - * @param int $maxlength Nombre de caracteres max dans libelle + * @param int $maxlength Max number of charaters into label. If negative, use the ref as label. * @param string $classname Force style class on a link - * @param string $option ''=Link to action,'birthday'=Link to contact + * @param string $option ''=Link to action, 'birthday'=Link to contact * @param int $overwritepicto 1=Overwrite picto * @return string Chaine avec URL */ @@ -1075,7 +1075,8 @@ class ActionComm extends CommonObject { $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) != "Action".$this->type_code)?$langs->transnoentities("Action".$this->type_code):$this->type_label; - $libelleshort=dol_trunc($libelle,$maxlength); + if ($maxlength < 0) $libelleshort=$this->ref; + else $libelleshort=dol_trunc($libelle,$maxlength); } if ($withpicto) diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index 9322680a682..15bb1b8b43d 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -196,10 +196,7 @@ class FormActions foreach($listofactions as $action) { - $savlabel=$action->label; - $action->label=$action->ref; - $ref=$action->getNomUrl(1); - $action->label=$savlabel; + $ref=$action->getNomUrl(1,-1); $label=$action->getNomUrl(0,38); $var=!$var;