mirror of
https://github.com/grocy/grocy.git
synced 2025-08-16 18:54:35 +00:00
Make it possible to add notes to meal plan (days) (closes #477)
This commit is contained in:
@@ -132,8 +132,20 @@ class RecipesController extends BaseController
|
||||
public function MealPlan(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
$recipes = $this->Database->recipes()->where('type', RecipesService::RECIPE_TYPE_NORMAL)->fetchAll();
|
||||
|
||||
$events = array();
|
||||
|
||||
foreach($this->Database->meal_plan_notes() as $mealPlanNote)
|
||||
{
|
||||
$events[] = array(
|
||||
'id' => intval($mealPlanNote['id']) * -1,
|
||||
'title' => '',
|
||||
'start' => $mealPlanNote['day'],
|
||||
'date_format' => 'date',
|
||||
'note' => json_encode($mealPlanNote),
|
||||
'type' => 'note'
|
||||
);
|
||||
}
|
||||
|
||||
foreach($this->Database->meal_plan() as $mealPlanEntry)
|
||||
{
|
||||
$recipe = FindObjectInArrayByPropertyValue($recipes, 'id', $mealPlanEntry['recipe_id']);
|
||||
@@ -149,7 +161,8 @@ class RecipesController extends BaseController
|
||||
'start' => $mealPlanEntry['day'],
|
||||
'date_format' => 'date',
|
||||
'recipe' => json_encode($recipe),
|
||||
'mealPlanEntry' => json_encode($mealPlanEntry)
|
||||
'mealPlanEntry' => json_encode($mealPlanEntry),
|
||||
'type' => 'recipe'
|
||||
);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user