diff --git a/changelog/70_UNRELEASED_xxxx.xx.xx.md b/changelog/70_UNRELEASED_xxxx.xx.xx.md index bacdb590..6c04d196 100644 --- a/changelog/70_UNRELEASED_xxxx.xx.xx.md +++ b/changelog/70_UNRELEASED_xxxx.xx.xx.md @@ -53,7 +53,10 @@ ### Chores -- xxx +- Changed the handling of the tracking buttons on the chores overview page: + - The green button now tracks an execution of the corresponding chore on the next scheduled time, rather than for now/today + - New context-/more menu option "Track chore execution now" to track an execution for now/today (so the same what the green button did before) +- Removed the limitation on the chore tracking page that the tracked time couldn't be in the future ### Calendar diff --git a/migrations/0115.sql b/migrations/0115.sql index 15636c61..20935e58 100644 --- a/migrations/0115.sql +++ b/migrations/0115.sql @@ -1 +1,3 @@ -update user_settings set key = "stock_due_soon_days" where key = "stock_expring_soon_days"; +UPDATE user_settings +SET key = 'stock_due_soon_days' +WHERE key = 'stock_expring_soon_days'; diff --git a/public/viewjs/choresoverview.js b/public/viewjs/choresoverview.js index 18040928..431e32ce 100644 --- a/public/viewjs/choresoverview.js +++ b/public/viewjs/choresoverview.js @@ -93,19 +93,20 @@ $(document).on('click', '.track-chore-button', function(e) var choreId = $(e.currentTarget).attr('data-chore-id'); var choreName = $(e.currentTarget).attr('data-chore-name'); var skipped = $(e.currentTarget).hasClass("skip"); + var now = $(e.currentTarget).hasClass("now"); Grocy.Api.Get('chores/' + choreId, function(choreDetails) { var trackedTime = moment().format('YYYY-MM-DD HH:mm:ss'); - if (skipped) + if ((skipped || !now) && choreDetails.next_estimated_execution_time != null) { trackedTime = moment(choreDetails.next_estimated_execution_time).format('YYYY-MM-DD HH:mm:ss'); } if (choreDetails.chore.track_date_only == 1) { - if (skipped) + if ((skipped || !now) && choreDetails.next_estimated_execution_time != null) { trackedTime = moment(choreDetails.next_estimated_execution_time).format('YYYY-MM-DD'); } diff --git a/public/viewjs/shoppinglist.js b/public/viewjs/shoppinglist.js index c7f5dff5..25294200 100644 --- a/public/viewjs/shoppinglist.js +++ b/public/viewjs/shoppinglist.js @@ -1,6 +1,5 @@ var shoppingListTable = $('#shoppinglist-table').DataTable({ 'order': [[1, 'asc']], - "orderFixed": [[3, 'asc']], 'columnDefs': [ { 'orderable': false, 'targets': 0 }, { 'searchable': false, "targets": 0 }, @@ -355,17 +354,24 @@ $(document).on('click', '.order-listitem-button', function(e) Grocy.Api.Put('objects/shopping_list/' + listItemId, { 'done': done }, function() { + var statusInfoCell = $("#shoppinglistitem-" + listItemId + "-status-info"); + if (done == 1) { $('#shoppinglistitem-' + listItemId + '-row').addClass("text-muted"); $('#shoppinglistitem-' + listItemId + '-row').addClass("text-strike-through"); + statusInfoCell.text(statusInfoCell.text().replace("xxUNDONExx", "xxDONExx")); } else { $('#shoppinglistitem-' + listItemId + '-row').removeClass("text-muted"); $('#shoppinglistitem-' + listItemId + '-row').removeClass("text-strike-through"); + statusInfoCell.text(statusInfoCell.text().replace("xxDONExx", "xxUNDONExx")); } + shoppingListTable.rows().invalidate().draw(false); + $("#status-filter").trigger("change"); + Grocy.FrontendHelpers.EndUiBusy(); }, function(xhr) @@ -374,20 +380,6 @@ $(document).on('click', '.order-listitem-button', function(e) console.error(xhr); } ); - - - var statusInfoCell = $("#shoppinglistitem-" + listItemId + "-status-info"); - if (done == 1) - { - statusInfoCell.text(statusInfoCell.text().replace("xxUNDONExx", "xxDONExx")); - } - else - { - statusInfoCell.text(statusInfoCell.text().replace("xxDONExx", "xxUNDONExx")); - } - shoppingListTable.rows().invalidate().draw(false); - - $("#status-filter").trigger("change"); }); function OnListItemRemoved() diff --git a/views/choresoverview.blade.php b/views/choresoverview.blade.php index e2cd0635..f16cb5a9 100644 --- a/views/choresoverview.blade.php +++ b/views/choresoverview.blade.php @@ -145,7 +145,7 @@ href="#" data-toggle="tooltip" data-placement="left" - title="{{ $__t('Track chore execution') }}" + title="{{ $__t('Track next chore schedule') }}" data-chore-id="{{ $curentChoreEntry->chore_id }}" data-chore-name="{{ FindObjectInArrayByPropertyValue($chores, 'id', $curentChoreEntry->chore_id)->name }}"> @@ -166,7 +166,13 @@