mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 17:45:39 +00:00
Added a sub feature flag to disable chore assignments when not needed
This commit is contained in:
parent
cf3217ada4
commit
cf2e6f1039
@ -9,6 +9,9 @@
|
||||
- It's now possible to display a recipe directly from the meal plan (new "eye button") (thanks @kriddles)
|
||||
- Improved the responsiveness of the meal plan and calendar page by automatically switching to a day calendar view on smaller screens (thanks for the idea @kriddles)
|
||||
|
||||
### Chores improvements
|
||||
- There is now a new sub feature flag `FEATURE_FLAG_CHORES_ASSIGNMENTS` to disable chore assignments if you don't need them (defaults to `true`, so no changed behavior when not configured)
|
||||
|
||||
### Calendar improvements
|
||||
- The calendar now also contains all planned recipes from the meal plan on the corresponding day
|
||||
- Improved that dates in the iCal calendar export now include the server timezone
|
||||
|
@ -124,6 +124,7 @@ Setting('FEATURE_FLAG_STOCK_PRICE_TRACKING', true);
|
||||
Setting('FEATURE_FLAG_STOCK_LOCATION_TRACKING', true);
|
||||
Setting('FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING', true);
|
||||
Setting('FEATURE_FLAG_STOCK_PRODUCT_OPENED_TRACKING', true);
|
||||
Setting('FEATURE_FLAG_CHORES_ASSIGNMENTS', true);
|
||||
|
||||
|
||||
# Feature settings
|
||||
|
@ -3,7 +3,11 @@
|
||||
e.preventDefault();
|
||||
|
||||
var jsonData = $('#chore-form').serializeJSON({ checkboxUncheckedValue: "0" });
|
||||
if (Grocy.FeatureFlags.GROCY_FEATURE_FLAG_CHORES_ASSIGNMENTS)
|
||||
{
|
||||
jsonData.assignment_config = $("#assignment_config").val().join(",");
|
||||
}
|
||||
|
||||
Grocy.FrontendHelpers.BeginUiBusy("chore-form");
|
||||
|
||||
if (Grocy.EditMode === 'create')
|
||||
|
@ -8,7 +8,7 @@
|
||||
Grocy.Api.Get('chores/' + jsonForm.chore_id,
|
||||
function (choreDetails)
|
||||
{
|
||||
Grocy.Api.Post('chores/' + jsonForm.chore_id + '/execute', { 'tracked_time': Grocy.Components.DateTimePicker.GetValue(), 'done_by': Grocy.Components.UserPicker.GetValue() },
|
||||
Grocy.Api.Post('chores/' + jsonForm.chore_id + '/execute', { 'tracked_time': Grocy.Components.DateTimePicker.GetValue(), 'done_by': $("#user_id").val() },
|
||||
function(result)
|
||||
{
|
||||
Grocy.FrontendHelpers.EndUiBusy("choretracking-form");
|
||||
|
@ -86,6 +86,7 @@
|
||||
|
||||
<input type="hidden" id="period_config" name="period_config" value="@if($mode == 'edit'){{ $chore->period_config }}@endif">
|
||||
|
||||
@if(GROCY_FEATURE_FLAG_CHORES_ASSIGNMENTS)
|
||||
<div class="form-group">
|
||||
<label for="assignment_type">{{ $__t('Assignment type') }} <span id="chore-assignment-type-info" class="small text-muted"></span></label>
|
||||
<select required class="form-control input-group-chore-assignment-type" id="assignment_type" name="assignment_type">
|
||||
@ -105,6 +106,10 @@
|
||||
</select>
|
||||
<div class="invalid-feedback">{{ $__t('This assignment type requires that at least one is assigned') }}</div>
|
||||
</div>
|
||||
@else
|
||||
<input type="hidden" id="assignment_type" name="assignment_type" value="{{ \Grocy\Services\ChoresService::CHORE_ASSIGNMENT_TYPE_NO_ASSIGNMENT }}">
|
||||
<input type="hidden" id="assignment_config" name="assignment_config" value="">
|
||||
@endif
|
||||
|
||||
<div class="form-group">
|
||||
<div class="form-check">
|
||||
|
@ -35,7 +35,9 @@
|
||||
<th class="border-right"></th>
|
||||
<th>{{ $__t('Chore') }}</th>
|
||||
<th>{{ $__t('Tracked time') }}</th>
|
||||
@if(GROCY_FEATURE_FLAG_CHORES_ASSIGNMENTS)
|
||||
<th>{{ $__t('Done by') }}</th>
|
||||
@endif
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="d-none">
|
||||
@ -58,6 +60,7 @@
|
||||
<span>{{ $choreLogEntry->tracked_time }}</span>
|
||||
<time class="timeago timeago-contextual @if(FindObjectInArrayByPropertyValue($chores, 'id', $choreLogEntry->chore_id)->track_date_only == 1) timeago-date-only @endif" datetime="{{ $choreLogEntry->tracked_time }}"></time>
|
||||
</td>
|
||||
@if(GROCY_FEATURE_FLAG_CHORES_ASSIGNMENTS)
|
||||
<td>
|
||||
@if ($choreLogEntry->done_by_user_id !== null && !empty($choreLogEntry->done_by_user_id))
|
||||
{{ GetUserDisplayName(FindObjectInArrayByPropertyValue($users, 'id', $choreLogEntry->done_by_user_id)) }}
|
||||
@ -65,6 +68,7 @@
|
||||
{{ $__t('Unknown') }}
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
|
@ -18,7 +18,9 @@
|
||||
</h1>
|
||||
<p id="info-due-chores" data-status-filter="duesoon" data-next-x-days="{{ $nextXDays }}" class="btn btn-lg btn-warning status-filter-button responsive-button mr-2"></p>
|
||||
<p id="info-overdue-chores" data-status-filter="overdue" class="btn btn-lg btn-danger status-filter-button responsive-button mr-2"></p>
|
||||
@if(GROCY_FEATURE_FLAG_CHORES_ASSIGNMENTS)
|
||||
<p id="info-assigned-to-me-chores" data-user-filter="xx{{ GROCY_USER_ID }}xx" class="btn btn-lg btn-secondary user-filter-button responsive-button"></p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -35,6 +37,7 @@
|
||||
<option class="bg-danger" value="overdue">{{ $__t('Overdue') }}</option>
|
||||
</select>
|
||||
</div>
|
||||
@if(GROCY_FEATURE_FLAG_CHORES_ASSIGNMENTS)
|
||||
<div class="col-xs-12 col-md-6 col-xl-3">
|
||||
<label for="user-filter">{{ $__t('Filter by assignment') }}</label> <i class="fas fa-filter"></i>
|
||||
<select class="form-control input-group-filter" id="user-filter">
|
||||
@ -44,6 +47,7 @@
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
@ -55,9 +59,13 @@
|
||||
<th>{{ $__t('Chore') }}</th>
|
||||
<th>{{ $__t('Next estimated tracking') }}</th>
|
||||
<th>{{ $__t('Last tracked') }}</th>
|
||||
@if(GROCY_FEATURE_FLAG_CHORES_ASSIGNMENTS)
|
||||
<th>{{ $__t('Assigned to') }}</th>
|
||||
@endif
|
||||
<th class="d-none">Hidden status</th>
|
||||
@if(GROCY_FEATURE_FLAG_CHORES_ASSIGNMENTS)
|
||||
<th class="d-none">Hidden assigned to user id</th>
|
||||
@endif
|
||||
|
||||
@include('components.userfields_thead', array(
|
||||
'userfields' => $userfields
|
||||
@ -106,6 +114,7 @@
|
||||
<span id="chore-{{ $curentChoreEntry->chore_id }}-last-tracked-time">{{ $curentChoreEntry->last_tracked_time }}</span>
|
||||
<time id="chore-{{ $curentChoreEntry->chore_id }}-last-tracked-time-timeago" class="timeago timeago-contextual @if($curentChoreEntry->track_date_only == 1) timeago-date-only @endif" datetime="{{ $curentChoreEntry->last_tracked_time }}"></time>
|
||||
</td>
|
||||
@if(GROCY_FEATURE_FLAG_CHORES_ASSIGNMENTS)
|
||||
<td>
|
||||
<span id="chore-{{ $curentChoreEntry->chore_id }}-next-execution-assigned-user">
|
||||
@if(!empty($curentChoreEntry->next_execution_assigned_to_user_id))
|
||||
@ -115,14 +124,17 @@
|
||||
@endif
|
||||
</span>
|
||||
</td>
|
||||
@endif
|
||||
<td id="chore-{{ $curentChoreEntry->chore_id }}-due-filter-column" class="d-none">
|
||||
@if(FindObjectInArrayByPropertyValue($chores, 'id', $curentChoreEntry->chore_id)->period_type !== \Grocy\Services\ChoresService::CHORE_PERIOD_TYPE_MANUALLY && $curentChoreEntry->next_estimated_execution_time < date('Y-m-d H:i:s')) overdue @elseif(FindObjectInArrayByPropertyValue($chores, 'id', $curentChoreEntry->chore_id)->period_type !== \Grocy\Services\ChoresService::CHORE_PERIOD_TYPE_MANUALLY && $curentChoreEntry->next_estimated_execution_time < date('Y-m-d H:i:s', strtotime("+$nextXDays days"))) duesoon @endif
|
||||
</td>
|
||||
@if(GROCY_FEATURE_FLAG_CHORES_ASSIGNMENTS)
|
||||
<td class="d-none">
|
||||
@if(!empty($curentChoreEntry->next_execution_assigned_to_user_id))
|
||||
xx{{ $curentChoreEntry->next_execution_assigned_to_user_id }}xx
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
|
||||
@include('components.userfields_tbody', array(
|
||||
'userfields' => $userfields,
|
||||
|
@ -32,12 +32,16 @@
|
||||
'invalidFeedback' => $__t('This can only be before now')
|
||||
))
|
||||
|
||||
@if(GROCY_FEATURE_FLAG_CHORES_ASSIGNMENTS)
|
||||
@include('components.userpicker', array(
|
||||
'label' => 'Done by',
|
||||
'users' => $users,
|
||||
'nextInputSelector' => '#user_id',
|
||||
'prefillByUserId' => GROCY_USER_ID
|
||||
))
|
||||
@else
|
||||
<input type="hidden" id="user_id" name="user_id" value="{{ GROCY_USER_ID }}">
|
||||
@endif
|
||||
|
||||
<button id="save-choretracking-button" class="btn btn-success">{{ $__t('OK') }}</button>
|
||||
|
||||
|
@ -13,6 +13,8 @@
|
||||
<h3><span id="chorecard-chore-name"></span></h3>
|
||||
<strong>{{ $__t('Tracked count') }}:</strong> <span id="chorecard-chore-tracked-count" class="locale-number locale-number-generic"></span><br>
|
||||
<strong>{{ $__t('Last tracked') }}:</strong> <span id="chorecard-chore-last-tracked"></span> <time id="chorecard-chore-last-tracked-timeago" class="timeago timeago-contextual"></time><br>
|
||||
@if(GROCY_FEATURE_FLAG_CHORES_ASSIGNMENTS)
|
||||
<strong>{{ $__t('Last done by') }}:</strong> <span id="chorecard-chore-last-done-by"></span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user