mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
NEW Add more information to holiday mailings (#25461)
* Add more information to holiday mailings * Fix leave type in mailings
This commit is contained in:
parent
37937f2a46
commit
c86b608a41
|
|
@ -522,11 +522,29 @@ if (empty($reshook)) {
|
|||
}
|
||||
}
|
||||
|
||||
$typeleaves = $object->getTypes(1, -1);
|
||||
$labeltoshow = (($typeleaves[$object->fk_type]['code'] && $langs->trans($typeleaves[$object->fk_type]['code']) != $typeleaves[$object->fk_type]['code']) ? $langs->trans($typeleaves[$object->fk_type]['code']) : $typeleaves[$object->fk_type]['label']);
|
||||
|
||||
if ($object->halfday == 2) {
|
||||
$starthalfdaykey = "Afternoon";
|
||||
$endhalfdaykey = "Morning";
|
||||
} elseif ($object->halfday == -1) {
|
||||
$starthalfdaykey = "Afternoon";
|
||||
$endhalfdaykey = "Afternoon";
|
||||
} elseif ($object->halfday == 1) {
|
||||
$starthalfdaykey = "Morning";
|
||||
$endhalfdaykey = "Morning";
|
||||
} elseif ($object->halfday == 2) {
|
||||
$starthalfdaykey = "Morning";
|
||||
$endhalfdaykey = "Afternoon";
|
||||
}
|
||||
|
||||
$link = dol_buildpath("/holiday/card.php", 3) . '?id='.$object->id;
|
||||
|
||||
$message .= "<ul>";
|
||||
$message .= "<li>".$langs->transnoentitiesnoconv("Name")." : ".dolGetFirstLastname($expediteur->firstname, $expediteur->lastname)."</li>\n";
|
||||
$message .= "<li>".$langs->transnoentitiesnoconv("Period")." : ".dol_print_date($object->date_debut, 'day')." ".$langs->transnoentitiesnoconv("To")." ".dol_print_date($object->date_fin, 'day')."</li>\n";
|
||||
$message .= "<li>".$langs->transnoentitiesnoconv("Type")." : ".(empty($labeltoshow) ? $langs->trans("TypeWasDisabledOrRemoved", $object->fk_type) : $labeltoshow)."</li>\n";
|
||||
$message .= "<li>".$langs->transnoentitiesnoconv("Period")." : ".dol_print_date($object->date_debut, 'day')." ".$langs->transnoentitiesnoconv($starthalfdaykey)." ".$langs->transnoentitiesnoconv("To")." ".dol_print_date($object->date_fin, 'day')." ".$langs->transnoentitiesnoconv($endhalfdaykey)."</li>\n";
|
||||
$message .= "<li>".$langs->transnoentitiesnoconv("Link").' : <a href="'.$link.'" target="_blank">'.$link."</a></li>\n";
|
||||
$message .= "</ul>\n";
|
||||
|
||||
|
|
|
|||
|
|
@ -747,11 +747,29 @@ function sendMail($id, $cancreate, $now, $autoValidation)
|
|||
}
|
||||
}
|
||||
|
||||
$typeleaves = $object->getTypes(1, -1);
|
||||
$labeltoshow = (($typeleaves[$object->fk_type]['code'] && $langs->trans($typeleaves[$object->fk_type]['code']) != $typeleaves[$object->fk_type]['code']) ? $langs->trans($typeleaves[$object->fk_type]['code']) : $typeleaves[$object->fk_type]['label']);
|
||||
|
||||
if ($object->halfday == 2) {
|
||||
$starthalfdaykey = "Afternoon";
|
||||
$endhalfdaykey = "Morning";
|
||||
} elseif ($object->halfday == -1) {
|
||||
$starthalfdaykey = "Afternoon";
|
||||
$endhalfdaykey = "Afternoon";
|
||||
} elseif ($object->halfday == 1) {
|
||||
$starthalfdaykey = "Morning";
|
||||
$endhalfdaykey = "Morning";
|
||||
} elseif ($object->halfday == 2) {
|
||||
$starthalfdaykey = "Morning";
|
||||
$endhalfdaykey = "Afternoon";
|
||||
}
|
||||
|
||||
$link = dol_buildpath("/holiday/card.php", 3) . '?id='.$object->id;
|
||||
|
||||
$message .= "<ul>";
|
||||
$message .= "<li>".$langs->transnoentitiesnoconv("Name")." : ".dolGetFirstLastname($expediteur->firstname, $expediteur->lastname)."</li>\n";
|
||||
$message .= "<li>".$langs->transnoentitiesnoconv("Period")." : ".dol_print_date($object->date_debut, 'day')." ".$langs->transnoentitiesnoconv("To")." ".dol_print_date($object->date_fin, 'day')."</li>\n";
|
||||
$message .= "<li>".$langs->transnoentitiesnoconv("Type")." : ".(empty($labeltoshow) ? $langs->trans("TypeWasDisabledOrRemoved", $object->fk_type) : $labeltoshow)."</li>\n";
|
||||
$message .= "<li>".$langs->transnoentitiesnoconv("Period")." : ".dol_print_date($object->date_debut, 'day')." ".$langs->transnoentitiesnoconv($starthalfdaykey)." ".$langs->transnoentitiesnoconv("To")." ".dol_print_date($object->date_fin, 'day')." ".$langs->transnoentitiesnoconv($endhalfdaykey)."</li>\n";
|
||||
$message .= "<li>".$langs->transnoentitiesnoconv("Link").' : <a href="'.$link.'" target="_blank">'.$link."</a></li>\n";
|
||||
$message .= "</ul>\n";
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user