Skip to content

Commit 02ca98b

Browse files
authored
Merge pull request #124 from mapiolca/1.6.2
1.6.2
2 parents 68019a0 + 966cba9 commit 02ca98b

File tree

12 files changed

+1160
-165
lines changed

12 files changed

+1160
-165
lines changed

ChangeLog.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# CHANGELOG MODULE TIMESHEETWEEK FOR [DOLIBARR ERP CRM](https://www.dolibarr.org)
22

3+
## 1.6.2 (14/12/2025)
4+
- 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.
5+
- 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.
6+
- 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.
7+
- Ajoute les traductions de TimesheetWeek en allemand, espagnol et italien. / Adds German, Spanish and Italian translations for TimesheetWeek.
8+
- 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.
9+
- 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.
10+
- 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.
11+
312
## 1.6.1 (08/12/2025)
413
- 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.
514

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ TimesheetWeek ajoute une gestion hebdomadaire des feuilles de temps fidèle à l
4141

4242
### Traductions
4343

44-
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.
44+
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.
4545

4646
## 🇬🇧 Overview
4747

@@ -84,7 +84,7 @@ TimesheetWeek delivers weekly timesheet management that follows Dolibarr design
8484

8585
### Translations
8686

87-
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.
87+
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.
8888

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

class/timesheetweek.class.php

Lines changed: 58 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1824,53 +1824,60 @@ public function sendNativeMailNotification($triggerCode, User $actionUser, $reci
18241824
}
18251825

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

18281831
$payload = array(
1829-
'trigger' => $triggerCode,
1830-
'action' => $triggerCode,
1831-
'code' => $triggerCode,
1832-
'event' => $triggerCode,
1833-
'user' => $actionUser,
1834-
'actionuser' => $actionUser,
1835-
'actor' => $actionUser,
1836-
'currentuser' => $actionUser,
1837-
'langs' => $langs,
1838-
'language' => $langs,
1839-
'conf' => $conf,
1840-
'subject' => isset($options['subject']) ? (string) $options['subject'] : '',
1841-
'message' => isset($options['message']) ? (string) $options['message'] : '',
1842-
'content' => isset($options['message']) ? (string) $options['message'] : '',
1843-
'body' => isset($options['message']) ? (string) $options['message'] : '',
1844-
'sendto' => $sendto,
1845-
'emailto' => $sendto,
1846-
'email_to' => $sendto,
1847-
'sendtolist' => $sendto,
1848-
'sendtocc' => isset($options['cc']) ? (string) $options['cc'] : '',
1849-
'emailcc' => isset($options['cc']) ? (string) $options['cc'] : '',
1850-
'sendtobcc' => isset($options['bcc']) ? (string) $options['bcc'] : '',
1851-
'emailbcc' => isset($options['bcc']) ? (string) $options['bcc'] : '',
1852-
'replyto' => isset($options['replyto']) ? (string) $options['replyto'] : '',
1853-
'emailreplyto' => isset($options['replyto']) ? (string) $options['replyto'] : '',
1854-
'deliveryreceipt' => !empty($options['deliveryreceipt']) ? 1 : 0,
1855-
'trackid' => !empty($options['trackid']) ? (string) $options['trackid'] : 'timesheetweek-'.$this->id.'-'.$triggerCode,
1856-
'substitutions' => $substitutions,
1857-
'substitutionarray' => $substitutions,
1858-
'mail_substitutions' => $substitutions,
1859-
'array_substitutions' => $substitutions,
1860-
'files' => isset($options['files']) && is_array($options['files']) ? $options['files'] : array(),
1861-
'filearray' => isset($options['files']) && is_array($options['files']) ? $options['files'] : array(),
1862-
'filename' => isset($options['filenames']) && is_array($options['filenames']) ? $options['filenames'] : array(),
1863-
'filenameList' => isset($options['filenames']) && is_array($options['filenames']) ? $options['filenames'] : array(),
1864-
'mimetype' => isset($options['mimetypes']) && is_array($options['mimetypes']) ? $options['mimetypes'] : array(),
1865-
'mimetypeList' => isset($options['mimetypes']) && is_array($options['mimetypes']) ? $options['mimetypes'] : array(),
1866-
'joinfiles' => isset($options['files']) && is_array($options['files']) ? $options['files'] : array(),
1867-
'mode' => 'email',
1868-
'recipient' => $recipient,
1869-
'email' => $sendto,
1870-
'context' => $this->context,
1871-
'moreinval' => array('context' => $this->context, 'timesheetweek' => $this),
1872-
'params' => isset($options['params']) && is_array($options['params']) ? $options['params'] : array(),
1873-
'options' => $options,
1832+
'trigger' => $triggerCode,
1833+
'action' => $triggerCode,
1834+
'code' => $triggerCode,
1835+
'event' => $triggerCode,
1836+
'user' => $actionUser,
1837+
'actionuser' => $actionUser,
1838+
'actor' => $actionUser,
1839+
'currentuser' => $actionUser,
1840+
'langs' => $langs,
1841+
'language' => $langs,
1842+
'conf' => $conf,
1843+
'subject' => isset($options['subject']) ? (string) $options['subject'] : '',
1844+
'message' => $message,
1845+
'content' => $htmlMessage,
1846+
'body' => $htmlMessage,
1847+
'sendto' => $sendto,
1848+
'emailto' => $sendto,
1849+
'email_to' => $sendto,
1850+
'sendtolist' => $sendto,
1851+
'sendtocc' => isset($options['cc']) ? (string) $options['cc'] : '',
1852+
'emailcc' => isset($options['cc']) ? (string) $options['cc'] : '',
1853+
'sendtobcc' => isset($options['bcc']) ? (string) $options['bcc'] : '',
1854+
'emailbcc' => isset($options['bcc']) ? (string) $options['bcc'] : '',
1855+
'replyto' => isset($options['replyto']) ? (string) $options['replyto'] : '',
1856+
'emailreplyto' => isset($options['replyto']) ? (string) $options['replyto'] : '',
1857+
'deliveryreceipt' => !empty($options['deliveryreceipt']) ? 1 : 0,
1858+
'trackid' => !empty($options['trackid']) ? (string) $options['trackid'] : 'timesheetweek-'.$this->id.'-'.$triggerCode,
1859+
'substitutions' => $substitutions,
1860+
'substitutionarray' => $substitutions,
1861+
'mail_substitutions' => $substitutions,
1862+
'array_substitutions' => $substitutions,
1863+
'files' => isset($options['files']) && is_array($options['files']) ? $options['files'] : array(),
1864+
'filearray' => isset($options['files']) && is_array($options['files']) ? $options['files'] : array(),
1865+
'filename' => isset($options['filenames']) && is_array($options['filenames']) ? $options['filenames'] : array(),
1866+
'filenameList' => isset($options['filenames']) && is_array($options['filenames']) ? $options['filenames'] : array(),
1867+
'mimetype' => isset($options['mimetypes']) && is_array($options['mimetypes']) ? $options['mimetypes'] : array(),
1868+
'mimetypeList' => isset($options['mimetypes']) && is_array($options['mimetypes']) ? $options['mimetypes'] : array(),
1869+
'joinfiles' => isset($options['files']) && is_array($options['files']) ? $options['files'] : array(),
1870+
'mode' => 'email',
1871+
'recipient' => $recipient,
1872+
'email' => $sendto,
1873+
'message_html' => $htmlMessage,
1874+
'html' => $htmlMessage,
1875+
'ishtml' => $isHtml,
1876+
'msgishtml' => $isHtml,
1877+
'context' => $this->context,
1878+
'moreinval' => array('context' => $this->context, 'timesheetweek' => $this),
1879+
'params' => isset($options['params']) && is_array($options['params']) ? $options['params'] : array(),
1880+
'options' => $options,
18741881
);
18751882

