mirror of
https://github.com/grocy/grocy.git
synced 2025-08-22 21:10:47 +00:00
Added a chore start date option (closes #1612)
This commit is contained in:
@@ -8,6 +8,8 @@
|
||||
}
|
||||
|
||||
var jsonData = $('#chore-form').serializeJSON();
|
||||
jsonData.start_date = Grocy.Components.DateTimePicker.GetValue();
|
||||
|
||||
if (Grocy.FeatureFlags.GROCY_FEATURE_FLAG_CHORES_ASSIGNMENTS)
|
||||
{
|
||||
jsonData.assignment_config = $("#assignment_config").val().join(",");
|
||||
@@ -107,6 +109,23 @@ Grocy.Components.UserfieldsForm.Load();
|
||||
$('#name').focus();
|
||||
Grocy.FrontendHelpers.ValidateForm('chore-form');
|
||||
|
||||
if (Grocy.EditMode == "edit")
|
||||
{
|
||||
Grocy.Api.Get('objects/chores_log?limit=1&query[]=chore_id=' + Grocy.EditObjectId,
|
||||
function(journalEntries)
|
||||
{
|
||||
if (journalEntries.length > 0)
|
||||
{
|
||||
$(".datetimepicker-input").attr("disabled", "");
|
||||
}
|
||||
},
|
||||
function(xhr)
|
||||
{
|
||||
console.error(xhr);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
setTimeout(function()
|
||||
{
|
||||
$(".input-group-chore-period-type").trigger("change");
|
||||
|
@@ -5,6 +5,11 @@ Grocy.Components.ChoreCard.Refresh = function(choreId)
|
||||
Grocy.Api.Get('chores/' + choreId,
|
||||
function(choreDetails)
|
||||
{
|
||||
if (choreDetails.last_done_by == null)
|
||||
{
|
||||
choreDetails.last_done_by = {};
|
||||
}
|
||||
|
||||
$('#chorecard-chore-name').text(choreDetails.chore.name);
|
||||
$('#chorecard-chore-description').html(nl2br(choreDetails.chore.description));
|
||||
$('#chorecard-chore-last-tracked').text((choreDetails.last_tracked || __t('never')));
|
||||
|
@@ -142,7 +142,7 @@ $('.save-product-button').on('click', function(e)
|
||||
|
||||
if (Grocy.EditMode == "edit")
|
||||
{
|
||||
Grocy.Api.Get('objects/stock_log?query[]=product_id=' + Grocy.EditObjectId,
|
||||
Grocy.Api.Get('objects/stock_log?limit=1&query[]=product_id=' + Grocy.EditObjectId,
|
||||
function(productJournalEntries)
|
||||
{
|
||||
if (productJournalEntries.length == 0)
|
||||
|
Reference in New Issue
Block a user