diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index ab6de76f340..21c130cafac 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -743,7 +743,7 @@ class ActionComm extends CommonObject $sql .= " a.fk_element as elementid, a.elementtype,"; $sql .= " a.priority, a.fulldayevent, a.location, a.transparency,"; $sql .= " a.email_msgid, a.email_subject, a.email_from, a.email_to, a.email_tocc, a.email_tobcc, a.errors_to,"; - $sql .= " c.id as type_id, c.code as type_code, c.libelle as type_label, c.color as type_color, c.picto as type_picto,"; + $sql .= " c.id as type_id, c.type as type_type, c.code as type_code, c.libelle as type_label, c.color as type_color, c.picto as type_picto,"; $sql .= " s.nom as socname,"; $sql .= " u.firstname, u.lastname as lastname,"; $sql .= " num_vote, event_paid, a.status"; @@ -779,8 +779,9 @@ class ActionComm extends CommonObject $this->type_code = $obj->type_code; $this->type_color = $obj->type_color; $this->type_picto = $obj->type_picto; - $transcode = $langs->trans("Action".$obj->type_code); - $this->type = (($transcode != "Action".$obj->type_code) ? $transcode : $obj->type_label); + $this->type = $obj->type_type; + /*$transcode = $langs->trans("Action".$obj->type_code); + $this->type = (($transcode != "Action".$obj->type_code) ? $transcode : $obj->type_label); */ $transcode = $langs->trans("Action".$obj->type_code.'Short'); $this->type_short = (($transcode != "Action".$obj->type_code.'Short') ? $transcode : ''); diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index f1b80843488..0380b26a392 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -183,6 +183,10 @@ class FormActions dol_print_error($this->db, 'FailedToGetActions'); } + require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php'; + $caction = new CActionComm($this->db); + $arraylist = $caction->liste_array(1, 'code', '', (empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : 0), '', 1); + $num = count($listofactions); if ($num || $forceshowtitle) { if ($typeelement == 'invoice') { @@ -275,14 +279,25 @@ class FormActions } print ''; + $actionstatic = $actioncomm; // Type - print ''; - print $actioncomm->getTypePicto(); - if ($actioncomm->type_code == 'AC_OTH' && $actioncomm->code == 'TICKET_MSG') { - print $langs->trans("Message"); - } else { - print $actioncomm->type_short ? $actioncomm->type_short : $actioncomm->type; + $labeltype = $actionstatic->type_code; + if (empty($conf->global->AGENDA_USE_EVENT_TYPE) && empty($arraylist[$labeltype])) { + $labeltype = 'AC_OTH'; } + if ($actionstatic->type_code == 'AC_OTH' && $actionstatic->code == 'TICKET_MSG') { + $labeltype = $langs->trans("Message"); + } else { + if (!empty($arraylist[$labeltype])) { + $labeltype = $arraylist[$labeltype]; + } + if ($actionstatic->type_code == 'AC_OTH_AUTO' && ($actionstatic->type_code != $actionstatic->code) && $labeltype && !empty($arraylist[$actionstatic->code])) { + $labeltype .= ' - '.$arraylist[$actionstatic->code]; // Use code in priority on type_code + } + } + print ''; + print $actioncomm->getTypePicto(); + print $labeltype; print ''; // Label diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 6f49606ebdf..09f7fbed871 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1783,31 +1783,6 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin $out .= ''; // Type - $out .= ''; - // TODO Code common with code into showactions - $imgpicto = ''; - if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) { - if ($actionstatic->type_picto) { - $imgpicto .= img_picto('', $actionstatic->type_picto); - } else { - if ($actionstatic->type_code == 'AC_RDV') { - $imgpicto .= img_picto('', 'object_group', '', false, 0, 0, '', 'paddingright').' '; - } elseif ($actionstatic->type_code == 'AC_TEL') { - $imgpicto .= img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright').' '; - } elseif ($actionstatic->type_code == 'AC_FAX') { - $imgpicto .= img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright').' '; - } elseif ($actionstatic->type_code == 'AC_EMAIL' || $actionstatic->type_code == 'AC_EMAIL_IN') { - $imgpicto .= img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright').' '; - } elseif ($actionstatic->type_code == 'AC_INT') { - $imgpicto .= img_picto('', 'object_intervention', '', false, 0, 0, '', 'paddingright').' '; - } elseif ($actionstatic->type_code == 'AC_OTH' && $actionstatic->code == 'TICKET_MSG') { - $imgpicto = img_picto('', 'object_conversation', '', false, 0, 0, '', 'paddingright').' '; - } elseif (!preg_match('/_AUTO/', $actionstatic->type_code)) { - $imgpicto .= img_picto('', 'object_action', '', false, 0, 0, '', 'paddingright').' '; - } - } - } - $out .= $imgpicto; $labeltype = $actionstatic->type_code; if (empty($conf->global->AGENDA_USE_EVENT_TYPE) && empty($arraylist[$labeltype])) { $labeltype = 'AC_OTH'; @@ -1822,7 +1797,9 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin $labeltype .= ' - '.$arraylist[$actionstatic->code]; // Use code in priority on type_code } } - $out .= dol_trunc($labeltype, 28); + $out .= ''; + $out .= $actionstatic->getTypePicto(); + $out .= $labeltype; $out .= ''; // Title