diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index a9c1b68470a0673534d9f458ceb2411b73a2fd36..b31f686c9fe6e502d22b2417027abaef6786fad1 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -854,7 +854,7 @@ class ActionComm extends CommonObject /** * Return URL of event - * Use $this->id, $this->type_code and $this->label + * Use $this->id, $this->type_code, $this->label and $this->type_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 @@ -884,15 +884,15 @@ class ActionComm extends CommonObject else { $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); + 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 ($withpicto) { - if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) + if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) // Add code into () { - $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).')':''); + $libelle.=(($this->type_code && $libelle!=$langs->transnoentities("Action".$this->type_code) && $langs->transnoentities("Action".$this->type_code)!="Action".$this->type_code)?' ('.$langs->transnoentities("Action".$this->type_code).')':''); } $result.=$lien.img_object($langs->trans("ShowAction").': '.$libelle,($overwritepicto?$overwritepicto:'action')).$lienfin; } diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index a8ce45ea99a17eed7583e3ee93b8cc7a1bfc6fbf..89933991b6a46c4b09e4b1ca4cedb4bfafdf65de 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -414,7 +414,7 @@ $sql.= ' a.percent,'; $sql.= ' a.fk_user_author,a.fk_user_action,a.fk_user_done,'; $sql.= ' a.transparency, a.priority, a.fulldayevent, a.location,'; $sql.= ' a.fk_soc, a.fk_contact,'; -$sql.= ' ca.code'; +$sql.= ' ca.code, ca.libelle as type_label'; $sql.= ' FROM '.MAIN_DB_PREFIX.'c_actioncomm as ca, '.MAIN_DB_PREFIX."actioncomm as a"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc"; if ($usergroup > 0) $sql.= ", ".MAIN_DB_PREFIX."usergroup_user as ugu"; @@ -496,6 +496,7 @@ if ($resql) $event->datep=$db->jdate($obj->datep); // datep and datef are GMT date $event->datef=$db->jdate($obj->datep2); $event->type_code=$obj->code; + $event->type_label=$obj->type_label; $event->libelle=$obj->label; $event->percentage=$obj->percent; $event->authorid=$obj->fk_user_author; // user id of creator