From c6ae8cc34838dcba9070e3fae75a78ce4b368f95 Mon Sep 17 00:00:00 2001 From: kriddles <54413450+kriddles@users.noreply.github.com> Date: Sat, 12 Oct 2019 03:16:06 -0500 Subject: [PATCH] Calendar descriptions (iCal export) (#417) * controllers CalendarApiController: setDescription for events * services CalendarService: include link to mealplan in calendar descriptions --- controllers/CalendarApiController.php | 1 + services/CalendarService.php | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/controllers/CalendarApiController.php b/controllers/CalendarApiController.php index a641a553..674ca0aa 100644 --- a/controllers/CalendarApiController.php +++ b/controllers/CalendarApiController.php @@ -38,6 +38,7 @@ class CalendarApiController extends BaseApiController $vEvent->setDtStart($date) ->setDtEnd($date) ->setSummary($event['title']) + ->setDescription($event['description']) ->setNoTime($event['date_format'] === 'date') ->setUseTimezone(true); diff --git a/services/CalendarService.php b/services/CalendarService.php index 8f05e2eb..0af223d1 100644 --- a/services/CalendarService.php +++ b/services/CalendarService.php @@ -99,7 +99,8 @@ class CalendarService extends BaseService $mealPlanRecipeEvents[] = array( 'title' => $titlePrefix . FindObjectInArrayByPropertyValue($recipes, 'id', $recipeOfCurrentDay->includes_recipe_id)->name, 'start' => FindObjectInArrayByPropertyValue($recipes, 'id', $recipeOfCurrentDay->recipe_id)->name, - 'date_format' => 'date' + 'date_format' => 'date', + 'description' => GROCY_BASE_URL . '/mealplan' . '?week=' . FindObjectInArrayByPropertyValue($recipes, 'id', $recipeOfCurrentDay->recipe_id)->name ); } }