Skip to content
Merged

1.6.2 #124

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# CHANGELOG MODULE TIMESHEETWEEK FOR [DOLIBARR ERP CRM](https://www.dolibarr.org)

## 1.6.2 (14/12/2025)
- Envoie les notifications de changement d'état avec des versions HTML pour conserver les actions et caractères spéciaux. / Sends status change notifications with HTML variants to preserve actions and special characters.
- Décode les entités HTML dans les objets générés pour afficher correctement les accents dans les courriels. / Decodes HTML entities in generated subjects to display accented characters correctly in emails.
- Calcule la signature des notifications en utilisant MAIN_APPLICATION_TITLE ou, à défaut, le nom de la société. / Builds notification signatures using MAIN_APPLICATION_TITLE or, if unavailable, the company name.
- Ajoute les traductions de TimesheetWeek en allemand, espagnol et italien. / Adds German, Spanish and Italian translations for TimesheetWeek.
- Aligne les traductions et la documentation pour les locales en_US, fr_FR, de_DE, es_ES et it_IT. / Aligns translations and documentation for en_US, fr_FR, de_DE, es_ES and it_IT locales.
- Corrige l'ajout du modèle de template par défaut pour les installations Dolibarr utilisant multicompany. / Fixes adding the default template model for Dolibarr instances using multicompany.
- Corrige le retour d'information lors de l'exécution du rappel de feuille d'heures. / Fixes the feedback returned when running the timesheet reminder.

## 1.6.1 (08/12/2025)
- Fige les heures contractuelles dans la fiche hebdomadaire et les PDF pour conserver le contexte en cas d'évolution du contrat. / Freezes contract hours in the weekly card and PDFs to preserve context when an employee contract changes.

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ TimesheetWeek ajoute une gestion hebdomadaire des feuilles de temps fidèle à l

### Traductions

Les fichiers de traduction sont disponibles dans `langs/en_US` et `langs/fr_FR`. Toute nouvelle chaîne doit être renseignée simultanément dans les deux langues conformément aux pratiques Dolibarr.
Les fichiers de traduction sont disponibles dans `langs/en_US`, `langs/fr_FR`, `langs/de_DE`, `langs/es_ES` et `langs/it_IT`. Toute nouvelle chaîne doit être renseignée simultanément dans ces langues conformément aux pratiques Dolibarr.

## 🇬🇧 Overview

Expand Down Expand Up @@ -84,7 +84,7 @@ TimesheetWeek delivers weekly timesheet management that follows Dolibarr design

### Translations

Translation sources are stored under `langs/en_US` and `langs/fr_FR`. Please keep both locales aligned for every new string to stay compatible with Dolibarr's translation workflow.
Translation sources are stored under `langs/en_US`, `langs/fr_FR`, `langs/de_DE`, `langs/es_ES` and `langs/it_IT`. Please keep these locales aligned for every new string to stay compatible with Dolibarr's translation workflow.

