mirror of
https://github.com/grocy/grocy.git
synced 2025-04-28 17:23:56 +00:00
Upgrade Slim Framework to v4 (closes #561)
This commit is contained in:
parent
d56aebc9b8
commit
d4fa1a64c2
57
app.php
57
app.php
@ -1,10 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use \Psr\Http\Message\ServerRequestInterface as Request;
|
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||||
use \Psr\Http\Message\ResponseInterface as Response;
|
use Psr\Http\Message\ResponseInterface as Response;
|
||||||
|
use Psr\Container\ContainerInterface as Container;
|
||||||
|
use Slim\Factory\AppFactory;
|
||||||
|
|
||||||
use \Grocy\Helpers\UrlManager;
|
use Grocy\Helpers\UrlManager;
|
||||||
use \Grocy\Controllers\LoginController;
|
use Grocy\Controllers\LoginController;
|
||||||
|
|
||||||
// Definitions for embedded mode
|
// Definitions for embedded mode
|
||||||
if (file_exists(__DIR__ . '/embedded.txt'))
|
if (file_exists(__DIR__ . '/embedded.txt'))
|
||||||
@ -42,31 +44,32 @@ if (GROCY_DISABLE_AUTH === true)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Setup base application
|
// Setup base application
|
||||||
$appContainer = new \Slim\Container([
|
AppFactory::setContainer(new DI\Container());
|
||||||
'settings' => [
|
$app = AppFactory::create();
|
||||||
'displayErrorDetails' => true,
|
|
||||||
'determineRouteBeforeAppMiddleware' => true
|
$container = $app->getContainer();
|
||||||
],
|
$container->set('view', function(Container $container)
|
||||||
'view' => function($container)
|
{
|
||||||
{
|
return new Slim\Views\Blade(__DIR__ . '/views', GROCY_DATAPATH . '/viewcache');
|
||||||
return new \Slim\Views\Blade(__DIR__ . '/views', GROCY_DATAPATH . '/viewcache');
|
});
|
||||||
},
|
$container->set('LoginControllerInstance', function(Container $container)
|
||||||
'LoginControllerInstance' => function($container)
|
{
|
||||||
{
|
return new LoginController($container, 'grocy_session');
|
||||||
return new LoginController($container, 'grocy_session');
|
});
|
||||||
},
|
$container->set('UrlManager', function(Container $container)
|
||||||
'UrlManager' => function($container)
|
{
|
||||||
{
|
return new UrlManager(GROCY_BASE_URL);
|
||||||
return new UrlManager(GROCY_BASE_URL);
|
});
|
||||||
},
|
$container->set('ApiKeyHeaderName', function(Container $container)
|
||||||
'ApiKeyHeaderName' => function($container)
|
{
|
||||||
{
|
return 'GROCY-API-KEY';
|
||||||
return 'GROCY-API-KEY';
|
});
|
||||||
}
|
|
||||||
]);
|
|
||||||
$app = new \Slim\App($appContainer);
|
|
||||||
|
|
||||||
// Load routes from separate file
|
// Load routes from separate file
|
||||||
require_once __DIR__ . '/routes.php';
|
require_once __DIR__ . '/routes.php';
|
||||||
|
|
||||||
|
// Add default middleware
|
||||||
|
$app->addRoutingMiddleware();
|
||||||
|
$app->addErrorMiddleware(true, false, false);
|
||||||
|
|
||||||
$app->run();
|
$app->run();
|
||||||
|
@ -1,14 +1,17 @@
|
|||||||
{
|
{
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=7.2",
|
"php": ">=7.2",
|
||||||
"slim/slim": "^3.12.2",
|
"slim/slim": "^4.0",
|
||||||
"morris/lessql": "^0.4.1",
|
"slim/psr7": "^1.0",
|
||||||
|
"slim/http": "^1.0",
|
||||||
|
"php-di/php-di": "^6.0",
|
||||||
"rubellum/slim-blade-view": "^0.1.1",
|
"rubellum/slim-blade-view": "^0.1.1",
|
||||||
"tuupola/cors-middleware": "^1.0.0",
|
"tuupola/cors-middleware": "^1.1",
|
||||||
"eluceo/ical": "^0.15.1",
|
"morris/lessql": "^0.4.1",
|
||||||
"erusev/parsedown": "^1.7.3",
|
"gettext/gettext": "^4.8",
|
||||||
"gettext/gettext": "^4.6.3",
|
"eluceo/ical": "^0.16.0",
|
||||||
"gumlet/php-image-resize": "^1.9.2"
|
"erusev/parsedown": "^1.7",
|
||||||
|
"gumlet/php-image-resize": "^1.9"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
|
684
composer.lock
generated
684
composer.lock
generated
@ -4,7 +4,7 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "eff0f8f394573d15e26d8abd3788ed72",
|
"content-hash": "9c7420e77a3f1afb59e00560d5b9081c",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "doctrine/inflector",
|
"name": "doctrine/inflector",
|
||||||
@ -75,23 +75,23 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "eluceo/ical",
|
"name": "eluceo/ical",
|
||||||
"version": "0.15.1",
|
"version": "0.16.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/markuspoerschke/iCal.git",
|
"url": "https://github.com/markuspoerschke/iCal.git",
|
||||||
"reference": "bdd24747587f6f9b10770a7b873a13e273f85f39"
|
"reference": "97da0d94c9716e65c141066a2d96aa098379721b"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/markuspoerschke/iCal/zipball/bdd24747587f6f9b10770a7b873a13e273f85f39",
|
"url": "https://api.github.com/repos/markuspoerschke/iCal/zipball/97da0d94c9716e65c141066a2d96aa098379721b",
|
||||||
"reference": "bdd24747587f6f9b10770a7b873a13e273f85f39",
|
"reference": "97da0d94c9716e65c141066a2d96aa098379721b",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=7.0"
|
"php": ">=7.1"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit": "^6.0"
|
"phpunit/phpunit": "^7.0"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"ext-mbstring": "Massive performance enhancement of line folding"
|
"ext-mbstring": "Massive performance enhancement of line folding"
|
||||||
@ -122,7 +122,7 @@
|
|||||||
"ics",
|
"ics",
|
||||||
"php calendar"
|
"php calendar"
|
||||||
],
|
],
|
||||||
"time": "2019-08-06T20:33:43+00:00"
|
"time": "2019-12-29T22:08:56+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "erusev/parsedown",
|
"name": "erusev/parsedown",
|
||||||
@ -170,6 +170,58 @@
|
|||||||
],
|
],
|
||||||
"time": "2019-12-30T22:54:17+00:00"
|
"time": "2019-12-30T22:54:17+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "fig/http-message-util",
|
||||||
|
"version": "1.1.4",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/php-fig/http-message-util.git",
|
||||||
|
"reference": "3242caa9da7221a304b8f84eb9eaddae0a7cf422"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/php-fig/http-message-util/zipball/3242caa9da7221a304b8f84eb9eaddae0a7cf422",
|
||||||
|
"reference": "3242caa9da7221a304b8f84eb9eaddae0a7cf422",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": "^5.3 || ^7.0"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"psr/http-message": "The package containing the PSR-7 interfaces"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "1.1.x-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Fig\\Http\\Message\\": "src/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "PHP-FIG",
|
||||||
|
"homepage": "http://www.php-fig.org/"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Utility classes and constants for use with PSR-7 (psr/http-message)",
|
||||||
|
"keywords": [
|
||||||
|
"http",
|
||||||
|
"http-message",
|
||||||
|
"psr",
|
||||||
|
"psr-7",
|
||||||
|
"request",
|
||||||
|
"response"
|
||||||
|
],
|
||||||
|
"time": "2020-02-05T20:36:27+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "gettext/gettext",
|
"name": "gettext/gettext",
|
||||||
"version": "v4.8.2",
|
"version": "v4.8.2",
|
||||||
@ -644,6 +696,64 @@
|
|||||||
"homepage": "https://laravel.com",
|
"homepage": "https://laravel.com",
|
||||||
"time": "2019-06-20T13:13:59+00:00"
|
"time": "2019-06-20T13:13:59+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "jeremeamia/superclosure",
|
||||||
|
"version": "2.4.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/jeremeamia/super_closure.git",
|
||||||
|
"reference": "5707d5821b30b9a07acfb4d76949784aaa0e9ce9"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/jeremeamia/super_closure/zipball/5707d5821b30b9a07acfb4d76949784aaa0e9ce9",
|
||||||
|
"reference": "5707d5821b30b9a07acfb4d76949784aaa0e9ce9",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"nikic/php-parser": "^1.2|^2.0|^3.0|^4.0",
|
||||||
|
"php": ">=5.4",
|
||||||
|
"symfony/polyfill-php56": "^1.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"phpunit/phpunit": "^4.0|^5.0"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "2.4-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"SuperClosure\\": "src/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Jeremy Lindblom",
|
||||||
|
"email": "jeremeamia@gmail.com",
|
||||||
|
"homepage": "https://github.com/jeremeamia",
|
||||||
|
"role": "Developer"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Serialize Closure objects, including their context and binding",
|
||||||
|
"homepage": "https://github.com/jeremeamia/super_closure",
|
||||||
|
"keywords": [
|
||||||
|
"closure",
|
||||||
|
"function",
|
||||||
|
"lambda",
|
||||||
|
"parser",
|
||||||
|
"serializable",
|
||||||
|
"serialize",
|
||||||
|
"tokenizer"
|
||||||
|
],
|
||||||
|
"time": "2018-03-21T22:21:57+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "morris/lessql",
|
"name": "morris/lessql",
|
||||||
"version": "v0.4.1",
|
"version": "v0.4.1",
|
||||||
@ -864,6 +974,58 @@
|
|||||||
],
|
],
|
||||||
"time": "2018-02-13T20:26:39+00:00"
|
"time": "2018-02-13T20:26:39+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "nikic/php-parser",
|
||||||
|
"version": "v4.3.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/nikic/PHP-Parser.git",
|
||||||
|
"reference": "9a9981c347c5c49d6dfe5cf826bb882b824080dc"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/9a9981c347c5c49d6dfe5cf826bb882b824080dc",
|
||||||
|
"reference": "9a9981c347c5c49d6dfe5cf826bb882b824080dc",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"ext-tokenizer": "*",
|
||||||
|
"php": ">=7.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"ircmaxell/php-yacc": "0.0.5",
|
||||||
|
"phpunit/phpunit": "^6.5 || ^7.0 || ^8.0"
|
||||||
|
},
|
||||||
|
"bin": [
|
||||||
|
"bin/php-parse"
|
||||||
|
],
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "4.3-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"PhpParser\\": "lib/PhpParser"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"BSD-3-Clause"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Nikita Popov"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "A PHP parser written in PHP",
|
||||||
|
"keywords": [
|
||||||
|
"parser",
|
||||||
|
"php"
|
||||||
|
],
|
||||||
|
"time": "2019-11-08T13:50:10+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "philo/laravel-blade",
|
"name": "philo/laravel-blade",
|
||||||
"version": "v3.1",
|
"version": "v3.1",
|
||||||
@ -906,54 +1068,147 @@
|
|||||||
"time": "2015-12-04T09:42:42+00:00"
|
"time": "2015-12-04T09:42:42+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "pimple/pimple",
|
"name": "php-di/invoker",
|
||||||
"version": "v3.2.3",
|
"version": "2.0.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/silexphp/Pimple.git",
|
"url": "https://github.com/PHP-DI/Invoker.git",
|
||||||
"reference": "9e403941ef9d65d20cba7d54e29fe906db42cf32"
|
"reference": "540c27c86f663e20fe39a24cd72fa76cdb21d41a"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/silexphp/Pimple/zipball/9e403941ef9d65d20cba7d54e29fe906db42cf32",
|
"url": "https://api.github.com/repos/PHP-DI/Invoker/zipball/540c27c86f663e20fe39a24cd72fa76cdb21d41a",
|
||||||
"reference": "9e403941ef9d65d20cba7d54e29fe906db42cf32",
|
"reference": "540c27c86f663e20fe39a24cd72fa76cdb21d41a",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.3.0",
|
"psr/container": "~1.0"
|
||||||
"psr/container": "^1.0"
|
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"symfony/phpunit-bridge": "^3.2"
|
"athletic/athletic": "~0.1.8",
|
||||||
|
"phpunit/phpunit": "~4.5"
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
|
||||||
"branch-alias": {
|
|
||||||
"dev-master": "3.2.x-dev"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-0": {
|
"psr-4": {
|
||||||
"Pimple": "src/"
|
"Invoker\\": "src/"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
"license": [
|
"license": [
|
||||||
"MIT"
|
"MIT"
|
||||||
],
|
],
|
||||||
"authors": [
|
"description": "Generic and extensible callable invoker",
|
||||||
{
|
"homepage": "https://github.com/PHP-DI/Invoker",
|
||||||
"name": "Fabien Potencier",
|
|
||||||
"email": "fabien@symfony.com"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "Pimple, a simple Dependency Injection Container",
|
|
||||||
"homepage": "http://pimple.sensiolabs.org",
|
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"container",
|
"callable",
|
||||||
"dependency injection"
|
"dependency",
|
||||||
|
"dependency-injection",
|
||||||
|
"injection",
|
||||||
|
"invoke",
|
||||||
|
"invoker"
|
||||||
],
|
],
|
||||||
"time": "2018-01-21T07:42:36+00:00"
|
"time": "2017-03-20T19:28:22+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "php-di/php-di",
|
||||||
|
"version": "6.0.11",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/PHP-DI/PHP-DI.git",
|
||||||
|
"reference": "9bdcc2f41f5fb700ddd01bc4fa8d5bd7b3f94620"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/PHP-DI/PHP-DI/zipball/9bdcc2f41f5fb700ddd01bc4fa8d5bd7b3f94620",
|
||||||
|
"reference": "9bdcc2f41f5fb700ddd01bc4fa8d5bd7b3f94620",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"jeremeamia/superclosure": "^2.0",
|
||||||
|
"nikic/php-parser": "^2.0|^3.0|^4.0",
|
||||||
|
"php": ">=7.0.0",
|
||||||
|
"php-di/invoker": "^2.0",
|
||||||
|
"php-di/phpdoc-reader": "^2.0.1",
|
||||||
|
"psr/container": "^1.0"
|
||||||
|
},
|
||||||
|
"provide": {
|
||||||
|
"psr/container-implementation": "^1.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"doctrine/annotations": "~1.2",
|
||||||
|
"friendsofphp/php-cs-fixer": "^2.4",
|
||||||
|
"mnapoli/phpunit-easymock": "~1.0",
|
||||||
|
"ocramius/proxy-manager": "~2.0.2",
|
||||||
|
"phpstan/phpstan": "^0.9.2",
|
||||||
|
"phpunit/phpunit": "~6.4"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"doctrine/annotations": "Install it if you want to use annotations (version ~1.2)",
|
||||||
|
"ocramius/proxy-manager": "Install it if you want to use lazy injection (version ~2.0)"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"DI\\": "src/"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"src/functions.php"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"description": "The dependency injection container for humans",
|
||||||
|
"homepage": "http://php-di.org/",
|
||||||
|
"keywords": [
|
||||||
|
"PSR-11",
|
||||||
|
"container",
|
||||||
|
"container-interop",
|
||||||
|
"dependency injection",
|
||||||
|
"di",
|
||||||
|
"ioc",
|
||||||
|
"psr11"
|
||||||
|
],
|
||||||
|
"time": "2019-12-12T07:58:02+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "php-di/phpdoc-reader",
|
||||||
|
"version": "2.1.1",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/PHP-DI/PhpDocReader.git",
|
||||||
|
"reference": "15678f7451c020226807f520efb867ad26fbbfcf"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/PHP-DI/PhpDocReader/zipball/15678f7451c020226807f520efb867ad26fbbfcf",
|
||||||
|
"reference": "15678f7451c020226807f520efb867ad26fbbfcf",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=5.4.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"phpunit/phpunit": "~4.6"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"PhpDocReader\\": "src/PhpDocReader"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"description": "PhpDocReader parses @var and @param values in PHP docblocks (supports namespaced class names with the same resolution rules as PHP)",
|
||||||
|
"keywords": [
|
||||||
|
"phpdoc",
|
||||||
|
"reflection"
|
||||||
|
],
|
||||||
|
"time": "2019-09-26T11:24:58+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "psr/container",
|
"name": "psr/container",
|
||||||
@ -1307,6 +1562,46 @@
|
|||||||
],
|
],
|
||||||
"time": "2017-10-23T01:57:42+00:00"
|
"time": "2017-10-23T01:57:42+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "ralouphie/getallheaders",
|
||||||
|
"version": "3.0.3",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/ralouphie/getallheaders.git",
|
||||||
|
"reference": "120b605dfeb996808c31b6477290a714d356e822"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822",
|
||||||
|
"reference": "120b605dfeb996808c31b6477290a714d356e822",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=5.6"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"php-coveralls/php-coveralls": "^2.1",
|
||||||
|
"phpunit/phpunit": "^5 || ^6.5"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"files": [
|
||||||
|
"src/getallheaders.php"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Ralph Khattar",
|
||||||
|
"email": "ralph.khattar@gmail.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "A polyfill for getallheaders.",
|
||||||
|
"time": "2019-03-08T08:55:37+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "rubellum/slim-blade-view",
|
"name": "rubellum/slim-blade-view",
|
||||||
"version": "0.1.1",
|
"version": "0.1.1",
|
||||||
@ -1358,35 +1653,199 @@
|
|||||||
"time": "2016-03-11T02:32:00+00:00"
|
"time": "2016-03-11T02:32:00+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "slim/slim",
|
"name": "slim/http",
|
||||||
"version": "3.12.3",
|
"version": "1.0.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/slimphp/Slim.git",
|
"url": "https://github.com/slimphp/Slim-Http.git",
|
||||||
"reference": "1c9318a84ffb890900901136d620b4f03a59da38"
|
"reference": "c2e67ac1680207aa7863fd4721530b01f3436b2e"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/slimphp/Slim/zipball/1c9318a84ffb890900901136d620b4f03a59da38",
|
"url": "https://api.github.com/repos/slimphp/Slim-Http/zipball/c2e67ac1680207aa7863fd4721530b01f3436b2e",
|
||||||
"reference": "1c9318a84ffb890900901136d620b4f03a59da38",
|
"reference": "c2e67ac1680207aa7863fd4721530b01f3436b2e",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
"ext-fileinfo": "*",
|
||||||
"ext-json": "*",
|
"ext-json": "*",
|
||||||
"ext-libxml": "*",
|
"ext-libxml": "*",
|
||||||
"ext-simplexml": "*",
|
"ext-simplexml": "*",
|
||||||
"nikic/fast-route": "^1.0",
|
"php": "^7.2",
|
||||||
"php": ">=5.5.0",
|
"psr/http-factory": "^1.0",
|
||||||
"pimple/pimple": "^3.0",
|
|
||||||
"psr/container": "^1.0",
|
|
||||||
"psr/http-message": "^1.0"
|
"psr/http-message": "^1.0"
|
||||||
},
|
},
|
||||||
|
"provide": {
|
||||||
|
"psr/http-factory": "^1.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"adriansuter/php-autoload-override": "^1.0",
|
||||||
|
"laminas/laminas-diactoros": "^2.0",
|
||||||
|
"nyholm/psr7": "^1.0",
|
||||||
|
"php-http/psr7-integration-tests": "dev-master",
|
||||||
|
"phpstan/phpstan": "^0.10.3",
|
||||||
|
"phpunit/phpunit": "^8.5",
|
||||||
|
"squizlabs/php_codesniffer": "^3.5"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Slim\\Http\\": "src/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Josh Lockhart",
|
||||||
|
"email": "hello@joshlockhart.com",
|
||||||
|
"homepage": "http://joshlockhart.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Andrew Smith",
|
||||||
|
"email": "a.smith@silentworks.co.uk",
|
||||||
|
"homepage": "http://silentworks.co.uk"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Rob Allen",
|
||||||
|
"email": "rob@akrabat.com",
|
||||||
|
"homepage": "http://akrabat.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Pierre Berube",
|
||||||
|
"email": "pierre@lgse.com",
|
||||||
|
"homepage": "http://www.lgse.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Slim PSR-7 Object Decorators",
|
||||||
|
"homepage": "http://slimframework.com",
|
||||||
|
"keywords": [
|
||||||
|
"http",
|
||||||
|
"psr-7",
|
||||||
|
"psr7"
|
||||||
|
],
|
||||||
|
"time": "2020-01-04T23:05:26+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "slim/psr7",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/slimphp/Slim-Psr7.git",
|
||||||
|
"reference": "7ca5b5d96687b7c563238715cc80b12675d8b895"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/slimphp/Slim-Psr7/zipball/7ca5b5d96687b7c563238715cc80b12675d8b895",
|
||||||
|
"reference": "7ca5b5d96687b7c563238715cc80b12675d8b895",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"fig/http-message-util": "^1.1.2",
|
||||||
|
"php": "^7.2",
|
||||||
|
"psr/http-factory": "^1.0",
|
||||||
|
"psr/http-message": "^1.0",
|
||||||
|
"ralouphie/getallheaders": "^3"
|
||||||
|
},
|
||||||
"provide": {
|
"provide": {
|
||||||
"psr/http-message-implementation": "1.0"
|
"psr/http-message-implementation": "1.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit": "^4.0",
|
"adriansuter/php-autoload-override": "^1.0",
|
||||||
"squizlabs/php_codesniffer": "^2.5"
|
"ext-json": "*",
|
||||||
|
"http-interop/http-factory-tests": "^0.6.0",
|
||||||
|
"php-http/psr7-integration-tests": "dev-master",
|
||||||
|
"phpstan/phpstan": "^0.12",
|
||||||
|
"phpunit/phpunit": "^8.5",
|
||||||
|
"squizlabs/php_codesniffer": "^3.5"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Slim\\Psr7\\": "src"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Josh Lockhart",
|
||||||
|
"email": "hello@joshlockhart.com",
|
||||||
|
"homepage": "http://joshlockhart.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Andrew Smith",
|
||||||
|
"email": "a.smith@silentworks.co.uk",
|
||||||
|
"homepage": "http://silentworks.co.uk"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Rob Allen",
|
||||||
|
"email": "rob@akrabat.com",
|
||||||
|
"homepage": "http://akrabat.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Pierre Berube",
|
||||||
|
"email": "pierre@lgse.com",
|
||||||
|
"homepage": "http://www.lgse.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Strict PSR-7 implementation",
|
||||||
|
"homepage": "https://www.slimframework.com",
|
||||||
|
"keywords": [
|
||||||
|
"http",
|
||||||
|
"psr-7",
|
||||||
|
"psr7"
|
||||||
|
],
|
||||||
|
"time": "2020-01-04T23:05:43+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "slim/slim",
|
||||||
|
"version": "4.4.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/slimphp/Slim.git",
|
||||||
|
"reference": "207acac048652a35d4762a737d59e317aedc02df"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/slimphp/Slim/zipball/207acac048652a35d4762a737d59e317aedc02df",
|
||||||
|
"reference": "207acac048652a35d4762a737d59e317aedc02df",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"ext-json": "*",
|
||||||
|
"nikic/fast-route": "^1.3",
|
||||||
|
"php": "^7.2",
|
||||||
|
"psr/container": "^1.0",
|
||||||
|
"psr/http-factory": "^1.0",
|
||||||
|
"psr/http-message": "^1.0",
|
||||||
|
"psr/http-server-handler": "^1.0",
|
||||||
|
"psr/http-server-middleware": "^1.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"adriansuter/php-autoload-override": "^1.0",
|
||||||
|
"ext-simplexml": "*",
|
||||||
|
"guzzlehttp/psr7": "^1.5",
|
||||||
|
"http-interop/http-factory-guzzle": "^1.0",
|
||||||
|
"laminas/laminas-diactoros": "^2.1",
|
||||||
|
"nyholm/psr7": "^1.1",
|
||||||
|
"nyholm/psr7-server": "^0.3.0",
|
||||||
|
"phpspec/prophecy": "^1.10",
|
||||||
|
"phpstan/phpstan": "^0.11.5",
|
||||||
|
"phpunit/phpunit": "^8.5",
|
||||||
|
"slim/http": "^0.7",
|
||||||
|
"slim/psr7": "^0.3",
|
||||||
|
"squizlabs/php_codesniffer": "^3.5"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"ext-simplexml": "Needed to support XML format in BodyParsingMiddleware",
|
||||||
|
"ext-xml": "Needed to support XML format in BodyParsingMiddleware",
|
||||||
|
"php-di/php-di": "PHP-DI is the recommended container library to be used with Slim",
|
||||||
|
"slim/psr7": "Slim PSR-7 implementation. See https://www.slimframework.com/docs/v4/start/installation.html for more information."
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
@ -1414,6 +1873,11 @@
|
|||||||
"email": "rob@akrabat.com",
|
"email": "rob@akrabat.com",
|
||||||
"homepage": "http://akrabat.com"
|
"homepage": "http://akrabat.com"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "Pierre Berube",
|
||||||
|
"email": "pierre@lgse.com",
|
||||||
|
"homepage": "http://www.lgse.com"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "Gabriel Manricks",
|
"name": "Gabriel Manricks",
|
||||||
"email": "gmanricks@me.com",
|
"email": "gmanricks@me.com",
|
||||||
@ -1421,27 +1885,27 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs",
|
"description": "Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs",
|
||||||
"homepage": "https://slimframework.com",
|
"homepage": "https://www.slimframework.com",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"api",
|
"api",
|
||||||
"framework",
|
"framework",
|
||||||
"micro",
|
"micro",
|
||||||
"router"
|
"router"
|
||||||
],
|
],
|
||||||
"time": "2019-11-28T17:40:33+00:00"
|
"time": "2020-01-05T03:51:47+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/debug",
|
"name": "symfony/debug",
|
||||||
"version": "v4.4.3",
|
"version": "v4.4.4",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/debug.git",
|
"url": "https://github.com/symfony/debug.git",
|
||||||
"reference": "89c3fd5c299b940333bc6fe9f1b8db1b0912c759"
|
"reference": "20236471058bbaa9907382500fc14005c84601f0"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/debug/zipball/89c3fd5c299b940333bc6fe9f1b8db1b0912c759",
|
"url": "https://api.github.com/repos/symfony/debug/zipball/20236471058bbaa9907382500fc14005c84601f0",
|
||||||
"reference": "89c3fd5c299b940333bc6fe9f1b8db1b0912c759",
|
"reference": "20236471058bbaa9907382500fc14005c84601f0",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -1484,11 +1948,11 @@
|
|||||||
],
|
],
|
||||||
"description": "Symfony Debug Component",
|
"description": "Symfony Debug Component",
|
||||||
"homepage": "https://symfony.com",
|
"homepage": "https://symfony.com",
|
||||||
"time": "2020-01-08T17:29:02+00:00"
|
"time": "2020-01-25T12:44:29+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/finder",
|
"name": "symfony/finder",
|
||||||
"version": "v4.4.3",
|
"version": "v4.4.4",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/finder.git",
|
"url": "https://github.com/symfony/finder.git",
|
||||||
@ -1594,9 +2058,117 @@
|
|||||||
],
|
],
|
||||||
"time": "2019-11-27T14:18:11+00:00"
|
"time": "2019-11-27T14:18:11+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "symfony/polyfill-php56",
|
||||||
|
"version": "v1.13.1",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/symfony/polyfill-php56.git",
|
||||||
|
"reference": "53dd1cdf3cb986893ccf2b96665b25b3abb384f4"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/53dd1cdf3cb986893ccf2b96665b25b3abb384f4",
|
||||||
|
"reference": "53dd1cdf3cb986893ccf2b96665b25b3abb384f4",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=5.3.3",
|
||||||
|
"symfony/polyfill-util": "~1.0"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "1.13-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Symfony\\Polyfill\\Php56\\": ""
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"bootstrap.php"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Nicolas Grekas",
|
||||||
|
"email": "p@tchwork.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Symfony Community",
|
||||||
|
"homepage": "https://symfony.com/contributors"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions",
|
||||||
|
"homepage": "https://symfony.com",
|
||||||
|
"keywords": [
|
||||||
|
"compatibility",
|
||||||
|
"polyfill",
|
||||||
|
"portable",
|
||||||
|
"shim"
|
||||||
|
],
|
||||||
|
"time": "2019-11-27T13:56:44+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "symfony/polyfill-util",
|
||||||
|
"version": "v1.13.1",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/symfony/polyfill-util.git",
|
||||||
|
"reference": "964a67f293b66b95883a5ed918a65354fcd2258f"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/symfony/polyfill-util/zipball/964a67f293b66b95883a5ed918a65354fcd2258f",
|
||||||
|
"reference": "964a67f293b66b95883a5ed918a65354fcd2258f",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=5.3.3"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "1.13-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Symfony\\Polyfill\\Util\\": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Nicolas Grekas",
|
||||||
|
"email": "p@tchwork.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Symfony Community",
|
||||||
|
"homepage": "https://symfony.com/contributors"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Symfony utilities for portability of PHP codes",
|
||||||
|
"homepage": "https://symfony.com",
|
||||||
|
"keywords": [
|
||||||
|
"compat",
|
||||||
|
"compatibility",
|
||||||
|
"polyfill",
|
||||||
|
"shim"
|
||||||
|
],
|
||||||
|
"time": "2019-11-27T13:56:44+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/translation",
|
"name": "symfony/translation",
|
||||||
"version": "v5.0.3",
|
"version": "v5.0.4",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/translation.git",
|
"url": "https://github.com/symfony/translation.git",
|
||||||
|
@ -5,7 +5,7 @@ namespace Grocy\Controllers;
|
|||||||
class BaseApiController extends BaseController
|
class BaseApiController extends BaseController
|
||||||
{
|
{
|
||||||
|
|
||||||
public function __construct(\Slim\Container $container)
|
public function __construct(\DI\Container $container)
|
||||||
{
|
{
|
||||||
parent::__construct($container);
|
parent::__construct($container);
|
||||||
$this->OpenApiSpec = json_decode(file_get_contents(__DIR__ . '/../grocy.openapi.json'));
|
$this->OpenApiSpec = json_decode(file_get_contents(__DIR__ . '/../grocy.openapi.json'));
|
||||||
@ -13,17 +13,18 @@ class BaseApiController extends BaseController
|
|||||||
|
|
||||||
protected $OpenApiSpec;
|
protected $OpenApiSpec;
|
||||||
|
|
||||||
protected function ApiResponse($data)
|
protected function ApiResponse(\Psr\Http\Message\ResponseInterface $response, $data)
|
||||||
{
|
{
|
||||||
return json_encode($data);
|
$response->getBody()->write(json_encode($data));
|
||||||
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function EmptyApiResponse($response, $status = 204)
|
protected function EmptyApiResponse(\Psr\Http\Message\ResponseInterface $response, $status = 204)
|
||||||
{
|
{
|
||||||
return $response->withStatus($status);
|
return $response->withStatus($status);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function GenericErrorResponse($response, $errorMessage, $status = 400)
|
protected function GenericErrorResponse(\Psr\Http\Message\ResponseInterface $response, $errorMessage, $status = 400)
|
||||||
{
|
{
|
||||||
return $response->withStatus($status)->withJson(array(
|
return $response->withStatus($status)->withJson(array(
|
||||||
'error_message' => $errorMessage
|
'error_message' => $errorMessage
|
||||||
|
@ -9,7 +9,7 @@ use \Grocy\Services\UsersService;
|
|||||||
|
|
||||||
class BaseController
|
class BaseController
|
||||||
{
|
{
|
||||||
public function __construct(\Slim\Container $container) {
|
public function __construct(\DI\Container $container) {
|
||||||
$databaseService = new DatabaseService();
|
$databaseService = new DatabaseService();
|
||||||
$this->Database = $databaseService->GetDbConnection();
|
$this->Database = $databaseService->GetDbConnection();
|
||||||
|
|
||||||
@ -18,30 +18,33 @@ class BaseController
|
|||||||
|
|
||||||
$applicationService = new ApplicationService();
|
$applicationService = new ApplicationService();
|
||||||
$versionInfo = $applicationService->GetInstalledVersion();
|
$versionInfo = $applicationService->GetInstalledVersion();
|
||||||
$container->view->set('version', $versionInfo->Version);
|
|
||||||
$container->view->set('releaseDate', $versionInfo->ReleaseDate);
|
|
||||||
|
|
||||||
$container->view->set('__t', function(string $text, ...$placeholderValues) use($localizationService)
|
$view = $container->get('view');
|
||||||
|
$this->View = $view;
|
||||||
|
|
||||||
|
$view->set('version', $versionInfo->Version);
|
||||||
|
$view->set('releaseDate', $versionInfo->ReleaseDate);
|
||||||
|
$view->set('__t', function(string $text, ...$placeholderValues) use($localizationService)
|
||||||
{
|
{
|
||||||
return $localizationService->__t($text, $placeholderValues);
|
return $localizationService->__t($text, $placeholderValues);
|
||||||
});
|
});
|
||||||
$container->view->set('__n', function($number, $singularForm, $pluralForm) use($localizationService)
|
$view->set('__n', function($number, $singularForm, $pluralForm) use($localizationService)
|
||||||
{
|
{
|
||||||
return $localizationService->__n($number, $singularForm, $pluralForm);
|
return $localizationService->__n($number, $singularForm, $pluralForm);
|
||||||
});
|
});
|
||||||
$container->view->set('GettextPo', $localizationService->GetPoAsJsonString());
|
$view->set('GettextPo', $localizationService->GetPoAsJsonString());
|
||||||
|
|
||||||
$container->view->set('U', function($relativePath, $isResource = false) use($container)
|
$view->set('U', function($relativePath, $isResource = false) use($container)
|
||||||
{
|
{
|
||||||
return $container->UrlManager->ConstructUrl($relativePath, $isResource);
|
return $container->get('UrlManager')->ConstructUrl($relativePath, $isResource);
|
||||||
});
|
});
|
||||||
|
|
||||||
$embedded = false;
|
$embedded = false;
|
||||||
if (isset($container->request->getQueryParams()['embedded']))
|
if (isset($_GET['embedded']))
|
||||||
{
|
{
|
||||||
$embedded = true;
|
$embedded = true;
|
||||||
}
|
}
|
||||||
$container->view->set('embedded', $embedded);
|
$view->set('embedded', $embedded);
|
||||||
|
|
||||||
$constants = get_defined_constants();
|
$constants = get_defined_constants();
|
||||||
foreach ($constants as $constant => $value)
|
foreach ($constants as $constant => $value)
|
||||||
@ -51,20 +54,20 @@ class BaseController
|
|||||||
unset($constants[$constant]);
|
unset($constants[$constant]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$container->view->set('featureFlags', $constants);
|
$view->set('featureFlags', $constants);
|
||||||
|
|
||||||
$container->view->set('userentitiesForSidebar', $this->Database->userentities()->where('show_in_sidebar_menu = 1')->orderBy('name'));
|
$view->set('userentitiesForSidebar', $this->Database->userentities()->where('show_in_sidebar_menu = 1')->orderBy('name'));
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
$usersService = new UsersService();
|
$usersService = new UsersService();
|
||||||
if (defined('GROCY_USER_ID'))
|
if (defined('GROCY_USER_ID'))
|
||||||
{
|
{
|
||||||
$container->view->set('userSettings', $usersService->GetUserSettings(GROCY_USER_ID));
|
$view->set('userSettings', $usersService->GetUserSettings(GROCY_USER_ID));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$container->view->set('userSettings', null);
|
$view->set('userSettings', null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (\Exception $ex)
|
catch (\Exception $ex)
|
||||||
@ -75,7 +78,13 @@ class BaseController
|
|||||||
$this->AppContainer = $container;
|
$this->AppContainer = $container;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function Root(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
|
{
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
protected $AppContainer;
|
protected $AppContainer;
|
||||||
protected $Database;
|
protected $Database;
|
||||||
protected $LocalizationService;
|
protected $LocalizationService;
|
||||||
|
protected $View;
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ use \Grocy\Services\BatteriesService;
|
|||||||
|
|
||||||
class BatteriesApiController extends BaseApiController
|
class BatteriesApiController extends BaseApiController
|
||||||
{
|
{
|
||||||
public function __construct(\Slim\Container $container)
|
public function __construct(\DI\Container $container)
|
||||||
{
|
{
|
||||||
parent::__construct($container);
|
parent::__construct($container);
|
||||||
$this->BatteriesService = new BatteriesService();
|
$this->BatteriesService = new BatteriesService();
|
||||||
@ -14,7 +14,7 @@ class BatteriesApiController extends BaseApiController
|
|||||||
|
|
||||||
protected $BatteriesService;
|
protected $BatteriesService;
|
||||||
|
|
||||||
public function TrackChargeCycle(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function TrackChargeCycle(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
$requestBody = $request->getParsedBody();
|
$requestBody = $request->getParsedBody();
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ class BatteriesApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
|
|
||||||
$chargeCycleId = $this->BatteriesService->TrackChargeCycle($args['batteryId'], $trackedTime);
|
$chargeCycleId = $this->BatteriesService->TrackChargeCycle($args['batteryId'], $trackedTime);
|
||||||
return $this->ApiResponse($this->Database->battery_charge_cycles($chargeCycleId));
|
return $this->ApiResponse($response, $this->Database->battery_charge_cycles($chargeCycleId));
|
||||||
}
|
}
|
||||||
catch (\Exception $ex)
|
catch (\Exception $ex)
|
||||||
{
|
{
|
||||||
@ -35,11 +35,11 @@ class BatteriesApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function BatteryDetails(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function BatteryDetails(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return $this->ApiResponse($this->BatteriesService->GetBatteryDetails($args['batteryId']));
|
return $this->ApiResponse($response, $this->BatteriesService->GetBatteryDetails($args['batteryId']));
|
||||||
}
|
}
|
||||||
catch (\Exception $ex)
|
catch (\Exception $ex)
|
||||||
{
|
{
|
||||||
@ -47,16 +47,16 @@ class BatteriesApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function Current(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function Current(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
return $this->ApiResponse($this->BatteriesService->GetCurrent());
|
return $this->ApiResponse($response, $this->BatteriesService->GetCurrent());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function UndoChargeCycle(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function UndoChargeCycle(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
$this->ApiResponse($this->BatteriesService->UndoChargeCycle($args['chargeCycleId']));
|
$this->ApiResponse($response, $this->BatteriesService->UndoChargeCycle($args['chargeCycleId']));
|
||||||
return $this->EmptyApiResponse($response);
|
return $this->EmptyApiResponse($response);
|
||||||
}
|
}
|
||||||
catch (\Exception $ex)
|
catch (\Exception $ex)
|
||||||
|
@ -8,7 +8,7 @@ use \Grocy\Services\UserfieldsService;
|
|||||||
|
|
||||||
class BatteriesController extends BaseController
|
class BatteriesController extends BaseController
|
||||||
{
|
{
|
||||||
public function __construct(\Slim\Container $container)
|
public function __construct(\DI\Container $container)
|
||||||
{
|
{
|
||||||
parent::__construct($container);
|
parent::__construct($container);
|
||||||
$this->BatteriesService = new BatteriesService();
|
$this->BatteriesService = new BatteriesService();
|
||||||
@ -18,12 +18,12 @@ class BatteriesController extends BaseController
|
|||||||
protected $BatteriesService;
|
protected $BatteriesService;
|
||||||
protected $UserfieldsService;
|
protected $UserfieldsService;
|
||||||
|
|
||||||
public function Overview(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function Overview(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
$usersService = new UsersService();
|
$usersService = new UsersService();
|
||||||
$nextXDays = $usersService->GetUserSettings(GROCY_USER_ID)['batteries_due_soon_days'];
|
$nextXDays = $usersService->GetUserSettings(GROCY_USER_ID)['batteries_due_soon_days'];
|
||||||
|
|
||||||
return $this->AppContainer->view->render($response, 'batteriesoverview', [
|
return $this->View->render($response, 'batteriesoverview', [
|
||||||
'batteries' => $this->Database->batteries()->orderBy('name'),
|
'batteries' => $this->Database->batteries()->orderBy('name'),
|
||||||
'current' => $this->BatteriesService->GetCurrent(),
|
'current' => $this->BatteriesService->GetCurrent(),
|
||||||
'nextXDays' => $nextXDays,
|
'nextXDays' => $nextXDays,
|
||||||
@ -32,34 +32,34 @@ class BatteriesController extends BaseController
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function TrackChargeCycle(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function TrackChargeCycle(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'batterytracking', [
|
return $this->View->render($response, 'batterytracking', [
|
||||||
'batteries' => $this->Database->batteries()->orderBy('name')
|
'batteries' => $this->Database->batteries()->orderBy('name')
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function BatteriesList(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function BatteriesList(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'batteries', [
|
return $this->View->render($response, 'batteries', [
|
||||||
'batteries' => $this->Database->batteries()->orderBy('name'),
|
'batteries' => $this->Database->batteries()->orderBy('name'),
|
||||||
'userfields' => $this->UserfieldsService->GetFields('batteries'),
|
'userfields' => $this->UserfieldsService->GetFields('batteries'),
|
||||||
'userfieldValues' => $this->UserfieldsService->GetAllValues('batteries')
|
'userfieldValues' => $this->UserfieldsService->GetAllValues('batteries')
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function BatteryEditForm(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function BatteryEditForm(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
if ($args['batteryId'] == 'new')
|
if ($args['batteryId'] == 'new')
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'batteryform', [
|
return $this->View->render($response, 'batteryform', [
|
||||||
'mode' => 'create',
|
'mode' => 'create',
|
||||||
'userfields' => $this->UserfieldsService->GetFields('batteries')
|
'userfields' => $this->UserfieldsService->GetFields('batteries')
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'batteryform', [
|
return $this->View->render($response, 'batteryform', [
|
||||||
'battery' => $this->Database->batteries($args['batteryId']),
|
'battery' => $this->Database->batteries($args['batteryId']),
|
||||||
'mode' => 'edit',
|
'mode' => 'edit',
|
||||||
'userfields' => $this->UserfieldsService->GetFields('batteries')
|
'userfields' => $this->UserfieldsService->GetFields('batteries')
|
||||||
@ -67,16 +67,16 @@ class BatteriesController extends BaseController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function Journal(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function Journal(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'batteriesjournal', [
|
return $this->View->render($response, 'batteriesjournal', [
|
||||||
'chargeCycles' => $this->Database->battery_charge_cycles()->orderBy('tracked_time', 'DESC'),
|
'chargeCycles' => $this->Database->battery_charge_cycles()->orderBy('tracked_time', 'DESC'),
|
||||||
'batteries' => $this->Database->batteries()->orderBy('name')
|
'batteries' => $this->Database->batteries()->orderBy('name')
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function BatteriesSettings(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function BatteriesSettings(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'batteriessettings');
|
return $this->View->render($response, 'batteriessettings');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ use \Grocy\Services\ApiKeyService;
|
|||||||
|
|
||||||
class CalendarApiController extends BaseApiController
|
class CalendarApiController extends BaseApiController
|
||||||
{
|
{
|
||||||
public function __construct(\Slim\Container $container)
|
public function __construct(\DI\Container $container)
|
||||||
{
|
{
|
||||||
parent::__construct($container);
|
parent::__construct($container);
|
||||||
$this->CalendarService = new CalendarService();
|
$this->CalendarService = new CalendarService();
|
||||||
@ -17,7 +17,7 @@ class CalendarApiController extends BaseApiController
|
|||||||
protected $CalendarService;
|
protected $CalendarService;
|
||||||
protected $ApiKeyService;
|
protected $ApiKeyService;
|
||||||
|
|
||||||
public function Ical(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function Ical(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -55,12 +55,12 @@ class CalendarApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function IcalSharingLink(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function IcalSharingLink(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return $this->ApiResponse(array(
|
return $this->ApiResponse($response, array(
|
||||||
'url' => $this->AppContainer->UrlManager->ConstructUrl('/api/calendar/ical?secret=' . $this->ApiKeyService->GetOrCreateApiKey(ApiKeyService::API_KEY_TYPE_SPECIAL_PURPOSE_CALENDAR_ICAL))
|
'url' => $this->AppContainer->get('UrlManager')->ConstructUrl('/api/calendar/ical?secret=' . $this->ApiKeyService->GetOrCreateApiKey(ApiKeyService::API_KEY_TYPE_SPECIAL_PURPOSE_CALENDAR_ICAL))
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
catch (\Exception $ex)
|
catch (\Exception $ex)
|
||||||
|
@ -6,7 +6,7 @@ use \Grocy\Services\CalendarService;
|
|||||||
|
|
||||||
class CalendarController extends BaseController
|
class CalendarController extends BaseController
|
||||||
{
|
{
|
||||||
public function __construct(\Slim\Container $container)
|
public function __construct(\DI\Container $container)
|
||||||
{
|
{
|
||||||
parent::__construct($container);
|
parent::__construct($container);
|
||||||
$this->CalendarService = new CalendarService();
|
$this->CalendarService = new CalendarService();
|
||||||
@ -14,9 +14,9 @@ class CalendarController extends BaseController
|
|||||||
|
|
||||||
protected $CalendarService;
|
protected $CalendarService;
|
||||||
|
|
||||||
public function Overview(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function Overview(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'calendar', [
|
return $this->View->render($response, 'calendar', [
|
||||||
'fullcalendarEventSources' => $this->CalendarService->GetEvents()
|
'fullcalendarEventSources' => $this->CalendarService->GetEvents()
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ use \Grocy\Services\ChoresService;
|
|||||||
|
|
||||||
class ChoresApiController extends BaseApiController
|
class ChoresApiController extends BaseApiController
|
||||||
{
|
{
|
||||||
public function __construct(\Slim\Container $container)
|
public function __construct(\DI\Container $container)
|
||||||
{
|
{
|
||||||
parent::__construct($container);
|
parent::__construct($container);
|
||||||
$this->ChoresService = new ChoresService();
|
$this->ChoresService = new ChoresService();
|
||||||
@ -14,7 +14,7 @@ class ChoresApiController extends BaseApiController
|
|||||||
|
|
||||||
protected $ChoresService;
|
protected $ChoresService;
|
||||||
|
|
||||||
public function TrackChoreExecution(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function TrackChoreExecution(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
$requestBody = $request->getParsedBody();
|
$requestBody = $request->getParsedBody();
|
||||||
|
|
||||||
@ -33,7 +33,7 @@ class ChoresApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
|
|
||||||
$choreExecutionId = $this->ChoresService->TrackChore($args['choreId'], $trackedTime, $doneBy);
|
$choreExecutionId = $this->ChoresService->TrackChore($args['choreId'], $trackedTime, $doneBy);
|
||||||
return $this->ApiResponse($this->Database->chores_log($choreExecutionId));
|
return $this->ApiResponse($response, $this->Database->chores_log($choreExecutionId));
|
||||||
}
|
}
|
||||||
catch (\Exception $ex)
|
catch (\Exception $ex)
|
||||||
{
|
{
|
||||||
@ -41,11 +41,11 @@ class ChoresApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function ChoreDetails(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function ChoreDetails(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return $this->ApiResponse($this->ChoresService->GetChoreDetails($args['choreId']));
|
return $this->ApiResponse($response, $this->ChoresService->GetChoreDetails($args['choreId']));
|
||||||
}
|
}
|
||||||
catch (\Exception $ex)
|
catch (\Exception $ex)
|
||||||
{
|
{
|
||||||
@ -53,16 +53,16 @@ class ChoresApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function Current(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function Current(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
return $this->ApiResponse($this->ChoresService->GetCurrent());
|
return $this->ApiResponse($response, $this->ChoresService->GetCurrent());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function UndoChoreExecution(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function UndoChoreExecution(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
$this->ApiResponse($this->ChoresService->UndoChoreExecution($args['executionId']));
|
$this->ApiResponse($response, $this->ChoresService->UndoChoreExecution($args['executionId']));
|
||||||
return $this->EmptyApiResponse($response);
|
return $this->EmptyApiResponse($response);
|
||||||
}
|
}
|
||||||
catch (\Exception $ex)
|
catch (\Exception $ex)
|
||||||
@ -71,7 +71,7 @@ class ChoresApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function CalculateNextExecutionAssignments(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function CalculateNextExecutionAssignments(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -8,7 +8,7 @@ use \Grocy\Services\UserfieldsService;
|
|||||||
|
|
||||||
class ChoresController extends BaseController
|
class ChoresController extends BaseController
|
||||||
{
|
{
|
||||||
public function __construct(\Slim\Container $container)
|
public function __construct(\DI\Container $container)
|
||||||
{
|
{
|
||||||
parent::__construct($container);
|
parent::__construct($container);
|
||||||
$this->ChoresService = new ChoresService();
|
$this->ChoresService = new ChoresService();
|
||||||
@ -18,12 +18,12 @@ class ChoresController extends BaseController
|
|||||||
protected $ChoresService;
|
protected $ChoresService;
|
||||||
protected $UserfieldsService;
|
protected $UserfieldsService;
|
||||||
|
|
||||||
public function Overview(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function Overview(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
$usersService = new UsersService();
|
$usersService = new UsersService();
|
||||||
$nextXDays = $usersService->GetUserSettings(GROCY_USER_ID)['chores_due_soon_days'];
|
$nextXDays = $usersService->GetUserSettings(GROCY_USER_ID)['chores_due_soon_days'];
|
||||||
|
|
||||||
return $this->AppContainer->view->render($response, 'choresoverview', [
|
return $this->View->render($response, 'choresoverview', [
|
||||||
'chores' => $this->Database->chores()->orderBy('name'),
|
'chores' => $this->Database->chores()->orderBy('name'),
|
||||||
'currentChores' => $this->ChoresService->GetCurrent(),
|
'currentChores' => $this->ChoresService->GetCurrent(),
|
||||||
'nextXDays' => $nextXDays,
|
'nextXDays' => $nextXDays,
|
||||||
@ -33,40 +33,40 @@ class ChoresController extends BaseController
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function TrackChoreExecution(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function TrackChoreExecution(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'choretracking', [
|
return $this->View->render($response, 'choretracking', [
|
||||||
'chores' => $this->Database->chores()->orderBy('name'),
|
'chores' => $this->Database->chores()->orderBy('name'),
|
||||||
'users' => $this->Database->users()->orderBy('username')
|
'users' => $this->Database->users()->orderBy('username')
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function ChoresList(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function ChoresList(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'chores', [
|
return $this->View->render($response, 'chores', [
|
||||||
'chores' => $this->Database->chores()->orderBy('name'),
|
'chores' => $this->Database->chores()->orderBy('name'),
|
||||||
'userfields' => $this->UserfieldsService->GetFields('chores'),
|
'userfields' => $this->UserfieldsService->GetFields('chores'),
|
||||||
'userfieldValues' => $this->UserfieldsService->GetAllValues('chores')
|
'userfieldValues' => $this->UserfieldsService->GetAllValues('chores')
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function Journal(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function Journal(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'choresjournal', [
|
return $this->View->render($response, 'choresjournal', [
|
||||||
'choresLog' => $this->Database->chores_log()->orderBy('tracked_time', 'DESC'),
|
'choresLog' => $this->Database->chores_log()->orderBy('tracked_time', 'DESC'),
|
||||||
'chores' => $this->Database->chores()->orderBy('name'),
|
'chores' => $this->Database->chores()->orderBy('name'),
|
||||||
'users' => $this->Database->users()->orderBy('username')
|
'users' => $this->Database->users()->orderBy('username')
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function ChoreEditForm(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function ChoreEditForm(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
$usersService = new UsersService();
|
$usersService = new UsersService();
|
||||||
$users = $usersService->GetUsersAsDto();
|
$users = $usersService->GetUsersAsDto();
|
||||||
|
|
||||||
if ($args['choreId'] == 'new')
|
if ($args['choreId'] == 'new')
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'choreform', [
|
return $this->View->render($response, 'choreform', [
|
||||||
'periodTypes' => GetClassConstants('\Grocy\Services\ChoresService', 'CHORE_PERIOD_TYPE_'),
|
'periodTypes' => GetClassConstants('\Grocy\Services\ChoresService', 'CHORE_PERIOD_TYPE_'),
|
||||||
'mode' => 'create',
|
'mode' => 'create',
|
||||||
'userfields' => $this->UserfieldsService->GetFields('chores'),
|
'userfields' => $this->UserfieldsService->GetFields('chores'),
|
||||||
@ -77,7 +77,7 @@ class ChoresController extends BaseController
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'choreform', [
|
return $this->View->render($response, 'choreform', [
|
||||||
'chore' => $this->Database->chores($args['choreId']),
|
'chore' => $this->Database->chores($args['choreId']),
|
||||||
'periodTypes' => GetClassConstants('\Grocy\Services\ChoresService', 'CHORE_PERIOD_TYPE_'),
|
'periodTypes' => GetClassConstants('\Grocy\Services\ChoresService', 'CHORE_PERIOD_TYPE_'),
|
||||||
'mode' => 'edit',
|
'mode' => 'edit',
|
||||||
@ -89,8 +89,8 @@ class ChoresController extends BaseController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function ChoresSettings(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function ChoresSettings(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'choressettings');
|
return $this->View->render($response, 'choressettings');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ use \Grocy\Services\UserfieldsService;
|
|||||||
|
|
||||||
class EquipmentController extends BaseController
|
class EquipmentController extends BaseController
|
||||||
{
|
{
|
||||||
public function __construct(\Slim\Container $container)
|
public function __construct(\DI\Container $container)
|
||||||
{
|
{
|
||||||
parent::__construct($container);
|
parent::__construct($container);
|
||||||
$this->UserfieldsService = new UserfieldsService();
|
$this->UserfieldsService = new UserfieldsService();
|
||||||
@ -14,27 +14,27 @@ class EquipmentController extends BaseController
|
|||||||
|
|
||||||
protected $UserfieldsService;
|
protected $UserfieldsService;
|
||||||
|
|
||||||
public function Overview(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function Overview(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'equipment', [
|
return $this->View->render($response, 'equipment', [
|
||||||
'equipment' => $this->Database->equipment()->orderBy('name'),
|
'equipment' => $this->Database->equipment()->orderBy('name'),
|
||||||
'userfields' => $this->UserfieldsService->GetFields('equipment'),
|
'userfields' => $this->UserfieldsService->GetFields('equipment'),
|
||||||
'userfieldValues' => $this->UserfieldsService->GetAllValues('equipment')
|
'userfieldValues' => $this->UserfieldsService->GetAllValues('equipment')
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function EditForm(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function EditForm(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
if ($args['equipmentId'] == 'new')
|
if ($args['equipmentId'] == 'new')
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'equipmentform', [
|
return $this->View->render($response, 'equipmentform', [
|
||||||
'mode' => 'create',
|
'mode' => 'create',
|
||||||
'userfields' => $this->UserfieldsService->GetFields('equipment')
|
'userfields' => $this->UserfieldsService->GetFields('equipment')
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'equipmentform', [
|
return $this->View->render($response, 'equipmentform', [
|
||||||
'equipment' => $this->Database->equipment($args['equipmentId']),
|
'equipment' => $this->Database->equipment($args['equipmentId']),
|
||||||
'mode' => 'edit',
|
'mode' => 'edit',
|
||||||
'userfields' => $this->UserfieldsService->GetFields('equipment')
|
'userfields' => $this->UserfieldsService->GetFields('equipment')
|
||||||
|
@ -6,7 +6,7 @@ use \Grocy\Services\FilesService;
|
|||||||
|
|
||||||
class FilesApiController extends BaseApiController
|
class FilesApiController extends BaseApiController
|
||||||
{
|
{
|
||||||
public function __construct(\Slim\Container $container)
|
public function __construct(\DI\Container $container)
|
||||||
{
|
{
|
||||||
parent::__construct($container);
|
parent::__construct($container);
|
||||||
$this->FilesService = new FilesService();
|
$this->FilesService = new FilesService();
|
||||||
@ -14,7 +14,7 @@ class FilesApiController extends BaseApiController
|
|||||||
|
|
||||||
protected $FilesService;
|
protected $FilesService;
|
||||||
|
|
||||||
public function UploadFile(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function UploadFile(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -38,7 +38,7 @@ class FilesApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function ServeFile(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function ServeFile(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -96,7 +96,7 @@ class FilesApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function DeleteFile(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function DeleteFile(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -6,7 +6,7 @@ use \Grocy\Services\UserfieldsService;
|
|||||||
|
|
||||||
class GenericEntityApiController extends BaseApiController
|
class GenericEntityApiController extends BaseApiController
|
||||||
{
|
{
|
||||||
public function __construct(\Slim\Container $container)
|
public function __construct(\DI\Container $container)
|
||||||
{
|
{
|
||||||
parent::__construct($container);
|
parent::__construct($container);
|
||||||
$this->UserfieldsService = new UserfieldsService();
|
$this->UserfieldsService = new UserfieldsService();
|
||||||
@ -14,11 +14,11 @@ class GenericEntityApiController extends BaseApiController
|
|||||||
|
|
||||||
protected $UserfieldsService;
|
protected $UserfieldsService;
|
||||||
|
|
||||||
public function GetObjects(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function GetObjects(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
if ($this->IsValidEntity($args['entity']) && !$this->IsEntityWithPreventedListing($args['entity']))
|
if ($this->IsValidEntity($args['entity']) && !$this->IsEntityWithPreventedListing($args['entity']))
|
||||||
{
|
{
|
||||||
return $this->ApiResponse($this->Database->{$args['entity']}());
|
return $this->ApiResponse($response, $this->Database->{$args['entity']}());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -26,11 +26,11 @@ class GenericEntityApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function GetObject(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function GetObject(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
if ($this->IsValidEntity($args['entity']) && !$this->IsEntityWithPreventedListing($args['entity']))
|
if ($this->IsValidEntity($args['entity']) && !$this->IsEntityWithPreventedListing($args['entity']))
|
||||||
{
|
{
|
||||||
return $this->ApiResponse($this->Database->{$args['entity']}($args['objectId']));
|
return $this->ApiResponse($response, $this->Database->{$args['entity']}($args['objectId']));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -38,7 +38,7 @@ class GenericEntityApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function AddObject(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function AddObject(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
if ($this->IsValidEntity($args['entity']))
|
if ($this->IsValidEntity($args['entity']))
|
||||||
{
|
{
|
||||||
@ -54,7 +54,7 @@ class GenericEntityApiController extends BaseApiController
|
|||||||
$newRow = $this->Database->{$args['entity']}()->createRow($requestBody);
|
$newRow = $this->Database->{$args['entity']}()->createRow($requestBody);
|
||||||
$newRow->save();
|
$newRow->save();
|
||||||
$success = $newRow->isClean();
|
$success = $newRow->isClean();
|
||||||
return $this->ApiResponse(array(
|
return $this->ApiResponse($response, array(
|
||||||
'created_object_id' => $this->Database->lastInsertId()
|
'created_object_id' => $this->Database->lastInsertId()
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
@ -69,7 +69,7 @@ class GenericEntityApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function EditObject(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function EditObject(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
if ($this->IsValidEntity($args['entity']))
|
if ($this->IsValidEntity($args['entity']))
|
||||||
{
|
{
|
||||||
@ -98,7 +98,7 @@ class GenericEntityApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function DeleteObject(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function DeleteObject(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
if ($this->IsValidEntity($args['entity']))
|
if ($this->IsValidEntity($args['entity']))
|
||||||
{
|
{
|
||||||
@ -113,13 +113,13 @@ class GenericEntityApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function SearchObjects(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function SearchObjects(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
if ($this->IsValidEntity($args['entity']) && !$this->IsEntityWithPreventedListing($args['entity']))
|
if ($this->IsValidEntity($args['entity']) && !$this->IsEntityWithPreventedListing($args['entity']))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return $this->ApiResponse($this->Database->{$args['entity']}()->where('name LIKE ?', '%' . $args['searchString'] . '%'));
|
return $this->ApiResponse($response, $this->Database->{$args['entity']}()->where('name LIKE ?', '%' . $args['searchString'] . '%'));
|
||||||
}
|
}
|
||||||
catch (\PDOException $ex)
|
catch (\PDOException $ex)
|
||||||
{
|
{
|
||||||
@ -132,11 +132,11 @@ class GenericEntityApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function GetUserfields(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function GetUserfields(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return $this->ApiResponse($this->UserfieldsService->GetValues($args['entity'], $args['objectId']));
|
return $this->ApiResponse($response, $this->UserfieldsService->GetValues($args['entity'], $args['objectId']));
|
||||||
}
|
}
|
||||||
catch (\Exception $ex)
|
catch (\Exception $ex)
|
||||||
{
|
{
|
||||||
@ -144,7 +144,7 @@ class GenericEntityApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function SetUserfields(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function SetUserfields(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
$requestBody = $request->getParsedBody();
|
$requestBody = $request->getParsedBody();
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ use \Grocy\Services\UserfieldsService;
|
|||||||
|
|
||||||
class GenericEntityController extends BaseController
|
class GenericEntityController extends BaseController
|
||||||
{
|
{
|
||||||
public function __construct(\Slim\Container $container)
|
public function __construct(\DI\Container $container)
|
||||||
{
|
{
|
||||||
parent::__construct($container);
|
parent::__construct($container);
|
||||||
$this->UserfieldsService = new UserfieldsService();
|
$this->UserfieldsService = new UserfieldsService();
|
||||||
@ -14,26 +14,26 @@ class GenericEntityController extends BaseController
|
|||||||
|
|
||||||
protected $UserfieldsService;
|
protected $UserfieldsService;
|
||||||
|
|
||||||
public function UserfieldsList(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function UserfieldsList(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'userfields', [
|
return $this->View->render($response, 'userfields', [
|
||||||
'userfields' => $this->UserfieldsService->GetAllFields(),
|
'userfields' => $this->UserfieldsService->GetAllFields(),
|
||||||
'entities' => $this->UserfieldsService->GetEntities()
|
'entities' => $this->UserfieldsService->GetEntities()
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function UserentitiesList(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function UserentitiesList(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'userentities', [
|
return $this->View->render($response, 'userentities', [
|
||||||
'userentities' => $this->Database->userentities()->orderBy('name')
|
'userentities' => $this->Database->userentities()->orderBy('name')
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function UserobjectsList(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function UserobjectsList(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
$userentity = $this->Database->userentities()->where('name = :1', $args['userentityName'])->fetch();
|
$userentity = $this->Database->userentities()->where('name = :1', $args['userentityName'])->fetch();
|
||||||
|
|
||||||
return $this->AppContainer->view->render($response, 'userobjects', [
|
return $this->View->render($response, 'userobjects', [
|
||||||
'userentity' => $userentity,
|
'userentity' => $userentity,
|
||||||
'userobjects' => $this->Database->userobjects()->where('userentity_id = :1', $userentity->id),
|
'userobjects' => $this->Database->userobjects()->where('userentity_id = :1', $userentity->id),
|
||||||
'userfields' => $this->UserfieldsService->GetFields('userentity-' . $args['userentityName']),
|
'userfields' => $this->UserfieldsService->GetFields('userentity-' . $args['userentityName']),
|
||||||
@ -41,11 +41,11 @@ class GenericEntityController extends BaseController
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function UserfieldEditForm(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function UserfieldEditForm(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
if ($args['userfieldId'] == 'new')
|
if ($args['userfieldId'] == 'new')
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'userfieldform', [
|
return $this->View->render($response, 'userfieldform', [
|
||||||
'mode' => 'create',
|
'mode' => 'create',
|
||||||
'userfieldTypes' => $this->UserfieldsService->GetFieldTypes(),
|
'userfieldTypes' => $this->UserfieldsService->GetFieldTypes(),
|
||||||
'entities' => $this->UserfieldsService->GetEntities()
|
'entities' => $this->UserfieldsService->GetEntities()
|
||||||
@ -53,7 +53,7 @@ class GenericEntityController extends BaseController
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'userfieldform', [
|
return $this->View->render($response, 'userfieldform', [
|
||||||
'mode' => 'edit',
|
'mode' => 'edit',
|
||||||
'userfield' => $this->UserfieldsService->GetField($args['userfieldId']),
|
'userfield' => $this->UserfieldsService->GetField($args['userfieldId']),
|
||||||
'userfieldTypes' => $this->UserfieldsService->GetFieldTypes(),
|
'userfieldTypes' => $this->UserfieldsService->GetFieldTypes(),
|
||||||
@ -62,30 +62,30 @@ class GenericEntityController extends BaseController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function UserentityEditForm(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function UserentityEditForm(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
if ($args['userentityId'] == 'new')
|
if ($args['userentityId'] == 'new')
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'userentityform', [
|
return $this->View->render($response, 'userentityform', [
|
||||||
'mode' => 'create'
|
'mode' => 'create'
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'userentityform', [
|
return $this->View->render($response, 'userentityform', [
|
||||||
'mode' => 'edit',
|
'mode' => 'edit',
|
||||||
'userentity' => $this->Database->userentities($args['userentityId'])
|
'userentity' => $this->Database->userentities($args['userentityId'])
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function UserobjectEditForm(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function UserobjectEditForm(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
$userentity = $this->Database->userentities()->where('name = :1', $args['userentityName'])->fetch();
|
$userentity = $this->Database->userentities()->where('name = :1', $args['userentityName'])->fetch();
|
||||||
|
|
||||||
if ($args['userobjectId'] == 'new')
|
if ($args['userobjectId'] == 'new')
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'userobjectform', [
|
return $this->View->render($response, 'userobjectform', [
|
||||||
'userentity' => $userentity,
|
'userentity' => $userentity,
|
||||||
'mode' => 'create',
|
'mode' => 'create',
|
||||||
'userfields' => $this->UserfieldsService->GetFields('userentity-' . $args['userentityName'])
|
'userfields' => $this->UserfieldsService->GetFields('userentity-' . $args['userentityName'])
|
||||||
@ -93,7 +93,7 @@ class GenericEntityController extends BaseController
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'userobjectform', [
|
return $this->View->render($response, 'userobjectform', [
|
||||||
'userentity' => $userentity,
|
'userentity' => $userentity,
|
||||||
'mode' => 'edit',
|
'mode' => 'edit',
|
||||||
'userobject' => $this->Database->userobjects($args['userobjectId']),
|
'userobject' => $this->Database->userobjects($args['userobjectId']),
|
||||||
|
@ -8,7 +8,7 @@ use \Grocy\Services\DemoDataGeneratorService;
|
|||||||
|
|
||||||
class LoginController extends BaseController
|
class LoginController extends BaseController
|
||||||
{
|
{
|
||||||
public function __construct(\Slim\Container $container, string $sessionCookieName)
|
public function __construct(\DI\Container $container, string $sessionCookieName)
|
||||||
{
|
{
|
||||||
parent::__construct($container);
|
parent::__construct($container);
|
||||||
$this->SessionService = new SessionService();
|
$this->SessionService = new SessionService();
|
||||||
@ -18,7 +18,7 @@ class LoginController extends BaseController
|
|||||||
protected $SessionService;
|
protected $SessionService;
|
||||||
protected $SessionCookieName;
|
protected $SessionCookieName;
|
||||||
|
|
||||||
public function ProcessLogin(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function ProcessLogin(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
$postParams = $request->getParsedBody();
|
$postParams = $request->getParsedBody();
|
||||||
if (isset($postParams['username']) && isset($postParams['password']))
|
if (isset($postParams['username']) && isset($postParams['password']))
|
||||||
@ -39,28 +39,28 @@ class LoginController extends BaseController
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $response->withRedirect($this->AppContainer->UrlManager->ConstructUrl('/'));
|
return $response->withRedirect($this->AppContainer->get('UrlManager')->ConstructUrl('/'));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return $response->withRedirect($this->AppContainer->UrlManager->ConstructUrl('/login?invalid=true'));
|
return $response->withRedirect($this->AppContainer->get('UrlManager')->ConstructUrl('/login?invalid=true'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return $response->withRedirect($this->AppContainer->UrlManager->ConstructUrl('/login?invalid=true'));
|
return $response->withRedirect($this->AppContainer->get('UrlManager')->ConstructUrl('/login?invalid=true'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function LoginPage(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function LoginPage(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'login');
|
return $this->View->render($response, 'login');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function Logout(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function Logout(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
$this->SessionService->RemoveSession($_COOKIE[$this->SessionCookieName]);
|
$this->SessionService->RemoveSession($_COOKIE[$this->SessionCookieName]);
|
||||||
return $response->withRedirect($this->AppContainer->UrlManager->ConstructUrl('/'));
|
return $response->withRedirect($this->AppContainer->get('UrlManager')->ConstructUrl('/'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function GetSessionCookieName()
|
public function GetSessionCookieName()
|
||||||
|
@ -7,7 +7,7 @@ use \Grocy\Services\ApiKeyService;
|
|||||||
|
|
||||||
class OpenApiController extends BaseApiController
|
class OpenApiController extends BaseApiController
|
||||||
{
|
{
|
||||||
public function __construct(\Slim\Container $container)
|
public function __construct(\DI\Container $container)
|
||||||
{
|
{
|
||||||
parent::__construct($container);
|
parent::__construct($container);
|
||||||
$this->ApiKeyService = new ApiKeyService();
|
$this->ApiKeyService = new ApiKeyService();
|
||||||
@ -15,35 +15,35 @@ class OpenApiController extends BaseApiController
|
|||||||
|
|
||||||
protected $ApiKeyService;
|
protected $ApiKeyService;
|
||||||
|
|
||||||
public function DocumentationUi(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function DocumentationUi(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'openapiui');
|
return $this->View->render($response, 'openapiui');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function DocumentationSpec(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function DocumentationSpec(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
$applicationService = new ApplicationService();
|
$applicationService = new ApplicationService();
|
||||||
|
|
||||||
$versionInfo = $applicationService->GetInstalledVersion();
|
$versionInfo = $applicationService->GetInstalledVersion();
|
||||||
$this->OpenApiSpec->info->version = $versionInfo->Version;
|
$this->OpenApiSpec->info->version = $versionInfo->Version;
|
||||||
$this->OpenApiSpec->info->description = str_replace('PlaceHolderManageApiKeysUrl', $this->AppContainer->UrlManager->ConstructUrl('/manageapikeys'), $this->OpenApiSpec->info->description);
|
$this->OpenApiSpec->info->description = str_replace('PlaceHolderManageApiKeysUrl', $this->AppContainer->get('UrlManager')->ConstructUrl('/manageapikeys'), $this->OpenApiSpec->info->description);
|
||||||
$this->OpenApiSpec->servers[0]->url = $this->AppContainer->UrlManager->ConstructUrl('/api');
|
$this->OpenApiSpec->servers[0]->url = $this->AppContainer->get('UrlManager')->ConstructUrl('/api');
|
||||||
|
|
||||||
return $this->ApiResponse($this->OpenApiSpec);
|
return $this->ApiResponse($response, $this->OpenApiSpec);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function ApiKeysList(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function ApiKeysList(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'manageapikeys', [
|
return $this->View->render($response, 'manageapikeys', [
|
||||||
'apiKeys' => $this->Database->api_keys(),
|
'apiKeys' => $this->Database->api_keys(),
|
||||||
'users' => $this->Database->users()
|
'users' => $this->Database->users()
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function CreateNewApiKey(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function CreateNewApiKey(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
$newApiKey = $this->ApiKeyService->CreateApiKey();
|
$newApiKey = $this->ApiKeyService->CreateApiKey();
|
||||||
$newApiKeyId = $this->ApiKeyService->GetApiKeyId($newApiKey);
|
$newApiKeyId = $this->ApiKeyService->GetApiKeyId($newApiKey);
|
||||||
return $response->withRedirect($this->AppContainer->UrlManager->ConstructUrl("/manageapikeys?CreatedApiKeyId=$newApiKeyId"));
|
return $response->withRedirect($this->AppContainer->get('UrlManager')->ConstructUrl("/manageapikeys?CreatedApiKeyId=$newApiKeyId"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ use \Grocy\Services\RecipesService;
|
|||||||
|
|
||||||
class RecipesApiController extends BaseApiController
|
class RecipesApiController extends BaseApiController
|
||||||
{
|
{
|
||||||
public function __construct(\Slim\Container $container)
|
public function __construct(\DI\Container $container)
|
||||||
{
|
{
|
||||||
parent::__construct($container);
|
parent::__construct($container);
|
||||||
$this->RecipesService = new RecipesService();
|
$this->RecipesService = new RecipesService();
|
||||||
@ -14,7 +14,7 @@ class RecipesApiController extends BaseApiController
|
|||||||
|
|
||||||
protected $RecipesService;
|
protected $RecipesService;
|
||||||
|
|
||||||
public function AddNotFulfilledProductsToShoppingList(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function AddNotFulfilledProductsToShoppingList(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
$requestBody = $request->getParsedBody();
|
$requestBody = $request->getParsedBody();
|
||||||
$excludedProductIds = null;
|
$excludedProductIds = null;
|
||||||
@ -28,7 +28,7 @@ class RecipesApiController extends BaseApiController
|
|||||||
return $this->EmptyApiResponse($response);
|
return $this->EmptyApiResponse($response);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function ConsumeRecipe(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function ConsumeRecipe(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -41,13 +41,13 @@ class RecipesApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function GetRecipeFulfillment(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function GetRecipeFulfillment(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if(!isset($args['recipeId']))
|
if(!isset($args['recipeId']))
|
||||||
{
|
{
|
||||||
return $this->ApiResponse($this->RecipesService->GetRecipesResolved());
|
return $this->ApiResponse($response, $this->RecipesService->GetRecipesResolved());
|
||||||
}
|
}
|
||||||
|
|
||||||
$recipeResolved = FindObjectInArrayByPropertyValue($this->RecipesService->GetRecipesResolved(), 'recipe_id', $args['recipeId']);
|
$recipeResolved = FindObjectInArrayByPropertyValue($this->RecipesService->GetRecipesResolved(), 'recipe_id', $args['recipeId']);
|
||||||
@ -57,7 +57,7 @@ class RecipesApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return $this->ApiResponse($recipeResolved);
|
return $this->ApiResponse($response, $recipeResolved);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (\Exception $ex)
|
catch (\Exception $ex)
|
||||||
|
@ -8,7 +8,7 @@ use \Grocy\Services\UserfieldsService;
|
|||||||
|
|
||||||
class RecipesController extends BaseController
|
class RecipesController extends BaseController
|
||||||
{
|
{
|
||||||
public function __construct(\Slim\Container $container)
|
public function __construct(\DI\Container $container)
|
||||||
{
|
{
|
||||||
parent::__construct($container);
|
parent::__construct($container);
|
||||||
$this->RecipesService = new RecipesService();
|
$this->RecipesService = new RecipesService();
|
||||||
@ -20,7 +20,7 @@ class RecipesController extends BaseController
|
|||||||
protected $StockService;
|
protected $StockService;
|
||||||
protected $UserfieldsService;
|
protected $UserfieldsService;
|
||||||
|
|
||||||
public function Overview(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function Overview(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
$recipes = $this->Database->recipes()->where('type', RecipesService::RECIPE_TYPE_NORMAL)->orderBy('name');
|
$recipes = $this->Database->recipes()->where('type', RecipesService::RECIPE_TYPE_NORMAL)->orderBy('name');
|
||||||
$recipesResolved = $this->RecipesService->GetRecipesResolved();
|
$recipesResolved = $this->RecipesService->GetRecipesResolved();
|
||||||
@ -52,7 +52,7 @@ class RecipesController extends BaseController
|
|||||||
$includedRecipeIdsAbsolute[] = $subRecipe->id;
|
$includedRecipeIdsAbsolute[] = $subRecipe->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->AppContainer->view->render($response, 'recipes', [
|
return $this->View->render($response, 'recipes', [
|
||||||
'recipes' => $recipes,
|
'recipes' => $recipes,
|
||||||
'recipesResolved' => $recipesResolved,
|
'recipesResolved' => $recipesResolved,
|
||||||
'recipePositionsResolved' => $this->Database->recipes_pos_resolved()->where('recipe_type', RecipesService::RECIPE_TYPE_NORMAL),
|
'recipePositionsResolved' => $this->Database->recipes_pos_resolved()->where('recipe_type', RecipesService::RECIPE_TYPE_NORMAL),
|
||||||
@ -71,7 +71,7 @@ class RecipesController extends BaseController
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function RecipeEditForm(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function RecipeEditForm(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
$recipeId = $args['recipeId'];
|
$recipeId = $args['recipeId'];
|
||||||
if ($recipeId == 'new')
|
if ($recipeId == 'new')
|
||||||
@ -84,7 +84,7 @@ class RecipesController extends BaseController
|
|||||||
$recipeId = $this->Database->lastInsertId();
|
$recipeId = $this->Database->lastInsertId();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->AppContainer->view->render($response, 'recipeform', [
|
return $this->View->render($response, 'recipeform', [
|
||||||
'recipe' => $this->Database->recipes($recipeId),
|
'recipe' => $this->Database->recipes($recipeId),
|
||||||
'recipePositions' => $this->Database->recipes_pos()->where('recipe_id', $recipeId),
|
'recipePositions' => $this->Database->recipes_pos()->where('recipe_id', $recipeId),
|
||||||
'mode' => 'edit',
|
'mode' => 'edit',
|
||||||
@ -99,11 +99,11 @@ class RecipesController extends BaseController
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function RecipePosEditForm(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function RecipePosEditForm(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
if ($args['recipePosId'] == 'new')
|
if ($args['recipePosId'] == 'new')
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'recipeposform', [
|
return $this->View->render($response, 'recipeposform', [
|
||||||
'mode' => 'create',
|
'mode' => 'create',
|
||||||
'recipe' => $this->Database->recipes($args['recipeId']),
|
'recipe' => $this->Database->recipes($args['recipeId']),
|
||||||
'recipePos' => new \stdClass(),
|
'recipePos' => new \stdClass(),
|
||||||
@ -114,7 +114,7 @@ class RecipesController extends BaseController
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'recipeposform', [
|
return $this->View->render($response, 'recipeposform', [
|
||||||
'mode' => 'edit',
|
'mode' => 'edit',
|
||||||
'recipe' => $this->Database->recipes($args['recipeId']),
|
'recipe' => $this->Database->recipes($args['recipeId']),
|
||||||
'recipePos' => $this->Database->recipes_pos($args['recipePosId']),
|
'recipePos' => $this->Database->recipes_pos($args['recipePosId']),
|
||||||
@ -125,12 +125,12 @@ class RecipesController extends BaseController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function RecipesSettings(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function RecipesSettings(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'recipessettings');
|
return $this->View->render($response, 'recipessettings');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function MealPlan(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function MealPlan(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
$recipes = $this->Database->recipes()->where('type', RecipesService::RECIPE_TYPE_NORMAL)->fetchAll();
|
$recipes = $this->Database->recipes()->where('type', RecipesService::RECIPE_TYPE_NORMAL)->fetchAll();
|
||||||
|
|
||||||
@ -162,7 +162,7 @@ class RecipesController extends BaseController
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->AppContainer->view->render($response, 'mealplan', [
|
return $this->View->render($response, 'mealplan', [
|
||||||
'fullcalendarEventSources' => $events,
|
'fullcalendarEventSources' => $events,
|
||||||
'recipes' => $recipes,
|
'recipes' => $recipes,
|
||||||
'internalRecipes' => $this->Database->recipes()->whereNot('type', RecipesService::RECIPE_TYPE_NORMAL)->fetchAll(),
|
'internalRecipes' => $this->Database->recipes()->whereNot('type', RecipesService::RECIPE_TYPE_NORMAL)->fetchAll(),
|
||||||
|
@ -6,7 +6,7 @@ use \Grocy\Services\StockService;
|
|||||||
|
|
||||||
class StockApiController extends BaseApiController
|
class StockApiController extends BaseApiController
|
||||||
{
|
{
|
||||||
public function __construct(\Slim\Container $container)
|
public function __construct(\DI\Container $container)
|
||||||
{
|
{
|
||||||
parent::__construct($container);
|
parent::__construct($container);
|
||||||
$this->StockService = new StockService();
|
$this->StockService = new StockService();
|
||||||
@ -14,11 +14,11 @@ class StockApiController extends BaseApiController
|
|||||||
|
|
||||||
protected $StockService;
|
protected $StockService;
|
||||||
|
|
||||||
public function ProductDetails(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function ProductDetails(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return $this->ApiResponse($this->StockService->GetProductDetails($args['productId']));
|
return $this->ApiResponse($response, $this->StockService->GetProductDetails($args['productId']));
|
||||||
}
|
}
|
||||||
catch (\Exception $ex)
|
catch (\Exception $ex)
|
||||||
{
|
{
|
||||||
@ -26,12 +26,12 @@ class StockApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function ProductDetailsByBarcode(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function ProductDetailsByBarcode(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
$productId = $this->StockService->GetProductIdFromBarcode($args['barcode']);
|
$productId = $this->StockService->GetProductIdFromBarcode($args['barcode']);
|
||||||
return $this->ApiResponse($this->StockService->GetProductDetails($productId));
|
return $this->ApiResponse($response, $this->StockService->GetProductDetails($productId));
|
||||||
}
|
}
|
||||||
catch (\Exception $ex)
|
catch (\Exception $ex)
|
||||||
{
|
{
|
||||||
@ -39,11 +39,11 @@ class StockApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function ProductPriceHistory(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function ProductPriceHistory(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return $this->ApiResponse($this->StockService->GetProductPriceHistory($args['productId']));
|
return $this->ApiResponse($response, $this->StockService->GetProductPriceHistory($args['productId']));
|
||||||
}
|
}
|
||||||
catch (\Exception $ex)
|
catch (\Exception $ex)
|
||||||
{
|
{
|
||||||
@ -51,7 +51,7 @@ class StockApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function AddProduct(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function AddProduct(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
$requestBody = $request->getParsedBody();
|
$requestBody = $request->getParsedBody();
|
||||||
|
|
||||||
@ -92,7 +92,7 @@ class StockApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
|
|
||||||
$bookingId = $this->StockService->AddProduct($args['productId'], $requestBody['amount'], $bestBeforeDate, $transactionType, date('Y-m-d'), $price, $locationId);
|
$bookingId = $this->StockService->AddProduct($args['productId'], $requestBody['amount'], $bestBeforeDate, $transactionType, date('Y-m-d'), $price, $locationId);
|
||||||
return $this->ApiResponse($this->Database->stock_log($bookingId));
|
return $this->ApiResponse($response, $this->Database->stock_log($bookingId));
|
||||||
}
|
}
|
||||||
catch (\Exception $ex)
|
catch (\Exception $ex)
|
||||||
{
|
{
|
||||||
@ -100,7 +100,7 @@ class StockApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function AddProductByBarcode(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function AddProductByBarcode(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -113,7 +113,7 @@ class StockApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function EditStockEntry(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function EditStockEntry(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
$requestBody = $request->getParsedBody();
|
$requestBody = $request->getParsedBody();
|
||||||
|
|
||||||
@ -148,7 +148,7 @@ class StockApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
|
|
||||||
$bookingId = $this->StockService->EditStockEntry($args['entryId'], $requestBody['amount'], $bestBeforeDate, $locationId, $price, $requestBody['open'], $requestBody['purchased_date']);
|
$bookingId = $this->StockService->EditStockEntry($args['entryId'], $requestBody['amount'], $bestBeforeDate, $locationId, $price, $requestBody['open'], $requestBody['purchased_date']);
|
||||||
return $this->ApiResponse($this->Database->stock_log($bookingId));
|
return $this->ApiResponse($response, $this->Database->stock_log($bookingId));
|
||||||
}
|
}
|
||||||
catch (\Exception $ex)
|
catch (\Exception $ex)
|
||||||
{
|
{
|
||||||
@ -156,7 +156,7 @@ class StockApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function TransferProduct(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function TransferProduct(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
$requestBody = $request->getParsedBody();
|
$requestBody = $request->getParsedBody();
|
||||||
|
|
||||||
@ -189,7 +189,7 @@ class StockApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
|
|
||||||
$bookingId = $this->StockService->TransferProduct($args['productId'], $requestBody['amount'], $requestBody['location_id_from'], $requestBody['location_id_to'], $specificStockEntryId);
|
$bookingId = $this->StockService->TransferProduct($args['productId'], $requestBody['amount'], $requestBody['location_id_from'], $requestBody['location_id_to'], $specificStockEntryId);
|
||||||
return $this->ApiResponse($this->Database->stock_log($bookingId));
|
return $this->ApiResponse($response, $this->Database->stock_log($bookingId));
|
||||||
}
|
}
|
||||||
catch (\Exception $ex)
|
catch (\Exception $ex)
|
||||||
{
|
{
|
||||||
@ -197,7 +197,7 @@ class StockApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function TransferProductByBarcode(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function TransferProductByBarcode(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -210,7 +210,7 @@ class StockApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function ConsumeProduct(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function ConsumeProduct(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
$requestBody = $request->getParsedBody();
|
$requestBody = $request->getParsedBody();
|
||||||
|
|
||||||
@ -257,7 +257,7 @@ class StockApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
|
|
||||||
$bookingId = $this->StockService->ConsumeProduct($args['productId'], $requestBody['amount'], $spoiled, $transactionType, $specificStockEntryId, $recipeId, $locationId);
|
$bookingId = $this->StockService->ConsumeProduct($args['productId'], $requestBody['amount'], $spoiled, $transactionType, $specificStockEntryId, $recipeId, $locationId);
|
||||||
return $this->ApiResponse($this->Database->stock_log($bookingId));
|
return $this->ApiResponse($response, $this->Database->stock_log($bookingId));
|
||||||
}
|
}
|
||||||
catch (\Exception $ex)
|
catch (\Exception $ex)
|
||||||
{
|
{
|
||||||
@ -265,7 +265,7 @@ class StockApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function ConsumeProductByBarcode(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function ConsumeProductByBarcode(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -278,7 +278,7 @@ class StockApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function InventoryProduct(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function InventoryProduct(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
$requestBody = $request->getParsedBody();
|
$requestBody = $request->getParsedBody();
|
||||||
|
|
||||||
@ -313,7 +313,7 @@ class StockApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
|
|
||||||
$bookingId = $this->StockService->InventoryProduct($args['productId'], $requestBody['new_amount'], $bestBeforeDate, $locationId, $price);
|
$bookingId = $this->StockService->InventoryProduct($args['productId'], $requestBody['new_amount'], $bestBeforeDate, $locationId, $price);
|
||||||
return $this->ApiResponse($this->Database->stock_log($bookingId));
|
return $this->ApiResponse($response, $this->Database->stock_log($bookingId));
|
||||||
}
|
}
|
||||||
catch (\Exception $ex)
|
catch (\Exception $ex)
|
||||||
{
|
{
|
||||||
@ -321,7 +321,7 @@ class StockApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function InventoryProductByBarcode(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function InventoryProductByBarcode(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -334,7 +334,7 @@ class StockApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function OpenProduct(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function OpenProduct(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
$requestBody = $request->getParsedBody();
|
$requestBody = $request->getParsedBody();
|
||||||
|
|
||||||
@ -357,7 +357,7 @@ class StockApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
|
|
||||||
$bookingId = $this->StockService->OpenProduct($args['productId'], $requestBody['amount'], $specificStockEntryId);
|
$bookingId = $this->StockService->OpenProduct($args['productId'], $requestBody['amount'], $specificStockEntryId);
|
||||||
return $this->ApiResponse($this->Database->stock_log($bookingId));
|
return $this->ApiResponse($response, $this->Database->stock_log($bookingId));
|
||||||
}
|
}
|
||||||
catch (\Exception $ex)
|
catch (\Exception $ex)
|
||||||
{
|
{
|
||||||
@ -365,7 +365,7 @@ class StockApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function OpenProductByBarcode(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function OpenProductByBarcode(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -378,12 +378,12 @@ class StockApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function CurrentStock(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function CurrentStock(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
return $this->ApiResponse($this->StockService->GetCurrentStock());
|
return $this->ApiResponse($response, $this->StockService->GetCurrentStock());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function CurrentVolatileStock(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function CurrentVolatileStock(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
$nextXDays = 5;
|
$nextXDays = 5;
|
||||||
if (isset($request->getQueryParams()['expiring_days']) && !empty($request->getQueryParams()['expiring_days']) && is_numeric($request->getQueryParams()['expiring_days']))
|
if (isset($request->getQueryParams()['expiring_days']) && !empty($request->getQueryParams()['expiring_days']) && is_numeric($request->getQueryParams()['expiring_days']))
|
||||||
@ -394,14 +394,14 @@ class StockApiController extends BaseApiController
|
|||||||
$expiringProducts = $this->StockService->GetExpiringProducts($nextXDays, true);
|
$expiringProducts = $this->StockService->GetExpiringProducts($nextXDays, true);
|
||||||
$expiredProducts = $this->StockService->GetExpiringProducts(-1);
|
$expiredProducts = $this->StockService->GetExpiringProducts(-1);
|
||||||
$missingProducts = $this->StockService->GetMissingProducts();
|
$missingProducts = $this->StockService->GetMissingProducts();
|
||||||
return $this->ApiResponse(array(
|
return $this->ApiResponse($response, array(
|
||||||
'expiring_products' => $expiringProducts,
|
'expiring_products' => $expiringProducts,
|
||||||
'expired_products' => $expiredProducts,
|
'expired_products' => $expiredProducts,
|
||||||
'missing_products' => $missingProducts
|
'missing_products' => $missingProducts
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function AddMissingProductsToShoppingList(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function AddMissingProductsToShoppingList(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -422,7 +422,7 @@ class StockApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function ClearShoppingList(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function ClearShoppingList(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -444,7 +444,7 @@ class StockApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function AddProductToShoppingList(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function AddProductToShoppingList(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -485,7 +485,7 @@ class StockApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function RemoveProductFromShoppingList(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function RemoveProductFromShoppingList(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -521,7 +521,7 @@ class StockApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function ExternalBarcodeLookup(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function ExternalBarcodeLookup(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -531,7 +531,7 @@ class StockApiController extends BaseApiController
|
|||||||
$addFoundProduct = true;
|
$addFoundProduct = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->ApiResponse($this->StockService->ExternalBarcodeLookup($args['barcode'], $addFoundProduct));
|
return $this->ApiResponse($response, $this->StockService->ExternalBarcodeLookup($args['barcode'], $addFoundProduct));
|
||||||
}
|
}
|
||||||
catch (\Exception $ex)
|
catch (\Exception $ex)
|
||||||
{
|
{
|
||||||
@ -539,11 +539,11 @@ class StockApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function UndoBooking(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function UndoBooking(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
$this->ApiResponse($this->StockService->UndoBooking($args['bookingId']));
|
$this->ApiResponse($response, $this->StockService->UndoBooking($args['bookingId']));
|
||||||
return $this->EmptyApiResponse($response);
|
return $this->EmptyApiResponse($response);
|
||||||
}
|
}
|
||||||
catch (\Exception $ex)
|
catch (\Exception $ex)
|
||||||
@ -552,11 +552,11 @@ class StockApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function UndoTransaction(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function UndoTransaction(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
$this->ApiResponse($this->StockService->UndoTransaction($args['transactionId']));
|
$this->ApiResponse($response, $this->StockService->UndoTransaction($args['transactionId']));
|
||||||
return $this->EmptyApiResponse($response);
|
return $this->EmptyApiResponse($response);
|
||||||
}
|
}
|
||||||
catch (\Exception $ex)
|
catch (\Exception $ex)
|
||||||
@ -565,7 +565,7 @@ class StockApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function ProductStockEntries(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function ProductStockEntries(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
$allowSubproductSubstitution = false;
|
$allowSubproductSubstitution = false;
|
||||||
if (isset($request->getQueryParams()['include_sub_products']) && filter_var($request->getQueryParams()['include_sub_products'], FILTER_VALIDATE_BOOLEAN))
|
if (isset($request->getQueryParams()['include_sub_products']) && filter_var($request->getQueryParams()['include_sub_products'], FILTER_VALIDATE_BOOLEAN))
|
||||||
@ -573,20 +573,20 @@ class StockApiController extends BaseApiController
|
|||||||
$allowSubproductSubstitution = true;
|
$allowSubproductSubstitution = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->ApiResponse($this->StockService->GetProductStockEntries($args['productId'], false, $allowSubproductSubstitution));
|
return $this->ApiResponse($response, $this->StockService->GetProductStockEntries($args['productId'], false, $allowSubproductSubstitution));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function ProductStockLocations(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function ProductStockLocations(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
return $this->ApiResponse($this->StockService->GetProductStockLocations($args['productId']));
|
return $this->ApiResponse($response, $this->StockService->GetProductStockLocations($args['productId']));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function StockEntry(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function StockEntry(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
return $this->ApiResponse($this->StockService->GetStockEntry($args['entryId']));
|
return $this->ApiResponse($response, $this->StockService->GetStockEntry($args['entryId']));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function StockBooking(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function StockBooking(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -597,7 +597,7 @@ class StockApiController extends BaseApiController
|
|||||||
throw new \Exception('Stock booking does not exist');
|
throw new \Exception('Stock booking does not exist');
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->ApiResponse($stockLogRow);
|
return $this->ApiResponse($response, $stockLogRow);
|
||||||
}
|
}
|
||||||
catch (\Exception $ex)
|
catch (\Exception $ex)
|
||||||
{
|
{
|
||||||
@ -605,7 +605,7 @@ class StockApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function StockTransactions(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function StockTransactions(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -616,7 +616,7 @@ class StockApiController extends BaseApiController
|
|||||||
throw new \Exception('No transaction was found by the given transaction id');
|
throw new \Exception('No transaction was found by the given transaction id');
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->ApiResponse($transactionRows);
|
return $this->ApiResponse($response, $transactionRows);
|
||||||
}
|
}
|
||||||
catch (\Exception $ex)
|
catch (\Exception $ex)
|
||||||
{
|
{
|
||||||
|
@ -9,7 +9,7 @@ use \Grocy\Services\UserfieldsService;
|
|||||||
class StockController extends BaseController
|
class StockController extends BaseController
|
||||||
{
|
{
|
||||||
|
|
||||||
public function __construct(\Slim\Container $container)
|
public function __construct(\DI\Container $container)
|
||||||
{
|
{
|
||||||
parent::__construct($container);
|
parent::__construct($container);
|
||||||
$this->StockService = new StockService();
|
$this->StockService = new StockService();
|
||||||
@ -19,12 +19,12 @@ class StockController extends BaseController
|
|||||||
protected $StockService;
|
protected $StockService;
|
||||||
protected $UserfieldsService;
|
protected $UserfieldsService;
|
||||||
|
|
||||||
public function Overview(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function Overview(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
$usersService = new UsersService();
|
$usersService = new UsersService();
|
||||||
$nextXDays = $usersService->GetUserSettings(GROCY_USER_ID)['stock_expring_soon_days'];
|
$nextXDays = $usersService->GetUserSettings(GROCY_USER_ID)['stock_expring_soon_days'];
|
||||||
|
|
||||||
return $this->AppContainer->view->render($response, 'stockoverview', [
|
return $this->View->render($response, 'stockoverview', [
|
||||||
'products' => $this->Database->products()->orderBy('name'),
|
'products' => $this->Database->products()->orderBy('name'),
|
||||||
'quantityunits' => $this->Database->quantity_units()->orderBy('name'),
|
'quantityunits' => $this->Database->quantity_units()->orderBy('name'),
|
||||||
'locations' => $this->Database->locations()->orderBy('name'),
|
'locations' => $this->Database->locations()->orderBy('name'),
|
||||||
@ -38,12 +38,12 @@ class StockController extends BaseController
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function Stockentries(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function Stockentries(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
$usersService = new UsersService();
|
$usersService = new UsersService();
|
||||||
$nextXDays = $usersService->GetUserSettings(GROCY_USER_ID)['stock_expring_soon_days'];
|
$nextXDays = $usersService->GetUserSettings(GROCY_USER_ID)['stock_expring_soon_days'];
|
||||||
|
|
||||||
return $this->AppContainer->view->render($response, 'stockentries', [
|
return $this->View->render($response, 'stockentries', [
|
||||||
'products' => $this->Database->products()->orderBy('name'),
|
'products' => $this->Database->products()->orderBy('name'),
|
||||||
'quantityunits' => $this->Database->quantity_units()->orderBy('name'),
|
'quantityunits' => $this->Database->quantity_units()->orderBy('name'),
|
||||||
'locations' => $this->Database->locations()->orderBy('name'),
|
'locations' => $this->Database->locations()->orderBy('name'),
|
||||||
@ -55,50 +55,50 @@ class StockController extends BaseController
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function Purchase(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function Purchase(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'purchase', [
|
return $this->View->render($response, 'purchase', [
|
||||||
'products' => $this->Database->products()->orderBy('name'),
|
'products' => $this->Database->products()->orderBy('name'),
|
||||||
'locations' => $this->Database->locations()->orderBy('name')
|
'locations' => $this->Database->locations()->orderBy('name')
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function Consume(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function Consume(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'consume', [
|
return $this->View->render($response, 'consume', [
|
||||||
'products' => $this->Database->products()->orderBy('name'),
|
'products' => $this->Database->products()->orderBy('name'),
|
||||||
'recipes' => $this->Database->recipes()->orderBy('name'),
|
'recipes' => $this->Database->recipes()->orderBy('name'),
|
||||||
'locations' => $this->Database->locations()->orderBy('name')
|
'locations' => $this->Database->locations()->orderBy('name')
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function Transfer(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function Transfer(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'transfer', [
|
return $this->View->render($response, 'transfer', [
|
||||||
'products' => $this->Database->products()->orderBy('name'),
|
'products' => $this->Database->products()->orderBy('name'),
|
||||||
'recipes' => $this->Database->recipes()->orderBy('name'),
|
'recipes' => $this->Database->recipes()->orderBy('name'),
|
||||||
'locations' => $this->Database->locations()->orderBy('name')
|
'locations' => $this->Database->locations()->orderBy('name')
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function Inventory(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function Inventory(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'inventory', [
|
return $this->View->render($response, 'inventory', [
|
||||||
'products' => $this->Database->products()->orderBy('name'),
|
'products' => $this->Database->products()->orderBy('name'),
|
||||||
'locations' => $this->Database->locations()->orderBy('name')
|
'locations' => $this->Database->locations()->orderBy('name')
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function StockEntryEditForm(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function StockEntryEditForm(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'stockentryform', [
|
return $this->View->render($response, 'stockentryform', [
|
||||||
'stockEntry' => $this->Database->stock()->where('id', $args['entryId'])->fetch(),
|
'stockEntry' => $this->Database->stock()->where('id', $args['entryId'])->fetch(),
|
||||||
'products' => $this->Database->products()->orderBy('name'),
|
'products' => $this->Database->products()->orderBy('name'),
|
||||||
'locations' => $this->Database->locations()->orderBy('name')
|
'locations' => $this->Database->locations()->orderBy('name')
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function ShoppingList(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function ShoppingList(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
$listId = 1;
|
$listId = 1;
|
||||||
if (isset($request->getQueryParams()['list']))
|
if (isset($request->getQueryParams()['list']))
|
||||||
@ -106,7 +106,7 @@ class StockController extends BaseController
|
|||||||
$listId = $request->getQueryParams()['list'];
|
$listId = $request->getQueryParams()['list'];
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->AppContainer->view->render($response, 'shoppinglist', [
|
return $this->View->render($response, 'shoppinglist', [
|
||||||
'listItems' => $this->Database->shopping_list()->where('shopping_list_id = :1', $listId),
|
'listItems' => $this->Database->shopping_list()->where('shopping_list_id = :1', $listId),
|
||||||
'products' => $this->Database->products()->orderBy('name'),
|
'products' => $this->Database->products()->orderBy('name'),
|
||||||
'quantityunits' => $this->Database->quantity_units()->orderBy('name'),
|
'quantityunits' => $this->Database->quantity_units()->orderBy('name'),
|
||||||
@ -119,9 +119,9 @@ class StockController extends BaseController
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function ProductsList(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function ProductsList(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'products', [
|
return $this->View->render($response, 'products', [
|
||||||
'products' => $this->Database->products()->orderBy('name'),
|
'products' => $this->Database->products()->orderBy('name'),
|
||||||
'locations' => $this->Database->locations()->orderBy('name'),
|
'locations' => $this->Database->locations()->orderBy('name'),
|
||||||
'quantityunits' => $this->Database->quantity_units()->orderBy('name'),
|
'quantityunits' => $this->Database->quantity_units()->orderBy('name'),
|
||||||
@ -131,27 +131,27 @@ class StockController extends BaseController
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function StockSettings(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function StockSettings(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'stocksettings', [
|
return $this->View->render($response, 'stocksettings', [
|
||||||
'locations' => $this->Database->locations()->orderBy('name'),
|
'locations' => $this->Database->locations()->orderBy('name'),
|
||||||
'quantityunits' => $this->Database->quantity_units()->orderBy('name'),
|
'quantityunits' => $this->Database->quantity_units()->orderBy('name'),
|
||||||
'productGroups' => $this->Database->product_groups()->orderBy('name')
|
'productGroups' => $this->Database->product_groups()->orderBy('name')
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function LocationsList(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function LocationsList(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'locations', [
|
return $this->View->render($response, 'locations', [
|
||||||
'locations' => $this->Database->locations()->orderBy('name'),
|
'locations' => $this->Database->locations()->orderBy('name'),
|
||||||
'userfields' => $this->UserfieldsService->GetFields('locations'),
|
'userfields' => $this->UserfieldsService->GetFields('locations'),
|
||||||
'userfieldValues' => $this->UserfieldsService->GetAllValues('locations')
|
'userfieldValues' => $this->UserfieldsService->GetAllValues('locations')
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function ProductGroupsList(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function ProductGroupsList(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'productgroups', [
|
return $this->View->render($response, 'productgroups', [
|
||||||
'productGroups' => $this->Database->product_groups()->orderBy('name'),
|
'productGroups' => $this->Database->product_groups()->orderBy('name'),
|
||||||
'products' => $this->Database->products()->orderBy('name'),
|
'products' => $this->Database->products()->orderBy('name'),
|
||||||
'userfields' => $this->UserfieldsService->GetFields('product_groups'),
|
'userfields' => $this->UserfieldsService->GetFields('product_groups'),
|
||||||
@ -159,20 +159,20 @@ class StockController extends BaseController
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function QuantityUnitsList(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function QuantityUnitsList(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'quantityunits', [
|
return $this->View->render($response, 'quantityunits', [
|
||||||
'quantityunits' => $this->Database->quantity_units()->orderBy('name'),
|
'quantityunits' => $this->Database->quantity_units()->orderBy('name'),
|
||||||
'userfields' => $this->UserfieldsService->GetFields('quantity_units'),
|
'userfields' => $this->UserfieldsService->GetFields('quantity_units'),
|
||||||
'userfieldValues' => $this->UserfieldsService->GetAllValues('quantity_units')
|
'userfieldValues' => $this->UserfieldsService->GetAllValues('quantity_units')
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function ProductEditForm(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function ProductEditForm(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
if ($args['productId'] == 'new')
|
if ($args['productId'] == 'new')
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'productform', [
|
return $this->View->render($response, 'productform', [
|
||||||
'locations' => $this->Database->locations()->orderBy('name'),
|
'locations' => $this->Database->locations()->orderBy('name'),
|
||||||
'quantityunits' => $this->Database->quantity_units()->orderBy('name'),
|
'quantityunits' => $this->Database->quantity_units()->orderBy('name'),
|
||||||
'productgroups' => $this->Database->product_groups()->orderBy('name'),
|
'productgroups' => $this->Database->product_groups()->orderBy('name'),
|
||||||
@ -186,7 +186,7 @@ class StockController extends BaseController
|
|||||||
{
|
{
|
||||||
$product = $this->Database->products($args['productId']);
|
$product = $this->Database->products($args['productId']);
|
||||||
|
|
||||||
return $this->AppContainer->view->render($response, 'productform', [
|
return $this->View->render($response, 'productform', [
|
||||||
'product' => $product,
|
'product' => $product,
|
||||||
'locations' => $this->Database->locations()->orderBy('name'),
|
'locations' => $this->Database->locations()->orderBy('name'),
|
||||||
'quantityunits' => $this->Database->quantity_units()->orderBy('name'),
|
'quantityunits' => $this->Database->quantity_units()->orderBy('name'),
|
||||||
@ -200,18 +200,18 @@ class StockController extends BaseController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function LocationEditForm(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function LocationEditForm(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
if ($args['locationId'] == 'new')
|
if ($args['locationId'] == 'new')
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'locationform', [
|
return $this->View->render($response, 'locationform', [
|
||||||
'mode' => 'create',
|
'mode' => 'create',
|
||||||
'userfields' => $this->UserfieldsService->GetFields('locations')
|
'userfields' => $this->UserfieldsService->GetFields('locations')
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'locationform', [
|
return $this->View->render($response, 'locationform', [
|
||||||
'location' => $this->Database->locations($args['locationId']),
|
'location' => $this->Database->locations($args['locationId']),
|
||||||
'mode' => 'edit',
|
'mode' => 'edit',
|
||||||
'userfields' => $this->UserfieldsService->GetFields('locations')
|
'userfields' => $this->UserfieldsService->GetFields('locations')
|
||||||
@ -219,18 +219,18 @@ class StockController extends BaseController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function ProductGroupEditForm(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function ProductGroupEditForm(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
if ($args['productGroupId'] == 'new')
|
if ($args['productGroupId'] == 'new')
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'productgroupform', [
|
return $this->View->render($response, 'productgroupform', [
|
||||||
'mode' => 'create',
|
'mode' => 'create',
|
||||||
'userfields' => $this->UserfieldsService->GetFields('product_groups')
|
'userfields' => $this->UserfieldsService->GetFields('product_groups')
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'productgroupform', [
|
return $this->View->render($response, 'productgroupform', [
|
||||||
'group' => $this->Database->product_groups($args['productGroupId']),
|
'group' => $this->Database->product_groups($args['productGroupId']),
|
||||||
'mode' => 'edit',
|
'mode' => 'edit',
|
||||||
'userfields' => $this->UserfieldsService->GetFields('product_groups')
|
'userfields' => $this->UserfieldsService->GetFields('product_groups')
|
||||||
@ -238,11 +238,11 @@ class StockController extends BaseController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function QuantityUnitEditForm(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function QuantityUnitEditForm(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
if ($args['quantityunitId'] == 'new')
|
if ($args['quantityunitId'] == 'new')
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'quantityunitform', [
|
return $this->View->render($response, 'quantityunitform', [
|
||||||
'mode' => 'create',
|
'mode' => 'create',
|
||||||
'userfields' => $this->UserfieldsService->GetFields('quantity_units'),
|
'userfields' => $this->UserfieldsService->GetFields('quantity_units'),
|
||||||
'pluralCount' => $this->LocalizationService->GetPluralCount(),
|
'pluralCount' => $this->LocalizationService->GetPluralCount(),
|
||||||
@ -253,7 +253,7 @@ class StockController extends BaseController
|
|||||||
{
|
{
|
||||||
$quantityUnit = $this->Database->quantity_units($args['quantityunitId']);
|
$quantityUnit = $this->Database->quantity_units($args['quantityunitId']);
|
||||||
|
|
||||||
return $this->AppContainer->view->render($response, 'quantityunitform', [
|
return $this->View->render($response, 'quantityunitform', [
|
||||||
'quantityUnit' => $quantityUnit,
|
'quantityUnit' => $quantityUnit,
|
||||||
'mode' => 'edit',
|
'mode' => 'edit',
|
||||||
'userfields' => $this->UserfieldsService->GetFields('quantity_units'),
|
'userfields' => $this->UserfieldsService->GetFields('quantity_units'),
|
||||||
@ -265,11 +265,11 @@ class StockController extends BaseController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function ShoppingListItemEditForm(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function ShoppingListItemEditForm(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
if ($args['itemId'] == 'new')
|
if ($args['itemId'] == 'new')
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'shoppinglistitemform', [
|
return $this->View->render($response, 'shoppinglistitemform', [
|
||||||
'products' => $this->Database->products()->orderBy('name'),
|
'products' => $this->Database->products()->orderBy('name'),
|
||||||
'shoppingLists' => $this->Database->shopping_lists()->orderBy('name'),
|
'shoppingLists' => $this->Database->shopping_lists()->orderBy('name'),
|
||||||
'mode' => 'create'
|
'mode' => 'create'
|
||||||
@ -277,7 +277,7 @@ class StockController extends BaseController
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'shoppinglistitemform', [
|
return $this->View->render($response, 'shoppinglistitemform', [
|
||||||
'listItem' => $this->Database->shopping_list($args['itemId']),
|
'listItem' => $this->Database->shopping_list($args['itemId']),
|
||||||
'products' => $this->Database->products()->orderBy('name'),
|
'products' => $this->Database->products()->orderBy('name'),
|
||||||
'shoppingLists' => $this->Database->shopping_lists()->orderBy('name'),
|
'shoppingLists' => $this->Database->shopping_lists()->orderBy('name'),
|
||||||
@ -286,31 +286,31 @@ class StockController extends BaseController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function ShoppingListEditForm(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function ShoppingListEditForm(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
if ($args['listId'] == 'new')
|
if ($args['listId'] == 'new')
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'shoppinglistform', [
|
return $this->View->render($response, 'shoppinglistform', [
|
||||||
'mode' => 'create'
|
'mode' => 'create'
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'shoppinglistform', [
|
return $this->View->render($response, 'shoppinglistform', [
|
||||||
'shoppingList' => $this->Database->shopping_lists($args['listId']),
|
'shoppingList' => $this->Database->shopping_lists($args['listId']),
|
||||||
'mode' => 'edit'
|
'mode' => 'edit'
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function ShoppingListSettings(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function ShoppingListSettings(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'shoppinglistsettings');
|
return $this->View->render($response, 'shoppinglistsettings');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function Journal(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function Journal(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'stockjournal', [
|
return $this->View->render($response, 'stockjournal', [
|
||||||
'stockLog' => $this->Database->stock_log()->orderBy('row_created_timestamp', 'DESC'),
|
'stockLog' => $this->Database->stock_log()->orderBy('row_created_timestamp', 'DESC'),
|
||||||
'locations' => $this->Database->locations()->orderBy('name'),
|
'locations' => $this->Database->locations()->orderBy('name'),
|
||||||
'products' => $this->Database->products()->orderBy('name'),
|
'products' => $this->Database->products()->orderBy('name'),
|
||||||
@ -318,9 +318,9 @@ class StockController extends BaseController
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function LocationContentSheet(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function LocationContentSheet(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'locationcontentsheet', [
|
return $this->View->render($response, 'locationcontentsheet', [
|
||||||
'products' => $this->Database->products()->orderBy('name'),
|
'products' => $this->Database->products()->orderBy('name'),
|
||||||
'quantityunits' => $this->Database->quantity_units()->orderBy('name'),
|
'quantityunits' => $this->Database->quantity_units()->orderBy('name'),
|
||||||
'locations' => $this->Database->locations()->orderBy('name'),
|
'locations' => $this->Database->locations()->orderBy('name'),
|
||||||
@ -328,7 +328,7 @@ class StockController extends BaseController
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function QuantityUnitConversionEditForm(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function QuantityUnitConversionEditForm(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
$product = null;
|
$product = null;
|
||||||
if (isset($request->getQueryParams()['product']))
|
if (isset($request->getQueryParams()['product']))
|
||||||
@ -344,7 +344,7 @@ class StockController extends BaseController
|
|||||||
|
|
||||||
if ($args['quConversionId'] == 'new')
|
if ($args['quConversionId'] == 'new')
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'quantityunitconversionform', [
|
return $this->View->render($response, 'quantityunitconversionform', [
|
||||||
'mode' => 'create',
|
'mode' => 'create',
|
||||||
'userfields' => $this->UserfieldsService->GetFields('quantity_unit_conversions'),
|
'userfields' => $this->UserfieldsService->GetFields('quantity_unit_conversions'),
|
||||||
'quantityunits' => $this->Database->quantity_units()->orderBy('name'),
|
'quantityunits' => $this->Database->quantity_units()->orderBy('name'),
|
||||||
@ -354,7 +354,7 @@ class StockController extends BaseController
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'quantityunitconversionform', [
|
return $this->View->render($response, 'quantityunitconversionform', [
|
||||||
'quConversion' => $this->Database->quantity_unit_conversions($args['quConversionId']),
|
'quConversion' => $this->Database->quantity_unit_conversions($args['quConversionId']),
|
||||||
'mode' => 'edit',
|
'mode' => 'edit',
|
||||||
'userfields' => $this->UserfieldsService->GetFields('quantity_unit_conversions'),
|
'userfields' => $this->UserfieldsService->GetFields('quantity_unit_conversions'),
|
||||||
@ -365,9 +365,9 @@ class StockController extends BaseController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function QuantityUnitPluralFormTesting(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function QuantityUnitPluralFormTesting(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'quantityunitpluraltesting', [
|
return $this->View->render($response, 'quantityunitpluraltesting', [
|
||||||
'quantityUnits' => $this->Database->quantity_units()->orderBy('name')
|
'quantityUnits' => $this->Database->quantity_units()->orderBy('name')
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ use \Grocy\Services\ApplicationService;
|
|||||||
|
|
||||||
class SystemApiController extends BaseApiController
|
class SystemApiController extends BaseApiController
|
||||||
{
|
{
|
||||||
public function __construct(\Slim\Container $container)
|
public function __construct(\DI\Container $container)
|
||||||
{
|
{
|
||||||
parent::__construct($container);
|
parent::__construct($container);
|
||||||
$this->DatabaseService = new DatabaseService();
|
$this->DatabaseService = new DatabaseService();
|
||||||
@ -17,14 +17,14 @@ class SystemApiController extends BaseApiController
|
|||||||
protected $DatabaseService;
|
protected $DatabaseService;
|
||||||
protected $ApplicationService;
|
protected $ApplicationService;
|
||||||
|
|
||||||
public function GetDbChangedTime(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function GetDbChangedTime(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
return $this->ApiResponse(array(
|
return $this->ApiResponse($response, array(
|
||||||
'changed_time' => $this->DatabaseService->GetDbChangedTime()
|
'changed_time' => $this->DatabaseService->GetDbChangedTime()
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function LogMissingLocalization(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function LogMissingLocalization(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
if (GROCY_MODE === 'dev')
|
if (GROCY_MODE === 'dev')
|
||||||
{
|
{
|
||||||
@ -42,8 +42,8 @@ class SystemApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function GetSystemInfo(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function GetSystemInfo(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
return $this->ApiResponse($this->ApplicationService->GetSystemInfo());
|
return $this->ApiResponse($response, $this->ApplicationService->GetSystemInfo());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,13 +10,13 @@ class SystemController extends BaseController
|
|||||||
{
|
{
|
||||||
protected $ApplicationService;
|
protected $ApplicationService;
|
||||||
|
|
||||||
public function __construct(\Slim\Container $container)
|
public function __construct(\DI\Container $container)
|
||||||
{
|
{
|
||||||
parent::__construct($container);
|
parent::__construct($container);
|
||||||
$this->ApplicationService = new ApplicationService();
|
$this->ApplicationService = new ApplicationService();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function Root(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function Root(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
// Schema migration is done here
|
// Schema migration is done here
|
||||||
$databaseMigrationService = new DatabaseMigrationService();
|
$databaseMigrationService = new DatabaseMigrationService();
|
||||||
@ -28,7 +28,7 @@ class SystemController extends BaseController
|
|||||||
$demoDataGeneratorService->PopulateDemoData();
|
$demoDataGeneratorService->PopulateDemoData();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $response->withRedirect($this->AppContainer->UrlManager->ConstructUrl($this->GetEntryPageRelative()));
|
return $response->withRedirect($this->AppContainer->get('UrlManager')->ConstructUrl($this->GetEntryPageRelative()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -94,16 +94,16 @@ class SystemController extends BaseController
|
|||||||
return '/about';
|
return '/about';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function About(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function About(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'about', [
|
return $this->View->render($response, 'about', [
|
||||||
'system_info' => $this->ApplicationService->GetSystemInfo(),
|
'system_info' => $this->ApplicationService->GetSystemInfo(),
|
||||||
'changelog' => $this->ApplicationService->GetChangelog()
|
'changelog' => $this->ApplicationService->GetChangelog()
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function BarcodeScannerTesting(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function BarcodeScannerTesting(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'barcodescannertesting');
|
return $this->View->render($response, 'barcodescannertesting');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ use \Grocy\Services\TasksService;
|
|||||||
|
|
||||||
class TasksApiController extends BaseApiController
|
class TasksApiController extends BaseApiController
|
||||||
{
|
{
|
||||||
public function __construct(\Slim\Container $container)
|
public function __construct(\DI\Container $container)
|
||||||
{
|
{
|
||||||
parent::__construct($container);
|
parent::__construct($container);
|
||||||
$this->TasksService = new TasksService();
|
$this->TasksService = new TasksService();
|
||||||
@ -14,12 +14,12 @@ class TasksApiController extends BaseApiController
|
|||||||
|
|
||||||
protected $TasksService;
|
protected $TasksService;
|
||||||
|
|
||||||
public function Current(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function Current(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
return $this->ApiResponse($this->TasksService->GetCurrent());
|
return $this->ApiResponse($response, $this->TasksService->GetCurrent());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function MarkTaskAsCompleted(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function MarkTaskAsCompleted(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
$requestBody = $request->getParsedBody();
|
$requestBody = $request->getParsedBody();
|
||||||
|
|
||||||
@ -40,7 +40,7 @@ class TasksApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function UndoTask(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function UndoTask(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -8,7 +8,7 @@ use \Grocy\Services\UserfieldsService;
|
|||||||
|
|
||||||
class TasksController extends BaseController
|
class TasksController extends BaseController
|
||||||
{
|
{
|
||||||
public function __construct(\Slim\Container $container)
|
public function __construct(\DI\Container $container)
|
||||||
{
|
{
|
||||||
parent::__construct($container);
|
parent::__construct($container);
|
||||||
$this->TasksService = new TasksService();
|
$this->TasksService = new TasksService();
|
||||||
@ -18,7 +18,7 @@ class TasksController extends BaseController
|
|||||||
protected $TasksService;
|
protected $TasksService;
|
||||||
protected $UserfieldsService;
|
protected $UserfieldsService;
|
||||||
|
|
||||||
public function Overview(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function Overview(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
if (isset($request->getQueryParams()['include_done']))
|
if (isset($request->getQueryParams()['include_done']))
|
||||||
{
|
{
|
||||||
@ -32,7 +32,7 @@ class TasksController extends BaseController
|
|||||||
$usersService = new UsersService();
|
$usersService = new UsersService();
|
||||||
$nextXDays = $usersService->GetUserSettings(GROCY_USER_ID)['tasks_due_soon_days'];
|
$nextXDays = $usersService->GetUserSettings(GROCY_USER_ID)['tasks_due_soon_days'];
|
||||||
|
|
||||||
return $this->AppContainer->view->render($response, 'tasks', [
|
return $this->View->render($response, 'tasks', [
|
||||||
'tasks' => $tasks,
|
'tasks' => $tasks,
|
||||||
'nextXDays' => $nextXDays,
|
'nextXDays' => $nextXDays,
|
||||||
'taskCategories' => $this->Database->task_categories()->orderBy('name'),
|
'taskCategories' => $this->Database->task_categories()->orderBy('name'),
|
||||||
@ -42,11 +42,11 @@ class TasksController extends BaseController
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function TaskEditForm(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function TaskEditForm(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
if ($args['taskId'] == 'new')
|
if ($args['taskId'] == 'new')
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'taskform', [
|
return $this->View->render($response, 'taskform', [
|
||||||
'mode' => 'create',
|
'mode' => 'create',
|
||||||
'taskCategories' => $this->Database->task_categories()->orderBy('name'),
|
'taskCategories' => $this->Database->task_categories()->orderBy('name'),
|
||||||
'users' => $this->Database->users()->orderBy('username'),
|
'users' => $this->Database->users()->orderBy('username'),
|
||||||
@ -55,7 +55,7 @@ class TasksController extends BaseController
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'taskform', [
|
return $this->View->render($response, 'taskform', [
|
||||||
'task' => $this->Database->tasks($args['taskId']),
|
'task' => $this->Database->tasks($args['taskId']),
|
||||||
'mode' => 'edit',
|
'mode' => 'edit',
|
||||||
'taskCategories' => $this->Database->task_categories()->orderBy('name'),
|
'taskCategories' => $this->Database->task_categories()->orderBy('name'),
|
||||||
@ -65,27 +65,27 @@ class TasksController extends BaseController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function TaskCategoriesList(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function TaskCategoriesList(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'taskcategories', [
|
return $this->View->render($response, 'taskcategories', [
|
||||||
'taskCategories' => $this->Database->task_categories()->orderBy('name'),
|
'taskCategories' => $this->Database->task_categories()->orderBy('name'),
|
||||||
'userfields' => $this->UserfieldsService->GetFields('task_categories'),
|
'userfields' => $this->UserfieldsService->GetFields('task_categories'),
|
||||||
'userfieldValues' => $this->UserfieldsService->GetAllValues('task_categories')
|
'userfieldValues' => $this->UserfieldsService->GetAllValues('task_categories')
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function TaskCategoryEditForm(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function TaskCategoryEditForm(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
if ($args['categoryId'] == 'new')
|
if ($args['categoryId'] == 'new')
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'taskcategoryform', [
|
return $this->View->render($response, 'taskcategoryform', [
|
||||||
'mode' => 'create',
|
'mode' => 'create',
|
||||||
'userfields' => $this->UserfieldsService->GetFields('task_categories')
|
'userfields' => $this->UserfieldsService->GetFields('task_categories')
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'taskcategoryform', [
|
return $this->View->render($response, 'taskcategoryform', [
|
||||||
'category' => $this->Database->task_categories($args['categoryId']),
|
'category' => $this->Database->task_categories($args['categoryId']),
|
||||||
'mode' => 'edit',
|
'mode' => 'edit',
|
||||||
'userfields' => $this->UserfieldsService->GetFields('task_categories')
|
'userfields' => $this->UserfieldsService->GetFields('task_categories')
|
||||||
@ -93,8 +93,8 @@ class TasksController extends BaseController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function TasksSettings(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function TasksSettings(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'taskssettings');
|
return $this->View->render($response, 'taskssettings');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ use \Grocy\Services\UsersService;
|
|||||||
|
|
||||||
class UsersApiController extends BaseApiController
|
class UsersApiController extends BaseApiController
|
||||||
{
|
{
|
||||||
public function __construct(\Slim\Container $container)
|
public function __construct(\DI\Container $container)
|
||||||
{
|
{
|
||||||
parent::__construct($container);
|
parent::__construct($container);
|
||||||
$this->UsersService = new UsersService();
|
$this->UsersService = new UsersService();
|
||||||
@ -14,11 +14,11 @@ class UsersApiController extends BaseApiController
|
|||||||
|
|
||||||
protected $UsersService;
|
protected $UsersService;
|
||||||
|
|
||||||
public function GetUsers(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function GetUsers(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return $this->ApiResponse($this->UsersService->GetUsersAsDto());
|
return $this->ApiResponse($response, $this->UsersService->GetUsersAsDto());
|
||||||
}
|
}
|
||||||
catch (\Exception $ex)
|
catch (\Exception $ex)
|
||||||
{
|
{
|
||||||
@ -26,7 +26,7 @@ class UsersApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function CreateUser(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function CreateUser(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
$requestBody = $request->getParsedBody();
|
$requestBody = $request->getParsedBody();
|
||||||
|
|
||||||
@ -46,7 +46,7 @@ class UsersApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function DeleteUser(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function DeleteUser(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -59,7 +59,7 @@ class UsersApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function EditUser(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function EditUser(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
$requestBody = $request->getParsedBody();
|
$requestBody = $request->getParsedBody();
|
||||||
|
|
||||||
@ -74,12 +74,12 @@ class UsersApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function GetUserSetting(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function GetUserSetting(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
$value = $this->UsersService->GetUserSetting(GROCY_USER_ID, $args['settingKey']);
|
$value = $this->UsersService->GetUserSetting(GROCY_USER_ID, $args['settingKey']);
|
||||||
return $this->ApiResponse(array('value' => $value));
|
return $this->ApiResponse($response, array('value' => $value));
|
||||||
}
|
}
|
||||||
catch (\Exception $ex)
|
catch (\Exception $ex)
|
||||||
{
|
{
|
||||||
@ -87,7 +87,7 @@ class UsersApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function SetUserSetting(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function SetUserSetting(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -4,24 +4,24 @@ namespace Grocy\Controllers;
|
|||||||
|
|
||||||
class UsersController extends BaseController
|
class UsersController extends BaseController
|
||||||
{
|
{
|
||||||
public function UsersList(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function UsersList(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'users', [
|
return $this->View->render($response, 'users', [
|
||||||
'users' => $this->Database->users()->orderBy('username')
|
'users' => $this->Database->users()->orderBy('username')
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function UserEditForm(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
public function UserEditForm(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||||
{
|
{
|
||||||
if ($args['userId'] == 'new')
|
if ($args['userId'] == 'new')
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'userform', [
|
return $this->View->render($response, 'userform', [
|
||||||
'mode' => 'create'
|
'mode' => 'create'
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return $this->AppContainer->view->render($response, 'userform', [
|
return $this->View->render($response, 'userform', [
|
||||||
'user' => $this->Database->users($args['userId']),
|
'user' => $this->Database->users($args['userId']),
|
||||||
'mode' => 'edit'
|
'mode' => 'edit'
|
||||||
]);
|
]);
|
||||||
|
@ -2,12 +2,17 @@
|
|||||||
|
|
||||||
namespace Grocy\Middleware;
|
namespace Grocy\Middleware;
|
||||||
|
|
||||||
use \Grocy\Services\SessionService;
|
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||||
use \Grocy\Services\ApiKeyService;
|
use Psr\Http\Server\RequestHandlerInterface as RequestHandler;
|
||||||
|
use Psr\Http\Message\ResponseInterface as Response;
|
||||||
|
use Slim\Routing\RouteContext;
|
||||||
|
|
||||||
|
use Grocy\Services\SessionService;
|
||||||
|
use Grocy\Services\ApiKeyService;
|
||||||
|
|
||||||
class ApiKeyAuthMiddleware extends BaseMiddleware
|
class ApiKeyAuthMiddleware extends BaseMiddleware
|
||||||
{
|
{
|
||||||
public function __construct(\Slim\Container $container, string $sessionCookieName, string $apiKeyHeaderName)
|
public function __construct(\DI\Container $container, string $sessionCookieName, string $apiKeyHeaderName)
|
||||||
{
|
{
|
||||||
parent::__construct($container);
|
parent::__construct($container);
|
||||||
$this->SessionCookieName = $sessionCookieName;
|
$this->SessionCookieName = $sessionCookieName;
|
||||||
@ -17,15 +22,16 @@ class ApiKeyAuthMiddleware extends BaseMiddleware
|
|||||||
protected $SessionCookieName;
|
protected $SessionCookieName;
|
||||||
protected $ApiKeyHeaderName;
|
protected $ApiKeyHeaderName;
|
||||||
|
|
||||||
public function __invoke(\Slim\Http\Request $request, \Slim\Http\Response $response, callable $next)
|
public function __invoke(Request $request, RequestHandler $handler): Response
|
||||||
{
|
{
|
||||||
$route = $request->getAttribute('route');
|
$routeContext = RouteContext::fromRequest($request);
|
||||||
|
$route = $routeContext->getRoute();
|
||||||
$routeName = $route->getName();
|
$routeName = $route->getName();
|
||||||
|
|
||||||
if (GROCY_MODE === 'dev' || GROCY_MODE === 'demo' || GROCY_MODE === 'prerelease' || GROCY_IS_EMBEDDED_INSTALL || GROCY_DISABLE_AUTH)
|
if (GROCY_MODE === 'dev' || GROCY_MODE === 'demo' || GROCY_MODE === 'prerelease' || GROCY_IS_EMBEDDED_INSTALL || GROCY_DISABLE_AUTH)
|
||||||
{
|
{
|
||||||
define('GROCY_AUTHENTICATED', true);
|
define('GROCY_AUTHENTICATED', true);
|
||||||
$response = $next($request, $response);
|
$response = $handler->handle($request);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -73,6 +79,7 @@ class ApiKeyAuthMiddleware extends BaseMiddleware
|
|||||||
if (!$validSession && !$validApiKey)
|
if (!$validSession && !$validApiKey)
|
||||||
{
|
{
|
||||||
define('GROCY_AUTHENTICATED', false);
|
define('GROCY_AUTHENTICATED', false);
|
||||||
|
$response = new \Slim\Psr7\Response(); // No content when unauthorized
|
||||||
$response = $response->withStatus(401);
|
$response = $response->withStatus(401);
|
||||||
}
|
}
|
||||||
elseif ($validApiKey)
|
elseif ($validApiKey)
|
||||||
@ -81,7 +88,7 @@ class ApiKeyAuthMiddleware extends BaseMiddleware
|
|||||||
define('GROCY_AUTHENTICATED', true);
|
define('GROCY_AUTHENTICATED', true);
|
||||||
define('GROCY_USER_ID', $user->id);
|
define('GROCY_USER_ID', $user->id);
|
||||||
|
|
||||||
$response = $next($request, $response);
|
$response = $handler->handle($request);
|
||||||
}
|
}
|
||||||
elseif ($validSession)
|
elseif ($validSession)
|
||||||
{
|
{
|
||||||
@ -89,7 +96,7 @@ class ApiKeyAuthMiddleware extends BaseMiddleware
|
|||||||
define('GROCY_AUTHENTICATED', true);
|
define('GROCY_AUTHENTICATED', true);
|
||||||
define('GROCY_USER_ID', $user->id);
|
define('GROCY_USER_ID', $user->id);
|
||||||
|
|
||||||
$response = $next($request, $response);
|
$response = $handler->handle($request);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ use \Grocy\Services\ApplicationService;
|
|||||||
|
|
||||||
class BaseMiddleware
|
class BaseMiddleware
|
||||||
{
|
{
|
||||||
public function __construct(\Slim\Container $container)
|
public function __construct(\DI\Container $container)
|
||||||
{
|
{
|
||||||
$this->AppContainer = $container;
|
$this->AppContainer = $container;
|
||||||
$this->ApplicationService = new ApplicationService();
|
$this->ApplicationService = new ApplicationService();
|
||||||
|
@ -2,11 +2,15 @@
|
|||||||
|
|
||||||
namespace Grocy\Middleware;
|
namespace Grocy\Middleware;
|
||||||
|
|
||||||
|
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||||
|
use Psr\Http\Server\RequestHandlerInterface as RequestHandler;
|
||||||
|
use Psr\Http\Message\ResponseInterface as Response;
|
||||||
|
|
||||||
class JsonMiddleware extends BaseMiddleware
|
class JsonMiddleware extends BaseMiddleware
|
||||||
{
|
{
|
||||||
public function __invoke(\Slim\Http\Request $request, \Slim\Http\Response $response, callable $next)
|
public function __invoke(Request $request, RequestHandler $handler): Response
|
||||||
{
|
{
|
||||||
$response = $next($request, $response);
|
$response = $handler->handle($request);
|
||||||
|
|
||||||
if ($response->hasHeader('Content-Disposition'))
|
if ($response->hasHeader('Content-Disposition'))
|
||||||
{
|
{
|
||||||
|
@ -2,12 +2,17 @@
|
|||||||
|
|
||||||
namespace Grocy\Middleware;
|
namespace Grocy\Middleware;
|
||||||
|
|
||||||
use \Grocy\Services\SessionService;
|
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||||
use \Grocy\Services\LocalizationService;
|
use Psr\Http\Server\RequestHandlerInterface as RequestHandler;
|
||||||
|
use Psr\Http\Message\ResponseInterface as Response;
|
||||||
|
use Slim\Routing\RouteContext;
|
||||||
|
|
||||||
|
use Grocy\Services\SessionService;
|
||||||
|
use Grocy\Services\LocalizationService;
|
||||||
|
|
||||||
class SessionAuthMiddleware extends BaseMiddleware
|
class SessionAuthMiddleware extends BaseMiddleware
|
||||||
{
|
{
|
||||||
public function __construct(\Slim\Container $container, string $sessionCookieName)
|
public function __construct(\DI\Container $container, string $sessionCookieName)
|
||||||
{
|
{
|
||||||
parent::__construct($container);
|
parent::__construct($container);
|
||||||
$this->SessionCookieName = $sessionCookieName;
|
$this->SessionCookieName = $sessionCookieName;
|
||||||
@ -15,15 +20,16 @@ class SessionAuthMiddleware extends BaseMiddleware
|
|||||||
|
|
||||||
protected $SessionCookieName;
|
protected $SessionCookieName;
|
||||||
|
|
||||||
public function __invoke(\Slim\Http\Request $request, \Slim\Http\Response $response, callable $next)
|
public function __invoke(Request $request, RequestHandler $handler): Response
|
||||||
{
|
{
|
||||||
$route = $request->getAttribute('route');
|
$routeContext = RouteContext::fromRequest($request);
|
||||||
|
$route = $routeContext->getRoute();
|
||||||
$routeName = $route->getName();
|
$routeName = $route->getName();
|
||||||
$sessionService = new SessionService();
|
$sessionService = new SessionService();
|
||||||
|
|
||||||
if ($routeName === 'root')
|
if ($routeName === 'root')
|
||||||
{
|
{
|
||||||
$response = $next($request, $response);
|
$response = $handler->handle($request);
|
||||||
}
|
}
|
||||||
elseif (GROCY_MODE === 'dev' || GROCY_MODE === 'demo' || GROCY_MODE === 'prerelease' || GROCY_IS_EMBEDDED_INSTALL || GROCY_DISABLE_AUTH)
|
elseif (GROCY_MODE === 'dev' || GROCY_MODE === 'demo' || GROCY_MODE === 'prerelease' || GROCY_IS_EMBEDDED_INSTALL || GROCY_DISABLE_AUTH)
|
||||||
{
|
{
|
||||||
@ -31,14 +37,15 @@ class SessionAuthMiddleware extends BaseMiddleware
|
|||||||
define('GROCY_AUTHENTICATED', true);
|
define('GROCY_AUTHENTICATED', true);
|
||||||
define('GROCY_USER_USERNAME', $user->username);
|
define('GROCY_USER_USERNAME', $user->username);
|
||||||
|
|
||||||
$response = $next($request, $response);
|
$response = $handler->handle($request);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ((!isset($_COOKIE[$this->SessionCookieName]) || !$sessionService->IsValidSession($_COOKIE[$this->SessionCookieName])) && $routeName !== 'login')
|
if ((!isset($_COOKIE[$this->SessionCookieName]) || !$sessionService->IsValidSession($_COOKIE[$this->SessionCookieName])) && $routeName !== 'login')
|
||||||
{
|
{
|
||||||
define('GROCY_AUTHENTICATED', false);
|
define('GROCY_AUTHENTICATED', false);
|
||||||
$response = $response->withRedirect($this->AppContainer->UrlManager->ConstructUrl('/login'));
|
$response = $handler->handle($request);
|
||||||
|
$response = $response->withHeader('Location', $this->AppContainer->get('UrlManager')->ConstructUrl('/login'));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -54,7 +61,7 @@ class SessionAuthMiddleware extends BaseMiddleware
|
|||||||
define('GROCY_AUTHENTICATED', false);
|
define('GROCY_AUTHENTICATED', false);
|
||||||
}
|
}
|
||||||
|
|
||||||
$response = $next($request, $response);
|
$response = $handler->handle($request);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@danielfarrell/bootstrap-combobox": "https://github.com/berrnd/bootstrap-combobox.git#master",
|
"@danielfarrell/bootstrap-combobox": "https://github.com/berrnd/bootstrap-combobox.git#master",
|
||||||
"@fortawesome/fontawesome-free": "^5.11.1",
|
"@fortawesome/fontawesome-free": "^5.12.1",
|
||||||
"TagManager": "https://github.com/max-favilli/tagmanager.git#master",
|
"TagManager": "https://github.com/max-favilli/tagmanager.git#master",
|
||||||
"animate.css": "^3.7.2",
|
"animate.css": "^3.7.2",
|
||||||
"bootbox": "^5.3.2",
|
"bootbox": "^5.3.2",
|
||||||
|
292
routes.php
292
routes.php
@ -1,251 +1,253 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use \Grocy\Middleware\JsonMiddleware;
|
use Slim\Routing\RouteCollectorProxy;
|
||||||
use \Grocy\Middleware\SessionAuthMiddleware;
|
use Tuupola\Middleware\CorsMiddleware;
|
||||||
use \Grocy\Middleware\ApiKeyAuthMiddleware;
|
|
||||||
use \Tuupola\Middleware\CorsMiddleware;
|
|
||||||
|
|
||||||
$app->group('', function()
|
use Grocy\Middleware\JsonMiddleware;
|
||||||
|
use Grocy\Middleware\SessionAuthMiddleware;
|
||||||
|
use Grocy\Middleware\ApiKeyAuthMiddleware;
|
||||||
|
|
||||||
|
$app->group('', function(RouteCollectorProxy $group)
|
||||||
{
|
{
|
||||||
// System routes
|
// System routes
|
||||||
$this->get('/', '\Grocy\Controllers\SystemController:Root')->setName('root');
|
$group->get('/', '\Grocy\Controllers\SystemController:Root')->setName('root');
|
||||||
$this->get('/about', '\Grocy\Controllers\SystemController:About');
|
$group->get('/about', '\Grocy\Controllers\SystemController:About');
|
||||||
$this->get('/barcodescannertesting', '\Grocy\Controllers\SystemController:BarcodeScannerTesting');
|
$group->get('/barcodescannertesting', '\Grocy\Controllers\SystemController:BarcodeScannerTesting');
|
||||||
|
|
||||||
// Login routes
|
// Login routes
|
||||||
$this->get('/login', 'LoginControllerInstance:LoginPage')->setName('login');
|
$group->get('/login', 'LoginControllerInstance:LoginPage')->setName('login');
|
||||||
$this->post('/login', 'LoginControllerInstance:ProcessLogin')->setName('login');
|
$group->post('/login', 'LoginControllerInstance:ProcessLogin')->setName('login');
|
||||||
$this->get('/logout', 'LoginControllerInstance:Logout');
|
$group->get('/logout', 'LoginControllerInstance:Logout');
|
||||||
|
|
||||||
// Generic entity interaction
|
// Generic entity interaction
|
||||||
$this->get('/userfields', '\Grocy\Controllers\GenericEntityController:UserfieldsList');
|
$group->get('/userfields', '\Grocy\Controllers\GenericEntityController:UserfieldsList');
|
||||||
$this->get('/userfield/{userfieldId}', '\Grocy\Controllers\GenericEntityController:UserfieldEditForm');
|
$group->get('/userfield/{userfieldId}', '\Grocy\Controllers\GenericEntityController:UserfieldEditForm');
|
||||||
$this->get('/userentities', '\Grocy\Controllers\GenericEntityController:UserentitiesList');
|
$group->get('/userentities', '\Grocy\Controllers\GenericEntityController:UserentitiesList');
|
||||||
$this->get('/userentity/{userentityId}', '\Grocy\Controllers\GenericEntityController:UserentityEditForm');
|
$group->get('/userentity/{userentityId}', '\Grocy\Controllers\GenericEntityController:UserentityEditForm');
|
||||||
$this->get('/userobjects/{userentityName}', '\Grocy\Controllers\GenericEntityController:UserobjectsList');
|
$group->get('/userobjects/{userentityName}', '\Grocy\Controllers\GenericEntityController:UserobjectsList');
|
||||||
$this->get('/userobject/{userentityName}/{userobjectId}', '\Grocy\Controllers\GenericEntityController:UserobjectEditForm');
|
$group->get('/userobject/{userentityName}/{userobjectId}', '\Grocy\Controllers\GenericEntityController:UserobjectEditForm');
|
||||||
|
|
||||||
// User routes
|
// User routes
|
||||||
$this->get('/users', '\Grocy\Controllers\UsersController:UsersList');
|
$group->get('/users', '\Grocy\Controllers\UsersController:UsersList');
|
||||||
$this->get('/user/{userId}', '\Grocy\Controllers\UsersController:UserEditForm');
|
$group->get('/user/{userId}', '\Grocy\Controllers\UsersController:UserEditForm');
|
||||||
|
|
||||||
// Stock routes
|
// Stock routes
|
||||||
if (GROCY_FEATURE_FLAG_STOCK)
|
if (GROCY_FEATURE_FLAG_STOCK)
|
||||||
{
|
{
|
||||||
$this->get('/stockoverview', '\Grocy\Controllers\StockController:Overview');
|
$group->get('/stockoverview', '\Grocy\Controllers\StockController:Overview');
|
||||||
$this->get('/stockentries', '\Grocy\Controllers\StockController:Stockentries');
|
$group->get('/stockentries', '\Grocy\Controllers\StockController:Stockentries');
|
||||||
$this->get('/purchase', '\Grocy\Controllers\StockController:Purchase');
|
$group->get('/purchase', '\Grocy\Controllers\StockController:Purchase');
|
||||||
$this->get('/consume', '\Grocy\Controllers\StockController:Consume');
|
$group->get('/consume', '\Grocy\Controllers\StockController:Consume');
|
||||||
$this->get('/transfer', '\Grocy\Controllers\StockController:Transfer');
|
$group->get('/transfer', '\Grocy\Controllers\StockController:Transfer');
|
||||||
$this->get('/inventory', '\Grocy\Controllers\StockController:Inventory');
|
$group->get('/inventory', '\Grocy\Controllers\StockController:Inventory');
|
||||||
$this->get('/stockentry/{entryId}', '\Grocy\Controllers\StockController:StockEntryEditForm');
|
$group->get('/stockentry/{entryId}', '\Grocy\Controllers\StockController:StockEntryEditForm');
|
||||||
$this->get('/products', '\Grocy\Controllers\StockController:ProductsList');
|
$group->get('/products', '\Grocy\Controllers\StockController:ProductsList');
|
||||||
$this->get('/product/{productId}', '\Grocy\Controllers\StockController:ProductEditForm');
|
$group->get('/product/{productId}', '\Grocy\Controllers\StockController:ProductEditForm');
|
||||||
$this->get('/stocksettings', '\Grocy\Controllers\StockController:StockSettings');
|
$group->get('/stocksettings', '\Grocy\Controllers\StockController:StockSettings');
|
||||||
$this->get('/locations', '\Grocy\Controllers\StockController:LocationsList');
|
$group->get('/locations', '\Grocy\Controllers\StockController:LocationsList');
|
||||||
$this->get('/location/{locationId}', '\Grocy\Controllers\StockController:LocationEditForm');
|
$group->get('/location/{locationId}', '\Grocy\Controllers\StockController:LocationEditForm');
|
||||||
$this->get('/quantityunits', '\Grocy\Controllers\StockController:QuantityUnitsList');
|
$group->get('/quantityunits', '\Grocy\Controllers\StockController:QuantityUnitsList');
|
||||||
$this->get('/quantityunit/{quantityunitId}', '\Grocy\Controllers\StockController:QuantityUnitEditForm');
|
$group->get('/quantityunit/{quantityunitId}', '\Grocy\Controllers\StockController:QuantityUnitEditForm');
|
||||||
$this->get('/quantityunitconversion/{quConversionId}', '\Grocy\Controllers\StockController:QuantityUnitConversionEditForm');
|
$group->get('/quantityunitconversion/{quConversionId}', '\Grocy\Controllers\StockController:QuantityUnitConversionEditForm');
|
||||||
$this->get('/productgroups', '\Grocy\Controllers\StockController:ProductGroupsList');
|
$group->get('/productgroups', '\Grocy\Controllers\StockController:ProductGroupsList');
|
||||||
$this->get('/productgroup/{productGroupId}', '\Grocy\Controllers\StockController:ProductGroupEditForm');
|
$group->get('/productgroup/{productGroupId}', '\Grocy\Controllers\StockController:ProductGroupEditForm');
|
||||||
$this->get('/stockjournal', '\Grocy\Controllers\StockController:Journal');
|
$group->get('/stockjournal', '\Grocy\Controllers\StockController:Journal');
|
||||||
$this->get('/locationcontentsheet', '\Grocy\Controllers\StockController:LocationContentSheet');
|
$group->get('/locationcontentsheet', '\Grocy\Controllers\StockController:LocationContentSheet');
|
||||||
$this->get('/quantityunitpluraltesting', '\Grocy\Controllers\StockController:QuantityUnitPluralFormTesting');
|
$group->get('/quantityunitpluraltesting', '\Grocy\Controllers\StockController:QuantityUnitPluralFormTesting');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Shopping list routes
|
// Shopping list routes
|
||||||
if (GROCY_FEATURE_FLAG_SHOPPINGLIST)
|
if (GROCY_FEATURE_FLAG_SHOPPINGLIST)
|
||||||
{
|
{
|
||||||
$this->get('/shoppinglist', '\Grocy\Controllers\StockController:ShoppingList');
|
$group->get('/shoppinglist', '\Grocy\Controllers\StockController:ShoppingList');
|
||||||
$this->get('/shoppinglistitem/{itemId}', '\Grocy\Controllers\StockController:ShoppingListItemEditForm');
|
$group->get('/shoppinglistitem/{itemId}', '\Grocy\Controllers\StockController:ShoppingListItemEditForm');
|
||||||
$this->get('/shoppinglist/{listId}', '\Grocy\Controllers\StockController:ShoppingListEditForm');
|
$group->get('/shoppinglist/{listId}', '\Grocy\Controllers\StockController:ShoppingListEditForm');
|
||||||
$this->get('/shoppinglistsettings', '\Grocy\Controllers\StockController:ShoppingListSettings');
|
$group->get('/shoppinglistsettings', '\Grocy\Controllers\StockController:ShoppingListSettings');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Recipe routes
|
// Recipe routes
|
||||||
if (GROCY_FEATURE_FLAG_RECIPES)
|
if (GROCY_FEATURE_FLAG_RECIPES)
|
||||||
{
|
{
|
||||||
$this->get('/recipes', '\Grocy\Controllers\RecipesController:Overview');
|
$group->get('/recipes', '\Grocy\Controllers\RecipesController:Overview');
|
||||||
$this->get('/recipe/{recipeId}', '\Grocy\Controllers\RecipesController:RecipeEditForm');
|
$group->get('/recipe/{recipeId}', '\Grocy\Controllers\RecipesController:RecipeEditForm');
|
||||||
$this->get('/recipe/{recipeId}/pos/{recipePosId}', '\Grocy\Controllers\RecipesController:RecipePosEditForm');
|
$group->get('/recipe/{recipeId}/pos/{recipePosId}', '\Grocy\Controllers\RecipesController:RecipePosEditForm');
|
||||||
$this->get('/mealplan', '\Grocy\Controllers\RecipesController:MealPlan');
|
$group->get('/mealplan', '\Grocy\Controllers\RecipesController:MealPlan');
|
||||||
$this->get('/recipessettings', '\Grocy\Controllers\RecipesController:RecipesSettings');
|
$group->get('/recipessettings', '\Grocy\Controllers\RecipesController:RecipesSettings');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Chore routes
|
// Chore routes
|
||||||
if (GROCY_FEATURE_FLAG_CHORES)
|
if (GROCY_FEATURE_FLAG_CHORES)
|
||||||
{
|
{
|
||||||
$this->get('/choresoverview', '\Grocy\Controllers\ChoresController:Overview');
|
$group->get('/choresoverview', '\Grocy\Controllers\ChoresController:Overview');
|
||||||
$this->get('/choretracking', '\Grocy\Controllers\ChoresController:TrackChoreExecution');
|
$group->get('/choretracking', '\Grocy\Controllers\ChoresController:TrackChoreExecution');
|
||||||
$this->get('/choresjournal', '\Grocy\Controllers\ChoresController:Journal');
|
$group->get('/choresjournal', '\Grocy\Controllers\ChoresController:Journal');
|
||||||
$this->get('/chores', '\Grocy\Controllers\ChoresController:ChoresList');
|
$group->get('/chores', '\Grocy\Controllers\ChoresController:ChoresList');
|
||||||
$this->get('/chore/{choreId}', '\Grocy\Controllers\ChoresController:ChoreEditForm');
|
$group->get('/chore/{choreId}', '\Grocy\Controllers\ChoresController:ChoreEditForm');
|
||||||
$this->get('/choressettings', '\Grocy\Controllers\ChoresController:ChoresSettings');
|
$group->get('/choressettings', '\Grocy\Controllers\ChoresController:ChoresSettings');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Battery routes
|
// Battery routes
|
||||||
if (GROCY_FEATURE_FLAG_BATTERIES)
|
if (GROCY_FEATURE_FLAG_BATTERIES)
|
||||||
{
|
{
|
||||||
$this->get('/batteriesoverview', '\Grocy\Controllers\BatteriesController:Overview');
|
$group->get('/batteriesoverview', '\Grocy\Controllers\BatteriesController:Overview');
|
||||||
$this->get('/batterytracking', '\Grocy\Controllers\BatteriesController:TrackChargeCycle');
|
$group->get('/batterytracking', '\Grocy\Controllers\BatteriesController:TrackChargeCycle');
|
||||||
$this->get('/batteriesjournal', '\Grocy\Controllers\BatteriesController:Journal');
|
$group->get('/batteriesjournal', '\Grocy\Controllers\BatteriesController:Journal');
|
||||||
$this->get('/batteries', '\Grocy\Controllers\BatteriesController:BatteriesList');
|
$group->get('/batteries', '\Grocy\Controllers\BatteriesController:BatteriesList');
|
||||||
$this->get('/battery/{batteryId}', '\Grocy\Controllers\BatteriesController:BatteryEditForm');
|
$group->get('/battery/{batteryId}', '\Grocy\Controllers\BatteriesController:BatteryEditForm');
|
||||||
$this->get('/batteriessettings', '\Grocy\Controllers\BatteriesController:BatteriesSettings');
|
$group->get('/batteriessettings', '\Grocy\Controllers\BatteriesController:BatteriesSettings');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Task routes
|
// Task routes
|
||||||
if (GROCY_FEATURE_FLAG_TASKS)
|
if (GROCY_FEATURE_FLAG_TASKS)
|
||||||
{
|
{
|
||||||
$this->get('/tasks', '\Grocy\Controllers\TasksController:Overview');
|
$group->get('/tasks', '\Grocy\Controllers\TasksController:Overview');
|
||||||
$this->get('/task/{taskId}', '\Grocy\Controllers\TasksController:TaskEditForm');
|
$group->get('/task/{taskId}', '\Grocy\Controllers\TasksController:TaskEditForm');
|
||||||
$this->get('/taskcategories', '\Grocy\Controllers\TasksController:TaskCategoriesList');
|
$group->get('/taskcategories', '\Grocy\Controllers\TasksController:TaskCategoriesList');
|
||||||
$this->get('/taskcategory/{categoryId}', '\Grocy\Controllers\TasksController:TaskCategoryEditForm');
|
$group->get('/taskcategory/{categoryId}', '\Grocy\Controllers\TasksController:TaskCategoryEditForm');
|
||||||
$this->get('/taskssettings', '\Grocy\Controllers\TasksController:TasksSettings');
|
$group->get('/taskssettings', '\Grocy\Controllers\TasksController:TasksSettings');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Equipment routes
|
// Equipment routes
|
||||||
if (GROCY_FEATURE_FLAG_EQUIPMENT)
|
if (GROCY_FEATURE_FLAG_EQUIPMENT)
|
||||||
{
|
{
|
||||||
$this->get('/equipment', '\Grocy\Controllers\EquipmentController:Overview');
|
$group->get('/equipment', '\Grocy\Controllers\EquipmentController:Overview');
|
||||||
$this->get('/equipment/{equipmentId}', '\Grocy\Controllers\EquipmentController:EditForm');
|
$group->get('/equipment/{equipmentId}', '\Grocy\Controllers\EquipmentController:EditForm');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calendar routes
|
// Calendar routes
|
||||||
if (GROCY_FEATURE_FLAG_CALENDAR)
|
if (GROCY_FEATURE_FLAG_CALENDAR)
|
||||||
{
|
{
|
||||||
$this->get('/calendar', '\Grocy\Controllers\CalendarController:Overview');
|
$group->get('/calendar', '\Grocy\Controllers\CalendarController:Overview');
|
||||||
}
|
}
|
||||||
|
|
||||||
// OpenAPI routes
|
// OpenAPI routes
|
||||||
$this->get('/api', '\Grocy\Controllers\OpenApiController:DocumentationUi');
|
$group->get('/api', '\Grocy\Controllers\OpenApiController:DocumentationUi');
|
||||||
$this->get('/manageapikeys', '\Grocy\Controllers\OpenApiController:ApiKeysList');
|
$group->get('/manageapikeys', '\Grocy\Controllers\OpenApiController:ApiKeysList');
|
||||||
$this->get('/manageapikeys/new', '\Grocy\Controllers\OpenApiController:CreateNewApiKey');
|
$group->get('/manageapikeys/new', '\Grocy\Controllers\OpenApiController:CreateNewApiKey');
|
||||||
})->add(new SessionAuthMiddleware($appContainer, $appContainer->LoginControllerInstance->GetSessionCookieName()));
|
})->add(new SessionAuthMiddleware($container, $container->get('LoginControllerInstance')->GetSessionCookieName()));
|
||||||
|
|
||||||
$app->group('/api', function()
|
$app->group('/api', function(RouteCollectorProxy $group)
|
||||||
{
|
{
|
||||||
// OpenAPI
|
// OpenAPI
|
||||||
$this->get('/openapi/specification', '\Grocy\Controllers\OpenApiController:DocumentationSpec');
|
$group->get('/openapi/specification', '\Grocy\Controllers\OpenApiController:DocumentationSpec');
|
||||||
|
|
||||||
// System
|
// System
|
||||||
$this->get('/system/info', '\Grocy\Controllers\SystemApiController:GetSystemInfo');
|
$group->get('/system/info', '\Grocy\Controllers\SystemApiController:GetSystemInfo');
|
||||||
$this->get('/system/db-changed-time', '\Grocy\Controllers\SystemApiController:GetDbChangedTime');
|
$group->get('/system/db-changed-time', '\Grocy\Controllers\SystemApiController:GetDbChangedTime');
|
||||||
$this->post('/system/log-missing-localization', '\Grocy\Controllers\SystemApiController:LogMissingLocalization');
|
$group->post('/system/log-missing-localization', '\Grocy\Controllers\SystemApiController:LogMissingLocalization');
|
||||||
|
|
||||||
// Generic entity interaction
|
// Generic entity interaction
|
||||||
$this->get('/objects/{entity}', '\Grocy\Controllers\GenericEntityApiController:GetObjects');
|
$group->get('/objects/{entity}', '\Grocy\Controllers\GenericEntityApiController:GetObjects');
|
||||||
$this->get('/objects/{entity}/{objectId}', '\Grocy\Controllers\GenericEntityApiController:GetObject');
|
$group->get('/objects/{entity}/{objectId}', '\Grocy\Controllers\GenericEntityApiController:GetObject');
|
||||||
$this->get('/objects/{entity}/search/{searchString}', '\Grocy\Controllers\GenericEntityApiController:SearchObjects');
|
$group->get('/objects/{entity}/search/{searchString}', '\Grocy\Controllers\GenericEntityApiController:SearchObjects');
|
||||||
$this->post('/objects/{entity}', '\Grocy\Controllers\GenericEntityApiController:AddObject');
|
$group->post('/objects/{entity}', '\Grocy\Controllers\GenericEntityApiController:AddObject');
|
||||||
$this->put('/objects/{entity}/{objectId}', '\Grocy\Controllers\GenericEntityApiController:EditObject');
|
$group->put('/objects/{entity}/{objectId}', '\Grocy\Controllers\GenericEntityApiController:EditObject');
|
||||||
$this->delete('/objects/{entity}/{objectId}', '\Grocy\Controllers\GenericEntityApiController:DeleteObject');
|
$group->delete('/objects/{entity}/{objectId}', '\Grocy\Controllers\GenericEntityApiController:DeleteObject');
|
||||||
$this->get('/userfields/{entity}/{objectId}', '\Grocy\Controllers\GenericEntityApiController:GetUserfields');
|
$group->get('/userfields/{entity}/{objectId}', '\Grocy\Controllers\GenericEntityApiController:GetUserfields');
|
||||||
$this->put('/userfields/{entity}/{objectId}', '\Grocy\Controllers\GenericEntityApiController:SetUserfields');
|
$group->put('/userfields/{entity}/{objectId}', '\Grocy\Controllers\GenericEntityApiController:SetUserfields');
|
||||||
|
|
||||||
// Files
|
// Files
|
||||||
$this->put('/files/{group}/{fileName}', '\Grocy\Controllers\FilesApiController:UploadFile');
|
$group->put('/files/{group}/{fileName}', '\Grocy\Controllers\FilesApiController:UploadFile');
|
||||||
$this->get('/files/{group}/{fileName}', '\Grocy\Controllers\FilesApiController:ServeFile');
|
$group->get('/files/{group}/{fileName}', '\Grocy\Controllers\FilesApiController:ServeFile');
|
||||||
$this->delete('/files/{group}/{fileName}', '\Grocy\Controllers\FilesApiController:DeleteFile');
|
$group->delete('/files/{group}/{fileName}', '\Grocy\Controllers\FilesApiController:DeleteFile');
|
||||||
|
|
||||||
// Users
|
// Users
|
||||||
$this->get('/users', '\Grocy\Controllers\UsersApiController:GetUsers');
|
$group->get('/users', '\Grocy\Controllers\UsersApiController:GetUsers');
|
||||||
$this->post('/users', '\Grocy\Controllers\UsersApiController:CreateUser');
|
$group->post('/users', '\Grocy\Controllers\UsersApiController:CreateUser');
|
||||||
$this->put('/users/{userId}', '\Grocy\Controllers\UsersApiController:EditUser');
|
$group->put('/users/{userId}', '\Grocy\Controllers\UsersApiController:EditUser');
|
||||||
$this->delete('/users/{userId}', '\Grocy\Controllers\UsersApiController:DeleteUser');
|
$group->delete('/users/{userId}', '\Grocy\Controllers\UsersApiController:DeleteUser');
|
||||||
|
|
||||||
// User
|
// User
|
||||||
$this->get('/user/settings/{settingKey}', '\Grocy\Controllers\UsersApiController:GetUserSetting');
|
$group->get('/user/settings/{settingKey}', '\Grocy\Controllers\UsersApiController:GetUserSetting');
|
||||||
$this->put('/user/settings/{settingKey}', '\Grocy\Controllers\UsersApiController:SetUserSetting');
|
$group->put('/user/settings/{settingKey}', '\Grocy\Controllers\UsersApiController:SetUserSetting');
|
||||||
|
|
||||||
// Stock
|
// Stock
|
||||||
if (GROCY_FEATURE_FLAG_STOCK)
|
if (GROCY_FEATURE_FLAG_STOCK)
|
||||||
{
|
{
|
||||||
$this->get('/stock', '\Grocy\Controllers\StockApiController:CurrentStock');
|
$group->get('/stock', '\Grocy\Controllers\StockApiController:CurrentStock');
|
||||||
$this->get('/stock/entry/{entryId}', '\Grocy\Controllers\StockApiController:StockEntry');
|
$group->get('/stock/entry/{entryId}', '\Grocy\Controllers\StockApiController:StockEntry');
|
||||||
$this->put('/stock/entry/{entryId}', '\Grocy\Controllers\StockApiController:EditStockEntry');
|
$group->put('/stock/entry/{entryId}', '\Grocy\Controllers\StockApiController:EditStockEntry');
|
||||||
$this->get('/stock/volatile', '\Grocy\Controllers\StockApiController:CurrentVolatileStock');
|
$group->get('/stock/volatile', '\Grocy\Controllers\StockApiController:CurrentVolatileStock');
|
||||||
$this->get('/stock/products/{productId}', '\Grocy\Controllers\StockApiController:ProductDetails');
|
$group->get('/stock/products/{productId}', '\Grocy\Controllers\StockApiController:ProductDetails');
|
||||||
$this->get('/stock/products/{productId}/entries', '\Grocy\Controllers\StockApiController:ProductStockEntries');
|
$group->get('/stock/products/{productId}/entries', '\Grocy\Controllers\StockApiController:ProductStockEntries');
|
||||||
$this->get('/stock/products/{productId}/locations', '\Grocy\Controllers\StockApiController:ProductStockLocations');
|
$group->get('/stock/products/{productId}/locations', '\Grocy\Controllers\StockApiController:ProductStockLocations');
|
||||||
$this->get('/stock/products/{productId}/price-history', '\Grocy\Controllers\StockApiController:ProductPriceHistory');
|
$group->get('/stock/products/{productId}/price-history', '\Grocy\Controllers\StockApiController:ProductPriceHistory');
|
||||||
$this->post('/stock/products/{productId}/add', '\Grocy\Controllers\StockApiController:AddProduct');
|
$group->post('/stock/products/{productId}/add', '\Grocy\Controllers\StockApiController:AddProduct');
|
||||||
$this->post('/stock/products/{productId}/consume', '\Grocy\Controllers\StockApiController:ConsumeProduct');
|
$group->post('/stock/products/{productId}/consume', '\Grocy\Controllers\StockApiController:ConsumeProduct');
|
||||||
$this->post('/stock/products/{productId}/transfer', '\Grocy\Controllers\StockApiController:TransferProduct');
|
$group->post('/stock/products/{productId}/transfer', '\Grocy\Controllers\StockApiController:TransferProduct');
|
||||||
$this->post('/stock/products/{productId}/inventory', '\Grocy\Controllers\StockApiController:InventoryProduct');
|
$group->post('/stock/products/{productId}/inventory', '\Grocy\Controllers\StockApiController:InventoryProduct');
|
||||||
$this->post('/stock/products/{productId}/open', '\Grocy\Controllers\StockApiController:OpenProduct');
|
$group->post('/stock/products/{productId}/open', '\Grocy\Controllers\StockApiController:OpenProduct');
|
||||||
$this->get('/stock/products/by-barcode/{barcode}', '\Grocy\Controllers\StockApiController:ProductDetailsByBarcode');
|
$group->get('/stock/products/by-barcode/{barcode}', '\Grocy\Controllers\StockApiController:ProductDetailsByBarcode');
|
||||||
$this->post('/stock/products/by-barcode/{barcode}/add', '\Grocy\Controllers\StockApiController:AddProductByBarcode');
|
$group->post('/stock/products/by-barcode/{barcode}/add', '\Grocy\Controllers\StockApiController:AddProductByBarcode');
|
||||||
$this->post('/stock/products/by-barcode/{barcode}/consume', '\Grocy\Controllers\StockApiController:ConsumeProductByBarcode');
|
$group->post('/stock/products/by-barcode/{barcode}/consume', '\Grocy\Controllers\StockApiController:ConsumeProductByBarcode');
|
||||||
$this->post('/stock/products/by-barcode/{barcode}/transfer', '\Grocy\Controllers\StockApiController:TransferProductByBarcode');
|
$group->post('/stock/products/by-barcode/{barcode}/transfer', '\Grocy\Controllers\StockApiController:TransferProductByBarcode');
|
||||||
$this->post('/stock/products/by-barcode/{barcode}/inventory', '\Grocy\Controllers\StockApiController:InventoryProductByBarcode');
|
$group->post('/stock/products/by-barcode/{barcode}/inventory', '\Grocy\Controllers\StockApiController:InventoryProductByBarcode');
|
||||||
$this->post('/stock/products/by-barcode/{barcode}/open', '\Grocy\Controllers\StockApiController:OpenProductByBarcode');
|
$group->post('/stock/products/by-barcode/{barcode}/open', '\Grocy\Controllers\StockApiController:OpenProductByBarcode');
|
||||||
$this->get('/stock/bookings/{bookingId}', '\Grocy\Controllers\StockApiController:StockBooking');
|
$group->get('/stock/bookings/{bookingId}', '\Grocy\Controllers\StockApiController:StockBooking');
|
||||||
$this->post('/stock/bookings/{bookingId}/undo', '\Grocy\Controllers\StockApiController:UndoBooking');
|
$group->post('/stock/bookings/{bookingId}/undo', '\Grocy\Controllers\StockApiController:UndoBooking');
|
||||||
$this->get('/stock/transactions/{transactionId}', '\Grocy\Controllers\StockApiController:StockTransactions');
|
$group->get('/stock/transactions/{transactionId}', '\Grocy\Controllers\StockApiController:StockTransactions');
|
||||||
$this->post('/stock/transactions/{transactionId}/undo', '\Grocy\Controllers\StockApiController:UndoTransaction');
|
$group->post('/stock/transactions/{transactionId}/undo', '\Grocy\Controllers\StockApiController:UndoTransaction');
|
||||||
$this->get('/stock/barcodes/external-lookup/{barcode}', '\Grocy\Controllers\StockApiController:ExternalBarcodeLookup');
|
$group->get('/stock/barcodes/external-lookup/{barcode}', '\Grocy\Controllers\StockApiController:ExternalBarcodeLookup');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Shopping list
|
// Shopping list
|
||||||
if (GROCY_FEATURE_FLAG_SHOPPINGLIST)
|
if (GROCY_FEATURE_FLAG_SHOPPINGLIST)
|
||||||
{
|
{
|
||||||
$this->post('/stock/shoppinglist/add-missing-products', '\Grocy\Controllers\StockApiController:AddMissingProductsToShoppingList');
|
$group->post('/stock/shoppinglist/add-missing-products', '\Grocy\Controllers\StockApiController:AddMissingProductsToShoppingList');
|
||||||
$this->post('/stock/shoppinglist/clear', '\Grocy\Controllers\StockApiController:ClearShoppingList');
|
$group->post('/stock/shoppinglist/clear', '\Grocy\Controllers\StockApiController:ClearShoppingList');
|
||||||
$this->post('/stock/shoppinglist/add-product', '\Grocy\Controllers\StockApiController:AddProductToShoppingList');
|
$group->post('/stock/shoppinglist/add-product', '\Grocy\Controllers\StockApiController:AddProductToShoppingList');
|
||||||
$this->post('/stock/shoppinglist/remove-product', '\Grocy\Controllers\StockApiController:RemoveProductFromShoppingList');
|
$group->post('/stock/shoppinglist/remove-product', '\Grocy\Controllers\StockApiController:RemoveProductFromShoppingList');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Recipes
|
// Recipes
|
||||||
if (GROCY_FEATURE_FLAG_RECIPES)
|
if (GROCY_FEATURE_FLAG_RECIPES)
|
||||||
{
|
{
|
||||||
$this->post('/recipes/{recipeId}/add-not-fulfilled-products-to-shoppinglist', '\Grocy\Controllers\RecipesApiController:AddNotFulfilledProductsToShoppingList');
|
$group->post('/recipes/{recipeId}/add-not-fulfilled-products-to-shoppinglist', '\Grocy\Controllers\RecipesApiController:AddNotFulfilledProductsToShoppingList');
|
||||||
$this->get('/recipes/{recipeId}/fulfillment', '\Grocy\Controllers\RecipesApiController:GetRecipeFulfillment');
|
$group->get('/recipes/{recipeId}/fulfillment', '\Grocy\Controllers\RecipesApiController:GetRecipeFulfillment');
|
||||||
$this->post('/recipes/{recipeId}/consume', '\Grocy\Controllers\RecipesApiController:ConsumeRecipe');
|
$group->post('/recipes/{recipeId}/consume', '\Grocy\Controllers\RecipesApiController:ConsumeRecipe');
|
||||||
$this->get('/recipes/fulfillment', '\Grocy\Controllers\RecipesApiController:GetRecipeFulfillment');
|
$group->get('/recipes/fulfillment', '\Grocy\Controllers\RecipesApiController:GetRecipeFulfillment');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Chores
|
// Chores
|
||||||
if (GROCY_FEATURE_FLAG_CHORES)
|
if (GROCY_FEATURE_FLAG_CHORES)
|
||||||
{
|
{
|
||||||
$this->get('/chores', '\Grocy\Controllers\ChoresApiController:Current');
|
$group->get('/chores', '\Grocy\Controllers\ChoresApiController:Current');
|
||||||
$this->get('/chores/{choreId}', '\Grocy\Controllers\ChoresApiController:ChoreDetails');
|
$group->get('/chores/{choreId}', '\Grocy\Controllers\ChoresApiController:ChoreDetails');
|
||||||
$this->post('/chores/{choreId}/execute', '\Grocy\Controllers\ChoresApiController:TrackChoreExecution');
|
$group->post('/chores/{choreId}/execute', '\Grocy\Controllers\ChoresApiController:TrackChoreExecution');
|
||||||
$this->post('/chores/executions/{executionId}/undo', '\Grocy\Controllers\ChoresApiController:UndoChoreExecution');
|
$group->post('/chores/executions/{executionId}/undo', '\Grocy\Controllers\ChoresApiController:UndoChoreExecution');
|
||||||
$this->post('/chores/executions/calculate-next-assignments', '\Grocy\Controllers\ChoresApiController:CalculateNextExecutionAssignments');
|
$group->post('/chores/executions/calculate-next-assignments', '\Grocy\Controllers\ChoresApiController:CalculateNextExecutionAssignments');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Batteries
|
// Batteries
|
||||||
if (GROCY_FEATURE_FLAG_BATTERIES)
|
if (GROCY_FEATURE_FLAG_BATTERIES)
|
||||||
{
|
{
|
||||||
$this->get('/batteries', '\Grocy\Controllers\BatteriesApiController:Current');
|
$group->get('/batteries', '\Grocy\Controllers\BatteriesApiController:Current');
|
||||||
$this->get('/batteries/{batteryId}', '\Grocy\Controllers\BatteriesApiController:BatteryDetails');
|
$group->get('/batteries/{batteryId}', '\Grocy\Controllers\BatteriesApiController:BatteryDetails');
|
||||||
$this->post('/batteries/{batteryId}/charge', '\Grocy\Controllers\BatteriesApiController:TrackChargeCycle');
|
$group->post('/batteries/{batteryId}/charge', '\Grocy\Controllers\BatteriesApiController:TrackChargeCycle');
|
||||||
$this->post('/batteries/charge-cycles/{chargeCycleId}/undo', '\Grocy\Controllers\BatteriesApiController:UndoChargeCycle');
|
$group->post('/batteries/charge-cycles/{chargeCycleId}/undo', '\Grocy\Controllers\BatteriesApiController:UndoChargeCycle');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tasks
|
// Tasks
|
||||||
if (GROCY_FEATURE_FLAG_TASKS)
|
if (GROCY_FEATURE_FLAG_TASKS)
|
||||||
{
|
{
|
||||||
$this->get('/tasks', '\Grocy\Controllers\TasksApiController:Current');
|
$group->get('/tasks', '\Grocy\Controllers\TasksApiController:Current');
|
||||||
$this->post('/tasks/{taskId}/complete', '\Grocy\Controllers\TasksApiController:MarkTaskAsCompleted');
|
$group->post('/tasks/{taskId}/complete', '\Grocy\Controllers\TasksApiController:MarkTaskAsCompleted');
|
||||||
$this->post('/tasks/{taskId}/undo', '\Grocy\Controllers\TasksApiController:UndoTask');
|
$group->post('/tasks/{taskId}/undo', '\Grocy\Controllers\TasksApiController:UndoTask');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calendar
|
// Calendar
|
||||||
if (GROCY_FEATURE_FLAG_CALENDAR)
|
if (GROCY_FEATURE_FLAG_CALENDAR)
|
||||||
{
|
{
|
||||||
$this->get('/calendar/ical', '\Grocy\Controllers\CalendarApiController:Ical')->setName('calendar-ical');
|
$group->get('/calendar/ical', '\Grocy\Controllers\CalendarApiController:Ical')->setName('calendar-ical');
|
||||||
$this->get('/calendar/ical/sharing-link', '\Grocy\Controllers\CalendarApiController:IcalSharingLink');
|
$group->get('/calendar/ical/sharing-link', '\Grocy\Controllers\CalendarApiController:IcalSharingLink');
|
||||||
}
|
}
|
||||||
})->add(new ApiKeyAuthMiddleware($appContainer, $appContainer->LoginControllerInstance->GetSessionCookieName(), $appContainer->ApiKeyHeaderName))
|
})->add(new CorsMiddleware([
|
||||||
->add(JsonMiddleware::class)
|
|
||||||
->add(new CorsMiddleware([
|
|
||||||
'origin' => ["*"],
|
'origin' => ["*"],
|
||||||
'methods' => ["GET", "POST"],
|
'methods' => ["GET", "POST"],
|
||||||
'headers.allow' => [ $appContainer->ApiKeyHeaderName ],
|
'headers.allow' => [ $container->get('ApiKeyHeaderName') ],
|
||||||
'headers.expose' => [ ],
|
'headers.expose' => [ ],
|
||||||
'credentials' => false,
|
'credentials' => false,
|
||||||
'cache' => 0,
|
'cache' => 0,
|
||||||
]));
|
]))
|
||||||
|
->add(JsonMiddleware::class)
|
||||||
|
->add(new ApiKeyAuthMiddleware($container, $container->get('LoginControllerInstance')->GetSessionCookieName(), $container->get('ApiKeyHeaderName')));
|
||||||
|
@ -6,10 +6,10 @@
|
|||||||
version "1.1.8"
|
version "1.1.8"
|
||||||
resolved "https://github.com/berrnd/bootstrap-combobox.git#fcf0110146f4daab94888234c57d198b4ca5f129"
|
resolved "https://github.com/berrnd/bootstrap-combobox.git#fcf0110146f4daab94888234c57d198b4ca5f129"
|
||||||
|
|
||||||
"@fortawesome/fontawesome-free@^5.11.1":
|
"@fortawesome/fontawesome-free@^5.12.1":
|
||||||
version "5.12.0"
|
version "5.12.1"
|
||||||
resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-free/-/fontawesome-free-5.12.0.tgz#8ceb9f09edfb85ea18a6c7bf098f6f5dd5ffd62b"
|
resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-free/-/fontawesome-free-5.12.1.tgz#2a98fea9fbb8a606ddc79a4680034e9d5591c550"
|
||||||
integrity sha512-vKDJUuE2GAdBERaQWmmtsciAMzjwNrROXA5KTGSZvayAsmuTGjam5z6QNqNPCwDfVljLWuov1nEC3mEQf/n6fQ==
|
integrity sha512-ZtjIIFplxncqxvogq148C3hBLQE+W3iJ8E4UvJ09zIJUgzwLcROsWwFDErVSXY2Plzao5J9KUYNHKHMEUYDMKw==
|
||||||
|
|
||||||
"TagManager@https://github.com/max-favilli/tagmanager.git#master":
|
"TagManager@https://github.com/max-favilli/tagmanager.git#master":
|
||||||
version "3.0.1"
|
version "3.0.1"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user