mirror of
https://github.com/grocy/grocy.git
synced 2025-08-21 04:43:32 +00:00
Always use the proper URL for meal plan links in iCal calendar export (references #417)
This commit is contained in:
@@ -7,6 +7,7 @@ use \Grocy\Services\TasksService;
|
|||||||
use \Grocy\Services\ChoresService;
|
use \Grocy\Services\ChoresService;
|
||||||
use \Grocy\Services\BatteriesService;
|
use \Grocy\Services\BatteriesService;
|
||||||
use \Grocy\Services\UsersService;
|
use \Grocy\Services\UsersService;
|
||||||
|
use \Grocy\Helpers\UrlManager;
|
||||||
|
|
||||||
class CalendarService extends BaseService
|
class CalendarService extends BaseService
|
||||||
{
|
{
|
||||||
@@ -17,12 +18,14 @@ class CalendarService extends BaseService
|
|||||||
$this->TasksService = new TasksService();
|
$this->TasksService = new TasksService();
|
||||||
$this->ChoresService = new ChoresService();
|
$this->ChoresService = new ChoresService();
|
||||||
$this->BatteriesService = new BatteriesService();
|
$this->BatteriesService = new BatteriesService();
|
||||||
|
$this->UrlManager = new UrlManager(GROCY_BASE_URL);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected $StockService;
|
protected $StockService;
|
||||||
protected $TasksService;
|
protected $TasksService;
|
||||||
protected $ChoresService;
|
protected $ChoresService;
|
||||||
protected $BatteriesService;
|
protected $BatteriesService;
|
||||||
|
protected $UrlManager;
|
||||||
|
|
||||||
public function GetEvents()
|
public function GetEvents()
|
||||||
{
|
{
|
||||||
@@ -100,7 +103,7 @@ class CalendarService extends BaseService
|
|||||||
'title' => $titlePrefix . FindObjectInArrayByPropertyValue($recipes, 'id', $recipeOfCurrentDay->includes_recipe_id)->name,
|
'title' => $titlePrefix . FindObjectInArrayByPropertyValue($recipes, 'id', $recipeOfCurrentDay->includes_recipe_id)->name,
|
||||||
'start' => FindObjectInArrayByPropertyValue($recipes, 'id', $recipeOfCurrentDay->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
|
'description' => $this->UrlManager->ConstructUrl('/mealplan' . '?week=' . FindObjectInArrayByPropertyValue($recipes, 'id', $recipeOfCurrentDay->recipe_id)->name)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user