Other external modules are available on [Dolistore.com](https://www.dolistore.com).

Expand Down
103 changes: 58 additions & 45 deletions class/timesheetweek.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1824,53 +1824,60 @@ public function sendNativeMailNotification($triggerCode, User $actionUser, $reci
}

$methods = array('sendEmailsFromTemplate', 'sendEmailsCommon', 'sendEmailsFromModel', 'sendEmails', 'sendMails');
$message = isset($options['message']) ? (string) $options['message'] : '';
$htmlMessage = isset($options['message_html']) ? (string) $options['message_html'] : $message;
$isHtml = !empty($options['ishtml']) ? 1 : 0;

$payload = array(
'trigger' => $triggerCode,
'action' => $triggerCode,
'code' => $triggerCode,
'event' => $triggerCode,
'user' => $actionUser,
'actionuser' => $actionUser,
'actor' => $actionUser,
'currentuser' => $actionUser,
'langs' => $langs,
'language' => $langs,
'conf' => $conf,
'subject' => isset($options['subject']) ? (string) $options['subject'] : '',
'message' => isset($options['message']) ? (string) $options['message'] : '',
'content' => isset($options['message']) ? (string) $options['message'] : '',
'body' => isset($options['message']) ? (string) $options['message'] : '',
'sendto' => $sendto,
'emailto' => $sendto,
'email_to' => $sendto,
'sendtolist' => $sendto,
'sendtocc' => isset($options['cc']) ? (string) $options['cc'] : '',
'emailcc' => isset($options['cc']) ? (string) $options['cc'] : '',
'sendtobcc' => isset($options['bcc']) ? (string) $options['bcc'] : '',
'emailbcc' => isset($options['bcc']) ? (string) $options['bcc'] : '',
'replyto' => isset($options['replyto']) ? (string) $options['replyto'] : '',
'emailreplyto' => isset($options['replyto']) ? (string) $options['replyto'] : '',
'deliveryreceipt' => !empty($options['deliveryreceipt']) ? 1 : 0,
'trackid' => !empty($options['trackid']) ? (string) $options['trackid'] : 'timesheetweek-'.$this->id.'-'.$triggerCode,
'substitutions' => $substitutions,
'substitutionarray' => $substitutions,
'mail_substitutions' => $substitutions,
'array_substitutions' => $substitutions,
'files' => isset($options['files']) && is_array($options['files']) ? $options['files'] : array(),
'filearray' => isset($options['files']) && is_array($options['files']) ? $options['files'] : array(),
'filename' => isset($options['filenames']) && is_array($options['filenames']) ? $options['filenames'] : array(),
'filenameList' => isset($options['filenames']) && is_array($options['filenames']) ? $options['filenames'] : array(),
'mimetype' => isset($options['mimetypes']) && is_array($options['mimetypes']) ? $options['mimetypes'] : array(),
'mimetypeList' => isset($options['mimetypes']) && is_array($options['mimetypes']) ? $options['mimetypes'] : array(),
'joinfiles' => isset($options['files']) && is_array($options['files']) ? $options['files'] : array(),
'mode' => 'email',
'recipient' => $recipient,
'email' => $sendto,
'context' => $this->context,
'moreinval' => array('context' => $this->context, 'timesheetweek' => $this),
'params' => isset($options['params']) && is_array($options['params']) ? $options['params'] : array(),
'options' => $options,
'trigger' => $triggerCode,
'action' => $triggerCode,
'code' => $triggerCode,
'event' => $triggerCode,
'user' => $actionUser,
'actionuser' => $actionUser,
'actor' => $actionUser,
'currentuser' => $actionUser,
'langs' => $langs,
'language' => $langs,
'conf' => $conf,
'subject' => isset($options['subject']) ? (string) $options['subject'] : '',
'message' => $message,
'content' => $htmlMessage,
'body' => $htmlMessage,
'sendto' => $sendto,
'emailto' => $sendto,
'email_to' => $sendto,
'sendtolist' => $sendto,
'sendtocc' => isset($options['cc']) ? (string) $options['cc'] : '',
'emailcc' => isset($options['cc']) ? (string) $options['cc'] : '',
'sendtobcc' => isset($options['bcc']) ? (string) $options['bcc'] : '',
'emailbcc' => isset($options['bcc']) ? (string) $options['bcc'] : '',
'replyto' => isset($options['replyto']) ? (string) $options['replyto'] : '',
'emailreplyto' => isset($options['replyto']) ? (string) $options['replyto'] : '',
'deliveryreceipt' => !empty($options['deliveryreceipt']) ? 1 : 0,
'trackid' => !empty($options['trackid']) ? (string) $options['trackid'] : 'timesheetweek-'.$this->id.'-'.$triggerCode,
'substitutions' => $substitutions,
'substitutionarray' => $substitutions,
'mail_substitutions' => $substitutions,
'array_substitutions' => $substitutions,
'files' => isset($options['files']) && is_array($options['files']) ? $options['files'] : array(),
'filearray' => isset($options['files']) && is_array($options['files']) ? $options['files'] : array(),
'filename' => isset($options['filenames']) && is_array($options['filenames']) ? $options['filenames'] : array(),
'filenameList' => isset($options['filenames']) && is_array($options['filenames']) ? $options['filenames'] : array(),
'mimetype' => isset($options['mimetypes']) && is_array($options['mimetypes']) ? $options['mimetypes'] : array(),
'mimetypeList' => isset($options['mimetypes']) && is_array($options['mimetypes']) ? $options['mimetypes'] : array(),
'joinfiles' => isset($options['files']) && is_array($options['files']) ? $options['files'] : array(),
'mode' => 'email',
'recipient' => $recipient,
'email' => $sendto,
'message_html' => $htmlMessage,
'html' => $htmlMessage,
'ishtml' => $isHtml,
'msgishtml' => $isHtml,
'context' => $this->context,
'moreinval' => array('context' => $this->context, 'timesheetweek' => $this),
'params' => isset($options['params']) && is_array($options['params']) ? $options['params'] : array(),
'options' => $options,
);

foreach ($methods as $methodName) {
Expand Down Expand Up @@ -1953,6 +1960,12 @@ protected function mapMailMethodArguments(array $signature, array $payload)
$value = $payload['subject'];
} elseif ((strpos($lower, 'message') !== false || strpos($lower, 'content') !== false || strpos($lower, 'body') !== false) && isset($payload['message'])) {
$value = $payload['message'];
} elseif (strpos($lower, 'html') !== false) {
if (strpos($lower, 'message') !== false && isset($payload['message_html'])) {
$value = $payload['message_html'];
} elseif (isset($payload['ishtml'])) {
$value = $payload['ishtml'];
}
} elseif (strpos($lower, 'reply') !== false && isset($payload['replyto'])) {
$value = $payload['replyto'];
} elseif (strpos($lower, 'cc') !== false && isset($payload['sendtocc'])) {
Expand Down
2 changes: 1 addition & 1 deletion class/timesheetweek_reminder.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ public function run($dbInstance = null, $limit = 0, $forcerun = 0, array $target
$this->output = $langs->trans('TimesheetWeekReminderSendSuccess', $emailsSent);
dol_syslog(__METHOD__.' sent='.$emailsSent, LOG_DEBUG);

return $emailsSent;
return 0;
}
/**
* Send a reminder test email to the current user using the configured template.
Expand Down
2 changes: 1 addition & 1 deletion core/modules/modTimesheetWeek.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public function __construct($db)
}

// Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated', 'experimental_deprecated' or a version string like 'x.y.z'
$this->version = '1.6.1';
$this->version = '1.6.2';

// Url to the file with your last numberversion of this module
$this->url_last_version = 'https://moduleversion.lesmetiersdubatiment.fr/ver.php?m=timesheetweek';
Expand Down
Loading