diff --git a/changelog/66_UNRELEASED_xxxx-xx-xx.md b/changelog/66_UNRELEASED_xxxx-xx-xx.md index c43b5130..001e3753 100644 --- a/changelog/66_UNRELEASED_xxxx-xx-xx.md +++ b/changelog/66_UNRELEASED_xxxx-xx-xx.md @@ -51,8 +51,10 @@ - Until now, the schedule starting point was the first tracked execution - For all existing chores, the start date will be set to the first tracked execution time (or today, for chores which were never tracked) on migration - The `Yearly` period type has been changed to be schedule the chore on the _same day_ each year - - This period type scheduled chores 1 year _after the last execution_ before, which is also possible by using the `Daily` period type and a period interval of 365 days - all existing `Yearly` schedules will be converted to that on migration + - This period type scheduled chores 1 year _after the last execution_ before, which is also possible by using the `Daily` period type and a period interval of 365 days - All existing `Yearly` schedules will be converted to that on migration - Added a new `Hourly` period type (to schedule chores every `x` hours) +- Removed the period type `Dynamic regular`, since it's the same as `Daily` + - All existing `Dynamic regular` schedules will be converted to that on migration ### Calendar diff --git a/grocy.openapi.json b/grocy.openapi.json index c8e08c8e..5f3d186a 100644 --- a/grocy.openapi.json +++ b/grocy.openapi.json @@ -5061,7 +5061,7 @@ "type": "string", "enum": [ "manually", - "dynamic-regular", + "hourly", "daily", "weekly", "monthly" diff --git a/localization/chore_period_types.pot b/localization/chore_period_types.pot index fa3d3870..ff368b5f 100644 --- a/localization/chore_period_types.pot +++ b/localization/chore_period_types.pot @@ -15,9 +15,6 @@ msgstr "" msgid "manually" msgstr "" -msgid "dynamic-regular" -msgstr "" - msgid "daily" msgstr "" diff --git a/localization/en/chore_period_types.po b/localization/en/chore_period_types.po index 74eb949b..25a8a4a8 100644 --- a/localization/en/chore_period_types.po +++ b/localization/en/chore_period_types.po @@ -16,9 +16,6 @@ msgstr "" msgid "manually" msgstr "Manually" -msgid "dynamic-regular" -msgstr "Dynamic regular" - msgid "daily" msgstr "Daily" diff --git a/migrations/0166.sql b/migrations/0166.sql index 99f49d1a..1d96118a 100644 --- a/migrations/0166.sql +++ b/migrations/0166.sql @@ -1,3 +1,8 @@ +UPDATE chores +SET period_type = 'daily', +period_interval = period_days +WHERE period_type = 'dynamic-regular'; + DROP VIEW chores_current; CREATE VIEW chores_current AS @@ -32,7 +37,6 @@ SELECT ELSE CASE h.period_type WHEN 'manually' THEN '2999-12-31 23:59:59' - WHEN 'dynamic-regular' THEN DATETIME(MAX(l.tracked_time), '+' || CAST(h.period_days AS TEXT) || ' day') WHEN 'hourly' THEN DATETIME(MAX(l.tracked_time), '+' || CAST(h.period_interval AS TEXT) || ' hour') WHEN 'daily' THEN DATETIME(MAX(l.tracked_time), '+' || CAST(h.period_interval AS TEXT) || ' day') WHEN 'weekly' THEN ( diff --git a/public/viewjs/choreform.js b/public/viewjs/choreform.js index ff18adb2..f64f0203 100644 --- a/public/viewjs/choreform.js +++ b/public/viewjs/choreform.js @@ -152,13 +152,6 @@ $('.input-group-chore-period-type').on('change keyup', function(e) { $('#chore-schedule-info').text(__t('This means the next execution of this chore is not scheduled')); } - else if (periodType === 'dynamic-regular') - { - $("label[for='period_days']").text(__t("Period days")); - $("#period_days").attr("min", "0"); - $("#period_days").removeAttr("max"); - $('#chore-schedule-info').text(__n(periodDays, "This means the next execution of this chore is scheduled %s day after the last execution", "This means the next execution of this chore is scheduled %s days after the last execution")); - } else if (periodType === 'hourly') { $('#chore-schedule-info').text(__n(periodInterval, "This means the next execution of this chore is scheduled %s hour after the last execution", "This means the next execution of this chore is scheduled %s hours after the last execution")); diff --git a/services/ChoresService.php b/services/ChoresService.php index 70a94d0d..8589239e 100644 --- a/services/ChoresService.php +++ b/services/ChoresService.php @@ -16,8 +16,6 @@ class ChoresService extends BaseService const CHORE_PERIOD_TYPE_DAILY = 'daily'; - const CHORE_PERIOD_TYPE_DYNAMIC_REGULAR = 'dynamic-regular'; - const CHORE_PERIOD_TYPE_MANUALLY = 'manually'; const CHORE_PERIOD_TYPE_MONTHLY = 'monthly'; diff --git a/services/DemoDataGeneratorService.php b/services/DemoDataGeneratorService.php index ec4a914d..123cd0f1 100644 --- a/services/DemoDataGeneratorService.php +++ b/services/DemoDataGeneratorService.php @@ -163,8 +163,8 @@ class DemoDataGeneratorService extends BaseService INSERT INTO meal_plan(day, type, note, section_id) VALUES ('{$saturdayThisWeek}', 'note', '{$this->__t_sql('Some good snacks')}', 3); INSERT INTO chores (name, period_type, period_days) VALUES ('{$this->__t_sql('Changed towels in the bathroom')}', 'manually', 5); --1 - INSERT INTO chores (name, period_type, period_days, assignment_type, assignment_config, next_execution_assigned_to_user_id) VALUES ('{$this->__t_sql('Cleaned the kitchen floor')}', 'dynamic-regular', 7, 'random', '1,2,3,4', 1); --2 - INSERT INTO chores (name, period_type, period_days, assignment_type, assignment_config, next_execution_assigned_to_user_id) VALUES ('{$this->__t_sql('Lawn mowed in the garden')}', 'dynamic-regular', 21, 'random', '1,2,3,4', 1); --3 + INSERT INTO chores (name, period_type, period_interval, assignment_type, assignment_config, next_execution_assigned_to_user_id) VALUES ('{$this->__t_sql('Cleaned the kitchen floor')}', 'daily', 7, 'random', '1,2,3,4', 1); --2 + INSERT INTO chores (name, period_type, period_interval, assignment_type, assignment_config, next_execution_assigned_to_user_id) VALUES ('{$this->__t_sql('Lawn mowed in the garden')}', 'daily', 21, 'random', '1,2,3,4', 1); --3 INSERT INTO chores (name, period_type, period_days) VALUES ('{$this->__t_sql('The thing which happens on the 5th of every month')}', 'monthly', 5); --4 INSERT INTO chores (name, period_type) VALUES ('{$this->__t_sql('The thing which happens daily')}', 'daily'); --5 INSERT INTO chores (name, period_type, period_config) VALUES ('{$this->__t_sql('The thing which happens on Mondays and Wednesdays')}', 'weekly', 'monday,wednesday'); --6 diff --git a/views/choreform.blade.php b/views/choreform.blade.php index 62d21c47..55284c55 100644 --- a/views/choreform.blade.php +++ b/views/choreform.blade.php @@ -87,7 +87,7 @@ 'value' => $value, 'min' => '0', 'additionalCssClasses' => 'input-group-chore-period-type', - 'additionalGroupCssClasses' => 'period-type-input period-type-dynamic-regular period-type-monthly' + 'additionalGroupCssClasses' => 'period-type-input period-type-monthly' ))