mirror of
https://github.com/grocy/grocy.git
synced 2026-04-04 03:46:16 +02:00
Merge branch 'master' into pr/raupie/2135
This commit is contained in:
commit
5ad1fdc814
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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 }}">
|
||||
<i class="fa-solid fa-play"></i>
|
||||
|
|
@ -166,7 +166,13 @@
|
|||
<i class="fa-solid fa-ellipsis-v"></i>
|
||||
</button>
|
||||
<div class="table-inline-menu dropdown-menu dropdown-menu-right">
|
||||
<a class="dropdown-item reschedule-chore-button"
|
||||
<a class="dropdown-item track-chore-button now permission-CHORE_TRACK_EXECUTION"
|
||||
data-chore-id="{{ $curentChoreEntry->chore_id }}"
|
||||
type="button"
|
||||
href="#">
|
||||
<span>{{ $__t('Track chore execution now') }}</span>
|
||||
</a>
|
||||
<a class="dropdown-item reschedule-chore-button permission-CHORE_TRACK_EXECUTION"
|
||||
data-chore-id="{{ $curentChoreEntry->chore_id }}"
|
||||
type="button"
|
||||
href="#">
|
||||
|
|
|
|||
|
|
@ -39,9 +39,9 @@
|
|||
'label' => 'Tracked time',
|
||||
'format' => 'YYYY-MM-DD HH:mm:ss',
|
||||
'initWithNow' => true,
|
||||
'limitEndToNow' => true,
|
||||
'limitEndToNow' => false,
|
||||
'limitStartToNow' => false,
|
||||
'invalidFeedback' => $__t('This can only be before now')
|
||||
'invalidFeedback' => $__t('A date is required')
|
||||
))
|
||||
|
||||
@if(GROCY_FEATURE_FLAG_CHORES_ASSIGNMENTS)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user