Skip to content
Merged
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.7.2 (27/01/2026)
- Respecte MAIN_DISABLE_FORCE_SAVEAS pour les liens PDF (aperçu, téléchargement, redirections). / Honors MAIN_DISABLE_FORCE_SAVEAS for PDF links (preview, download, redirects).
- Ajuste la hauteur des lignes du tableau de synthèse PDF selon le contenu. / Adjusts summary PDF table row height based on content.
- Ajoute le scelleur et la date de scellement dans la synthèse PDF générée par la massaction. / Adds the sealer and seal date in the summary PDF generated by the mass action.
- Met à jour les métadonnées de scellement (fk_user_seal, date_seal) lors du scellement via l'action de masse. / Updates seal metadata (fk_user_seal, date_seal) during the mass action sealing.
- Met à jour les métadonnées de scellement (fk_user_seal, date_seal) lors des scellements manuels et automatiques. / Updates seal metadata (fk_user_seal, date_seal) during manual and automatic sealing.
- Met à jour les métadonnées de scellement (fk_user_seal, date_seal) lors du scellement manuel. / Updates seal metadata (fk_user_seal, date_seal) during manual sealing.
- Ajoute les colonnes fk_user_seal et date_seal sur llx_timesheet_week avec les index associés. / Adds fk_user_seal and date_seal columns on llx_timesheet_week with the related indexes.

## 1.7.1 (25/01/2026)
- Corrige un problème pouvant empecher la création des PDF chez certains utilisateurs / Fix an issue that could break the PDF's generation for some users.

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ TimesheetWeek ajoute une gestion hebdomadaire des feuilles de temps fidèle à l
- Saisie dédiée pour les salariés en forfait jour grâce à des sélecteurs Journée/Matin/Après-midi convertissant automatiquement les heures.
- Rappel hebdomadaire automatique par email configurable (activation, jour, heure, modèle) avec tâche planifiée dédiée et bouton d'envoi de test administrateur.
- Scellement automatique des feuilles approuvées après un délai configurable via une tâche planifiée Dolibarr native.
- Stocke l'utilisateur et la date de scellement dans des colonnes dédiées pour faciliter le suivi.
- Affichage des compteurs dans la liste hebdomadaire et ajout du libellé « Zone » sur chaque sélecteur quotidien pour clarifier la saisie.
- Capture les heures au contrat au moment de la soumission pour figer le calcul des heures supplémentaires et les PDF, même si le contrat salarié évolue ensuite.
- Ligne de total en bas de la liste hebdomadaire pour additionner heures, zones, paniers et afficher la colonne de date de validation.
Expand Down Expand Up @@ -57,6 +58,7 @@ TimesheetWeek delivers weekly timesheet management that follows Dolibarr design
- Dedicated input for daily rate employees with Full day/Morning/Afternoon selectors that automatically convert hours.
- Configurable automatic weekly email reminder (enablement, weekday, time, template) with a dedicated scheduled task and admin test send button.
- Automatic sealing of approved timesheets after a configurable delay through a native Dolibarr scheduled task.
- Stores seal user and seal date in dedicated columns for easier tracking.
- Counter display inside the weekly list plus a « Zone » caption on each daily selector for better input guidance.
- Snapshots contract hours at submission so overtime calculations and PDFs stay aligned even if the employee contract changes later.
- Total row at the bottom of the weekly list to sum hours, zones, meals and expose the validation date column.
Expand Down
29 changes: 29 additions & 0 deletions class/timesheetweek.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1032,6 +1032,8 @@ public function seal($user, $origin = 'manual')

$now = dol_now();
$noteUpdate = null;
$hasSealUserColumn = false;
$hasSealDateColumn = false;

