diff --git a/changelog/77_UNRELEASED_xxxx-xx-xx.md b/changelog/77_UNRELEASED_xxxx-xx-xx.md index c1404296..55c6bd8b 100644 --- a/changelog/77_UNRELEASED_xxxx-xx-xx.md +++ b/changelog/77_UNRELEASED_xxxx-xx-xx.md @@ -42,7 +42,11 @@ ### Chores -- Added a new option "Swap track next schedule / track now buttons" (stock settings / top right corner settings menu) to swap the "Track next chore schedule" and "Track chore execution now" buttons/menu items on the chores overview page (defaults to disabled, so no changed behavior when not configured) +- Added the possibility to see if a scheduled schedule chore was tracked/done on time or not: + - When tracking chores, the "Next estimated tracking date" (so the current scheduled time) is now also stored in the corresponding chore journal entry and displayed in new column "Scheduled tracking time" on the chores journal page + - When the "Tracked time" is later than the "Scheduled tracking time", the corresponding chore journal entry is now highlighted in red on the chores journal page +- Added a new column "Time of tracking" on the chores journal page (displays the time when the tracking actually happened, hidden by default) +- Added a new option "Swap track next schedule / track now buttons" (chores settings / top right corner settings menu) to swap the "Track next chore schedule" / "Track chore execution now" buttons/menu items on the chores overview page (defaults to disabled, so no changed behavior when not configured) ### Calendar diff --git a/localization/strings.pot b/localization/strings.pot index 798f8fd0..652b42a0 100644 --- a/localization/strings.pot +++ b/localization/strings.pot @@ -2440,3 +2440,9 @@ msgstr "" msgid "Swap track next schedule / track now buttons" msgstr "" + +msgid "Scheduled tracking time" +msgstr "" + +msgid "Time of tracking" +msgstr "" diff --git a/migrations/0244.sql b/migrations/0244.sql new file mode 100644 index 00000000..0aace2a5 --- /dev/null +++ b/migrations/0244.sql @@ -0,0 +1,10 @@ +ALTER TABLE chores_log +ADD scheduled_execution_time DATETIME; + +DELETE FROM user_settings +WHERE key IN ( + 'datatables_state_chores-journal-table', + 'datatables_rowGroup_chores-journal-table', + 'datatables_state_products-table', + 'datatables_rowGroup_products-table' +); diff --git a/public/viewjs/choresjournal.js b/public/viewjs/choresjournal.js index dc86f2d3..8dd4b013 100644 --- a/public/viewjs/choresjournal.js +++ b/public/viewjs/choresjournal.js @@ -2,7 +2,8 @@ 'order': [[2, 'desc']], 'columnDefs': [ { 'orderable': false, 'targets': 0 }, - { 'searchable': false, "targets": 0 } + { 'searchable': false, "targets": 0 }, + { 'visible': false, 'targets': 4 } ].concat($.fn.dataTable.defaults.columnDefs) }); $('#chores-journal-table tbody').removeClass("d-none"); diff --git a/services/ChoresService.php b/services/ChoresService.php index 5ee3313a..0fcccd19 100644 --- a/services/ChoresService.php +++ b/services/ChoresService.php @@ -187,11 +187,13 @@ class ChoresService extends BaseService } } + $scheduledExecutionTime = $this->getDatabase()->chores_current()->where('chore_id = :1', $chore->id)->fetch()->next_estimated_execution_time; $logRow = $this->getDatabase()->chores_log()->createRow([ 'chore_id' => $choreId, 'tracked_time' => $trackedTime, 'done_by_user_id' => $doneBy, - 'skipped' => BoolToInt($skipped) + 'skipped' => BoolToInt($skipped), + 'scheduled_execution_time' => $scheduledExecutionTime ]); $logRow->save(); $lastInsertId = $this->getDatabase()->lastInsertId(); diff --git a/views/batteriessettings.blade.php b/views/batteriessettings.blade.php index be0008aa..918be3c5 100644 --- a/views/batteriessettings.blade.php +++ b/views/batteriessettings.blade.php @@ -13,17 +13,18 @@