Fix agenda event type label instead of event type code on actionComm card (#31106)

* Fix display agenda event type label instead of event type code when event type code has no translation

In a ActionComm card, if we use agenda event types, the type of event displayed is the event code if this event code has no translation.
Now, if there is no translation, the label of the event type is displayed instead of the code.

* fix for PHPStan

* fix for PHPStan

* fix for PHPStan

* fix for PHPStan

---------

Co-authored-by: Ulysse Valdenaire <uvaldenaire@easya.solutions>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
UltraViolet33 2024-09-26 17:47:49 +02:00 committed by GitHub
parent c4ffa090b2
commit b2aafb37f3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 3 deletions

View File

@ -2336,12 +2336,13 @@ if ($id > 0) {
// Type
if (getDolGlobalString('AGENDA_USE_EVENT_TYPE')) {
print '<tr><td class="titlefield">'.$langs->trans("Type").'</td><td>';
$labeltoshow = $langs->trans("Action".$object->type_code);
$labeltype = ($langs->transnoentities("Action".$object->type_code) != "Action".$object->type_code) ? $langs->transnoentities("Action".$object->type_code) : $object->type_label;
$labeltoshow = $labeltype;
if ($object->code) {
$labeltoshow .= ' ('.$object->code.')';
}
print $object->getTypePicto('pictofixedwidth paddingright', $labeltoshow);
print $langs->trans("Action".$object->type_code);
print $labeltype;
print '</td></tr>';
}

View File

@ -845,6 +845,7 @@ class ActionComm extends CommonObject
$this->type_color = $obj->type_color;
$this->type_picto = $obj->type_picto;
$this->type = $obj->type_type;
$this->type_label = $obj->type_label;
$this->code = $obj->code;
$this->label = $obj->label;

View File

@ -201,7 +201,7 @@ if ($action == 'order' && GETPOST('valid') && $user->hasRight('fournisseur', 'co
// If we use multicurrency
if (isModEnabled('multicurrency') && !empty($productsupplier->fourn_multicurrency_code) && $productsupplier->fourn_multicurrency_code != $conf->currency) {
$line->multicurrency_code = $productsupplier->fourn_multicurrency_code;
$line->fk_multicurrency = $productsupplier->fourn_multicurrency_id;
$line->fk_multicurrency = (int) $productsupplier->fourn_multicurrency_id;
$line->multicurrency_subprice = $productsupplier->fourn_multicurrency_unitprice;
}