bug fixes following merge

This commit is contained in:
zebardy 2020-02-19 01:32:30 +00:00
parent 40631ff60d
commit 5402319a2c
5 changed files with 21 additions and 20 deletions

View File

@ -38,19 +38,4 @@ class BaseApiController extends BaseController
'error_message' => $errorMessage 'error_message' => $errorMessage
)); ));
} }
protected function getApiKeyService()
{
return ApiKeyService::getInstance();
}
protected function getChoresService()
{
return ChoresService::getInstance();
}
protected function getFilesService()
{
return FilesService::getInstance();
}
} }

View File

@ -13,6 +13,9 @@ use \Grocy\Services\CalendarService;
use \Grocy\Services\SessionService; use \Grocy\Services\SessionService;
use \Grocy\Services\RecipesService; use \Grocy\Services\RecipesService;
use \Grocy\Services\TasksService; use \Grocy\Services\TasksService;
use \Grocy\Services\FilesService;
use \Grocy\Services\ChoresService;
use \Grocy\Services\ApiKeyService;
class BaseController class BaseController
{ {
@ -144,12 +147,25 @@ class BaseController
return UsersService::getInstance(); return UsersService::getInstance();
} }
private $userfieldsService = null;
protected function getUserfieldsService() protected function getUserfieldsService()
{ {
return UserfieldsService::getInstance(); return UserfieldsService::getInstance();
} }
protected function getApiKeyService()
{
return ApiKeyService::getInstance();
}
protected function getChoresService()
{
return ChoresService::getInstance();
}
protected function getFilesService()
{
return FilesService::getInstance();
}
protected $AppContainer; protected $AppContainer;
} }

View File

@ -77,7 +77,7 @@ class RecipesController extends BaseController
'recipe' => $this->getDatabase()->recipes($recipeId), 'recipe' => $this->getDatabase()->recipes($recipeId),
'recipePositions' => $this->getDatabase()->recipes_pos()->where('recipe_id', $recipeId), 'recipePositions' => $this->getDatabase()->recipes_pos()->where('recipe_id', $recipeId),
'mode' => 'edit', 'mode' => 'edit',
'products' => $this->getDatabase()->products()->orderBy('name'),, 'products' => $this->getDatabase()->products()->orderBy('name'),
'quantityunits' => $this->getDatabase()->quantity_units(), 'quantityunits' => $this->getDatabase()->quantity_units(),
'recipePositionsResolved' => $this->getRecipesService()->GetRecipesPosResolved(), 'recipePositionsResolved' => $this->getRecipesService()->GetRecipesPosResolved(),
'recipesResolved' => $this->getRecipesService()->GetRecipesResolved(), 'recipesResolved' => $this->getRecipesService()->GetRecipesResolved(),

View File

@ -65,7 +65,7 @@ class StockController extends BaseController
public function Transfer(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args) public function Transfer(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
{ {
return $this->View->render($response, 'transfer', [ return $this->renderPage($response, 'transfer', [
'products' => $this->getDatabase()->products()->orderBy('name'), 'products' => $this->getDatabase()->products()->orderBy('name'),
'recipes' => $this->getDatabase()->recipes()->orderBy('name'), 'recipes' => $this->getDatabase()->recipes()->orderBy('name'),
'locations' => $this->getDatabase()->locations()->orderBy('name') 'locations' => $this->getDatabase()->locations()->orderBy('name')

View File

@ -107,7 +107,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' => $this->getUrlManager()->ConstructUrl('/mealplan' . '?week=' . FindObjectInArrayByPropertyValue($recipes, 'id', $recipeOfCurrentDay->recipe_id)->name) 'description' => $this->UrlManager()->ConstructUrl('/mealplan' . '?week=' . FindObjectInArrayByPropertyValue($recipes, 'id', $recipeOfCurrentDay->recipe_id)->name)
); );
} }
} }