18761883
foreach ($methods as $methodName) {
@@ -1953,6 +1960,12 @@ protected function mapMailMethodArguments(array $signature, array $payload)
19531960
$value = $payload['subject'];
19541961
} elseif ((strpos($lower, 'message') !== false || strpos($lower, 'content') !== false || strpos($lower, 'body') !== false) && isset($payload['message'])) {
19551962
$value = $payload['message'];
1963+
} elseif (strpos($lower, 'html') !== false) {
1964+
if (strpos($lower, 'message') !== false && isset($payload['message_html'])) {
1965+
$value = $payload['message_html'];
1966+
} elseif (isset($payload['ishtml'])) {
1967+
$value = $payload['ishtml'];
1968+
}
19561969
} elseif (strpos($lower, 'reply') !== false && isset($payload['replyto'])) {
19571970
$value = $payload['replyto'];
19581971
} elseif (strpos($lower, 'cc') !== false && isset($payload['sendtocc'])) {

class/timesheetweek_reminder.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ public function run($dbInstance = null, $limit = 0, $forcerun = 0, array $target
282282
$this->output = $langs->trans('TimesheetWeekReminderSendSuccess', $emailsSent);
283283
dol_syslog(__METHOD__.' sent='.$emailsSent, LOG_DEBUG);
284284

285-
return $emailsSent;
285+
return 0;
286286
}
287287
/**
288288
* Send a reminder test email to the current user using the configured template.

core/modules/modTimesheetWeek.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public function __construct($db)
112112
}
113113

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

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

0 commit comments

Comments
 (0)