Show the meal plan section for a meal plan entry types on the calendar (references #1582)

This commit is contained in:
Bernd Bestel 2022-02-08 19:09:17 +01:00
parent 66cf7e4ffa
commit 411dbabc90
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
2 changed files with 16 additions and 3 deletions

View File

@ -79,5 +79,5 @@
### API
- The API endpoint `/stock/shoppinglist/clear` has now a new optional request body parameter `done_only` (to only remove done items from the given shopping list, defaults to `false`)
- The API endpoint `/chores/{choreId}/execute` has now a new optional request body parameter `skipped` (to skip the next chore schedule)
- The API endpoint `/chores/{choreId}/execute` has now a new optional request body parameter `skipped` (to skip the next chore schedule, defaults to `false`)
- Fixed that the barcode lookup for the "Stock by-barcode" API endpoints was case sensitive

View File

@ -144,8 +144,15 @@ class CalendarService extends BaseService
$dateFormat = 'datetime';
}
$titlePrefix2 = '';
if (!empty($section->name))
{
$titlePrefix2 = $section->name . ': ';
}
$mealPlanNotesEvents[] = [
'title' => $titlePrefix . $mealPlanDayNote->note,
'title' => $titlePrefix . $titlePrefix2 . $mealPlanDayNote->note,
'start' => $start,
'date_format' => $dateFormat
];
@ -165,8 +172,14 @@ class CalendarService extends BaseService
$dateFormat = 'datetime';
}
$titlePrefix2 = '';
if (!empty($section->name))
{
$titlePrefix2 = $section->name . ': ';
}
$mealPlanProductEvents[] = [
'title' => $titlePrefix . FindObjectInArrayByPropertyValue($products, 'id', $mealPlanDayProduct->product_id)->name,
'title' => $titlePrefix . $titlePrefix2 . FindObjectInArrayByPropertyValue($products, 'id', $mealPlanDayProduct->product_id)->name,
'start' => $start,
'date_format' => $dateFormat
];