if ((int) $this->status !== self::STATUS_APPROVED) {
$this->error = 'BadStatusForSeal';
Expand All @@ -1058,9 +1060,30 @@ public function seal($user, $origin = 'manual')

$this->db->begin();

// EN: Detect optional seal metadata columns.
// FR: Détecte les colonnes optionnelles de métadonnées de scellement.
$sqlCheckSealUser = "SHOW COLUMNS FROM ".MAIN_DB_PREFIX.$this->table_element." LIKE 'fk_user_seal'";
$resqlCheckSealUser = $this->db->query($sqlCheckSealUser);
if ($resqlCheckSealUser) {
$hasSealUserColumn = ($this->db->num_rows($resqlCheckSealUser) > 0);
$this->db->free($resqlCheckSealUser);
}
$sqlCheckSealDate = "SHOW COLUMNS FROM ".MAIN_DB_PREFIX.$this->table_element." LIKE 'date_seal'";
$resqlCheckSealDate = $this->db->query($sqlCheckSealDate);
if ($resqlCheckSealDate) {
$hasSealDateColumn = ($this->db->num_rows($resqlCheckSealDate) > 0);
$this->db->free($resqlCheckSealDate);
}

$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET";
$sql .= " status=".(int) self::STATUS_SEALED;
$sql .= ", tms='".$this->db->idate($now)."'";
if ($hasSealUserColumn) {
$sql .= ", fk_user_seal=".(int) $user->id;
}
if ($hasSealDateColumn) {
$sql .= ", date_seal='".$this->db->idate($now)."'";
}
if ($noteUpdate !== null) {
$sql .= ", note='".$this->db->escape($noteUpdate)."'";
}
Expand All @@ -1076,6 +1099,12 @@ public function seal($user, $origin = 'manual')
// FR : Conserve les métadonnées d'approbation tout en verrouillant la feuille.
$this->status = self::STATUS_SEALED;
$this->tms = $now;
if ($hasSealUserColumn) {
$this->fk_user_seal = (int) $user->id;
}
if ($hasSealDateColumn) {
$this->date_seal = $now;
}
if ($noteUpdate !== null) {
$this->note = $noteUpdate;
}
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.7.1';
$this->version = '1.7.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
1 change: 1 addition & 0 deletions langs/de_DE/timesheetweek.lang
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ TimesheetWeekSummaryColumnStatus = Status
TimesheetWeekSummaryColumnApprovedBy = Approved by
TimesheetWeekSummaryStatusApprovedBy = Approved by %s
TimesheetWeekSummaryStatusSealedBy = Sealed by %s
TimesheetWeekSummaryStatusSealedOn = Sealed on %s
TimesheetWeekSummaryUserTitle = %s
TimesheetWeekSummaryTotalsLabel = Totals
TimesheetWeekSummaryTableTooTall = The summary for %s contains too many rows to fit on a single page.
Expand Down
1 change: 1 addition & 0 deletions langs/en_US/timesheetweek.lang
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ TimesheetWeekSummaryColumnStatus = Status
TimesheetWeekSummaryColumnApprovedBy = Approved by
TimesheetWeekSummaryStatusApprovedBy = Approved by %s
TimesheetWeekSummaryStatusSealedBy = Sealed by %s
TimesheetWeekSummaryStatusSealedOn = Sealed on %s
TimesheetWeekSummaryUserTitle = %s
TimesheetWeekSummaryTotalsLabel = Totals
TimesheetWeekSummaryTableTooTall = The summary for %s contains too many rows to fit on a single page.
Expand Down
1 change: 1 addition & 0 deletions langs/es_ES/timesheetweek.lang
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ TimesheetWeekSummaryColumnStatus = Status
TimesheetWeekSummaryColumnApprovedBy = Approved by
TimesheetWeekSummaryStatusApprovedBy = Approved by %s
TimesheetWeekSummaryStatusSealedBy = Sealed by %s
TimesheetWeekSummaryStatusSealedOn = Sealed on %s
TimesheetWeekSummaryUserTitle = %s
TimesheetWeekSummaryTotalsLabel = Totals
TimesheetWeekSummaryTableTooTall = The summary for %s contains too many rows to fit on a single page.
Expand Down
1 change: 1 addition & 0 deletions langs/fr_FR/timesheetweek.lang
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ TimesheetWeekSummaryColumnStatus = Statut
TimesheetWeekSummaryColumnApprovedBy = Approuvé par
TimesheetWeekSummaryStatusApprovedBy = Approuvé par %s
TimesheetWeekSummaryStatusSealedBy = Scellée par %s
TimesheetWeekSummaryStatusSealedOn = Scellée le %s
TimesheetWeekSummaryUserTitle = %s
TimesheetWeekSummaryTotalsLabel = Totaux
TimesheetWeekSummaryTableTooTall = La synthèse pour %s contient trop de lignes pour tenir sur une seule page.
Expand Down
1 change: 1 addition & 0 deletions langs/it_IT/timesheetweek.lang
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ TimesheetWeekSummaryColumnStatus = Status
TimesheetWeekSummaryColumnApprovedBy = Approved by
TimesheetWeekSummaryStatusApprovedBy = Approved by %s
TimesheetWeekSummaryStatusSealedBy = Sealed by %s
TimesheetWeekSummaryStatusSealedOn = Sealed on %s
TimesheetWeekSummaryUserTitle = %s
TimesheetWeekSummaryTotalsLabel = Totals
TimesheetWeekSummaryTableTooTall = The summary for %s contains too many rows to fit on a single page.
Expand Down
Loading