diff --git a/changelog/62_UNRELEASED_xxxx-xx-xx.md b/changelog/62_UNRELEASED_xxxx-xx-xx.md
index 765cbd27..857a9369 100644
--- a/changelog/62_UNRELEASED_xxxx-xx-xx.md
+++ b/changelog/62_UNRELEASED_xxxx-xx-xx.md
@@ -70,7 +70,10 @@
- This happens automatically on consuming a recipe/product from the meal plan page
- Fixed that stock fulfillment checking used the desired servings of the recipe (those selected on the recipes page, not them from the meal plan entry)
-### Chores fixes
+### Chores improvements(fixes
+- It's now possible to track any addtional info on a chore execution by using Userfields
+ - => Configure the desired Userfields for the entity `chores_log`
+ - => The on chore execution tracking entered information is then visible on the corresponding chore journal entry
- Fixed that tracking chores with "Done by" a different user was not possible
### Userfield fixes
diff --git a/controllers/ChoresController.php b/controllers/ChoresController.php
index 403e8e9d..9a8e621a 100644
--- a/controllers/ChoresController.php
+++ b/controllers/ChoresController.php
@@ -62,7 +62,9 @@ class ChoresController extends BaseController
return $this->renderPage($response, 'choresjournal', [
'choresLog' => $this->getDatabase()->chores_log()->orderBy('tracked_time', 'DESC'),
'chores' => $this->getDatabase()->chores()->where('active = 1')->orderBy('name', 'COLLATE NOCASE'),
- 'users' => $this->getDatabase()->users()->orderBy('username')
+ 'users' => $this->getDatabase()->users()->orderBy('username'),
+ 'userfields' => $this->getUserfieldsService()->GetFields('chores_log'),
+ 'userfieldValues' => $this->getUserfieldsService()->GetAllValues('chores_log')
]);
}
@@ -85,7 +87,8 @@ class ChoresController extends BaseController
{
return $this->renderPage($response, 'choretracking', [
'chores' => $this->getDatabase()->chores()->where('active = 1')->orderBy('name', 'COLLATE NOCASE'),
- 'users' => $this->getDatabase()->users()->orderBy('username')
+ 'users' => $this->getDatabase()->users()->orderBy('username'),
+ 'userfields' => $this->getUserfieldsService()->GetFields('chores_log'),
]);
}
diff --git a/grocy.openapi.json b/grocy.openapi.json
index 07e84b26..8d8aeccc 100644
--- a/grocy.openapi.json
+++ b/grocy.openapi.json
@@ -5447,7 +5447,7 @@
"stock_log",
"stock",
"stock_current_locations",
- "api_keys"
+ "chores_log"
]
},
"ExposedEntityNoListing": {
@@ -5462,7 +5462,8 @@
"stock_log",
"api_keys",
"stock",
- "stock_current_locations"
+ "stock_current_locations",
+ "chores_log"
]
},
"ExposedEntityNoDelete": {
@@ -5470,7 +5471,8 @@
"enum": [
"stock_log",
"stock",
- "stock_current_locations"
+ "stock_current_locations",
+ "chores_log"
]
},
"ExposedEntityEditRequiresAdmin": {
diff --git a/public/viewjs/choretracking.js b/public/viewjs/choretracking.js
index 40d2add9..eaf23ea7 100644
--- a/public/viewjs/choretracking.js
+++ b/public/viewjs/choretracking.js
@@ -16,16 +16,20 @@
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");
- toastr.success(__t('Tracked execution of chore %1$s on %2$s', choreDetails.chore.name, Grocy.Components.DateTimePicker.GetValue()) + '
' + __t("Undo") + '');
- Grocy.Components.ChoreCard.Refresh($('#chore_id').val());
+ Grocy.EditObjectId = result.id;
+ Grocy.Components.UserfieldsForm.Save(function()
+ {
+ Grocy.FrontendHelpers.EndUiBusy("choretracking-form");
+ toastr.success(__t('Tracked execution of chore %1$s on %2$s', choreDetails.chore.name, Grocy.Components.DateTimePicker.GetValue()) + '
' + __t("Undo") + '');
+ Grocy.Components.ChoreCard.Refresh($('#chore_id').val());
- $('#chore_id').val('');
- $('#chore_id_text_input').focus();
- $('#chore_id_text_input').val('');
- Grocy.Components.DateTimePicker.SetValue(moment().format('YYYY-MM-DD HH:mm:ss'));
- $('#chore_id_text_input').trigger('change');
- Grocy.FrontendHelpers.ValidateForm('choretracking-form');
+ $('#chore_id').val('');
+ $('#chore_id_text_input').focus();
+ $('#chore_id_text_input').val('');
+ Grocy.Components.DateTimePicker.SetValue(moment().format('YYYY-MM-DD HH:mm:ss'));
+ $('#chore_id_text_input').trigger('change');
+ Grocy.FrontendHelpers.ValidateForm('choretracking-form');
+ });
},
function(xhr)
{
diff --git a/services/UserfieldsService.php b/services/UserfieldsService.php
index 1c7f8c4c..75161e5a 100644
--- a/services/UserfieldsService.php
+++ b/services/UserfieldsService.php
@@ -59,7 +59,9 @@ class UserfieldsService extends BaseService
$userEntities[] = 'userentity-' . $userentity->name;
}
- return array_merge($exposedDefaultEntities, $userEntities, $specialEntities);
+ $entitiesSorted = array_merge($exposedDefaultEntities, $userEntities, $specialEntities);
+ sort($entitiesSorted);
+ return $entitiesSorted;
}
public function GetField($fieldId)
diff --git a/views/choresjournal.blade.php b/views/choresjournal.blade.php
index 714c688c..8f6f9d99 100644
--- a/views/choresjournal.blade.php
+++ b/views/choresjournal.blade.php
@@ -77,6 +77,10 @@
@if(GROCY_FEATURE_FLAG_CHORES_ASSIGNMENTS)