mirror of
https://github.com/grocy/grocy.git
synced 2025-09-16 09:51:30 +00:00
Compare commits
394 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
a9c0539305 | ||
|
5b304c5e97 | ||
|
1b26a6277b | ||
|
353a65d41c | ||
|
bfcd05473a | ||
|
3d485d4850 | ||
|
9d02fbc13c | ||
|
27ba2bfd55 | ||
|
61f582554f | ||
|
75241fc61f | ||
|
91289588b5 | ||
|
3f4a5cc0d6 | ||
|
e693460894 | ||
|
47a6260d27 | ||
|
bfd29def8d | ||
|
cd0ca4a67c | ||
|
659d60b235 | ||
|
8efcb79ed7 | ||
|
5ba55823c9 | ||
|
6de4b120b3 | ||
|
8fec262184 | ||
|
bd483ec8b0 | ||
|
4d215edbd0 | ||
|
a3d4fd834f | ||
|
2d0c0bf34f | ||
|
0f03420808 | ||
|
ba319dc6f1 | ||
|
c10890205c | ||
|
643f6272e4 | ||
|
cad5e9ef79 | ||
|
01fdfe1a0c | ||
|
acd1e7337c | ||
|
3586bf77c3 | ||
|
ff886fea61 | ||
|
5bd00d8be7 | ||
|
9f36a599a4 | ||
|
ff15e81abe | ||
|
e8b471f572 | ||
|
2d8ad24887 | ||
|
45db9ff90c | ||
|
c813a6500d | ||
|
1077149784 | ||
|
e08dfb408c | ||
|
fcdeda91d9 | ||
|
4932b9c6d2 | ||
|
7f2942d414 | ||
|
3a1c5efcfd | ||
|
816eb03147 | ||
|
8504429f5f | ||
|
90291fdbca | ||
|
77b0bc675c | ||
|
8020f92d6b | ||
|
38825c70da | ||
|
bb5daa5f8b | ||
|
8c11d0f15d | ||
|
5b544f76a5 | ||
|
6f93da9b5f | ||
|
e9ef7ea6d8 | ||
|
54a23019b8 | ||
|
89ad25c904 | ||
|
ee38d626aa | ||
|
40b60bed85 | ||
|
b89643ddb1 | ||
|
32e878afc9 | ||
|
9974305ad4 | ||
|
a3b2d03d68 | ||
|
01e9e3f5ce | ||
|
b5ac319a90 | ||
|
ad09630dbe | ||
|
03720940d4 | ||
|
dfc05e0bec | ||
|
9e139e2b73 | ||
|
5c622b9512 | ||
|
eec3515b6d | ||
|
276bc94cc6 | ||
|
bfa59dd29c | ||
|
0ce8d706a6 | ||
|
98d95f80df | ||
|
a72afa7174 | ||
|
0d145bbf1e | ||
|
f6cf26009d | ||
|
c042657dd8 | ||
|
43c9ab7734 | ||
|
f6649d51bd | ||
|
2e265ac70a | ||
|
30e54997b2 | ||
|
b9f0470d76 | ||
|
bdcd176f81 | ||
|
04dacacd73 | ||
|
a9502d1ddb | ||
|
5c25e91984 | ||
|
02163c4305 | ||
|
c3731b3200 | ||
|
5cdf2c14d3 | ||
|
e92d74f5c3 | ||
|
2b3516dadd | ||
|
8041dd9c26 | ||
|
2f7b78bc40 | ||
|
61fc6e05f4 | ||
|
367a3e52de | ||
|
a3617cffb8 | ||
|
ff341d8547 | ||
|
01fab6999f | ||
|
b6152ce874 | ||
|
ca5df3b217 | ||
|
dd48be595c | ||
|
306d0f7da6 | ||
|
c61c37e67a | ||
|
f7f90238f2 | ||
|
589ad36855 | ||
|
5da24d2d4f | ||
|
f7f2bf3fc0 | ||
|
34d1bdd53f | ||
|
e021c93d22 | ||
|
2ff5faacc0 | ||
|
a489190e81 | ||
|
a403bb687a | ||
|
5966a3d678 | ||
|
c71e46191f | ||
|
862fd7c644 | ||
|
10ea9c44fd | ||
|
816ca6460f | ||
|
b6d60c4e34 | ||
|
6f67619784 | ||
|
db0b48e7ae | ||
|
973f07b360 | ||
|
0f73d849eb | ||
|
1a6849ad37 | ||
|
8f31f891fd | ||
|
83985e9f21 | ||
|
04e9ba8e34 | ||
|
960ee919f9 | ||
|
f4534a4bfb | ||
|
89553b7fa0 | ||
|
364f6b2051 | ||
|
fe83e2fa6f | ||
|
1f3dd58ddf | ||
|
da98efa833 | ||
|
3e6cf545d7 | ||
|
1080c3486c | ||
|
cd7b6b686d | ||
|
b84e6da0dd | ||
|
fc3a4c6899 | ||
|
12a2cb0bdf | ||
|
57a0864465 | ||
|
b3da837ede | ||
|
3de3e03ab3 | ||
|
78865a9d3c | ||
|
5b3230d63d | ||
|
04c93d937e | ||
|
5318e79f55 | ||
|
7bf4421d44 | ||
|
366152c049 | ||
|
70c00e81d9 | ||
|
f13abf483e | ||
|
0e723a0a9b | ||
|
4a35477c35 | ||
|
df7d360516 | ||
|
03eaa6c79f | ||
|
132999ce36 | ||
|
188407e3c7 | ||
|
8cf68ade30 | ||
|
d62657c698 | ||
|
3262e534dc | ||
|
6202e8bda7 | ||
|
9984e8f218 | ||
|
b0c91f6ad1 | ||
|
9e24586190 | ||
|
7ba6fc875b | ||
|
3b10906e78 | ||
|
ebd24bf30e | ||
|
ebd9b1b851 | ||
|
b242a5de52 | ||
|
81ec011095 | ||
|
2a371cc081 | ||
|
edb986ce24 | ||
|
f90faca62e | ||
|
6090ac621e | ||
|
ae58606d04 | ||
|
bb9caf9cc9 | ||
|
9dd57decdf | ||
|
f1fc0ee549 | ||
|
fcdeb33426 | ||
|
44cd26ae77 | ||
|
04f34ea6b0 | ||
|
e5fb609c8e | ||
|
c675b534ef | ||
|
6c74881f95 | ||
|
756ec319cc | ||
|
ba2d32be60 | ||
|
7cc09cec67 | ||
|
8b815fce93 | ||
|
f1c78659be | ||
|
5c79a80f7a | ||
|
f451e65278 | ||
|
176333df5b | ||
|
d4227d2e41 | ||
|
0bbd2d9880 | ||
|
b81316bd60 | ||
|
d11dcb38fe | ||
|
77d82f22dc | ||
|
be326a5211 | ||
|
83624eaf27 | ||
|
055619d275 | ||
|
cda3dde120 | ||
|
5a0b862d22 | ||
|
bb5fd8360b | ||
|
d7180bd7b2 | ||
|
8c9b0dedb2 | ||
|
9c2c2c1fa2 | ||
|
596dc9e36d | ||
|
b2019ba42d | ||
|
003d4a567a | ||
|
5112e0f551 | ||
|
8008fcdc65 | ||
|
8d41dcc650 | ||
|
037d024862 | ||
|
03ca5cd45b | ||
|
60d47bef84 | ||
|
98a7bcb044 | ||
|
7401971884 | ||
|
067a10e1b2 | ||
|
ddfe33fab6 | ||
|
2a0ec30bb0 | ||
|
8540fc44f3 | ||
|
66095738e3 | ||
|
e472711d23 | ||
|
8e054a4981 | ||
|
feb28211d8 | ||
|
06f25b7006 | ||
|
f85a67a1ff | ||
|
6fe0100927 | ||
|
bcb359e317 | ||
|
4075067a10 | ||
|
bd3c63218b | ||
|
27daf384da | ||
|
905fc0f357 | ||
|
9cd0e4ab2d | ||
|
6b38cd450f | ||
|
bb60f5f043 | ||
|
e777be4d3b | ||
|
8a71d55f0f | ||
|
b01b49d10c | ||
|
496594d898 | ||
|
1d5e82c341 | ||
|
a9b696f41c | ||
|
e50b1eb359 | ||
|
92e0245387 | ||
|
67d0d3c3d6 | ||
|
23bcbc23e9 | ||
|
085d9a0bc7 | ||
|
368df142cf | ||
|
d38edabb14 | ||
|
4426a10e2e | ||
|
931dc9d243 | ||
|
c5b8893008 | ||
|
c27f41aee4 | ||
|
ef043b38ce | ||
|
bb261f99c4 | ||
|
48ca0f2ac7 | ||
|
b7f0b06684 | ||
|
324487d395 | ||
|
9a8c61497b | ||
|
bc7afe4bdd | ||
|
bb5dcb2434 | ||
|
71b9d11ff5 | ||
|
3e73a44576 | ||
|
dedfe3a854 | ||
|
c4b0ef4d49 | ||
|
339d81318f | ||
|
282ee0885b | ||
|
5833364e51 | ||
|
525f1705d1 | ||
|
5a13cb5ffe | ||
|
e830805443 | ||
|
ca3f28b615 | ||
|
6081b8ee67 | ||
|
7eef4acd81 | ||
|
678579e933 | ||
|
4cc2d39063 | ||
|
14cc153422 | ||
|
f5b5c4c7e1 | ||
|
88b76a52a5 | ||
|
a4a25af460 | ||
|
41a72d11da | ||
|
c8236b101b | ||
|
ef1df0a446 | ||
|
5c4953b9b2 | ||
|
ccaf2411fe | ||
|
bce8bd6b35 | ||
|
66c07887cb | ||
|
be99880ce4 | ||
|
e026609972 | ||
|
3474f55866 | ||
|
f583810d5c | ||
|
419445f5ae | ||
|
c64eb27ca1 | ||
|
f4eb5196f7 | ||
|
9e493430d8 | ||
|
7690eedd70 | ||
|
aaa270a52f | ||
|
6f47a5415c | ||
|
42c1709633 | ||
|
4685ff4145 | ||
|
249b01d7a8 | ||
|
bcbdf58376 | ||
|
7f8540ff4e | ||
|
b52ab91606 | ||
|
7246ac55b6 | ||
|
848931da21 | ||
|
bf4092e746 | ||
|
7cee18c926 | ||
|
e9a4b43268 | ||
|
b1522742cc | ||
|
ecdaaab789 | ||
|
3379942086 | ||
|
12eaa8c074 | ||
|
c6310d636d | ||
|
9bedc6a138 | ||
|
70dbc6018f | ||
|
3afeb44b1d | ||
|
3131b8965e | ||
|
bbc2fc9e42 | ||
|
3b4141eb4d | ||
|
5f826be82c | ||
|
db9ee93d2b | ||
|
1eabd29105 | ||
|
dc05c56440 | ||
|
cb88ab2080 | ||
|
254e1a9bc1 | ||
|
0fc7c297bf | ||
|
82bfb6a3c3 | ||
|
277c622475 | ||
|
091a0f3efe | ||
|
823c76aa08 | ||
|
37dee2a50b | ||
|
ea0f5101ec | ||
|
be650d093d | ||
|
734814d96b | ||
|
d9246b9b42 | ||
|
70e7e630c3 | ||
|
71fc49252f | ||
|
aa0771877f | ||
|
e5a4d11c0b | ||
|
909949a9e1 | ||
|
f018696219 | ||
|
347a47d0d2 | ||
|
c3de4b86b0 | ||
|
594e77ca41 | ||
|
31ce7a13ea | ||
|
5d762001c8 | ||
|
bc3d339d9c | ||
|
33e5ed9ddc | ||
|
2d712b0ef7 | ||
|
13d81a4e4b | ||
|
8d917aee12 | ||
|
09b2cfc46a | ||
|
789e475207 | ||
|
eec5105e5b | ||
|
82f7b2109c | ||
|
840dd58c03 | ||
|
37d1377f99 | ||
|
882a3545e5 | ||
|
778191fd11 | ||
|
71701804ea | ||
|
306c404362 | ||
|
4fab4f87d3 | ||
|
54717a81b1 | ||
|
eca299454b | ||
|
c58083f84a | ||
|
ecf96252b9 | ||
|
92e648490a | ||
|
6dd3c26ddd | ||
|
02ea26b090 | ||
|
0954b5a741 | ||
|
02b6c3b721 | ||
|
6fa4e13ba2 | ||
|
9837f79f9c | ||
|
6e4cd22118 | ||
|
ca00dd8e2d | ||
|
5455ec7bde | ||
|
2e7af1b050 | ||
|
89bae8d25e | ||
|
5b5c272909 | ||
|
3e394a3840 | ||
|
ab8094e1c0 | ||
|
bbb5f1c7c7 | ||
|
b607f188af | ||
|
9ab1a674fe | ||
|
2f0a1391b7 | ||
|
a9a1358b08 | ||
|
4853174d03 | ||
|
538d789366 | ||
|
0751919b82 |
16
.devtools/create_release_package.bat
Normal file
16
.devtools/create_release_package.bat
Normal file
@@ -0,0 +1,16 @@
|
||||
set projectPath=%~dp0
|
||||
if %projectPath:~-1%==\ set projectPath=%projectPath:~0,-1%
|
||||
set projectPath=%projectPath%\..
|
||||
|
||||
set releasePath=%projectPath%\.release
|
||||
mkdir "%releasePath%"
|
||||
|
||||
copy "%projectPath%\version.json" versiontemp.json
|
||||
for /f "tokens=*" %%a in ('jq .Version versiontemp.json --raw-output') do set version=%%a
|
||||
del versiontemp.json
|
||||
|
||||
del "%releasePath%\grocy_%version%.zip"
|
||||
7za a -r "%releasePath%\grocy_%version%.zip" "%projectPath%\*" -xr!.* -xr!build.bat -xr!composer.json -xr!composer.lock -xr!package.json -xr!yarn.lock -xr!publication_assets
|
||||
7za a "%releasePath%\grocy_%version%.zip" "%projectPath%\public\.htaccess"
|
||||
7za rn "%releasePath%\grocy_%version%.zip" .htaccess public\.htaccess
|
||||
7za d "%releasePath%\grocy_%version%.zip" data\*.* data\storage data\viewcache\*
|
4
.devtools/install_dependencies.bat
Normal file
4
.devtools/install_dependencies.bat
Normal file
@@ -0,0 +1,4 @@
|
||||
pushd ..
|
||||
call composer install
|
||||
yarn install
|
||||
popd
|
3
.devtools/transifex_download.bat
Normal file
3
.devtools/transifex_download.bat
Normal file
@@ -0,0 +1,3 @@
|
||||
pushd ..
|
||||
tx pull --all --minimum-perc=90
|
||||
popd
|
3
.devtools/transifex_upload.bat
Normal file
3
.devtools/transifex_upload.bat
Normal file
@@ -0,0 +1,3 @@
|
||||
pushd ..
|
||||
tx push --source
|
||||
popd
|
4
.devtools/update_dependencies.bat
Normal file
4
.devtools/update_dependencies.bat
Normal file
@@ -0,0 +1,4 @@
|
||||
pushd ..
|
||||
call composer update
|
||||
yarn upgrade
|
||||
popd
|
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,3 +1,4 @@
|
||||
/public/bower_components
|
||||
/public/node_modules
|
||||
/vendor
|
||||
/.release
|
||||
embedded.txt
|
37
.tx/config
Normal file
37
.tx/config
Normal file
@@ -0,0 +1,37 @@
|
||||
[main]
|
||||
host = https://www.transifex.com
|
||||
|
||||
[grocy.stringsphp]
|
||||
file_filter = localization/<lang>/strings.php
|
||||
minimum_perc = 0
|
||||
source_file = localization/en/strings.php
|
||||
source_lang = en
|
||||
type = PHP_ARRAY
|
||||
|
||||
[grocy.stock_transaction_typesphp]
|
||||
file_filter = localization/<lang>/stock_transaction_types.php
|
||||
minimum_perc = 0
|
||||
source_file = localization/en/stock_transaction_types.php
|
||||
source_lang = en
|
||||
type = PHP_ARRAY
|
||||
|
||||
[grocy.chore_typesphp]
|
||||
file_filter = localization/<lang>/chore_types.php
|
||||
minimum_perc = 0
|
||||
source_file = localization/en/chore_types.php
|
||||
source_lang = en
|
||||
type = PHP_ARRAY
|
||||
|
||||
[grocy.component_translationsphp]
|
||||
file_filter = localization/<lang>/component_translations.php
|
||||
minimum_perc = 0
|
||||
source_file = localization/en/component_translations.php
|
||||
source_lang = en
|
||||
type = PHP_ARRAY
|
||||
|
||||
[grocy.demo_dataphp]
|
||||
file_filter = localization/<lang>/demo_data.php
|
||||
minimum_perc = 0
|
||||
source_file = localization/en/demo_data.php
|
||||
source_lang = en
|
||||
type = PHP_ARRAY
|
4
.yarnrc
Normal file
4
.yarnrc
Normal file
@@ -0,0 +1,4 @@
|
||||
--modules-folder public/node_modules
|
||||
--install.production true
|
||||
--install.ignore-scripts true
|
||||
--install.ignore-optional true
|
68
README.md
68
README.md
@@ -2,37 +2,62 @@
|
||||
ERP beyond your fridge
|
||||
|
||||
## Give it a try
|
||||
Public demo of the latest version → [https://demo.grocy.info](https://demo.grocy.info)
|
||||
- Public demo of the latest stable version → [https://demo.grocy.info](https://demo.grocy.info)
|
||||
- Public demo of the latest pre-release version (current master branch) → [https://demo-prerelease.grocy.info](https://demo-prerelease.grocy.info)
|
||||
|
||||
## Motivation
|
||||
A household needs to be managed. I did this so far (almost 10 years) with my first self written software (a C# windows forms application) and with a bunch of Excel sheets. The software is a pain to use and Excel is Excel. So I searched for and tried different things for a (very) long time, nothing 100 % fitted, so this is my aim for a "complete houshold management"-thing.
|
||||
|
||||
## What it is about
|
||||
For now my main focus is on stock management, ERP your fridge!
|
||||
A household needs to be managed. I did this so far (almost 10 years) with my first self written software (a C# windows forms application) and with a bunch of Excel sheets. The software is a pain to use and Excel is Excel. So I searched for and tried different things for a (very) long time, nothing 100 % fitted, so this is my aim for a "complete household management"-thing. ERP your fridge!
|
||||
|
||||
## How to install
|
||||
Just unpack the [latest release](https://github.com/berrnd/grocy/releases/latest) on your PHP (7.0 or later required) enabled webserver (webservers root should point to the `/public` directory), copy `config-dist.php` to `data/config.php`, edit it to your needs, ensure that the `data` directory is writable and you're ready to go.
|
||||
> **NEW**
|
||||
>
|
||||
> There is now grocy-desktop if you want to run grocy without a webserver just like a normal (windows) desktop application.
|
||||
>
|
||||
> See https://github.com/grocy/grocy-desktop or directly download the [latest release](https://releases.grocy.info/latest-desktop) - the installation is nothing more than just clicking 2 times "next"...
|
||||
|
||||
Default login is user `admin` with password `admin` - see the `data/config.php` file. Alternatively clone this repository and install Composer and Bower dependencies manually.
|
||||
Just unpack the [latest release](https://releases.grocy.info/latest) on your PHP (SQLite (3.8.3 or higher) extension required, currently only tested with PHP 7.2) enabled webserver (webservers root should point to the `public` directory), copy `config-dist.php` to `data/config.php`, edit it to your needs, ensure that the `data` directory is writable and you're ready to go, (to make writable `chown -R www-data:www-data data/`). Default login is user `admin` with password `admin`, please change the password immediately (see user menu).
|
||||
|
||||
Alternatively clone this repository and install Composer and Yarn dependencies manually.
|
||||
|
||||
If you use nginx as your webserver, please include `try_files $uri /index.php;` in your location block.
|
||||
|
||||
If, however, your webserver does not support URL rewriting, set `DISABLE_URL_REWRITING` in `data/config.php` (`Setting('DISABLE_URL_REWRITING', true);`).
|
||||
|
||||
## How to run using Docker
|
||||
|
||||
See [grocy/grocy-docker](https://github.com/grocy/grocy-docker) for instructions.
|
||||
|
||||
## How to update
|
||||
Just overwrite everything with the latest release while keeping the `/data` directory, check `config-dist.php` for new configuration options and add them to your `data/config.php` (it will show up as an error if something is missing there).
|
||||
Just overwrite everything with the latest release while keeping the `data` directory, check `config-dist.php` for new configuration options and add them to your `data/config.php` (the default from values `config-dist.php` will be used for not in `data/config.php` defined settings). Just to be sure, please empty `data/viewcache`.
|
||||
|
||||
If you run grocy on Linux, there is also `update.sh` (remember to make the script executable, `chmod +x update.sh` and ensure that you have `unzip` installed) which does exactly this and additionally creates a backup (`.tgz` archive) of the current installation in `data/backups` (backups older than 60 days will be deleted during the update).
|
||||
|
||||
## Localization
|
||||
grocy is fully localizable - the default language is English (integrated into code), a German localization is always maintained by me.
|
||||
You can easily help translating grocy at https://www.transifex.com/grocy/grocy, if your language is incomplete or not available yet.
|
||||
(Language can be changed in `data/config.php`, e. g. `Setting('CULTURE', 'it');`)
|
||||
|
||||
### Maintaining your own localization
|
||||
As the German translation will always be the most complete one, for maintaining your localization it would be easiest when you compare your localization with the German one with a diff tool of your choice.
|
||||
|
||||
## Things worth to know
|
||||
|
||||
### REST API & data model documentation
|
||||
See the integrated Swagger UI instance on [/api](https://demo-en.grocy.info/api).
|
||||
|
||||
### Barcode readers
|
||||
Some fields also allow to select a value by scanning a barcode. It works best when your barcode reader prefixes every barcode with a letter which is normally not part of a item name (I use a `$`) and sends a `TAB` after a scan.
|
||||
|
||||
### Input shorthands for date fields
|
||||
For (productivity) reasons all date (and time) input fields use the ISO-8601 format regardless of localization.
|
||||
The following shorthands are available:
|
||||
- `MMDD` gets expanded to the given day on the current year in proper notation
|
||||
- `MMDD` gets expanded to the given day on the current year, if > today, or to the given day next year, if < today, in proper notation
|
||||
- Example: `0517` will be converted to `2018-05-17`
|
||||
- `YYYYMMDD` gets expanded to the proper ISO-8601 notation
|
||||
- Example: `20190417` will be converted to `2019-04-17`
|
||||
- `x` gets expanded to `2099-12-31` (which I use for products which never expire)
|
||||
- `YYYYMMe` or `YYYYMM+` gets expanded to the end of the given month in the given year in proper notation
|
||||
- Example: `201807e` will be converted to `2018-07-31`
|
||||
- `x` gets expanded to `2999-12-31` (which I use for products which never expire)
|
||||
- Down/up arrow keys will increase/decrease the date by one day
|
||||
- Right/left arrow keys will increase/decrease the date by 1 week
|
||||
|
||||
@@ -40,21 +65,38 @@ The following shorthands are available:
|
||||
Wherever a button contains a bold highlighted letter, this is a shortcut key.
|
||||
Example: Button "Add as new **p**roduct" can be "pressed" by using the `P` key on your keyboard.
|
||||
|
||||
### Barcode lookup via external services
|
||||
Products can be directly added to the database via looking them up against external services by a barcode.
|
||||
This is currently only possible through the REST API.
|
||||
There is no plugin included for any service, see the reference implementation in `data/plugins/DemoBarcodeLookupPlugin.php`.
|
||||
|
||||
### Database migrations
|
||||
Database schema migration is automatically done when visiting the root (`/`) route (click on the logo in the left upper edge).
|
||||
|
||||
### Disable certain features
|
||||
If you don't use certain feature sets of grocy (for example if you don't need "Chores"), there are feature flags per major feature set to hide/disable the related UI elements (see `config-dist.php`)
|
||||
|
||||
### Adding your own CSS or JS without to have to modify the application itself
|
||||
- When the file `data/custom_js.html` exists, the contents of the file will be added just before `</body>` (end of body) on every page
|
||||
- When the file `data/custom_css.html` exists, the contents of the file will be added just before `</head>` (end of head) on every page
|
||||
|
||||
### Demo mode
|
||||
When the file `data/demo.txt` exists, the application will work in a demo mode which means authentication is disabled and some demo data will be generated during the database schema migration.
|
||||
|
||||
### Embedded mode
|
||||
When the file `embedded.txt` exists, it must contain a valid and writable path which will be used as the data directory instead of `data` and authentication will be disabled (used in [grocy-desktop](https://github.com/grocy/grocy-desktop)).
|
||||
|
||||
In embedded mode, settings can be overridden by text files in `data/settingoverrides`, the file name must be `<SettingName>.txt` (e. g. `BASE_URL.txt`) and the content must be the setting value (normally one single line).
|
||||
|
||||
## Screenshots
|
||||
#### Dashboard
|
||||

|
||||

|
||||
|
||||
#### Purchase - with barcode scan
|
||||

|
||||

|
||||
|
||||
#### Consume - with manual search
|
||||

|
||||

|
||||
|
||||
## License
|
||||
The MIT License (MIT)
|
||||
|
43
app.php
43
app.php
@@ -6,8 +6,39 @@ use \Psr\Http\Message\ResponseInterface as Response;
|
||||
use \Grocy\Helpers\UrlManager;
|
||||
use \Grocy\Controllers\LoginController;
|
||||
|
||||
// Definitions for embedded mode
|
||||
if (file_exists(__DIR__ . '/embedded.txt'))
|
||||
{
|
||||
define('GROCY_IS_EMBEDDED_INSTALL', true);
|
||||
define('GROCY_DATAPATH', file_get_contents(__DIR__ . '/embedded.txt'));
|
||||
define('GROCY_USER_ID', 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
define('GROCY_IS_EMBEDDED_INSTALL', false);
|
||||
define('GROCY_DATAPATH', __DIR__ . '/data');
|
||||
}
|
||||
|
||||
// Definitions for demo mode
|
||||
if (file_exists(GROCY_DATAPATH . '/demo.txt'))
|
||||
{
|
||||
define('GROCY_IS_DEMO_INSTALL', true);
|
||||
if (!defined('GROCY_USER_ID'))
|
||||
{
|
||||
define('GROCY_USER_ID', 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
define('GROCY_IS_DEMO_INSTALL', false);
|
||||
}
|
||||
|
||||
// Load composer dependencies
|
||||
require_once __DIR__ . '/vendor/autoload.php';
|
||||
require_once __DIR__ . '/data/config.php';
|
||||
|
||||
// Load config files
|
||||
require_once GROCY_DATAPATH . '/config.php';
|
||||
require_once __DIR__ . '/config-dist.php'; //For not in own config defined values we use the default ones
|
||||
|
||||
// Setup base application
|
||||
$appContainer = new \Slim\Container([
|
||||
@@ -17,7 +48,7 @@ $appContainer = new \Slim\Container([
|
||||
],
|
||||
'view' => function($container)
|
||||
{
|
||||
return new \Slim\Views\Blade(__DIR__ . '/views', __DIR__ . '/data/viewcache');
|
||||
return new \Slim\Views\Blade(__DIR__ . '/views', GROCY_DATAPATH . '/viewcache');
|
||||
},
|
||||
'LoginControllerInstance' => function($container)
|
||||
{
|
||||
@@ -25,7 +56,7 @@ $appContainer = new \Slim\Container([
|
||||
},
|
||||
'UrlManager' => function($container)
|
||||
{
|
||||
return new UrlManager(BASE_URL);
|
||||
return new UrlManager(GROCY_BASE_URL);
|
||||
},
|
||||
'ApiKeyHeaderName' => function($container)
|
||||
{
|
||||
@@ -34,11 +65,7 @@ $appContainer = new \Slim\Container([
|
||||
]);
|
||||
$app = new \Slim\App($appContainer);
|
||||
|
||||
if (PHP_SAPI === 'cli')
|
||||
{
|
||||
$app->add(\pavlakis\cli\CliRequest::class);
|
||||
}
|
||||
|
||||
// Load routes from separate file
|
||||
require_once __DIR__ . '/routes.php';
|
||||
|
||||
$app->run();
|
||||
|
24
bower.json
24
bower.json
@@ -1,24 +0,0 @@
|
||||
{
|
||||
"name": "grocy",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"bootstrap": "^3.3.7",
|
||||
"font-awesome": "^4.7.0",
|
||||
"bootbox": "^4.4.0",
|
||||
"jquery.serializeJSON": "^2.8.1",
|
||||
"bootstrap-validator": "^0.11.9",
|
||||
"bootstrap-datepicker": "^1.7.1",
|
||||
"moment": "^2.18.1",
|
||||
"bootstrap-combobox": "^1.1.8",
|
||||
"datatables.net": "^1.10.15",
|
||||
"datatables.net-bs": "^2.1.1",
|
||||
"datatables.net-responsive": "^2.1.1",
|
||||
"datatables.net-responsive-bs": "^2.1.1",
|
||||
"jquery-timeago": "^1.6.1",
|
||||
"toastr": "^2.1.3",
|
||||
"tagmanager": "^3.0.2",
|
||||
"eonasdan-bootstrap-datetimepicker": "^4.17.47",
|
||||
"swagger-ui": "^3.13.4",
|
||||
"jquery-ui": "^1.12.1"
|
||||
}
|
||||
}
|
13
build.bat
13
build.bat
@@ -1,13 +0,0 @@
|
||||
set projectPath=%~dp0
|
||||
if %projectPath:~-1%==\ set projectPath=%projectPath:~0,-1%
|
||||
|
||||
set releasePath=%projectPath%\.release
|
||||
mkdir "%releasePath%"
|
||||
|
||||
for /f "tokens=*" %%a in ('type version.txt') do set version=%%a
|
||||
|
||||
del "%releasePath%\grocy_%version%.zip"
|
||||
"build_tools\7za.exe" a -r "%releasePath%\grocy_%version%.zip" "%projectPath%\*" -xr!.* -xr!build_tools -xr!build.bat -xr!composer.json -xr!composer.lock -xr!bower.json -xr!publication_assets
|
||||
"build_tools\7za.exe" a "%releasePath%\grocy_%version%.zip" "%projectPath%\public\.htaccess"
|
||||
"build_tools\7za.exe" rn "%releasePath%\grocy_%version%.zip" .htaccess public\.htaccess
|
||||
"build_tools\7za.exe" d "%releasePath%\grocy_%version%.zip" data\*.* data\sessions data\viewcache\*
|
Binary file not shown.
1
changelog/10_1.4.0_2017-06-04.md
Normal file
1
changelog/10_1.4.0_2017-06-04.md
Normal file
@@ -0,0 +1 @@
|
||||
- Added a login screen and switched to cookie/session based authentication instead of HTTP-basic-auth
|
2
changelog/11_1.5.0_2017-07-25.md
Normal file
2
changelog/11_1.5.0_2017-07-25.md
Normal file
@@ -0,0 +1,2 @@
|
||||
- New feature: Habit tracking
|
||||
- Fixed an issue which prevented that the databse is correctly created on unix systems
|
2
changelog/12_1.6.0_2017-11-06.md
Normal file
2
changelog/12_1.6.0_2017-11-06.md
Normal file
@@ -0,0 +1,2 @@
|
||||
- New feature: Rechargeable battery management
|
||||
- Improved productivity of input forms
|
1
changelog/13_1.6.1_2017-11-09.md
Normal file
1
changelog/13_1.6.1_2017-11-09.md
Normal file
@@ -0,0 +1 @@
|
||||
- Improved sidebar responsiveness
|
2
changelog/14_1.7.0_2018-04-15.md
Normal file
2
changelog/14_1.7.0_2018-04-15.md
Normal file
@@ -0,0 +1,2 @@
|
||||
- Allow to add anything to the shopping list, not only products
|
||||
- Major project refactoring
|
1
changelog/15_1.8.0_2018-04-16.md
Normal file
1
changelog/15_1.8.0_2018-04-16.md
Normal file
@@ -0,0 +1 @@
|
||||
- grocy is now fully localizable and ships by default with English and German translations
|
2
changelog/16_1.8.1_2018-04-18.md
Normal file
2
changelog/16_1.8.1_2018-04-18.md
Normal file
@@ -0,0 +1,2 @@
|
||||
- New configuration option "BASE_URL" to define base installation URL (should make subdirectory installations possible, see #3)
|
||||
- Added some missing translations
|
1
changelog/17_1.8.2_2018-04-18.md
Normal file
1
changelog/17_1.8.2_2018-04-18.md
Normal file
@@ -0,0 +1 @@
|
||||
- Fixed login form didn't respect the configured BASE_URL
|
1
changelog/18_1.9.0_2018-04-21.md
Normal file
1
changelog/18_1.9.0_2018-04-21.md
Normal file
@@ -0,0 +1 @@
|
||||
- Documented the REST API and data model, see the integrated instance of Swagger UI at [/api](https://demo-en.grocy.info/api)
|
1
changelog/19_1.9.1_2018-04-22.md
Normal file
1
changelog/19_1.9.1_2018-04-22.md
Normal file
@@ -0,0 +1 @@
|
||||
- Added validation of all API requests and improved Swagger/OpenAPI description
|
1
changelog/1_0.1.0_2017-04-15.md
Normal file
1
changelog/1_0.1.0_2017-04-15.md
Normal file
@@ -0,0 +1 @@
|
||||
- Basic features, mainly about a interface to record grocery purchases and consumptions
|
1
changelog/20_1.9.2_2018-04-22.md
Normal file
1
changelog/20_1.9.2_2018-04-22.md
Normal file
@@ -0,0 +1 @@
|
||||
- Added a plugin system for looking up products against external services by barcode, see #6 for reference
|
4
changelog/21_1.10.0_2018-05-12.md
Normal file
4
changelog/21_1.10.0_2018-05-12.md
Normal file
@@ -0,0 +1,4 @@
|
||||
- It's now possible to consume products directly from stock overview with one click
|
||||
- Added due/overdue info on bateries- and habits overview (like on stock overview)
|
||||
- Reworked general page layout and improved responsiveness (see #9 and thanks @d-Rickyy-b)
|
||||
- Translations fixes
|
1
changelog/22_1.11.0_2018-06-15.md
Normal file
1
changelog/22_1.11.0_2018-06-15.md
Normal file
@@ -0,0 +1 @@
|
||||
- Added an option to not use URL rewriting (for webservers which, however, don't support URL rewriting)
|
2
changelog/23_1.12.0_2018-07-08.md
Normal file
2
changelog/23_1.12.0_2018-07-08.md
Normal file
@@ -0,0 +1,2 @@
|
||||
- On the stockoverview it's now possible to filter the products by location
|
||||
- All dropdowns are now sorted alphabetically
|
1
changelog/24_1.12.1_2018-07-08.md
Normal file
1
changelog/24_1.12.1_2018-07-08.md
Normal file
@@ -0,0 +1 @@
|
||||
- Bug fix for location filtering on stock overview page did not work in all browsers
|
3
changelog/25_1.13.0_2018-07-12.md
Normal file
3
changelog/25_1.13.0_2018-07-12.md
Normal file
@@ -0,0 +1,3 @@
|
||||
- Upgraded Bootstrap and some other dependencies (grocy now looks even better!)
|
||||
- Added Italian translation (thanks @davidoskky)
|
||||
- => Demo for this language available at: https://demo-it.grocy.info
|
5
changelog/26_1.13.1_2018-07-12.md
Normal file
5
changelog/26_1.13.1_2018-07-12.md
Normal file
@@ -0,0 +1,5 @@
|
||||
This was released shortly after the last release to fix a small regression bug, original changes from Version 1.13.0:
|
||||
|
||||
- Upgraded Bootstrap and some other dependencies (grocy now looks even better!)
|
||||
- Added Italian translation (thanks @davidoskky)
|
||||
- => Demo for this language available at: https://demo-it.grocy.info
|
13
changelog/27_1.14.0_2018-07-15.md
Normal file
13
changelog/27_1.14.0_2018-07-15.md
Normal file
@@ -0,0 +1,13 @@
|
||||
- New feature: **Recipes**
|
||||
- Organize a list of products, amounts and a description into recipes and see at a glance if everything needed is in stock or put the missing things with one click on the shopping list
|
||||
- Try it live on the demo page: => https://demo-en.grocy.info/recipes
|
||||
- Added norwegian translation (thanks @BlizzWave)
|
||||
- Demo available at: => https://demo-no.grocy.info
|
||||
- A lot of small UI improvements
|
||||
- Columns in tables can now be reordered
|
||||
- Show a calendar on the shopping list page (useful, at least for me)
|
||||
- Table column ordering and sorting is now remembered
|
||||
- Sidebar collapse state is now remembered
|
||||
- Fixed datetimepicker border
|
||||
- Keep the parent sidebar menu item expanded if the active page is a sub menu item
|
||||
- Custom JS/CSS file names have changed [see README](https://github.com/berrnd/grocy#adding-your-own-css-or-js-without-to-have-to-modify-the-application-itself)
|
9
changelog/28_1.15.0_2018-07-22.md
Normal file
9
changelog/28_1.15.0_2018-07-22.md
Normal file
@@ -0,0 +1,9 @@
|
||||
- New related project: **grocy-desktop**
|
||||
- => https://github.com/berrnd/grocy-desktop
|
||||
- Run grocy without a webserver just like a normal (windows) desktop application
|
||||
- New "embedded mode" for grocy to help running in "desktop application mode" [see README](https://github.com/berrnd/grocy#embedded-mode)
|
||||
- New datepicker shorthands and improvements
|
||||
- `YYYYMMe` or `YYYYMM+` gets expanded to the end of the given month in the given year in proper notation
|
||||
- Changed: `MMDD` will be expanded to the given day next year if > today
|
||||
- [see README](https://github.com/berrnd/grocy#input-shorthands-for-date-fields)
|
||||
- Some other small bug fixes
|
8
changelog/29_1.16.0_2018-07-25.md
Normal file
8
changelog/29_1.16.0_2018-07-25.md
Normal file
@@ -0,0 +1,8 @@
|
||||
- Replaced the single user (so far defined in `/data/config.php`) with a multi-user management
|
||||
- The currently defined user will automatically be migrated, please remove `HTTP_USER` and `HTTP_PASSWORD` from your config file afterwards
|
||||
- For this it was necessary to delete all sessions and API keys during the migration
|
||||
- Added an update script (`/update.sh`) to make updates (on Linux machines) easier
|
||||
- See also ["How to update" in README](https://github.com/berrnd/grocy#how-to-update)
|
||||
- Added the possibility to track who did a habit
|
||||
- Added a rudimentary habit analysis possibility
|
||||
- Different small UI, code and translation improvements
|
1
changelog/2_0.2.0_2017-04-16.md
Normal file
1
changelog/2_0.2.0_2017-04-16.md
Normal file
@@ -0,0 +1 @@
|
||||
- General improvements, the work goes on...
|
4
changelog/30_1.17.0_2018-08-04.md
Normal file
4
changelog/30_1.17.0_2018-08-04.md
Normal file
@@ -0,0 +1,4 @@
|
||||
- Basic product price tracking (can be entered on purchase, a little price history chart is shown in the product card - right side on purchase/consume/etc. pages)
|
||||
- Proper pluralization of everything (for quantity units you can enter the plural form in master data)
|
||||
- On all overview pages the statistics shown in the header are now updated when doing changes directly on the page (e. g. consuming a product)
|
||||
- Lots of small fixes and improvements (form validation, translations - thanks for keeping the norwegian translation always updated @BlizzWave, other small bugs)
|
5
changelog/31_1.18.0_2018-08-11.md
Normal file
5
changelog/31_1.18.0_2018-08-11.md
Normal file
@@ -0,0 +1,5 @@
|
||||
- The complete row is now refreshed on changes on all overview pages
|
||||
- Added a checkbox to set the "never expires date" in best before date inputs (alternative to shortcut "x")
|
||||
- Recipes can now have arbitrary quantity units and stock is only checked for one unit then (imagine you have sugar in "Packs" in stock but your recipe "Pancakes" needs 200 grams)
|
||||
- Added a "consume this recipe button" to remove all ingredients of a recipe from stock with one click
|
||||
- Other small UI changes/improvements
|
1
changelog/32_1.18.1_2018-09-08.md
Normal file
1
changelog/32_1.18.1_2018-09-08.md
Normal file
@@ -0,0 +1 @@
|
||||
- Some smaller UI bug fixes and enhancements (thanks again for all the testing @BlizzWave)
|
6
changelog/33_1.19.0_2018-09-24.md
Normal file
6
changelog/33_1.19.0_2018-09-24.md
Normal file
@@ -0,0 +1,6 @@
|
||||
- New feature: Tasks / To-do list
|
||||
- Renamed habits to chores as this is more what it is about
|
||||
- Products can now be organized in product groups, this group is also used to group the items on the shopping list (you can use this to optimize your way in the supermarket for example)
|
||||
- Added an option to stay logged in permanently (checkbox on the login page)
|
||||
- When the database was changed externally, the current page is automatically reloaded when there was no input for at least 50 seconds
|
||||
- Fixed some minor UI bugs
|
2
changelog/34_1.19.1_2018-09-27.md
Normal file
2
changelog/34_1.19.1_2018-09-27.md
Normal file
@@ -0,0 +1,2 @@
|
||||
- The colored info bars on top of all (overview)pages can now be clicked to filter the table accordingly
|
||||
- Fixed some minor mostly UI related bugs
|
2
changelog/35_1.19.2_2018-09-29.md
Normal file
2
changelog/35_1.19.2_2018-09-29.md
Normal file
@@ -0,0 +1,2 @@
|
||||
- Important bug fix: All forms were submitted twice when using ENTER instead of the OK/Save button
|
||||
- Norwegian translation updates (thanks @BlizzWave )
|
3
changelog/36_1.20.0_2018-09-30.md
Normal file
3
changelog/36_1.20.0_2018-09-30.md
Normal file
@@ -0,0 +1,3 @@
|
||||
- New optional "Night Mode" (thanks a lot @BlizzWave, can also be activated automatically by a time range - see the new dropdown menu next to the user menu)
|
||||
- Docker support (thanks @talmai)
|
||||
- Fixed some minor UI bugs
|
6
changelog/37_1.21.0_2018-10-06.md
Normal file
6
changelog/37_1.21.0_2018-10-06.md
Normal file
@@ -0,0 +1,6 @@
|
||||
- New feature: Equipment
|
||||
- Manage all your household equipment/devices in one place and have the information/instruction manual at hand when needed
|
||||
- New feature: Products can now have pictures
|
||||
- Add them in the product edit page
|
||||
- Will be shown in the productcard (purchase/consume/etc. pages) and when you click the product name on the stock overview page (a little image icon next to the product name indicates if the product has an image)
|
||||
- Recipes and the new equipment edit page now have a little editor with text formatting capabilities
|
14
changelog/38_1.22.0_2018-10-27.md
Normal file
14
changelog/38_1.22.0_2018-10-27.md
Normal file
@@ -0,0 +1,14 @@
|
||||
- Added a journal for stock bookings, chore executions and battery charge cycles
|
||||
- => Button in each line on the overview pages or the "Journal" button next to the headline on every overview page
|
||||
- Added the possibility to undo any stock booking, chore execution and battery charge cycle
|
||||
- => Button in the success popup while booking a purchase/consume/etc. or on the new journal pages (see above)
|
||||
- Presets for new products are now configurable
|
||||
- => "Presets for new products" button next to the headline on the products list page
|
||||
- Recipes can now be nested (include a recipe into another one)
|
||||
- Recipe ingredients can now be grouped together which will result in headlines per group in the rendered recipe
|
||||
- => Group can be set on the recipe position edit page, demo recipe is "Pizza")
|
||||
- On the stock overview page, the product card is now shown when clicking the product name
|
||||
- Added option to filter by product group on stock overview page
|
||||
- When auto reloading on external changes is enabled, the page is not reloaded when there is a fullscreen card active (recipe/equipment instruction manual)
|
||||
- On the product-/chore-/batterycard there is now a link to the edit page of the corresponding item
|
||||
- Some other minor bug fixes
|
18
changelog/39_1.23.0_2018-11-24.md
Normal file
18
changelog/39_1.23.0_2018-11-24.md
Normal file
@@ -0,0 +1,18 @@
|
||||
- New feature: "Shopping list to stock workflow"
|
||||
- Add a single shopping list item or all at once to stock directly from the shopping list
|
||||
- There are new "stock settings" under settings menu in the top right corner
|
||||
- You can enable there, that all products which have "Default best before days" set, are added without confirmation in this workflow
|
||||
- => This means, you can add the whole shopping list to stock with one click, if you want
|
||||
- Improved stock handling
|
||||
- On consume, a specific stock item can now be picked
|
||||
- A stock item can now be marked as "opened" (on the consume page or directly from stock overview, visible in the product card and on the stock overview page)
|
||||
- New feature: Calendar
|
||||
- Shows all upcoming product expirations, due chores, due tasks and due battery charge cycles
|
||||
- New translation: French (thanks all the translators)
|
||||
- As for all languages, a demo is available at: https://demo-fr.grocy.info
|
||||
- Small other improvements
|
||||
- Allow fraction numbers for recipe ingredients when not checked against stock and add an option to not check stock for a recipe position
|
||||
- The current time can now be shown in the header (see the settings menu next to the user icon)
|
||||
- Changed: Docker related things are now in a separate repository: https://github.com/grocy/grocy-docker
|
||||
- Changed: Translations are now managed with Transifex: https://www.transifex.com/grocy/grocy
|
||||
|
1
changelog/3_0.3.0_2017-04-17.md
Normal file
1
changelog/3_0.3.0_2017-04-17.md
Normal file
@@ -0,0 +1 @@
|
||||
- Form validation and barcode input handling improvements
|
2
changelog/40_1.23.1_2018-11-27.md
Normal file
2
changelog/40_1.23.1_2018-11-27.md
Normal file
@@ -0,0 +1,2 @@
|
||||
- Added a skip button when adding all shopping list items in "Shopping list to stock workflow"
|
||||
- Fixed some minor UI related bugs
|
1
changelog/41_1.24.0_2018-12-30.md
Normal file
1
changelog/41_1.24.0_2018-12-30.md
Normal file
@@ -0,0 +1 @@
|
||||
- All `config.php` settings can now also be set via environment variables (for [grocy-docker](https://github.com/grocy/grocy-docker))
|
5
changelog/42_1.24.1_2019-01-10.md
Normal file
5
changelog/42_1.24.1_2019-01-10.md
Normal file
@@ -0,0 +1,5 @@
|
||||
- Fixed a SQL error during database migration when using SQLite >= 3.25.2
|
||||
- Improved data tables loading time
|
||||
- Location edit form did not work (master data)
|
||||
- Quantity unit "purchase to stock factor" was not respected when putting a recipe on the shopping list or when comparing the already on the shopping list amount
|
||||
- Better API response for POST routes when there is no or invalid JSON request body content
|
23
changelog/43_2.0.0_2019-03-06.md
Normal file
23
changelog/43_2.0.0_2019-03-06.md
Normal file
@@ -0,0 +1,23 @@
|
||||
- Breaking change: The API has been completely reworked, please review [the documentation](https://demo-en.grocy.info/api) before updating when you are using the API
|
||||
- New feature: Tare weight handling
|
||||
- An option per product
|
||||
- Imagine this: You have flour in jars, the jar weighs 500 grams, currently there are 1000 grams in stock, the new weight including the jar is 1100 grams - grocy can now calculate the used amount on consume/purchase/inventory automatically, you only have to enter the weighed amount including the jar (demo product to showcase this "Flour")
|
||||
- Recipe improvements
|
||||
- Recipes are now scalable - define per recipe for how much servings it is, change the desired servings on the fly when the recipe is displayed, ingredient amounts are scaled accordingly
|
||||
- The cost of a recipe is now displayed based on the last purchase price per ingredient (recipe scaling also applies)
|
||||
- When putting all missing recipe ingredients on the shopping list, it is now possible to ignore certain ingredients (in the popup when clicking the "Put missing items on shopping list" button)
|
||||
- A new option per recipe to not check against the amount already on the shopping list when putting all missing ingredients on it (by default, only the amount not already on the shopping list is added, when this is enabled, always the whole missing amount will be put on the shopping list)
|
||||
- On consume, there can now be tracked for which recipe it was, this is also tracked automatically when using the "Consume all ingredients needed by this recipe" button (for future statistical purposes)
|
||||
- Recipes can now have pictures
|
||||
- New "gallery view" for recipes (demo available at https://demo-en.grocy.info/recipes?tab=gallery)
|
||||
- Stock improvements
|
||||
- It is now optionally possible to have partial units in stock (option per product)
|
||||
- On purchase, a different location can now be assigned (imagine you have two freezers, by default you store your pizza there, but sometimes there)
|
||||
- New translations: (thanks all the translators)
|
||||
- Spanish (demo available at https://demo-es.grocy.info)
|
||||
- Turkish (demo available at https://demo-tr.grocy.info)
|
||||
- Other improvements
|
||||
- The calendar can now be shared/integrated in iCal format (button in the header on the calendar page)
|
||||
- Added feature flags to hide/disable certain parts of grocy when you don't use them (for example hide "Chores" and all related UI elements, when you don't use it, see `config-dist.php`)
|
||||
- Added a "Apple Touch Icon" and a "Web App Manifest" which should improve grocy on mobile devices and also enables "Add to Home screen" on major mobile browsers
|
||||
- A lot of other minor small and bigger UI improvements
|
10
changelog/44_2.1.0_2019-03-09.md
Normal file
10
changelog/44_2.1.0_2019-03-09.md
Normal file
@@ -0,0 +1,10 @@
|
||||
- Some small UI fixes & improvements
|
||||
- Recipe ingredient notes were not displayed
|
||||
- Edit/delete buttons on the equipment page had no icons
|
||||
- Improved the overview pages "action buttons column" (e. g. hide more rarely used actions behind a context/dropdown menu)
|
||||
- The "purchase to stock conversion factor" is now displayed on the purchase page when QU units are different (above the amount field)
|
||||
- Some JS files were not loaded correctly on case sensitive file systems
|
||||
- The changelog is now included as markdown files (in `/changelog` directory, one file per release with a filename in format `<ReleaseNumber>_<Version>_<ReleaseDateIso>.md`) and shown in the about dialog
|
||||
- Please review your `CURRENCY` setting in `data/config.php`, see also `config-dist.php` - this should be the ISO 4217 code of the currency to properly work with the JS `toLocaleString` function
|
||||
- New translation: (thanks all the translators)
|
||||
- Russian (demo available at https://demo-ru.grocy.info)
|
5
changelog/45_2.2.0_2019-03-10.md
Normal file
5
changelog/45_2.2.0_2019-03-10.md
Normal file
@@ -0,0 +1,5 @@
|
||||
- New API method to get a product by its barcode (`/stock/products/by-barcode/{barcode}`, thanks @matejdro)
|
||||
- The best before date on the purchase and inventory page can now also be today or earlier, but when so, a short hint is displayed
|
||||
- Fixed some UI bugs
|
||||
- When consuming a product with "Allow partial units in stock" enabled from the stock overview page, the displayed amount after the stock booking was wrong
|
||||
- The inventory form was not validated with certain click paths
|
1
changelog/4_0.4.0_2017-04-18.md
Normal file
1
changelog/4_0.4.0_2017-04-18.md
Normal file
@@ -0,0 +1 @@
|
||||
- Add possibility to have multiple barcodes per product
|
1
changelog/5_1.0.0_2017-04-20.md
Normal file
1
changelog/5_1.0.0_2017-04-20.md
Normal file
@@ -0,0 +1 @@
|
||||
- Ready to ERP your fridge!
|
1
changelog/6_1.0.1_2017-04-20.md
Normal file
1
changelog/6_1.0.1_2017-04-20.md
Normal file
@@ -0,0 +1 @@
|
||||
- Added flow to directly add products and barcodes from purchase and inventory view
|
2
changelog/7_1.1.0_2017-04-21.md
Normal file
2
changelog/7_1.1.0_2017-04-21.md
Normal file
@@ -0,0 +1,2 @@
|
||||
* New feature: Shopping list (which is also automatically filled based on defined min. stock amount)
|
||||
* Small UI changes for better productivity
|
1
changelog/8_1.2.0_2017-04-21.md
Normal file
1
changelog/8_1.2.0_2017-04-21.md
Normal file
@@ -0,0 +1 @@
|
||||
- Added a flow to add a new product with prefilled barcode
|
1
changelog/9_1.3.0_2017-04-22.md
Normal file
1
changelog/9_1.3.0_2017-04-22.md
Normal file
@@ -0,0 +1 @@
|
||||
- Added a favicon and more productivity improvements
|
@@ -1,11 +1,12 @@
|
||||
{
|
||||
"require": {
|
||||
"php": ">=7.0",
|
||||
"php": ">=7.2",
|
||||
"slim/slim": "^3.8",
|
||||
"morris/lessql": "^0.3.4",
|
||||
"pavlakis/slim-cli": "^1.0",
|
||||
"rubellum/slim-blade-view": "^0.1.1",
|
||||
"tuupola/cors-middleware": "^0.7.0"
|
||||
"tuupola/cors-middleware": "^0.7.0",
|
||||
"eluceo/ical": "^0.15.0",
|
||||
"erusev/parsedown": "^1.7.1"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
496
composer.lock
generated
496
composer.lock
generated
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"_readme": [
|
||||
"This file locks the dependencies of your project to a known state",
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "42031c0b205b7ce7efb4b6eb95a0096a",
|
||||
"content-hash": "d11fedeb82f88d3996984cca43395a08",
|
||||
"packages": [
|
||||
{
|
||||
"name": "container-interop/container-interop",
|
||||
@@ -104,6 +104,103 @@
|
||||
],
|
||||
"time": "2018-01-09T20:05:19+00:00"
|
||||
},
|
||||
{
|
||||
"name": "eluceo/ical",
|
||||
"version": "0.15.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/markuspoerschke/iCal.git",
|
||||
"reference": "add0ca99aa1f77f134a2e8b071f2ebc22b115139"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/markuspoerschke/iCal/zipball/add0ca99aa1f77f134a2e8b071f2ebc22b115139",
|
||||
"reference": "add0ca99aa1f77f134a2e8b071f2ebc22b115139",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^6.0"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-mbstring": "Massive performance enhancement of line folding"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Eluceo\\iCal\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Markus Poerschke",
|
||||
"email": "markus@eluceo.de",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"description": "The eluceo/iCal package offers a abstraction layer for creating iCalendars. You can easily create iCal files by using PHP object instead of typing your *.ics file by hand. The output will follow RFC 5545 as best as possible.",
|
||||
"homepage": "https://github.com/markuspoerschke/iCal",
|
||||
"keywords": [
|
||||
"calendar",
|
||||
"iCalendar",
|
||||
"ical",
|
||||
"ics",
|
||||
"php calendar"
|
||||
],
|
||||
"time": "2019-01-13T22:00:58+00:00"
|
||||
},
|
||||
{
|
||||
"name": "erusev/parsedown",
|
||||
"version": "1.7.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/erusev/parsedown.git",
|
||||
"reference": "92e9c27ba0e74b8b028b111d1b6f956a15c01fc1"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/erusev/parsedown/zipball/92e9c27ba0e74b8b028b111d1b6f956a15c01fc1",
|
||||
"reference": "92e9c27ba0e74b8b028b111d1b6f956a15c01fc1",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-mbstring": "*",
|
||||
"php": ">=5.3.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^4.8.35"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Parsedown": ""
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Emanuil Rusev",
|
||||
"email": "hello@erusev.com",
|
||||
"homepage": "http://erusev.com"
|
||||
}
|
||||
],
|
||||
"description": "Parser for Markdown.",
|
||||
"homepage": "http://parsedown.org",
|
||||
"keywords": [
|
||||
"markdown",
|
||||
"parser"
|
||||
],
|
||||
"time": "2018-03-08T01:11:30+00:00"
|
||||
},
|
||||
{
|
||||
"name": "http-interop/http-factory",
|
||||
"version": "0.3.0",
|
||||
@@ -154,31 +251,33 @@
|
||||
"request",
|
||||
"response"
|
||||
],
|
||||
"abandoned": "psr/http-factory",
|
||||
"time": "2017-03-24T14:48:51+00:00"
|
||||
},
|
||||
{
|
||||
"name": "illuminate/container",
|
||||
"version": "v5.6.17",
|
||||
"version": "v5.8.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/illuminate/container.git",
|
||||
"reference": "4a42d667a05ec6d31f05b532cdac7e8e68e5ea2a"
|
||||
"reference": "b984960d2634c6be97b0dd368a8953e8c4e06ec7"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/illuminate/container/zipball/4a42d667a05ec6d31f05b532cdac7e8e68e5ea2a",
|
||||
"reference": "4a42d667a05ec6d31f05b532cdac7e8e68e5ea2a",
|
||||
"url": "https://api.github.com/repos/illuminate/container/zipball/b984960d2634c6be97b0dd368a8953e8c4e06ec7",
|
||||
"reference": "b984960d2634c6be97b0dd368a8953e8c4e06ec7",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"illuminate/contracts": "5.6.*",
|
||||
"illuminate/contracts": "5.8.*",
|
||||
"illuminate/support": "5.8.*",
|
||||
"php": "^7.1.3",
|
||||
"psr/container": "~1.0"
|
||||
"psr/container": "^1.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "5.6-dev"
|
||||
"dev-master": "5.8-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -198,31 +297,31 @@
|
||||
],
|
||||
"description": "The Illuminate Container package.",
|
||||
"homepage": "https://laravel.com",
|
||||
"time": "2018-01-21T02:13:38+00:00"
|
||||
"time": "2019-03-03T15:13:35+00:00"
|
||||
},
|
||||
{
|
||||
"name": "illuminate/contracts",
|
||||
"version": "v5.6.17",
|
||||
"version": "v5.8.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/illuminate/contracts.git",
|
||||
"reference": "322ec80498b3bf85bc4025d028e130a9b50242b9"
|
||||
"reference": "3e3a9a654adbf798e05491a5dbf90112df1effde"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/illuminate/contracts/zipball/322ec80498b3bf85bc4025d028e130a9b50242b9",
|
||||
"reference": "322ec80498b3bf85bc4025d028e130a9b50242b9",
|
||||
"url": "https://api.github.com/repos/illuminate/contracts/zipball/3e3a9a654adbf798e05491a5dbf90112df1effde",
|
||||
"reference": "3e3a9a654adbf798e05491a5dbf90112df1effde",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.1.3",
|
||||
"psr/container": "~1.0",
|
||||
"psr/simple-cache": "~1.0"
|
||||
"psr/container": "^1.0",
|
||||
"psr/simple-cache": "^1.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "5.6-dev"
|
||||
"dev-master": "5.8-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -242,32 +341,32 @@
|
||||
],
|
||||
"description": "The Illuminate Contracts package.",
|
||||
"homepage": "https://laravel.com",
|
||||
"time": "2018-04-07T17:05:26+00:00"
|
||||
"time": "2019-02-18T18:37:54+00:00"
|
||||
},
|
||||
{
|
||||
"name": "illuminate/events",
|
||||
"version": "v5.6.17",
|
||||
"version": "v5.8.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/illuminate/events.git",
|
||||
"reference": "b6e73ed40478cef2ef98d5ddb27f333291606cea"
|
||||
"reference": "a85d7c273bc4e3357000c5fc4812374598515de3"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/illuminate/events/zipball/b6e73ed40478cef2ef98d5ddb27f333291606cea",
|
||||
"reference": "b6e73ed40478cef2ef98d5ddb27f333291606cea",
|
||||
"url": "https://api.github.com/repos/illuminate/events/zipball/a85d7c273bc4e3357000c5fc4812374598515de3",
|
||||
"reference": "a85d7c273bc4e3357000c5fc4812374598515de3",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"illuminate/container": "5.6.*",
|
||||
"illuminate/contracts": "5.6.*",
|
||||
"illuminate/support": "5.6.*",
|
||||
"illuminate/container": "5.8.*",
|
||||
"illuminate/contracts": "5.8.*",
|
||||
"illuminate/support": "5.8.*",
|
||||
"php": "^7.1.3"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "5.6-dev"
|
||||
"dev-master": "5.8-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -287,39 +386,39 @@
|
||||
],
|
||||
"description": "The Illuminate Events package.",
|
||||
"homepage": "https://laravel.com",
|
||||
"time": "2018-02-26T19:00:55+00:00"
|
||||
"time": "2019-02-18T18:37:54+00:00"
|
||||
},
|
||||
{
|
||||
"name": "illuminate/filesystem",
|
||||
"version": "v5.6.17",
|
||||
"version": "v5.8.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/illuminate/filesystem.git",
|
||||
"reference": "c9ab9376076cedd88a374d7281d62b619634d578"
|
||||
"reference": "8aef3ed5028eea80fa20287b776d6ec8e7eafbba"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/illuminate/filesystem/zipball/c9ab9376076cedd88a374d7281d62b619634d578",
|
||||
"reference": "c9ab9376076cedd88a374d7281d62b619634d578",
|
||||
"url": "https://api.github.com/repos/illuminate/filesystem/zipball/8aef3ed5028eea80fa20287b776d6ec8e7eafbba",
|
||||
"reference": "8aef3ed5028eea80fa20287b776d6ec8e7eafbba",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"illuminate/contracts": "5.6.*",
|
||||
"illuminate/support": "5.6.*",
|
||||
"illuminate/contracts": "5.8.*",
|
||||
"illuminate/support": "5.8.*",
|
||||
"php": "^7.1.3",
|
||||
"symfony/finder": "~4.0"
|
||||
"symfony/finder": "^4.2"
|
||||
},
|
||||
"suggest": {
|
||||
"league/flysystem": "Required to use the Flysystem local and FTP drivers (~1.0).",
|
||||
"league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (~1.0).",
|
||||
"league/flysystem-cached-adapter": "Required to use the Flysystem cache (~1.0).",
|
||||
"league/flysystem-rackspace": "Required to use the Flysystem Rackspace driver (~1.0).",
|
||||
"league/flysystem-sftp": "Required to use the Flysystem SFTP driver (~1.0)."
|
||||
"league/flysystem": "Required to use the Flysystem local and FTP drivers (^1.0).",
|
||||
"league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^1.0).",
|
||||
"league/flysystem-cached-adapter": "Required to use the Flysystem cache (^1.0).",
|
||||
"league/flysystem-rackspace": "Required to use the Flysystem Rackspace driver (^1.0).",
|
||||
"league/flysystem-sftp": "Required to use the Flysystem SFTP driver (^1.0)."
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "5.6-dev"
|
||||
"dev-master": "5.8-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -339,41 +438,45 @@
|
||||
],
|
||||
"description": "The Illuminate Filesystem package.",
|
||||
"homepage": "https://laravel.com",
|
||||
"time": "2018-04-06T13:15:37+00:00"
|
||||
"time": "2019-02-18T18:37:54+00:00"
|
||||
},
|
||||
{
|
||||
"name": "illuminate/support",
|
||||
"version": "v5.6.17",
|
||||
"version": "v5.8.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/illuminate/support.git",
|
||||
"reference": "cc8d6f5cef3a901de6bb7d1b362102a6db001085"
|
||||
"reference": "0f0291d1bc2f036af3fceb8e46900b58812533c4"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/illuminate/support/zipball/cc8d6f5cef3a901de6bb7d1b362102a6db001085",
|
||||
"reference": "cc8d6f5cef3a901de6bb7d1b362102a6db001085",
|
||||
"url": "https://api.github.com/repos/illuminate/support/zipball/0f0291d1bc2f036af3fceb8e46900b58812533c4",
|
||||
"reference": "0f0291d1bc2f036af3fceb8e46900b58812533c4",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"doctrine/inflector": "~1.1",
|
||||
"doctrine/inflector": "^1.1",
|
||||
"ext-json": "*",
|
||||
"ext-mbstring": "*",
|
||||
"illuminate/contracts": "5.6.*",
|
||||
"nesbot/carbon": "^1.24.1",
|
||||
"illuminate/contracts": "5.8.*",
|
||||
"nesbot/carbon": "^1.26.3 || ^2.0",
|
||||
"php": "^7.1.3"
|
||||
},
|
||||
"conflict": {
|
||||
"tightenco/collect": "<5.5.33"
|
||||
},
|
||||
"suggest": {
|
||||
"illuminate/filesystem": "Required to use the composer class (5.6.*).",
|
||||
"symfony/process": "Required to use the composer class (~4.0).",
|
||||
"symfony/var-dumper": "Required to use the dd function (~4.0)."
|
||||
"illuminate/filesystem": "Required to use the composer class (5.8.*).",
|
||||
"moontoast/math": "Required to use ordered UUIDs (^1.1).",
|
||||
"ramsey/uuid": "Required to use Str::uuid() (^3.7).",
|
||||
"symfony/process": "Required to use the composer class (^4.2).",
|
||||
"symfony/var-dumper": "Required to use the dd function (^4.2).",
|
||||
"vlucas/phpdotenv": "Required to use the env helper (^3.3)."
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "5.6-dev"
|
||||
"dev-master": "5.8-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -396,35 +499,36 @@
|
||||
],
|
||||
"description": "The Illuminate Support package.",
|
||||
"homepage": "https://laravel.com",
|
||||
"time": "2018-04-17T12:26:47+00:00"
|
||||
"time": "2019-03-05T13:38:58+00:00"
|
||||
},
|
||||
{
|
||||
"name": "illuminate/view",
|
||||
"version": "v5.6.17",
|
||||
"version": "v5.8.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/illuminate/view.git",
|
||||
"reference": "54eaf45ee7946d8f8cde13d5e89c5ea2e997040d"
|
||||
"reference": "33818dc7b783f3afbeea9b0b09455c8cc89aa899"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/illuminate/view/zipball/54eaf45ee7946d8f8cde13d5e89c5ea2e997040d",
|
||||
"reference": "54eaf45ee7946d8f8cde13d5e89c5ea2e997040d",
|
||||
"url": "https://api.github.com/repos/illuminate/view/zipball/33818dc7b783f3afbeea9b0b09455c8cc89aa899",
|
||||
"reference": "33818dc7b783f3afbeea9b0b09455c8cc89aa899",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"illuminate/container": "5.6.*",
|
||||
"illuminate/contracts": "5.6.*",
|
||||
"illuminate/events": "5.6.*",
|
||||
"illuminate/filesystem": "5.6.*",
|
||||
"illuminate/support": "5.6.*",
|
||||
"ext-json": "*",
|
||||
"illuminate/container": "5.8.*",
|
||||
"illuminate/contracts": "5.8.*",
|
||||
"illuminate/events": "5.8.*",
|
||||
"illuminate/filesystem": "5.8.*",
|
||||
"illuminate/support": "5.8.*",
|
||||
"php": "^7.1.3",
|
||||
"symfony/debug": "~4.0"
|
||||
"symfony/debug": "^4.2"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "5.6-dev"
|
||||
"dev-master": "5.8-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -444,7 +548,7 @@
|
||||
],
|
||||
"description": "The Illuminate View package.",
|
||||
"homepage": "https://laravel.com",
|
||||
"time": "2018-04-03T12:56:35+00:00"
|
||||
"time": "2019-02-27T12:03:43+00:00"
|
||||
},
|
||||
{
|
||||
"name": "morris/lessql",
|
||||
@@ -496,16 +600,16 @@
|
||||
},
|
||||
{
|
||||
"name": "neomerx/cors-psr7",
|
||||
"version": "v1.0.12",
|
||||
"version": "v1.0.13",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/neomerx/cors-psr7.git",
|
||||
"reference": "24944f39483d1a89f66ae9d58cca9f82b8815b35"
|
||||
"reference": "2556e2013f16a55532c95928455257d5b6bbc6e2"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/neomerx/cors-psr7/zipball/24944f39483d1a89f66ae9d58cca9f82b8815b35",
|
||||
"reference": "24944f39483d1a89f66ae9d58cca9f82b8815b35",
|
||||
"url": "https://api.github.com/repos/neomerx/cors-psr7/zipball/2556e2013f16a55532c95928455257d5b6bbc6e2",
|
||||
"reference": "2556e2013f16a55532c95928455257d5b6bbc6e2",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -514,7 +618,7 @@
|
||||
"psr/log": "^1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"mockery/mockery": "^0.9.9",
|
||||
"mockery/mockery": "^1.0",
|
||||
"phpunit/phpunit": "^5.7",
|
||||
"scrutinizer/ocular": "^1.1",
|
||||
"squizlabs/php_codesniffer": "^3.0"
|
||||
@@ -547,34 +651,46 @@
|
||||
"w3.org",
|
||||
"www.w3.org"
|
||||
],
|
||||
"time": "2017-09-03T22:31:57+00:00"
|
||||
"time": "2018-05-23T16:10:11+00:00"
|
||||
},
|
||||
{
|
||||
"name": "nesbot/carbon",
|
||||
"version": "1.26.4",
|
||||
"version": "2.14.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/briannesbitt/Carbon.git",
|
||||
"reference": "e3d9014279133a3cccc01f6a691322a2d5a6a87b"
|
||||
"reference": "a1f4f9abcde8241ce33bf5090896e9c16d0b4232"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/e3d9014279133a3cccc01f6a691322a2d5a6a87b",
|
||||
"reference": "e3d9014279133a3cccc01f6a691322a2d5a6a87b",
|
||||
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/a1f4f9abcde8241ce33bf5090896e9c16d0b4232",
|
||||
"reference": "a1f4f9abcde8241ce33bf5090896e9c16d0b4232",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.9",
|
||||
"symfony/translation": "~2.6 || ~3.0 || ~4.0"
|
||||
"ext-json": "*",
|
||||
"php": "^7.1.8 || ^8.0",
|
||||
"symfony/translation": "^3.4 || ^4.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"friendsofphp/php-cs-fixer": "~2",
|
||||
"phpunit/phpunit": "^4.8.35 || ^5.7"
|
||||
"friendsofphp/php-cs-fixer": "^2.14 || ^3.0",
|
||||
"kylekatarnls/multi-tester": "^0.1",
|
||||
"phpmd/phpmd": "^2.6",
|
||||
"phpstan/phpstan": "^0.10.8",
|
||||
"phpunit/phpunit": "^7.5 || ^8.0",
|
||||
"squizlabs/php_codesniffer": "^3.4"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Carbon\\Laravel\\ServiceProvider"
|
||||
]
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"": "src/"
|
||||
"Carbon\\": "src/Carbon/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
@@ -595,7 +711,7 @@
|
||||
"datetime",
|
||||
"time"
|
||||
],
|
||||
"time": "2018-04-17T15:35:42+00:00"
|
||||
"time": "2019-02-28T09:07:12+00:00"
|
||||
},
|
||||
{
|
||||
"name": "nikic/fast-route",
|
||||
@@ -643,55 +759,6 @@
|
||||
],
|
||||
"time": "2018-02-13T20:26:39+00:00"
|
||||
},
|
||||
{
|
||||
"name": "pavlakis/slim-cli",
|
||||
"version": "1.0.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/pavlakis/slim-cli.git",
|
||||
"reference": "603933a54e391b3c70c573206cce543b75d8b1db"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/pavlakis/slim-cli/zipball/603933a54e391b3c70c573206cce543b75d8b1db",
|
||||
"reference": "603933a54e391b3c70c573206cce543b75d8b1db",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^5.5|^5.6|^7.0|^7.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^4.0",
|
||||
"slim/slim": "^3.0"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"pavlakis\\cli\\tests\\": "tests/phpunit",
|
||||
"pavlakis\\cli\\": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Antonis Pavlakis",
|
||||
"email": "adoni@pavlakis.info",
|
||||
"homepage": "http://pavlakis.info"
|
||||
}
|
||||
],
|
||||
"description": "Making a mock GET request through the CLI and enabling the same application entry point on CLI scripts.",
|
||||
"homepage": "http://github.com/pavlakis/slim-cli",
|
||||
"keywords": [
|
||||
"cli",
|
||||
"framework",
|
||||
"middleware",
|
||||
"slim"
|
||||
],
|
||||
"time": "2017-01-30T22:50:06+00:00"
|
||||
},
|
||||
{
|
||||
"name": "philo/laravel-blade",
|
||||
"version": "v3.1",
|
||||
@@ -884,16 +951,16 @@
|
||||
},
|
||||
{
|
||||
"name": "psr/http-server-handler",
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-fig/http-server-handler.git",
|
||||
"reference": "439d92054dc06097f2406ec074a2627839955a02"
|
||||
"reference": "aff2f80e33b7f026ec96bb42f63242dc50ffcae7"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/http-server-handler/zipball/439d92054dc06097f2406ec074a2627839955a02",
|
||||
"reference": "439d92054dc06097f2406ec074a2627839955a02",
|
||||
"url": "https://api.github.com/repos/php-fig/http-server-handler/zipball/aff2f80e33b7f026ec96bb42f63242dc50ffcae7",
|
||||
"reference": "aff2f80e33b7f026ec96bb42f63242dc50ffcae7",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -933,20 +1000,20 @@
|
||||
"response",
|
||||
"server"
|
||||
],
|
||||
"time": "2018-01-22T17:04:15+00:00"
|
||||
"time": "2018-10-30T16:46:14+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/http-server-middleware",
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-fig/http-server-middleware.git",
|
||||
"reference": "ea17eb1fb2c8df6db919cc578451a8013c6a0ae5"
|
||||
"reference": "2296f45510945530b9dceb8bcedb5cb84d40c5f5"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/http-server-middleware/zipball/ea17eb1fb2c8df6db919cc578451a8013c6a0ae5",
|
||||
"reference": "ea17eb1fb2c8df6db919cc578451a8013c6a0ae5",
|
||||
"url": "https://api.github.com/repos/php-fig/http-server-middleware/zipball/2296f45510945530b9dceb8bcedb5cb84d40c5f5",
|
||||
"reference": "2296f45510945530b9dceb8bcedb5cb84d40c5f5",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -986,20 +1053,20 @@
|
||||
"request",
|
||||
"response"
|
||||
],
|
||||
"time": "2018-01-22T17:08:31+00:00"
|
||||
"time": "2018-10-30T17:12:04+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/log",
|
||||
"version": "1.0.2",
|
||||
"version": "1.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-fig/log.git",
|
||||
"reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d"
|
||||
"reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
|
||||
"reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
|
||||
"url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd",
|
||||
"reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1033,7 +1100,7 @@
|
||||
"psr",
|
||||
"psr-3"
|
||||
],
|
||||
"time": "2016-10-10T12:19:37+00:00"
|
||||
"time": "2018-11-20T15:27:04+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/simple-cache",
|
||||
@@ -1135,16 +1202,16 @@
|
||||
},
|
||||
{
|
||||
"name": "slim/slim",
|
||||
"version": "3.10.0",
|
||||
"version": "3.12.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/slimphp/Slim.git",
|
||||
"reference": "d8aabeacc3688b25e2f2dd2db91df91ec6fdd748"
|
||||
"reference": "f4947cc900b6e51cbfda58b9f1247bca2f76f9f0"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/slimphp/Slim/zipball/d8aabeacc3688b25e2f2dd2db91df91ec6fdd748",
|
||||
"reference": "d8aabeacc3688b25e2f2dd2db91df91ec6fdd748",
|
||||
"url": "https://api.github.com/repos/slimphp/Slim/zipball/f4947cc900b6e51cbfda58b9f1247bca2f76f9f0",
|
||||
"reference": "f4947cc900b6e51cbfda58b9f1247bca2f76f9f0",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1202,20 +1269,88 @@
|
||||
"micro",
|
||||
"router"
|
||||
],
|
||||
"time": "2018-04-19T19:29:08+00:00"
|
||||
"time": "2019-01-15T13:21:25+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/debug",
|
||||
"version": "v4.0.8",
|
||||
"name": "symfony/contracts",
|
||||
"version": "v1.0.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/debug.git",
|
||||
"reference": "5961d02d48828671f5d8a7805e06579d692f6ede"
|
||||
"url": "https://github.com/symfony/contracts.git",
|
||||
"reference": "1aa7ab2429c3d594dd70689604b5cf7421254cdf"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/debug/zipball/5961d02d48828671f5d8a7805e06579d692f6ede",
|
||||
"reference": "5961d02d48828671f5d8a7805e06579d692f6ede",
|
||||
"url": "https://api.github.com/repos/symfony/contracts/zipball/1aa7ab2429c3d594dd70689604b5cf7421254cdf",
|
||||
"reference": "1aa7ab2429c3d594dd70689604b5cf7421254cdf",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.1.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"psr/cache": "^1.0",
|
||||
"psr/container": "^1.0"
|
||||
},
|
||||
"suggest": {
|
||||
"psr/cache": "When using the Cache contracts",
|
||||
"psr/container": "When using the Service contracts",
|
||||
"symfony/cache-contracts-implementation": "",
|
||||
"symfony/service-contracts-implementation": "",
|
||||
"symfony/translation-contracts-implementation": ""
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Symfony\\Contracts\\": ""
|
||||
},
|
||||
"exclude-from-classmap": [
|
||||
"**/Tests/"
|
||||
]
|
||||
},
|
||||
"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": "A set of abstractions extracted out of the Symfony components",
|
||||
"homepage": "https://symfony.com",
|
||||
"keywords": [
|
||||
"abstractions",
|
||||
"contracts",
|
||||
"decoupling",
|
||||
"interfaces",
|
||||
"interoperability",
|
||||
"standards"
|
||||
],
|
||||
"time": "2018-12-05T08:06:11+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/debug",
|
||||
"version": "v4.2.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/debug.git",
|
||||
"reference": "de73f48977b8eaf7ce22814d66e43a1662cc864f"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/debug/zipball/de73f48977b8eaf7ce22814d66e43a1662cc864f",
|
||||
"reference": "de73f48977b8eaf7ce22814d66e43a1662cc864f",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1231,7 +1366,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "4.0-dev"
|
||||
"dev-master": "4.2-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -1258,20 +1393,20 @@
|
||||
],
|
||||
"description": "Symfony Debug Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2018-04-03T05:24:00+00:00"
|
||||
"time": "2019-03-03T18:11:24+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/finder",
|
||||
"version": "v4.0.8",
|
||||
"version": "v4.2.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/finder.git",
|
||||
"reference": "ca27c02b7a3fef4828c998c2ff9ba7aae1641c49"
|
||||
"reference": "267b7002c1b70ea80db0833c3afe05f0fbde580a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/finder/zipball/ca27c02b7a3fef4828c998c2ff9ba7aae1641c49",
|
||||
"reference": "ca27c02b7a3fef4828c998c2ff9ba7aae1641c49",
|
||||
"url": "https://api.github.com/repos/symfony/finder/zipball/267b7002c1b70ea80db0833c3afe05f0fbde580a",
|
||||
"reference": "267b7002c1b70ea80db0833c3afe05f0fbde580a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1280,7 +1415,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "4.0-dev"
|
||||
"dev-master": "4.2-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -1307,20 +1442,20 @@
|
||||
],
|
||||
"description": "Symfony Finder Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2018-04-04T05:10:37+00:00"
|
||||
"time": "2019-02-23T15:42:05+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-mbstring",
|
||||
"version": "v1.7.0",
|
||||
"version": "v1.10.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-mbstring.git",
|
||||
"reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b"
|
||||
"reference": "c79c051f5b3a46be09205c73b80b346e4153e494"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/78be803ce01e55d3491c1397cf1c64beb9c1b63b",
|
||||
"reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494",
|
||||
"reference": "c79c051f5b3a46be09205c73b80b346e4153e494",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1332,7 +1467,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.7-dev"
|
||||
"dev-master": "1.9-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -1366,24 +1501,25 @@
|
||||
"portable",
|
||||
"shim"
|
||||
],
|
||||
"time": "2018-01-30T19:27:44+00:00"
|
||||
"time": "2018-09-21T13:07:52+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/translation",
|
||||
"version": "v4.0.8",
|
||||
"version": "v4.2.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/translation.git",
|
||||
"reference": "e20a9b7f9f62cb33a11638b345c248e7d510c938"
|
||||
"reference": "748464177a77011f8f4cdd076773862ce4915f8f"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/translation/zipball/e20a9b7f9f62cb33a11638b345c248e7d510c938",
|
||||
"reference": "e20a9b7f9f62cb33a11638b345c248e7d510c938",
|
||||
"url": "https://api.github.com/repos/symfony/translation/zipball/748464177a77011f8f4cdd076773862ce4915f8f",
|
||||
"reference": "748464177a77011f8f4cdd076773862ce4915f8f",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.1.3",
|
||||
"symfony/contracts": "^1.0.2",
|
||||
"symfony/polyfill-mbstring": "~1.0"
|
||||
},
|
||||
"conflict": {
|
||||
@@ -1391,23 +1527,27 @@
|
||||
"symfony/dependency-injection": "<3.4",
|
||||
"symfony/yaml": "<3.4"
|
||||
},
|
||||
"provide": {
|
||||
"symfony/translation-contracts-implementation": "1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"psr/log": "~1.0",
|
||||
"symfony/config": "~3.4|~4.0",
|
||||
"symfony/console": "~3.4|~4.0",
|
||||
"symfony/dependency-injection": "~3.4|~4.0",
|
||||
"symfony/finder": "~2.8|~3.0|~4.0",
|
||||
"symfony/intl": "~3.4|~4.0",
|
||||
"symfony/yaml": "~3.4|~4.0"
|
||||
},
|
||||
"suggest": {
|
||||
"psr/log": "To use logging capability in translator",
|
||||
"psr/log-implementation": "To use logging capability in translator",
|
||||
"symfony/config": "",
|
||||
"symfony/yaml": ""
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "4.0-dev"
|
||||
"dev-master": "4.2-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -1434,7 +1574,7 @@
|
||||
],
|
||||
"description": "Symfony Translation Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2018-02-22T10:50:29+00:00"
|
||||
"time": "2019-02-27T03:31:50+00:00"
|
||||
},
|
||||
{
|
||||
"name": "tuupola/callable-handler",
|
||||
@@ -1604,7 +1744,7 @@
|
||||
"prefer-stable": false,
|
||||
"prefer-lowest": false,
|
||||
"platform": {
|
||||
"php": ">=7.0"
|
||||
"php": ">=7.2"
|
||||
},
|
||||
"platform-dev": []
|
||||
}
|
||||
|
@@ -1,17 +1,88 @@
|
||||
<?php
|
||||
|
||||
# Login credentials
|
||||
define('HTTP_USER', 'admin');
|
||||
define('HTTP_PASSWORD', 'admin');
|
||||
# Settings can also be overwritten in two ways
|
||||
#
|
||||
# First priority
|
||||
# A .txt file with the same name as the setting in /data/settingoverrides
|
||||
# the content of the file is used as the setting value
|
||||
#
|
||||
# Second priority
|
||||
# An environment variable with the same name as the setting and prefix "GROCY_"
|
||||
# so for example "GROCY_BASE_URL"
|
||||
#
|
||||
# Third priority
|
||||
# The settings defined here below
|
||||
|
||||
# Either "production" or "dev"
|
||||
define('MODE', 'production');
|
||||
|
||||
# Either "production", "dev" or "prerelease"
|
||||
Setting('MODE', 'production');
|
||||
|
||||
# Either "en" or "de" or the filename (without extension) of
|
||||
# one of the other available localization files in the "/localization" directory
|
||||
define('CULTURE', 'en');
|
||||
Setting('CULTURE', 'en');
|
||||
|
||||
# To keep it simple: grocy does not handle any currency conversions,
|
||||
# this here is used to format all money values,
|
||||
# so doesn't matter really matter, but should be the
|
||||
# ISO 4217 code of the currency ("USD", "EUR", "GBP", etc.)
|
||||
Setting('CURRENCY', 'USD');
|
||||
|
||||
# The base url of your installation,
|
||||
# should be just "/" when running directly under the root of a (sub)domain
|
||||
# or for example "https:/example.com/grocy" when using a subdirectory
|
||||
define('BASE_URL', '/');
|
||||
# or for example "https://example.com/grocy" when using a subdirectory
|
||||
Setting('BASE_URL', '/');
|
||||
|
||||
# The plugin to use for external barcode lookups,
|
||||
# must be the filename without .php extension and must be located in /data/plugins,
|
||||
# see /data/plugins/DemoBarcodeLookupPlugin.php for an example implementation
|
||||
Setting('STOCK_BARCODE_LOOKUP_PLUGIN', 'DemoBarcodeLookupPlugin');
|
||||
|
||||
# If, however, your webserver does not support URL rewriting,
|
||||
# set this to true
|
||||
Setting('DISABLE_URL_REWRITING', false);
|
||||
|
||||
|
||||
|
||||
|
||||
# Default user settings
|
||||
# These settings can be changed per user, here the defaults
|
||||
# are defined which are used when the user has not changed the setting so far
|
||||
|
||||
# Night mode related
|
||||
DefaultUserSetting('night_mode_enabled', false); // If night mode is enabled always
|
||||
DefaultUserSetting('auto_night_mode_enabled', false); // If night mode is enabled automatically when inside a given time range (see the two settings below)
|
||||
DefaultUserSetting('auto_night_mode_time_range_from', "20:00"); // Format HH:mm
|
||||
DefaultUserSetting('auto_night_mode_time_range_to', "07:00"); // Format HH:mm
|
||||
DefaultUserSetting('auto_night_mode_time_range_goes_over_midnight', true); // If the time range above goes over midnight
|
||||
DefaultUserSetting('currently_inside_night_mode_range', false); // If we're currently inside of night mode time range (this is not user configurable, but stored as a user setting because it's evaluated client side to be able to use the client time instead of the maybe different server time)
|
||||
DefaultUserSetting('product_presets_location_id', -1); // Default location id for new products (-1 means no location is preset)
|
||||
DefaultUserSetting('product_presets_product_group_id', -1); // Default product group id for new products (-1 means no product group is preset)
|
||||
DefaultUserSetting('product_presets_qu_id', -1); // Default quantity unit id for new products (-1 means no quantity unit is preset)
|
||||
|
||||
# If the page should be automatically reloaded when there was
|
||||
# an external change
|
||||
DefaultUserSetting('auto_reload_on_db_change', true);
|
||||
|
||||
# Show a clock in the header next to the logo or not
|
||||
DefaultUserSetting('show_clock_in_header', false);
|
||||
|
||||
# Shopping list to stock workflow:
|
||||
# Automatically do the booking using the last price and the amount
|
||||
# of the shopping list item, if the product has "Default best before days" set
|
||||
DefaultUserSetting('shopping_list_to_stock_workflow_auto_submit_when_prefilled', false);
|
||||
|
||||
|
||||
|
||||
|
||||
# Feature flags
|
||||
# grocy was initially about "stock management for your household", many other things
|
||||
# came and still come by, because they are useful - here you can disable the parts
|
||||
# which you don't need to have a less cluttered UI
|
||||
# (set the setting to "false" to disable the corresponding part, which should be self explanatory)
|
||||
Setting('FEATURE_FLAG_SHOPPINGLIST', true);
|
||||
Setting('FEATURE_FLAG_RECIPES', true);
|
||||
Setting('FEATURE_FLAG_CHORES', true);
|
||||
Setting('FEATURE_FLAG_TASKS', true);
|
||||
Setting('FEATURE_FLAG_BATTERIES', true);
|
||||
Setting('FEATURE_FLAG_EQUIPMENT', true);
|
||||
Setting('FEATURE_FLAG_CALENDAR', true);
|
||||
|
@@ -4,8 +4,29 @@ namespace Grocy\Controllers;
|
||||
|
||||
class BaseApiController extends BaseController
|
||||
{
|
||||
protected function ApiResponse($response)
|
||||
|
||||
public function __construct(\Slim\Container $container)
|
||||
{
|
||||
return json_encode($response);
|
||||
parent::__construct($container);
|
||||
$this->OpenApiSpec = json_decode(file_get_contents(__DIR__ . '/../grocy.openapi.json'));
|
||||
}
|
||||
|
||||
protected $OpenApiSpec;
|
||||
|
||||
protected function ApiResponse($data)
|
||||
{
|
||||
return json_encode($data);
|
||||
}
|
||||
|
||||
protected function EmptyApiResponse($response, $status = 204)
|
||||
{
|
||||
return $response->withStatus($status);
|
||||
}
|
||||
|
||||
protected function GenericErrorResponse($response, $errorMessage, $status = 400)
|
||||
{
|
||||
return $response->withStatus($status)->withJson(array(
|
||||
'error_message' => $errorMessage
|
||||
));
|
||||
}
|
||||
}
|
||||
|
@@ -5,30 +5,77 @@ namespace Grocy\Controllers;
|
||||
use \Grocy\Services\DatabaseService;
|
||||
use \Grocy\Services\ApplicationService;
|
||||
use \Grocy\Services\LocalizationService;
|
||||
use \Grocy\Services\UsersService;
|
||||
|
||||
class BaseController
|
||||
{
|
||||
public function __construct(\Slim\Container $container) {
|
||||
$databaseService = new DatabaseService();
|
||||
$this->Database = $databaseService->GetDbConnection();
|
||||
|
||||
$localizationService = new LocalizationService(GROCY_CULTURE);
|
||||
$this->LocalizationService = $localizationService;
|
||||
|
||||
$applicationService = new ApplicationService();
|
||||
$container->view->set('version', $applicationService->GetInstalledVersion());
|
||||
if (GROCY_MODE === 'prerelease')
|
||||
{
|
||||
$commitHash = trim(exec('git log --pretty="%h" -n1 HEAD'));
|
||||
$commitDate = trim(exec('git log --date=iso --pretty="%cd" -n1 HEAD'));
|
||||
|
||||
$container->view->set('version', "pre-release-$commitHash");
|
||||
$container->view->set('releaseDate', \substr($commitDate, 0, 19));
|
||||
}
|
||||
else
|
||||
{
|
||||
$applicationService = new ApplicationService();
|
||||
$versionInfo = $applicationService->GetInstalledVersion();
|
||||
$container->view->set('version', $versionInfo->Version);
|
||||
$container->view->set('releaseDate', $versionInfo->ReleaseDate);
|
||||
}
|
||||
|
||||
$localizationService = new LocalizationService(CULTURE);
|
||||
$container->view->set('localizationStrings', $localizationService->GetCurrentCultureLocalizations());
|
||||
$container->view->set('L', function($text, ...$placeholderValues) use($localizationService)
|
||||
{
|
||||
return $localizationService->Localize($text, ...$placeholderValues);
|
||||
});
|
||||
$container->view->set('U', function($relativePath) use($container)
|
||||
$container->view->set('U', function($relativePath, $isResource = false) use($container)
|
||||
{
|
||||
return $container->UrlManager->ConstructUrl($relativePath);
|
||||
return $container->UrlManager->ConstructUrl($relativePath, $isResource);
|
||||
});
|
||||
|
||||
$embedded = false;
|
||||
if (isset($container->request->getQueryParams()['embedded']))
|
||||
{
|
||||
$embedded = true;
|
||||
}
|
||||
$container->view->set('embedded', $embedded);
|
||||
|
||||
$constants = get_defined_constants();
|
||||
foreach ($constants as $constant => $value)
|
||||
{
|
||||
if (substr($constant, 0, 19) !== 'GROCY_FEATURE_FLAG_')
|
||||
{
|
||||
unset($constants[$constant]);
|
||||
}
|
||||
}
|
||||
$container->view->set('featureFlags', $constants);
|
||||
|
||||
try
|
||||
{
|
||||
$usersService = new UsersService();
|
||||
if (defined('GROCY_USER_ID'))
|
||||
{
|
||||
$container->view->set('userSettings', $usersService->GetUserSettings(GROCY_USER_ID));
|
||||
}
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
{
|
||||
// Happens when database is not initialised or migrated...
|
||||
}
|
||||
|
||||
$this->AppContainer = $container;
|
||||
}
|
||||
|
||||
protected $AppContainer;
|
||||
protected $Database;
|
||||
protected $LocalizationService;
|
||||
}
|
||||
|
@@ -16,17 +16,52 @@ class BatteriesApiController extends BaseApiController
|
||||
|
||||
public function TrackChargeCycle(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
$trackedTime = date('Y-m-d H:i:s');
|
||||
if (isset($request->getQueryParams()['tracked_time']) && !empty($request->getQueryParams()['tracked_time']))
|
||||
{
|
||||
$trackedTime = $request->getQueryParams()['tracked_time'];
|
||||
}
|
||||
$requestBody = $request->getParsedBody();
|
||||
|
||||
return $this->ApiResponse(array('success' => $this->BatteriesService->TrackChargeCycle($args['batteryId'], $trackedTime)));
|
||||
try
|
||||
{
|
||||
$trackedTime = date('Y-m-d H:i:s');
|
||||
if (array_key_exists('tracked_time', $requestBody) && IsIsoDateTime($requestBody['tracked_time']))
|
||||
{
|
||||
$trackedTime = $requestBody['tracked_time'];
|
||||
}
|
||||
|
||||
$chargeCycleId = $this->BatteriesService->TrackChargeCycle($args['batteryId'], $trackedTime);
|
||||
return $this->ApiResponse($this->Database->battery_charge_cycles($chargeCycleId));
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
{
|
||||
return $this->GenericErrorResponse($response, $ex->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public function BatteryDetails(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
return $this->ApiResponse($this->BatteriesService->GetBatteryDetails($args['batteryId']));
|
||||
try
|
||||
{
|
||||
return $this->ApiResponse($this->BatteriesService->GetBatteryDetails($args['batteryId']));
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
{
|
||||
return $this->GenericErrorResponse($response, $ex->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public function Current(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
return $this->ApiResponse($this->BatteriesService->GetCurrent());
|
||||
}
|
||||
|
||||
public function UndoChargeCycle(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
try
|
||||
{
|
||||
$this->ApiResponse($this->BatteriesService->UndoChargeCycle($args['chargeCycleId']));
|
||||
return $this->EmptyApiResponse($response);
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
{
|
||||
return $this->GenericErrorResponse($response, $ex->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -16,30 +16,24 @@ class BatteriesController extends BaseController
|
||||
|
||||
public function Overview(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
$nextChargeTimes = array();
|
||||
foreach($this->Database->batteries() as $battery)
|
||||
{
|
||||
$nextChargeTimes[$battery->id] = $this->BatteriesService->GetNextChargeTime($battery->id);
|
||||
}
|
||||
|
||||
return $this->AppContainer->view->render($response, 'batteriesoverview', [
|
||||
'batteries' => $this->Database->batteries(),
|
||||
'batteries' => $this->Database->batteries()->orderBy('name'),
|
||||
'current' => $this->BatteriesService->GetCurrent(),
|
||||
'nextChargeTimes' => $nextChargeTimes
|
||||
'nextXDays' => 5
|
||||
]);
|
||||
}
|
||||
|
||||
public function TrackChargeCycle(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
return $this->AppContainer->view->render($response, 'batterytracking', [
|
||||
'batteries' => $this->Database->batteries()
|
||||
'batteries' => $this->Database->batteries()->orderBy('name')
|
||||
]);
|
||||
}
|
||||
|
||||
public function BatteriesList(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
return $this->AppContainer->view->render($response, 'batteries', [
|
||||
'batteries' => $this->Database->batteries()
|
||||
'batteries' => $this->Database->batteries()->orderBy('name')
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -59,4 +53,12 @@ class BatteriesController extends BaseController
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
public function Journal(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
return $this->AppContainer->view->render($response, 'batteriesjournal', [
|
||||
'chargeCycles' => $this->Database->battery_charge_cycles()->orderBy('tracked_time', 'DESC'),
|
||||
'batteries' => $this->Database->batteries()->orderBy('name')
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
62
controllers/CalendarApiController.php
Normal file
62
controllers/CalendarApiController.php
Normal file
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
namespace Grocy\Controllers;
|
||||
|
||||
use \Grocy\Services\CalendarService;
|
||||
use \Grocy\Services\ApiKeyService;
|
||||
|
||||
class CalendarApiController extends BaseApiController
|
||||
{
|
||||
public function __construct(\Slim\Container $container)
|
||||
{
|
||||
parent::__construct($container);
|
||||
$this->CalendarService = new CalendarService();
|
||||
$this->ApiKeyService = new ApiKeyService();
|
||||
}
|
||||
|
||||
protected $CalendarService;
|
||||
protected $ApiKeyService;
|
||||
|
||||
public function Ical(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
try
|
||||
{
|
||||
$vCalendar = new \Eluceo\iCal\Component\Calendar('grocy');
|
||||
|
||||
$events = $this->CalendarService->GetEvents();
|
||||
foreach($events as $event)
|
||||
{
|
||||
$vEvent = new \Eluceo\iCal\Component\Event();
|
||||
$vEvent->setDtStart(new \DateTime($event['start']))
|
||||
->setDtEnd(new \DateTime($event['start']))
|
||||
->setSummary($event['title'])
|
||||
->setNoTime($event['date_format'] === 'date')
|
||||
->setUseUtc(false);
|
||||
|
||||
$vCalendar->addComponent($vEvent);
|
||||
}
|
||||
|
||||
$response->write($vCalendar->render());
|
||||
$response = $response->withHeader('Content-Type', 'text/calendar; charset=utf-8');
|
||||
return $response->withHeader('Content-Disposition', 'attachment; filename="grocy.ics"');
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
{
|
||||
return $this->GenericErrorResponse($response, $ex->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public function IcalSharingLink(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
try
|
||||
{
|
||||
return $this->ApiResponse(array(
|
||||
'url' => $this->AppContainer->UrlManager->ConstructUrl('/api/calendar/ical?secret=' . $this->ApiKeyService->GetOrCreateApiKey(ApiKeyService::API_KEY_TYPE_SPECIAL_PURPOSE_CALENDAR_ICAL))
|
||||
));
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
{
|
||||
return $this->GenericErrorResponse($response, $ex->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
23
controllers/CalendarController.php
Normal file
23
controllers/CalendarController.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Grocy\Controllers;
|
||||
|
||||
use \Grocy\Services\CalendarService;
|
||||
|
||||
class CalendarController extends BaseController
|
||||
{
|
||||
public function __construct(\Slim\Container $container)
|
||||
{
|
||||
parent::__construct($container);
|
||||
$this->CalendarService = new CalendarService();
|
||||
}
|
||||
|
||||
protected $CalendarService;
|
||||
|
||||
public function Overview(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
return $this->AppContainer->view->render($response, 'calendar', [
|
||||
'fullcalendarEventSources' => $this->CalendarService->GetEvents()
|
||||
]);
|
||||
}
|
||||
}
|
73
controllers/ChoresApiController.php
Normal file
73
controllers/ChoresApiController.php
Normal file
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
namespace Grocy\Controllers;
|
||||
|
||||
use \Grocy\Services\ChoresService;
|
||||
|
||||
class ChoresApiController extends BaseApiController
|
||||
{
|
||||
public function __construct(\Slim\Container $container)
|
||||
{
|
||||
parent::__construct($container);
|
||||
$this->ChoresService = new ChoresService();
|
||||
}
|
||||
|
||||
protected $ChoresService;
|
||||
|
||||
public function TrackChoreExecution(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
$requestBody = $request->getParsedBody();
|
||||
|
||||
try
|
||||
{
|
||||
$trackedTime = date('Y-m-d H:i:s');
|
||||
if (array_key_exists('tracked_time', $requestBody) && IsIsoDateTime($requestBody['tracked_time']))
|
||||
{
|
||||
$trackedTime = $requestBody['tracked_time'];
|
||||
}
|
||||
|
||||
$doneBy = GROCY_USER_ID;
|
||||
if (array_key_exists('done_by', $requestBody) && !empty($requestBody['done_by']))
|
||||
{
|
||||
$doneBy = $requestBody['done_by'];
|
||||
}
|
||||
|
||||
$choreExecutionId = $this->ChoresService->TrackChore($args['choreId'], $trackedTime, $doneBy);
|
||||
return $this->ApiResponse($this->Database->chores_log($choreExecutionId));
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
{
|
||||
return $this->GenericErrorResponse($response, $ex->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public function ChoreDetails(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
try
|
||||
{
|
||||
return $this->ApiResponse($this->ChoresService->GetChoreDetails($args['choreId']));
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
{
|
||||
return $this->GenericErrorResponse($response, $ex->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public function Current(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
return $this->ApiResponse($this->ChoresService->GetCurrent());
|
||||
}
|
||||
|
||||
public function UndoChoreExecution(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
try
|
||||
{
|
||||
$this->ApiResponse($this->ChoresService->UndoChoreExecution($args['executionId']));
|
||||
return $this->EmptyApiResponse($response);
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
{
|
||||
return $this->GenericErrorResponse($response, $ex->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
68
controllers/ChoresController.php
Normal file
68
controllers/ChoresController.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace Grocy\Controllers;
|
||||
|
||||
use \Grocy\Services\ChoresService;
|
||||
|
||||
class ChoresController extends BaseController
|
||||
{
|
||||
public function __construct(\Slim\Container $container)
|
||||
{
|
||||
parent::__construct($container);
|
||||
$this->ChoresService = new ChoresService();
|
||||
}
|
||||
|
||||
protected $ChoresService;
|
||||
|
||||
public function Overview(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
return $this->AppContainer->view->render($response, 'choresoverview', [
|
||||
'chores' => $this->Database->chores()->orderBy('name'),
|
||||
'currentChores' => $this->ChoresService->GetCurrent(),
|
||||
'nextXDays' => 5
|
||||
]);
|
||||
}
|
||||
|
||||
public function TrackChoreExecution(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
return $this->AppContainer->view->render($response, 'choretracking', [
|
||||
'chores' => $this->Database->chores()->orderBy('name'),
|
||||
'users' => $this->Database->users()->orderBy('username')
|
||||
]);
|
||||
}
|
||||
|
||||
public function ChoresList(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
return $this->AppContainer->view->render($response, 'chores', [
|
||||
'chores' => $this->Database->chores()->orderBy('name')
|
||||
]);
|
||||
}
|
||||
|
||||
public function Journal(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
return $this->AppContainer->view->render($response, 'choresjournal', [
|
||||
'choresLog' => $this->Database->chores_log()->orderBy('tracked_time', 'DESC'),
|
||||
'chores' => $this->Database->chores()->orderBy('name'),
|
||||
'users' => $this->Database->users()->orderBy('username')
|
||||
]);
|
||||
}
|
||||
|
||||
public function ChoreEditForm(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
if ($args['choreId'] == 'new')
|
||||
{
|
||||
return $this->AppContainer->view->render($response, 'choreform', [
|
||||
'periodTypes' => GetClassConstants('\Grocy\Services\ChoresService'),
|
||||
'mode' => 'create'
|
||||
]);
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->AppContainer->view->render($response, 'choreform', [
|
||||
'chore' => $this->Database->chores($args['choreId']),
|
||||
'periodTypes' => GetClassConstants('\Grocy\Services\ChoresService'),
|
||||
'mode' => 'edit'
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,19 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Grocy\Controllers;
|
||||
|
||||
use \Grocy\Services\ApplicationService;
|
||||
use \Grocy\Services\DatabaseMigrationService;
|
||||
|
||||
class CliController extends BaseController
|
||||
{
|
||||
public function RecreateDemo(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
$applicationService = new ApplicationService();
|
||||
if ($applicationService->IsDemoInstallation())
|
||||
{
|
||||
$databaseMigrationService = new DatabaseMigrationService();
|
||||
$databaseMigrationService->RecreateDemo();
|
||||
}
|
||||
}
|
||||
}
|
31
controllers/EquipmentController.php
Normal file
31
controllers/EquipmentController.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace Grocy\Controllers;
|
||||
|
||||
|
||||
class EquipmentController extends BaseController
|
||||
{
|
||||
public function Overview(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
return $this->AppContainer->view->render($response, 'equipment', [
|
||||
'equipment' => $this->Database->equipment()->orderBy('name')
|
||||
]);
|
||||
}
|
||||
|
||||
public function EditForm(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
if ($args['equipmentId'] == 'new')
|
||||
{
|
||||
return $this->AppContainer->view->render($response, 'equipmentform', [
|
||||
'mode' => 'create'
|
||||
]);
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->AppContainer->view->render($response, 'equipmentform', [
|
||||
'equipment' => $this->Database->equipment($args['equipmentId']),
|
||||
'mode' => 'edit'
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
99
controllers/FilesApiController.php
Normal file
99
controllers/FilesApiController.php
Normal file
@@ -0,0 +1,99 @@
|
||||
<?php
|
||||
|
||||
namespace Grocy\Controllers;
|
||||
|
||||
use \Grocy\Services\FilesService;
|
||||
|
||||
class FilesApiController extends BaseApiController
|
||||
{
|
||||
public function __construct(\Slim\Container $container)
|
||||
{
|
||||
parent::__construct($container);
|
||||
$this->FilesService = new FilesService();
|
||||
}
|
||||
|
||||
protected $FilesService;
|
||||
|
||||
public function UploadFile(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (IsValidFileName(base64_decode($args['fileName'])))
|
||||
{
|
||||
$fileName = base64_decode($args['fileName']);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new \Exception('Invalid filename');
|
||||
}
|
||||
|
||||
$data = $request->getBody()->getContents();
|
||||
file_put_contents($this->FilesService->GetFilePath($args['group'], $fileName), $data);
|
||||
|
||||
return $this->EmptyApiResponse($response);
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
{
|
||||
return $this->GenericErrorResponse($response, $ex->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public function ServeFile(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (IsValidFileName(base64_decode($args['fileName'])))
|
||||
{
|
||||
$fileName = base64_decode($args['fileName']);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new \Exception('Invalid filename');
|
||||
}
|
||||
|
||||
$filePath = $this->FilesService->GetFilePath($args['group'], $fileName);
|
||||
|
||||
if (file_exists($filePath))
|
||||
{
|
||||
$response->write(file_get_contents($filePath));
|
||||
$response = $response->withHeader('Content-Type', mime_content_type($filePath));
|
||||
return $response->withHeader('Content-Disposition', 'inline; filename="' . $fileName . '"');
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->GenericErrorResponse($response, 'File not found', 404);
|
||||
}
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
{
|
||||
return $this->GenericErrorResponse($response, $ex->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public function DeleteFile(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (IsValidFileName(base64_decode($args['fileName'])))
|
||||
{
|
||||
$fileName = base64_decode($args['fileName']);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new \Exception('Invalid filename');
|
||||
}
|
||||
|
||||
$filePath = $this->FilesService->GetFilePath($args['group'], $fileName);
|
||||
if (file_exists($filePath))
|
||||
{
|
||||
unlink($filePath);
|
||||
}
|
||||
|
||||
return $this->EmptyApiResponse($response);
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
{
|
||||
return $this->GenericErrorResponse($response, $ex->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
@@ -6,35 +6,108 @@ class GenericEntityApiController extends BaseApiController
|
||||
{
|
||||
public function GetObjects(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
return $this->ApiResponse($this->Database->{$args['entity']}());
|
||||
if ($this->IsValidEntity($args['entity']) && !$this->IsEntityWithPreventedListing($args['entity']))
|
||||
{
|
||||
return $this->ApiResponse($this->Database->{$args['entity']}());
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->GenericErrorResponse($response, 'Entity does not exist or is not exposed');
|
||||
}
|
||||
}
|
||||
|
||||
public function GetObject(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
return $this->ApiResponse($this->Database->{$args['entity']}($args['objectId']));
|
||||
if ($this->IsValidEntity($args['entity']) && !$this->IsEntityWithPreventedListing($args['entity']))
|
||||
{
|
||||
return $this->ApiResponse($this->Database->{$args['entity']}($args['objectId']));
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->GenericErrorResponse($response, 'Entity does not exist or is not exposed');
|
||||
}
|
||||
}
|
||||
|
||||
public function AddObject(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
$newRow = $this->Database->{$args['entity']}()->createRow($request->getParsedBody());
|
||||
$newRow->save();
|
||||
$success = $newRow->isClean();
|
||||
return $this->ApiResponse(array('success' => $success));
|
||||
if ($this->IsValidEntity($args['entity']))
|
||||
{
|
||||
$requestBody = $request->getParsedBody();
|
||||
|
||||
try
|
||||
{
|
||||
if ($requestBody === null)
|
||||
{
|
||||
throw new \Exception('Request body could not be parsed (probably invalid JSON format or missing/wrong Content-Type header)');
|
||||
}
|
||||
|
||||
$newRow = $this->Database->{$args['entity']}()->createRow($requestBody);
|
||||
$newRow->save();
|
||||
$success = $newRow->isClean();
|
||||
return $this->EmptyApiResponse($response);
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
{
|
||||
return $this->GenericErrorResponse($response, $ex->getMessage());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->GenericErrorResponse($response, 'Entity does not exist or is not exposed');
|
||||
}
|
||||
}
|
||||
|
||||
public function EditObject(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
$row = $this->Database->{$args['entity']}($args['objectId']);
|
||||
$row->update($request->getParsedBody());
|
||||
$success = $row->isClean();
|
||||
return $this->ApiResponse(array('success' => $success));
|
||||
if ($this->IsValidEntity($args['entity']))
|
||||
{
|
||||
$requestBody = $request->getParsedBody();
|
||||
|
||||
try
|
||||
{
|
||||
if ($requestBody === null)
|
||||
{
|
||||
throw new \Exception('Request body could not be parsed (probably invalid JSON format or missing/wrong Content-Type header)');
|
||||
}
|
||||
|
||||
$row = $this->Database->{$args['entity']}($args['objectId']);
|
||||
$row->update($requestBody);
|
||||
$success = $row->isClean();
|
||||
return $this->EmptyApiResponse($response);
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
{
|
||||
return $this->GenericErrorResponse($response, $ex->getMessage());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->GenericErrorResponse($response, 'Entity does not exist or is not exposed');
|
||||
}
|
||||
}
|
||||
|
||||
public function DeleteObject(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
$row = $this->Database->{$args['entity']}($args['objectId']);
|
||||
$row->delete();
|
||||
$success = $row->isClean();
|
||||
return $this->ApiResponse(array('success' => $success));
|
||||
if ($this->IsValidEntity($args['entity']))
|
||||
{
|
||||
$row = $this->Database->{$args['entity']}($args['objectId']);
|
||||
$row->delete();
|
||||
$success = $row->isClean();
|
||||
return $this->EmptyApiResponse($response);
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->GenericErrorResponse($response, $ex->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private function IsValidEntity($entity)
|
||||
{
|
||||
return in_array($entity, $this->OpenApiSpec->components->internalSchemas->ExposedEntity->enum);
|
||||
}
|
||||
|
||||
private function IsEntityWithPreventedListing($entity)
|
||||
{
|
||||
return in_array($entity, $this->OpenApiSpec->components->internalSchemas->ExposedEntitiesPreventListing->enum);
|
||||
}
|
||||
}
|
||||
|
@@ -1,32 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Grocy\Controllers;
|
||||
|
||||
use \Grocy\Services\HabitsService;
|
||||
|
||||
class HabitsApiController extends BaseApiController
|
||||
{
|
||||
public function __construct(\Slim\Container $container)
|
||||
{
|
||||
parent::__construct($container);
|
||||
$this->HabitsService = new HabitsService();
|
||||
}
|
||||
|
||||
protected $HabitsService;
|
||||
|
||||
public function TrackHabitExecution(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
$trackedTime = date('Y-m-d H:i:s');
|
||||
if (isset($request->getQueryParams()['tracked_time']) && !empty($request->getQueryParams()['tracked_time']))
|
||||
{
|
||||
$trackedTime = $request->getQueryParams()['tracked_time'];
|
||||
}
|
||||
|
||||
return $this->ApiResponse(array('success' => $this->HabitsService->TrackHabit($args['habitId'], $trackedTime)));
|
||||
}
|
||||
|
||||
public function HabitDetails(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
return $this->ApiResponse($this->HabitsService->GetHabitDetails($args['habitId']));
|
||||
}
|
||||
}
|
@@ -1,64 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Grocy\Controllers;
|
||||
|
||||
use \Grocy\Services\HabitsService;
|
||||
|
||||
class HabitsController extends BaseController
|
||||
{
|
||||
public function __construct(\Slim\Container $container)
|
||||
{
|
||||
parent::__construct($container);
|
||||
$this->HabitsService = new HabitsService();
|
||||
}
|
||||
|
||||
protected $HabitsService;
|
||||
|
||||
public function Overview(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
$nextHabitTimes = array();
|
||||
foreach($this->Database->habits() as $habit)
|
||||
{
|
||||
$nextHabitTimes[$habit->id] = $this->HabitsService->GetNextHabitTime($habit->id);
|
||||
}
|
||||
|
||||
return $this->AppContainer->view->render($response, 'habitsoverview', [
|
||||
'habits' => $this->Database->habits(),
|
||||
'currentHabits' => $this->HabitsService->GetCurrentHabits(),
|
||||
'nextHabitTimes' => $nextHabitTimes
|
||||
]);
|
||||
}
|
||||
|
||||
public function TrackHabitExecution(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
return $this->AppContainer->view->render($response, 'habittracking', [
|
||||
'habits' => $this->Database->habits()
|
||||
]);
|
||||
}
|
||||
|
||||
public function HabitsList(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
return $this->AppContainer->view->render($response, 'habits', [
|
||||
'habits' => $this->Database->habits()
|
||||
]);
|
||||
}
|
||||
|
||||
public function HabitEditForm(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
if ($args['habitId'] == 'new')
|
||||
{
|
||||
return $this->AppContainer->view->render($response, 'habitform', [
|
||||
'periodTypes' => GetClassConstants('\Grocy\Services\HabitsService'),
|
||||
'mode' => 'create'
|
||||
]);
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->AppContainer->view->render($response, 'habitform', [
|
||||
'habit' => $this->Database->habits($args['habitId']),
|
||||
'periodTypes' => GetClassConstants('\Grocy\Services\HabitsService'),
|
||||
'mode' => 'edit'
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
@@ -3,7 +3,6 @@
|
||||
namespace Grocy\Controllers;
|
||||
|
||||
use \Grocy\Services\SessionService;
|
||||
use \Grocy\Services\ApplicationService;
|
||||
use \Grocy\Services\DatabaseMigrationService;
|
||||
use \Grocy\Services\DemoDataGeneratorService;
|
||||
|
||||
@@ -24,10 +23,21 @@ class LoginController extends BaseController
|
||||
$postParams = $request->getParsedBody();
|
||||
if (isset($postParams['username']) && isset($postParams['password']))
|
||||
{
|
||||
if ($postParams['username'] === HTTP_USER && $postParams['password'] === HTTP_PASSWORD)
|
||||
$user = $this->Database->users()->where('username', $postParams['username'])->fetch();
|
||||
$inputPassword = $postParams['password'];
|
||||
$stayLoggedInPermanently = $postParams['stay_logged_in'] == 'on';
|
||||
|
||||
if ($user !== null && password_verify($inputPassword, $user->password))
|
||||
{
|
||||
$sessionKey = $this->SessionService->CreateSession();
|
||||
setcookie($this->SessionCookieName, $sessionKey, time() + 31536000); // Cookie expires in 1 year, but session validity is up to SessionService
|
||||
$sessionKey = $this->SessionService->CreateSession($user->id, $stayLoggedInPermanently);
|
||||
setcookie($this->SessionCookieName, $sessionKey, intval(time() + 31220640000)); // Cookie expires in 999 years, but session validity is up to SessionService
|
||||
|
||||
if (password_needs_rehash($user->password, PASSWORD_DEFAULT))
|
||||
{
|
||||
$user->update(array(
|
||||
'password' => password_hash($inputPassword, PASSWORD_DEFAULT)
|
||||
));
|
||||
}
|
||||
|
||||
return $response->withRedirect($this->AppContainer->UrlManager->ConstructUrl('/'));
|
||||
}
|
||||
@@ -53,22 +63,6 @@ class LoginController extends BaseController
|
||||
return $response->withRedirect($this->AppContainer->UrlManager->ConstructUrl('/'));
|
||||
}
|
||||
|
||||
public function Root(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
// Schema migration is done here
|
||||
$databaseMigrationService = new DatabaseMigrationService();
|
||||
$databaseMigrationService->MigrateDatabase();
|
||||
|
||||
$applicationService = new ApplicationService();
|
||||
if ($applicationService->IsDemoInstallation())
|
||||
{
|
||||
$demoDataGeneratorService = new DemoDataGeneratorService();
|
||||
$demoDataGeneratorService->PopulateDemoData();
|
||||
}
|
||||
|
||||
return $response->withRedirect($this->AppContainer->UrlManager->ConstructUrl('/stockoverview'));
|
||||
}
|
||||
|
||||
public function GetSessionCookieName()
|
||||
{
|
||||
return $this->SessionCookieName;
|
||||
|
@@ -24,18 +24,19 @@ class OpenApiController extends BaseApiController
|
||||
{
|
||||
$applicationService = new ApplicationService();
|
||||
|
||||
$specJson = json_decode(file_get_contents(__DIR__ . '/../grocy.openapi.json'));
|
||||
$specJson->info->version = $applicationService->GetInstalledVersion();
|
||||
$specJson->info->description = str_replace('PlaceHolderManageApiKeysUrl', $this->AppContainer->UrlManager->ConstructUrl('/manageapikeys'), $specJson->info->description);
|
||||
$specJson->servers[0]->url = $this->AppContainer->UrlManager->ConstructUrl('/api');
|
||||
$versionInfo = $applicationService->GetInstalledVersion();
|
||||
$this->OpenApiSpec->info->version = $versionInfo->Version;
|
||||
$this->OpenApiSpec->info->description = str_replace('PlaceHolderManageApiKeysUrl', $this->AppContainer->UrlManager->ConstructUrl('/manageapikeys'), $this->OpenApiSpec->info->description);
|
||||
$this->OpenApiSpec->servers[0]->url = $this->AppContainer->UrlManager->ConstructUrl('/api');
|
||||
|
||||
return $this->ApiResponse($specJson);
|
||||
return $this->ApiResponse($this->OpenApiSpec);
|
||||
}
|
||||
|
||||
public function ApiKeysList(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
return $this->AppContainer->view->render($response, 'manageapikeys', [
|
||||
'apiKeys' => $this->Database->api_keys()
|
||||
'apiKeys' => $this->Database->api_keys(),
|
||||
'users' => $this->Database->users()
|
||||
]);
|
||||
}
|
||||
|
||||
|
43
controllers/RecipesApiController.php
Normal file
43
controllers/RecipesApiController.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace Grocy\Controllers;
|
||||
|
||||
use \Grocy\Services\RecipesService;
|
||||
|
||||
class RecipesApiController extends BaseApiController
|
||||
{
|
||||
public function __construct(\Slim\Container $container)
|
||||
{
|
||||
parent::__construct($container);
|
||||
$this->RecipesService = new RecipesService();
|
||||
}
|
||||
|
||||
protected $RecipesService;
|
||||
|
||||
public function AddNotFulfilledProductsToShoppingList(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
$requestBody = $request->getParsedBody();
|
||||
$excludedProductIds = null;
|
||||
|
||||
if ($requestBody !== null && array_key_exists('excludedProductIds', $requestBody))
|
||||
{
|
||||
$excludedProductIds = $requestBody['excludedProductIds'];
|
||||
}
|
||||
|
||||
$this->RecipesService->AddNotFulfilledProductsToShoppingList($args['recipeId'], $excludedProductIds);
|
||||
return $this->EmptyApiResponse($response);
|
||||
}
|
||||
|
||||
public function ConsumeRecipe(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
try
|
||||
{
|
||||
$this->RecipesService->ConsumeRecipe($args['recipeId']);
|
||||
return $this->EmptyApiResponse($response);
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
{
|
||||
return $this->GenericErrorResponse($response, $ex->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
112
controllers/RecipesController.php
Normal file
112
controllers/RecipesController.php
Normal file
@@ -0,0 +1,112 @@
|
||||
<?php
|
||||
|
||||
namespace Grocy\Controllers;
|
||||
|
||||
use \Grocy\Services\RecipesService;
|
||||
|
||||
class RecipesController extends BaseController
|
||||
{
|
||||
public function __construct(\Slim\Container $container)
|
||||
{
|
||||
parent::__construct($container);
|
||||
$this->RecipesService = new RecipesService();
|
||||
}
|
||||
|
||||
protected $RecipesService;
|
||||
|
||||
public function Overview(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
$recipes = $this->Database->recipes()->orderBy('name');
|
||||
$recipesResolved = $this->RecipesService->GetRecipesResolved();
|
||||
|
||||
$selectedRecipe = null;
|
||||
$selectedRecipePositionsResolved = null;
|
||||
if (isset($request->getQueryParams()['recipe']))
|
||||
{
|
||||
$selectedRecipe = $this->Database->recipes($request->getQueryParams()['recipe']);
|
||||
$selectedRecipePositionsResolved = $this->Database->recipes_pos_resolved()->where('recipe_id', $request->getQueryParams()['recipe'])->orderBy('ingredient_group');
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach ($recipes as $recipe)
|
||||
{
|
||||
$selectedRecipe = $recipe;
|
||||
$selectedRecipePositionsResolved = $this->Database->recipes_pos_resolved()->where('recipe_id', $recipe->id)->orderBy('ingredient_group');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$selectedRecipeSubRecipes = $this->Database->recipes()->where('id IN (SELECT includes_recipe_id FROM recipes_nestings_resolved WHERE recipe_id = :1 AND includes_recipe_id != :1)', $selectedRecipe->id)->orderBy('name')->fetchAll();
|
||||
$selectedRecipeSubRecipesPositions = $this->Database->recipes_pos_resolved()->where('recipe_id = :1', $selectedRecipe->id)->orderBy('ingredient_group')->fetchAll();
|
||||
|
||||
$includedRecipeIdsAbsolute = array();
|
||||
$includedRecipeIdsAbsolute[] = $selectedRecipe->id;
|
||||
foreach($selectedRecipeSubRecipes as $subRecipe)
|
||||
{
|
||||
$includedRecipeIdsAbsolute[] = $subRecipe->id;
|
||||
}
|
||||
|
||||
return $this->AppContainer->view->render($response, 'recipes', [
|
||||
'recipes' => $recipes,
|
||||
'recipesResolved' => $recipesResolved,
|
||||
'recipePositionsResolved' => $this->Database->recipes_pos_resolved(),
|
||||
'selectedRecipe' => $selectedRecipe,
|
||||
'selectedRecipePositionsResolved' => $selectedRecipePositionsResolved,
|
||||
'products' => $this->Database->products(),
|
||||
'quantityunits' => $this->Database->quantity_units(),
|
||||
'selectedRecipeSubRecipes' => $selectedRecipeSubRecipes,
|
||||
'selectedRecipeSubRecipesPositions' => $selectedRecipeSubRecipesPositions,
|
||||
'includedRecipeIdsAbsolute' => $includedRecipeIdsAbsolute,
|
||||
'selectedRecipeTotalCosts' => FindObjectInArrayByPropertyValue($recipesResolved, 'recipe_id', $selectedRecipe->id)->costs
|
||||
]);
|
||||
}
|
||||
|
||||
public function RecipeEditForm(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
$recipeId = $args['recipeId'];
|
||||
if ($recipeId == 'new')
|
||||
{
|
||||
$newRecipe = $this->Database->recipes()->createRow(array(
|
||||
'name' => $this->LocalizationService->Localize('New recipe')
|
||||
));
|
||||
$newRecipe->save();
|
||||
|
||||
$recipeId = $this->Database->lastInsertId();
|
||||
}
|
||||
|
||||
return $this->AppContainer->view->render($response, 'recipeform', [
|
||||
'recipe' => $this->Database->recipes($recipeId),
|
||||
'recipePositions' => $this->Database->recipes_pos()->where('recipe_id', $recipeId),
|
||||
'mode' => 'edit',
|
||||
'products' => $this->Database->products(),
|
||||
'quantityunits' => $this->Database->quantity_units(),
|
||||
'recipePositionsResolved' => $this->RecipesService->GetRecipesPosResolved(),
|
||||
'recipesResolved' => $this->RecipesService->GetRecipesResolved(),
|
||||
'recipes' => $this->Database->recipes()->orderBy('name'),
|
||||
'recipeNestings' => $this->Database->recipes_nestings()->where('recipe_id', $recipeId)
|
||||
]);
|
||||
}
|
||||
|
||||
public function RecipePosEditForm(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
if ($args['recipePosId'] == 'new')
|
||||
{
|
||||
return $this->AppContainer->view->render($response, 'recipeposform', [
|
||||
'mode' => 'create',
|
||||
'recipe' => $this->Database->recipes($args['recipeId']),
|
||||
'products' => $this->Database->products()->orderBy('name'),
|
||||
'quantityUnits' => $this->Database->quantity_units()->orderBy('name')
|
||||
]);
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->AppContainer->view->render($response, 'recipeposform', [
|
||||
'mode' => 'edit',
|
||||
'recipe' => $this->Database->recipes($args['recipeId']),
|
||||
'recipePos' => $this->Database->recipes_pos($args['recipePosId']),
|
||||
'products' => $this->Database->products()->orderBy('name'),
|
||||
'quantityUnits' => $this->Database->quantity_units()->orderBy('name')
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
@@ -16,52 +16,199 @@ class StockApiController extends BaseApiController
|
||||
|
||||
public function ProductDetails(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
return $this->ApiResponse($this->StockService->GetProductDetails($args['productId']));
|
||||
try
|
||||
{
|
||||
return $this->ApiResponse($this->StockService->GetProductDetails($args['productId']));
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
{
|
||||
return $this->GenericErrorResponse($response, $ex->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public function ProductDetailsByBarcode(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
try
|
||||
{
|
||||
$productId = $this->StockService->GetProductIdFromBarcode($args['barcode']);
|
||||
return $this->ApiResponse($this->StockService->GetProductDetails($productId));
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
{
|
||||
return $this->GenericErrorResponse($response, $ex->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public function ProductPriceHistory(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
try
|
||||
{
|
||||
return $this->ApiResponse($this->StockService->GetProductPriceHistory($args['productId']));
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
{
|
||||
return $this->GenericErrorResponse($response, $ex->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public function AddProduct(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
$bestBeforeDate = date('Y-m-d');
|
||||
if (isset($request->getQueryParams()['bestbeforedate']) && !empty($request->getQueryParams()['bestbeforedate']))
|
||||
{
|
||||
$bestBeforeDate = $request->getQueryParams()['bestbeforedate'];
|
||||
}
|
||||
$requestBody = $request->getParsedBody();
|
||||
|
||||
$transactionType = StockService::TRANSACTION_TYPE_PURCHASE;
|
||||
if (isset($request->getQueryParams()['transactiontype']) && !empty($request->getQueryParams()['transactiontype']))
|
||||
try
|
||||
{
|
||||
$transactionType = $request->getQueryParams()['transactiontype'];
|
||||
}
|
||||
if ($requestBody === null)
|
||||
{
|
||||
throw new \Exception('Request body could not be parsed (probably invalid JSON format or missing/wrong Content-Type header)');
|
||||
}
|
||||
|
||||
return $this->ApiResponse(array('success' => $this->StockService->AddProduct($args['productId'], $args['amount'], $bestBeforeDate, $transactionType)));
|
||||
if (!array_key_exists('amount', $requestBody))
|
||||
{
|
||||
throw new \Exception('An amount is required');
|
||||
}
|
||||
|
||||
$bestBeforeDate = date('Y-m-d');
|
||||
if (array_key_exists('best_before_date', $requestBody) && IsIsoDate($requestBody['best_before_date']))
|
||||
{
|
||||
$bestBeforeDate = $requestBody['best_before_date'];
|
||||
}
|
||||
|
||||
$price = null;
|
||||
if (array_key_exists('price', $requestBody) && is_numeric($requestBody['price']))
|
||||
{
|
||||
$price = $requestBody['price'];
|
||||
}
|
||||
|
||||
$locationId = null;
|
||||
if (array_key_exists('location_id', $requestBody) && is_numeric($requestBody['location_id']))
|
||||
{
|
||||
$locationId = $requestBody['location_id'];
|
||||
}
|
||||
|
||||
$transactionType = StockService::TRANSACTION_TYPE_PURCHASE;
|
||||
if (array_key_exists('transaction_type', $requestBody) && !empty($requestBody['transactiontype']))
|
||||
{
|
||||
$transactionType = $requestBody['transactiontype'];
|
||||
}
|
||||
|
||||
$bookingId = $this->StockService->AddProduct($args['productId'], $requestBody['amount'], $bestBeforeDate, $transactionType, date('Y-m-d'), $price, $locationId);
|
||||
return $this->ApiResponse($this->Database->stock_log($bookingId));
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
{
|
||||
return $this->GenericErrorResponse($response, $ex->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public function ConsumeProduct(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
$spoiled = false;
|
||||
if (isset($request->getQueryParams()['spoiled']) && !empty($request->getQueryParams()['spoiled']) && $request->getQueryParams()['spoiled'] == '1')
|
||||
{
|
||||
$spoiled = true;
|
||||
}
|
||||
$requestBody = $request->getParsedBody();
|
||||
|
||||
$transactionType = StockService::TRANSACTION_TYPE_CONSUME;
|
||||
if (isset($request->getQueryParams()['transactiontype']) && !empty($request->getQueryParams()['transactiontype']))
|
||||
try
|
||||
{
|
||||
$transactionType = $request->getQueryParams()['transactiontype'];
|
||||
}
|
||||
if ($requestBody === null)
|
||||
{
|
||||
throw new \Exception('Request body could not be parsed (probably invalid JSON format or missing/wrong Content-Type header)');
|
||||
}
|
||||
|
||||
return $this->ApiResponse(array('success' => $this->StockService->ConsumeProduct($args['productId'], $args['amount'], $spoiled, $transactionType)));
|
||||
if (!array_key_exists('amount', $requestBody))
|
||||
{
|
||||
throw new \Exception('An amount is required');
|
||||
}
|
||||
|
||||
$spoiled = false;
|
||||
if (array_key_exists('spoiled', $requestBody))
|
||||
{
|
||||
$spoiled = $requestBody['spoiled'];
|
||||
}
|
||||
|
||||
$transactionType = StockService::TRANSACTION_TYPE_CONSUME;
|
||||
if (array_key_exists('transaction_type', $requestBody) && !empty($requestBody['transactiontype']))
|
||||
{
|
||||
$transactionType = $requestBody['transactiontype'];
|
||||
}
|
||||
|
||||
$specificStockEntryId = 'default';
|
||||
if (array_key_exists('stock_entry_id', $requestBody) && !empty($requestBody['stock_entry_id']))
|
||||
{
|
||||
$specificStockEntryId = $requestBody['stock_entry_id'];
|
||||
}
|
||||
|
||||
$recipeId = null;
|
||||
if (array_key_exists('recipe_id', $requestBody) && is_numeric($requestBody['recipe_id']))
|
||||
{
|
||||
$recipeId = $requestBody['recipe_id'];
|
||||
}
|
||||
|
||||
$bookingId = $this->StockService->ConsumeProduct($args['productId'], $requestBody['amount'], $spoiled, $transactionType, $specificStockEntryId, $recipeId);
|
||||
return $this->ApiResponse($this->Database->stock_log($bookingId));
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
{
|
||||
return $this->GenericErrorResponse($response, $ex->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public function InventoryProduct(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
$bestBeforeDate = date('Y-m-d');
|
||||
if (isset($request->getQueryParams()['bestbeforedate']) && !empty($request->getQueryParams()['bestbeforedate']))
|
||||
{
|
||||
$bestBeforeDate = $request->getQueryParams()['bestbeforedate'];
|
||||
}
|
||||
$requestBody = $request->getParsedBody();
|
||||
|
||||
return $this->ApiResponse(array('success' => $this->StockService->InventoryProduct($args['productId'], $args['newAmount'], $bestBeforeDate)));
|
||||
try
|
||||
{
|
||||
if ($requestBody === null)
|
||||
{
|
||||
throw new \Exception('Request body could not be parsed (probably invalid JSON format or missing/wrong Content-Type header)');
|
||||
}
|
||||
|
||||
if (!array_key_exists('new_amount', $requestBody))
|
||||
{
|
||||
throw new \Exception('An new amount is required');
|
||||
}
|
||||
|
||||
$bestBeforeDate = date('Y-m-d');
|
||||
if (array_key_exists('best_before_date', $requestBody) && IsIsoDate($requestBody['best_before_date']))
|
||||
{
|
||||
$bestBeforeDate = $requestBody['best_before_date'];
|
||||
}
|
||||
|
||||
$bookingId = $this->StockService->InventoryProduct($args['productId'], $requestBody['new_amount'], $bestBeforeDate);
|
||||
return $this->ApiResponse($this->Database->stock_log($bookingId));
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
{
|
||||
return $this->GenericErrorResponse($response, $ex->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public function OpenProduct(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
$requestBody = $request->getParsedBody();
|
||||
|
||||
try
|
||||
{
|
||||
if ($requestBody === null)
|
||||
{
|
||||
throw new \Exception('Request body could not be parsed (probably invalid JSON format or missing/wrong Content-Type header)');
|
||||
}
|
||||
|
||||
if (!array_key_exists('amount', $requestBody))
|
||||
{
|
||||
throw new \Exception('An amount is required');
|
||||
}
|
||||
|
||||
$specificStockEntryId = 'default';
|
||||
if (array_key_exists('stock_entry_id', $requestBody) && !empty($requestBody['stock_entry_id']))
|
||||
{
|
||||
$specificStockEntryId = $requestBody['stock_entry_id'];
|
||||
}
|
||||
|
||||
$bookingId = $this->StockService->OpenProduct($args['productId'], $requestBody['amount'], $specificStockEntryId);
|
||||
return $this->ApiResponse($this->Database->stock_log($bookingId));
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
{
|
||||
return $this->GenericErrorResponse($response, $ex->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public function CurrentStock(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
@@ -69,9 +216,69 @@ class StockApiController extends BaseApiController
|
||||
return $this->ApiResponse($this->StockService->GetCurrentStock());
|
||||
}
|
||||
|
||||
public function AddmissingProductsToShoppingList(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
public function CurrentVolatilStock(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
$nextXDays = 5;
|
||||
if (isset($request->getQueryParams()['expiring_days']) && !empty($request->getQueryParams()['expiring_days']) && is_numeric($request->getQueryParams()['expiring_days']))
|
||||
{
|
||||
$nextXDays = $request->getQueryParams()['expiring_days'];
|
||||
}
|
||||
|
||||
$expiringProducts = $this->StockService->GetExpiringProducts($nextXDays, true);
|
||||
$expiredProducts = $this->StockService->GetExpiringProducts(-1);
|
||||
$missingProducts = $this->StockService->GetMissingProducts();
|
||||
return $this->ApiResponse(array(
|
||||
'expiring_products' => $expiringProducts,
|
||||
'expired_products' => $expiredProducts,
|
||||
'missing_products' => $missingProducts
|
||||
));
|
||||
}
|
||||
|
||||
public function AddMissingProductsToShoppingList(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
$this->StockService->AddMissingProductsToShoppingList();
|
||||
return $this->ApiResponse(array('success' => true));
|
||||
return $this->EmptyApiResponse($response);
|
||||
}
|
||||
|
||||
public function ClearShoppingList(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
$this->StockService->ClearShoppingList();
|
||||
return $this->EmptyApiResponse($response);
|
||||
}
|
||||
|
||||
public function ExternalBarcodeLookup(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
try
|
||||
{
|
||||
$addFoundProduct = false;
|
||||
if (isset($request->getQueryParams()['add']) && ($request->getQueryParams()['add'] === 'true' || $request->getQueryParams()['add'] === 1))
|
||||
{
|
||||
$addFoundProduct = true;
|
||||
}
|
||||
|
||||
return $this->ApiResponse($this->StockService->ExternalBarcodeLookup($args['barcode'], $addFoundProduct));
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
{
|
||||
return $this->GenericErrorResponse($response, $ex->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public function UndoBooking(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
try
|
||||
{
|
||||
$this->ApiResponse($this->StockService->UndoBooking($args['bookingId']));
|
||||
return $this->EmptyApiResponse($response);
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
{
|
||||
return $this->GenericErrorResponse($response, $ex->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public function ProductStockEntries(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
return $this->ApiResponse($this->StockService->GetProductStockEntries($args['productId']));
|
||||
}
|
||||
}
|
||||
|
@@ -18,31 +18,37 @@ class StockController extends BaseController
|
||||
public function Overview(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
return $this->AppContainer->view->render($response, 'stockoverview', [
|
||||
'products' => $this->Database->products(),
|
||||
'quantityunits' => $this->Database->quantity_units(),
|
||||
'products' => $this->Database->products()->orderBy('name'),
|
||||
'quantityunits' => $this->Database->quantity_units()->orderBy('name'),
|
||||
'locations' => $this->Database->locations()->orderBy('name'),
|
||||
'currentStock' => $this->StockService->GetCurrentStock(),
|
||||
'missingProducts' => $this->StockService->GetMissingProducts()
|
||||
'currentStockLocations' => $this->StockService->GetCurrentStockLocations(),
|
||||
'missingProducts' => $this->StockService->GetMissingProducts(),
|
||||
'nextXDays' => 5,
|
||||
'productGroups' => $this->Database->product_groups()->orderBy('name')
|
||||
]);
|
||||
}
|
||||
|
||||
public function Purchase(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
return $this->AppContainer->view->render($response, 'purchase', [
|
||||
'products' => $this->Database->products()
|
||||
'products' => $this->Database->products()->orderBy('name'),
|
||||
'locations' => $this->Database->locations()->orderBy('name')
|
||||
]);
|
||||
}
|
||||
|
||||
public function Consume(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
return $this->AppContainer->view->render($response, 'consume', [
|
||||
'products' => $this->Database->products()
|
||||
'products' => $this->Database->products()->orderBy('name'),
|
||||
'recipes' => $this->Database->recipes()->orderBy('name')
|
||||
]);
|
||||
}
|
||||
|
||||
public function Inventory(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
return $this->AppContainer->view->render($response, 'inventory', [
|
||||
'products' => $this->Database->products()
|
||||
'products' => $this->Database->products()->orderBy('name')
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -50,32 +56,50 @@ class StockController extends BaseController
|
||||
{
|
||||
return $this->AppContainer->view->render($response, 'shoppinglist', [
|
||||
'listItems' => $this->Database->shopping_list(),
|
||||
'products' => $this->Database->products(),
|
||||
'quantityunits' => $this->Database->quantity_units(),
|
||||
'missingProducts' => $this->StockService->GetMissingProducts()
|
||||
'products' => $this->Database->products()->orderBy('name'),
|
||||
'quantityunits' => $this->Database->quantity_units()->orderBy('name'),
|
||||
'missingProducts' => $this->StockService->GetMissingProducts(),
|
||||
'productGroups' => $this->Database->product_groups()->orderBy('name')
|
||||
]);
|
||||
}
|
||||
|
||||
public function ProductsList(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
return $this->AppContainer->view->render($response, 'products', [
|
||||
'products' => $this->Database->products(),
|
||||
'locations' => $this->Database->locations(),
|
||||
'quantityunits' => $this->Database->quantity_units()
|
||||
'products' => $this->Database->products()->orderBy('name'),
|
||||
'locations' => $this->Database->locations()->orderBy('name'),
|
||||
'quantityunits' => $this->Database->quantity_units()->orderBy('name'),
|
||||
'productGroups' => $this->Database->product_groups()->orderBy('name')
|
||||
]);
|
||||
}
|
||||
|
||||
public function StockSettings(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
return $this->AppContainer->view->render($response, 'stocksettings', [
|
||||
'locations' => $this->Database->locations()->orderBy('name'),
|
||||
'quantityunits' => $this->Database->quantity_units()->orderBy('name'),
|
||||
'productGroups' => $this->Database->product_groups()->orderBy('name')
|
||||
]);
|
||||
}
|
||||
|
||||
public function LocationsList(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
return $this->AppContainer->view->render($response, 'locations', [
|
||||
'locations' => $this->Database->locations()
|
||||
'locations' => $this->Database->locations()->orderBy('name')
|
||||
]);
|
||||
}
|
||||
|
||||
public function ProductGroupsList(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
return $this->AppContainer->view->render($response, 'productgroups', [
|
||||
'productGroups' => $this->Database->product_groups()->orderBy('name')
|
||||
]);
|
||||
}
|
||||
|
||||
public function QuantityUnitsList(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
return $this->AppContainer->view->render($response, 'quantityunits', [
|
||||
'quantityunits' => $this->Database->quantity_units()
|
||||
'quantityunits' => $this->Database->quantity_units()->orderBy('name')
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -84,8 +108,9 @@ class StockController extends BaseController
|
||||
if ($args['productId'] == 'new')
|
||||
{
|
||||
return $this->AppContainer->view->render($response, 'productform', [
|
||||
'locations' => $this->Database->locations(),
|
||||
'quantityunits' => $this->Database->quantity_units(),
|
||||
'locations' => $this->Database->locations()->orderBy('name'),
|
||||
'quantityunits' => $this->Database->quantity_units()->orderBy('name'),
|
||||
'productgroups' => $this->Database->product_groups()->orderBy('name'),
|
||||
'mode' => 'create'
|
||||
]);
|
||||
}
|
||||
@@ -93,8 +118,9 @@ class StockController extends BaseController
|
||||
{
|
||||
return $this->AppContainer->view->render($response, 'productform', [
|
||||
'product' => $this->Database->products($args['productId']),
|
||||
'locations' => $this->Database->locations(),
|
||||
'quantityunits' => $this->Database->quantity_units(),
|
||||
'locations' => $this->Database->locations()->orderBy('name'),
|
||||
'quantityunits' => $this->Database->quantity_units()->orderBy('name'),
|
||||
'productgroups' => $this->Database->product_groups()->orderBy('name'),
|
||||
'mode' => 'edit'
|
||||
]);
|
||||
}
|
||||
@@ -117,6 +143,23 @@ class StockController extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
public function ProductGroupEditForm(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
if ($args['productGroupId'] == 'new')
|
||||
{
|
||||
return $this->AppContainer->view->render($response, 'productgroupform', [
|
||||
'mode' => 'create'
|
||||
]);
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->AppContainer->view->render($response, 'productgroupform', [
|
||||
'group' => $this->Database->product_groups($args['productGroupId']),
|
||||
'mode' => 'edit'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
public function QuantityUnitEditForm(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
if ($args['quantityunitId'] == 'new')
|
||||
@@ -139,7 +182,7 @@ class StockController extends BaseController
|
||||
if ($args['itemId'] == 'new')
|
||||
{
|
||||
return $this->AppContainer->view->render($response, 'shoppinglistform', [
|
||||
'products' => $this->Database->products(),
|
||||
'products' => $this->Database->products()->orderBy('name'),
|
||||
'mode' => 'create'
|
||||
]);
|
||||
}
|
||||
@@ -147,9 +190,18 @@ class StockController extends BaseController
|
||||
{
|
||||
return $this->AppContainer->view->render($response, 'shoppinglistform', [
|
||||
'listItem' => $this->Database->shopping_list($args['itemId']),
|
||||
'products' => $this->Database->products(),
|
||||
'products' => $this->Database->products()->orderBy('name'),
|
||||
'mode' => 'edit'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
public function Journal(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
return $this->AppContainer->view->render($response, 'stockjournal', [
|
||||
'stockLog' => $this->Database->stock_log()->orderBy('row_created_timestamp', 'DESC'),
|
||||
'products' => $this->Database->products()->orderBy('name'),
|
||||
'quantityunits' => $this->Database->quantity_units()->orderBy('name')
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
49
controllers/SystemApiController.php
Normal file
49
controllers/SystemApiController.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace Grocy\Controllers;
|
||||
|
||||
use \Grocy\Services\DatabaseService;
|
||||
use \Grocy\Services\ApplicationService;
|
||||
|
||||
class SystemApiController extends BaseApiController
|
||||
{
|
||||
public function __construct(\Slim\Container $container)
|
||||
{
|
||||
parent::__construct($container);
|
||||
$this->DatabaseService = new DatabaseService();
|
||||
$this->ApplicationService = new ApplicationService();
|
||||
}
|
||||
|
||||
protected $DatabaseService;
|
||||
protected $ApplicationService;
|
||||
|
||||
public function GetDbChangedTime(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
return $this->ApiResponse(array(
|
||||
'changed_time' => $this->DatabaseService->GetDbChangedTime()
|
||||
));
|
||||
}
|
||||
|
||||
public function LogMissingLocalization(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
if (GROCY_MODE === 'dev')
|
||||
{
|
||||
try
|
||||
{
|
||||
$requestBody = $request->getParsedBody();
|
||||
|
||||
$this->LocalizationService->LogMissingLocalization(GROCY_CULTURE, $requestBody['text']);
|
||||
return $this->EmptyApiResponse($response);
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
{
|
||||
return $this->GenericErrorResponse($response, $ex->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function GetSystemInfo(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
return $this->ApiResponse($this->ApplicationService->GetSystemInfo());
|
||||
}
|
||||
}
|
41
controllers/SystemController.php
Normal file
41
controllers/SystemController.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace Grocy\Controllers;
|
||||
|
||||
use \Grocy\Services\ApplicationService;
|
||||
use \Grocy\Services\DatabaseMigrationService;
|
||||
use \Grocy\Services\DemoDataGeneratorService;
|
||||
|
||||
class SystemController extends BaseController
|
||||
{
|
||||
public function __construct(\Slim\Container $container)
|
||||
{
|
||||
parent::__construct($container);
|
||||
$this->ApplicationService = new ApplicationService();
|
||||
}
|
||||
|
||||
protected $ApplicationService;
|
||||
|
||||
public function Root(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
// Schema migration is done here
|
||||
$databaseMigrationService = new DatabaseMigrationService();
|
||||
$databaseMigrationService->MigrateDatabase();
|
||||
|
||||
if (GROCY_IS_DEMO_INSTALL)
|
||||
{
|
||||
$demoDataGeneratorService = new DemoDataGeneratorService();
|
||||
$demoDataGeneratorService->PopulateDemoData();
|
||||
}
|
||||
|
||||
return $response->withRedirect($this->AppContainer->UrlManager->ConstructUrl('/stockoverview'));
|
||||
}
|
||||
|
||||
public function About(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
return $this->AppContainer->view->render($response, 'about', [
|
||||
'system_info' => $this->ApplicationService->GetSystemInfo(),
|
||||
'changelog' => $this->ApplicationService->GetChangelog()
|
||||
]);
|
||||
}
|
||||
}
|
42
controllers/TasksApiController.php
Normal file
42
controllers/TasksApiController.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace Grocy\Controllers;
|
||||
|
||||
use \Grocy\Services\TasksService;
|
||||
|
||||
class TasksApiController extends BaseApiController
|
||||
{
|
||||
public function __construct(\Slim\Container $container)
|
||||
{
|
||||
parent::__construct($container);
|
||||
$this->TasksService = new TasksService();
|
||||
}
|
||||
|
||||
protected $TasksService;
|
||||
|
||||
public function Current(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
return $this->ApiResponse($this->TasksService->GetCurrent());
|
||||
}
|
||||
|
||||
public function MarkTaskAsCompleted(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
$requestBody = $request->getParsedBody();
|
||||
|
||||
try
|
||||
{
|
||||
$doneTime = date('Y-m-d H:i:s');
|
||||
if (array_key_exists('done_time', $requestBody) && IsIsoDateTime($requestBody['done_time']))
|
||||
{
|
||||
$doneTime = $requestBody['done_time'];
|
||||
}
|
||||
|
||||
$this->TasksService->MarkTaskAsCompleted($args['taskId'], $doneTime);
|
||||
return $this->EmptyApiResponse($response);
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
{
|
||||
return $this->GenericErrorResponse($response, $ex->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
80
controllers/TasksController.php
Normal file
80
controllers/TasksController.php
Normal file
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
|
||||
namespace Grocy\Controllers;
|
||||
|
||||
use \Grocy\Services\TasksService;
|
||||
|
||||
class TasksController extends BaseController
|
||||
{
|
||||
public function __construct(\Slim\Container $container)
|
||||
{
|
||||
parent::__construct($container);
|
||||
$this->TasksService = new TasksService();
|
||||
}
|
||||
|
||||
protected $TasksService;
|
||||
|
||||
public function Overview(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
if (isset($request->getQueryParams()['include_done']))
|
||||
{
|
||||
$tasks = $this->Database->tasks()->orderBy('name');
|
||||
}
|
||||
else
|
||||
{
|
||||
$tasks = $this->TasksService->GetCurrent();
|
||||
}
|
||||
|
||||
return $this->AppContainer->view->render($response, 'tasks', [
|
||||
'tasks' => $tasks,
|
||||
'nextXDays' => 5,
|
||||
'taskCategories' => $this->Database->task_categories()->orderBy('name'),
|
||||
'users' => $this->Database->users()
|
||||
]);
|
||||
}
|
||||
|
||||
public function TaskEditForm(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
if ($args['taskId'] == 'new')
|
||||
{
|
||||
return $this->AppContainer->view->render($response, 'taskform', [
|
||||
'mode' => 'create',
|
||||
'taskCategories' => $this->Database->task_categories()->orderBy('name'),
|
||||
'users' => $this->Database->users()->orderBy('username')
|
||||
]);
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->AppContainer->view->render($response, 'taskform', [
|
||||
'task' => $this->Database->tasks($args['taskId']),
|
||||
'mode' => 'edit',
|
||||
'taskCategories' => $this->Database->task_categories()->orderBy('name'),
|
||||
'users' => $this->Database->users()->orderBy('username')
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
public function TaskCategoriesList(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
return $this->AppContainer->view->render($response, 'taskcategories', [
|
||||
'taskCategories' => $this->Database->task_categories()->orderBy('name')
|
||||
]);
|
||||
}
|
||||
|
||||
public function TaskCategoryEditForm(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
if ($args['categoryId'] == 'new')
|
||||
{
|
||||
return $this->AppContainer->view->render($response, 'taskcategoryform', [
|
||||
'mode' => 'create'
|
||||
]);
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->AppContainer->view->render($response, 'taskcategoryform', [
|
||||
'category' => $this->Database->task_categories($args['categoryId']),
|
||||
'mode' => 'edit'
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
104
controllers/UsersApiController.php
Normal file
104
controllers/UsersApiController.php
Normal file
@@ -0,0 +1,104 @@
|
||||
<?php
|
||||
|
||||
namespace Grocy\Controllers;
|
||||
|
||||
use \Grocy\Services\UsersService;
|
||||
|
||||
class UsersApiController extends BaseApiController
|
||||
{
|
||||
public function __construct(\Slim\Container $container)
|
||||
{
|
||||
parent::__construct($container);
|
||||
$this->UsersService = new UsersService();
|
||||
}
|
||||
|
||||
protected $UsersService;
|
||||
|
||||
public function GetUsers(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
try
|
||||
{
|
||||
return $this->ApiResponse($this->UsersService->GetUsersAsDto());
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
{
|
||||
return $this->GenericErrorResponse($response, $ex->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public function CreateUser(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
$requestBody = $request->getParsedBody();
|
||||
|
||||
try
|
||||
{
|
||||
if ($requestBody === null)
|
||||
{
|
||||
throw new \Exception('Request body could not be parsed (probably invalid JSON format or missing/wrong Content-Type header)');
|
||||
}
|
||||
|
||||
$this->UsersService->CreateUser($requestBody['username'], $requestBody['first_name'], $requestBody['last_name'], $requestBody['password']);
|
||||
return $this->EmptyApiResponse($response);
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
{
|
||||
return $this->GenericErrorResponse($response, $ex->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public function DeleteUser(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
try
|
||||
{
|
||||
$this->UsersService->DeleteUser($args['userId']);
|
||||
return $this->EmptyApiResponse($response);
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
{
|
||||
return $this->GenericErrorResponse($response, $ex->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public function EditUser(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
$requestBody = $request->getParsedBody();
|
||||
|
||||
try
|
||||
{
|
||||
$this->UsersService->EditUser($args['userId'], $requestBody['username'], $requestBody['first_name'], $requestBody['last_name'], $requestBody['password']);
|
||||
return $this->EmptyApiResponse($response);
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
{
|
||||
return $this->GenericErrorResponse($response, $ex->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public function GetUserSetting(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
try
|
||||
{
|
||||
$value = $this->UsersService->GetUserSetting(GROCY_USER_ID, $args['settingKey']);
|
||||
return $this->ApiResponse(array('value' => $value));
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
{
|
||||
return $this->GenericErrorResponse($response, $ex->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public function SetUserSetting(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
try
|
||||
{
|
||||
$requestBody = $request->getParsedBody();
|
||||
|
||||
$value = $this->UsersService->SetUserSetting(GROCY_USER_ID, $args['settingKey'], $requestBody['value']);
|
||||
return $this->EmptyApiResponse($response);
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
{
|
||||
return $this->GenericErrorResponse($response, $ex->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
30
controllers/UsersController.php
Normal file
30
controllers/UsersController.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Grocy\Controllers;
|
||||
|
||||
class UsersController extends BaseController
|
||||
{
|
||||
public function UsersList(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
return $this->AppContainer->view->render($response, 'users', [
|
||||
'users' => $this->Database->users()->orderBy('username')
|
||||
]);
|
||||
}
|
||||
|
||||
public function UserEditForm(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
|
||||
{
|
||||
if ($args['userId'] == 'new')
|
||||
{
|
||||
return $this->AppContainer->view->render($response, 'userform', [
|
||||
'mode' => 'create'
|
||||
]);
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->AppContainer->view->render($response, 'userform', [
|
||||
'user' => $this->Database->users($args['userId']),
|
||||
'mode' => 'edit'
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
1
data/.gitignore
vendored
1
data/.gitignore
vendored
@@ -1,3 +1,4 @@
|
||||
*
|
||||
!.gitignore
|
||||
!viewcache
|
||||
!plugins
|
||||
|
3
data/plugins/.gitignore
vendored
Normal file
3
data/plugins/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
*
|
||||
!.gitignore
|
||||
!DemoBarcodeLookupPlugin.php
|
78
data/plugins/DemoBarcodeLookupPlugin.php
Normal file
78
data/plugins/DemoBarcodeLookupPlugin.php
Normal file
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
|
||||
use \Grocy\Helpers\BaseBarcodeLookupPlugin;
|
||||
|
||||
/*
|
||||
This class must extend BaseBarcodeLookupPlugin (in namespace \Grocy\Helpers)
|
||||
*/
|
||||
class DemoBarcodeLookupPlugin extends BaseBarcodeLookupPlugin
|
||||
{
|
||||
/*
|
||||
To use this plugin, configure it in data/config.php like this:
|
||||
Setting('STOCK_BARCODE_LOOKUP_PLUGIN', 'DemoBarcodeLookupPlugin');
|
||||
*/
|
||||
|
||||
/*
|
||||
To try it:
|
||||
Call the API function at /api/stock/external-barcode-lookup/{barcode}
|
||||
|
||||
When you also add ?add=true as a query parameter to the API call,
|
||||
on a successful lookup the product is added to the database and in the output
|
||||
the new product id is included (automatically, nothing to do here in the plugin)
|
||||
*/
|
||||
|
||||
/*
|
||||
Provided references:
|
||||
|
||||
$this->Locations contains all locations
|
||||
$this->QuantityUnits contains all quantity units
|
||||
*/
|
||||
|
||||
/*
|
||||
Useful hints:
|
||||
|
||||
Get a quantity unit by name:
|
||||
$quantityUnit = FindObjectInArrayByPropertyValue($this->QuantityUnits, 'name', 'Piece');
|
||||
|
||||
Get a location by name:
|
||||
$location = FindObjectInArrayByPropertyValue($this->Locations, 'name', 'Fridge');
|
||||
*/
|
||||
|
||||
/*
|
||||
This class must implement the protected abstract function ExecuteLookup($barcode),
|
||||
which is called with the barcode that needs to be looked up and must return an
|
||||
associative array of the product model or null, when nothing was found for the barcode.
|
||||
|
||||
The returned array must contain at least these properties:
|
||||
array(
|
||||
'name' => '',
|
||||
'location_id' => 1, // A valid id of a location object, check against $this->Locations
|
||||
'qu_id_purchase' => 1, // A valid id of quantity unit object, check against $this->QuantityUnits
|
||||
'qu_id_stock' => 1, // A valid id of quantity unit object, check against $this->QuantityUnits
|
||||
'qu_factor_purchase_to_stock' => 1, // Normally 1 when quantity unit stock and purchase is the same
|
||||
'barcode' => $barcode // The barcode of the product, maybe just pass through $barcode or manipulate it if necessary
|
||||
)
|
||||
*/
|
||||
protected function ExecuteLookup($barcode)
|
||||
{
|
||||
if ($barcode === 'x') // Demonstration when nothing is found
|
||||
{
|
||||
return null;
|
||||
}
|
||||
elseif ($barcode === 'e') // Demonstration when an error occurred
|
||||
{
|
||||
throw new \Exception('This is the error message from the plugin...');
|
||||
}
|
||||
else
|
||||
{
|
||||
return array(
|
||||
'name' => 'LookedUpProduct_' . RandomString(5),
|
||||
'location_id' => $this->Locations[0]->id,
|
||||
'qu_id_purchase' => $this->QuantityUnits[0]->id,
|
||||
'qu_id_stock' => $this->QuantityUnits[0]->id,
|
||||
'qu_factor_purchase_to_stock' => 1,
|
||||
'barcode' => $barcode
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
2143
grocy.openapi.json
2143
grocy.openapi.json
File diff suppressed because it is too large
Load Diff
80
helpers/BaseBarcodeLookupPlugin.php
Normal file
80
helpers/BaseBarcodeLookupPlugin.php
Normal file
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
|
||||
namespace Grocy\Helpers;
|
||||
|
||||
abstract class BaseBarcodeLookupPlugin
|
||||
{
|
||||
final public function __construct($locations, $quantityUnits)
|
||||
{
|
||||
$this->Locations = $locations;
|
||||
$this->QuantityUnits = $quantityUnits;
|
||||
}
|
||||
|
||||
protected $Locations;
|
||||
protected $QuantityUnits;
|
||||
|
||||
abstract protected function ExecuteLookup($barcode);
|
||||
|
||||
final public function Lookup($barcode)
|
||||
{
|
||||
$pluginOutput = $this->ExecuteLookup($barcode);
|
||||
|
||||
if ($pluginOutput === null)
|
||||
{
|
||||
return $pluginOutput;
|
||||
}
|
||||
|
||||
// Plugin must return an associative array
|
||||
if (!is_array($pluginOutput))
|
||||
{
|
||||
throw new \Exception('Plugin output must be an associative array');
|
||||
}
|
||||
if (!IsAssociativeArray($pluginOutput)) // $pluginOutput is at least an indexed array here
|
||||
{
|
||||
throw new \Exception('Plugin output must be an associative array');
|
||||
}
|
||||
|
||||
// Check for minimum needed properties
|
||||
$minimunNeededProperties = array(
|
||||
'name',
|
||||
'location_id',
|
||||
'qu_id_purchase',
|
||||
'qu_id_stock',
|
||||
'qu_factor_purchase_to_stock',
|
||||
'barcode'
|
||||
);
|
||||
foreach ($minimunNeededProperties as $prop)
|
||||
{
|
||||
if (!array_key_exists($prop, $pluginOutput))
|
||||
{
|
||||
throw new \Exception("Plugin output does not provide needed property $prop");
|
||||
}
|
||||
}
|
||||
|
||||
// $pluginOutput contains all needed properties here
|
||||
|
||||
// Check referenced entity ids are valid
|
||||
$locationId = $pluginOutput['location_id'];
|
||||
if (FindObjectInArrayByPropertyValue($this->Locations, 'id', $locationId) === null)
|
||||
{
|
||||
throw new \Exception("Location $locationId is not a valid location id");
|
||||
}
|
||||
$quIdPurchase = $pluginOutput['qu_id_purchase'];
|
||||
if (FindObjectInArrayByPropertyValue($this->QuantityUnits, 'id', $quIdPurchase) === null)
|
||||
{
|
||||
throw new \Exception("Location $quIdPurchase is not a valid quantity unit id");
|
||||
}
|
||||
$quIdStock = $pluginOutput['qu_id_stock'];
|
||||
if (FindObjectInArrayByPropertyValue($this->QuantityUnits, 'id', $quIdStock) === null)
|
||||
{
|
||||
throw new \Exception("Location $quIdStock is not a valid quantity unit id");
|
||||
}
|
||||
$quFactor = $pluginOutput['qu_factor_purchase_to_stock'];
|
||||
if (empty($quFactor) || !is_numeric($quFactor))
|
||||
{
|
||||
throw new \Exception('Quantity unit factor is empty or not a number');
|
||||
}
|
||||
|
||||
return $pluginOutput;
|
||||
}
|
||||
}
|
@@ -18,13 +18,25 @@ class UrlManager
|
||||
|
||||
protected $BasePath;
|
||||
|
||||
public function ConstructUrl($relativePath)
|
||||
public function ConstructUrl($relativePath, $isResource = false)
|
||||
{
|
||||
return rtrim($this->BasePath, '/') . $relativePath;
|
||||
if (GROCY_DISABLE_URL_REWRITING === false || $isResource === true)
|
||||
{
|
||||
return rtrim($this->BasePath, '/') . $relativePath;
|
||||
}
|
||||
else // Is not a resource and URL rewriting is disabled
|
||||
{
|
||||
return rtrim($this->BasePath, '/') . '/index.php' . $relativePath;
|
||||
}
|
||||
}
|
||||
|
||||
private function GetBaseUrl()
|
||||
{
|
||||
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false)
|
||||
{
|
||||
$_SERVER['HTTPS'] = 'on';
|
||||
}
|
||||
|
||||
return (isset($_SERVER['HTTPS']) ? "https" : "http") . "://$_SERVER[HTTP_HOST]";
|
||||
}
|
||||
}
|
||||
|
@@ -45,6 +45,38 @@ function FindAllObjectsInArrayByPropertyValue($array, $propertyName, $propertyVa
|
||||
return $returnArray;
|
||||
}
|
||||
|
||||
function FindAllItemsInArrayByValue($array, $value, $operator = '==')
|
||||
{
|
||||
$returnArray = array();
|
||||
|
||||
foreach($array as $item)
|
||||
{
|
||||
switch($operator)
|
||||
{
|
||||
case '==':
|
||||
if($item == $value)
|
||||
{
|
||||
$returnArray[] = $item;
|
||||
}
|
||||
break;
|
||||
case '>':
|
||||
if($item > $value)
|
||||
{
|
||||
$returnArray[] = $item;
|
||||
}
|
||||
break;
|
||||
case '<':
|
||||
if($item < $value)
|
||||
{
|
||||
$returnArray[] = $item;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $returnArray;
|
||||
}
|
||||
|
||||
function SumArrayValue($array, $propertyName)
|
||||
{
|
||||
$sum = 0;
|
||||
@@ -72,3 +104,102 @@ function RandomString($length, $allowedChars = '0123456789abcdefghijklmnopqrstuv
|
||||
|
||||
return $randomString;
|
||||
}
|
||||
|
||||
function IsAssociativeArray(array $array)
|
||||
{
|
||||
$keys = array_keys($array);
|
||||
return array_keys($keys) !== $keys;
|
||||
}
|
||||
|
||||
function IsIsoDate($dateString)
|
||||
{
|
||||
$d = DateTime::createFromFormat('Y-m-d', $dateString);
|
||||
return $d && $d->format('Y-m-d') === $dateString;
|
||||
}
|
||||
|
||||
function IsIsoDateTime($dateTimeString)
|
||||
{
|
||||
$d = DateTime::createFromFormat('Y-m-d H:i:s', $dateTimeString);
|
||||
return $d && $d->format('Y-m-d H:i:s') === $dateTimeString;
|
||||
}
|
||||
|
||||
function BoolToString(bool $bool)
|
||||
{
|
||||
return $bool ? 'true' : 'false';
|
||||
}
|
||||
|
||||
function Setting(string $name, $value)
|
||||
{
|
||||
if (!defined('GROCY_' . $name))
|
||||
{
|
||||
// The content of a $name.txt file in /data/settingoverrides can overwrite the given setting (for embedded mode)
|
||||
$settingOverrideFile = GROCY_DATAPATH . '/settingoverrides/' . $name . '.txt';
|
||||
if (file_exists($settingOverrideFile))
|
||||
{
|
||||
define('GROCY_' . $name, file_get_contents($settingOverrideFile));
|
||||
}
|
||||
elseif (getenv('GROCY_' . $name) !== false) // An environment variable with the same name and prefix GROCY_ overwrites the given setting
|
||||
{
|
||||
define('GROCY_' . $name, getenv('GROCY_' . $name));
|
||||
}
|
||||
else
|
||||
{
|
||||
define('GROCY_' . $name, $value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
global $GROCY_DEFAULT_USER_SETTINGS;
|
||||
$GROCY_DEFAULT_USER_SETTINGS = array();
|
||||
function DefaultUserSetting(string $name, $value)
|
||||
{
|
||||
global $GROCY_DEFAULT_USER_SETTINGS;
|
||||
if (!array_key_exists($name, $GROCY_DEFAULT_USER_SETTINGS))
|
||||
{
|
||||
$GROCY_DEFAULT_USER_SETTINGS[$name] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
function GetUserDisplayName($user)
|
||||
{
|
||||
$displayName = '';
|
||||
|
||||
if (empty($user->first_name) && !empty($user->last_name))
|
||||
{
|
||||
$displayName = $user->last_name;
|
||||
}
|
||||
elseif (empty($user->last_name) && !empty($user->first_name))
|
||||
{
|
||||
$displayName = $user->first_name;
|
||||
}
|
||||
elseif (!empty($user->last_name) && !empty($user->first_name))
|
||||
{
|
||||
$displayName = $user->first_name . ' ' . $user->last_name;
|
||||
}
|
||||
else
|
||||
{
|
||||
$displayName = $user->username;
|
||||
}
|
||||
|
||||
return $displayName;
|
||||
}
|
||||
|
||||
function Pluralize($number, $singularForm, $pluralForm)
|
||||
{
|
||||
$text = $singularForm;
|
||||
if ($number != 1 && $pluralForm !== null && !empty($pluralForm))
|
||||
{
|
||||
$text = $pluralForm;
|
||||
}
|
||||
return $text;
|
||||
}
|
||||
|
||||
function IsValidFileName($fileName)
|
||||
{
|
||||
if(preg_match('=^[^/?*;:{}\\\\]+\.[^/?*;:{}\\\\]+$=', $fileName))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
6
localization/da/chore_types.php
Normal file
6
localization/da/chore_types.php
Normal file
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
'manually' => 'Manuelt',
|
||||
'dynamic-regular' => 'Dynamic regular'
|
||||
);
|
@@ -1,14 +1,10 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
//Constants
|
||||
'manually' => 'Manually',
|
||||
'dynamic-regular' => 'Dynamic regular',
|
||||
|
||||
//Technical component translations
|
||||
'timeago_locale' => 'en',
|
||||
'timeago_nan' => 'NaN years ago',
|
||||
'moment_locale' => '',
|
||||
'bootstrap_datepicker_locale' => '',
|
||||
'datatables_localization' => '{"sEmptyTable":"No data available in table","sInfo":"Showing _START_ to _END_ of _TOTAL_ entries","sInfoEmpty":"Showing 0 to 0 of 0 entries","sInfoFiltered":"(filtered from _MAX_ total entries)","sInfoPostFix":"","sInfoThousands":",","sLengthMenu":"Show _MENU_ entries","sLoadingRecords":"Loading...","sProcessing":"Processing...","sSearch":"Search:","sZeroRecords":"No matching records found","oPaginate":{"sFirst":"First","sLast":"Last","sNext":"Next","sPrevious":"Previous"},"oAria":{"sSortAscending":": activate to sort column ascending","sSortDescending":": activate to sort column descending"}}'
|
||||
'moment_locale' => 'x',
|
||||
'datatables_localization' => '{"sEmptyTable":"No data available in table","sInfo":"Showing _START_ to _END_ of _TOTAL_ entries","sInfoEmpty":"Showing 0 to 0 of 0 entries","sInfoFiltered":"(filtered from _MAX_ total entries)","sInfoPostFix":"","sInfoThousands":",","sLengthMenu":"Show _MENU_ entries","sLoadingRecords":"Loading...","sProcessing":"Processing...","sSearch":"Search:","sZeroRecords":"No matching records found","oPaginate":{"sFirst":"First","sLast":"Last","sNext":"Next","sPrevious":"Previous"},"oAria":{"sSortAscending":": activate to sort column ascending","sSortDescending":": activate to sort column descending"}}',
|
||||
'summernote_locale' => 'x',
|
||||
'fullcalendar_locale' => 'x'
|
||||
);
|
90
localization/da/demo_data.php
Normal file
90
localization/da/demo_data.php
Normal file
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
'Cookies' => 'Småkager',
|
||||
'Chocolate' => 'chokolade',
|
||||
'Pantry' => 'Spisekammer',
|
||||
'Candy cupboard' => 'Slik skuffe',
|
||||
'Tinned food cupboard' => 'Dåsemadsskab',
|
||||
'Fridge' => 'Køleskab',
|
||||
'Piece' => 'Styk',
|
||||
'Pieces' => 'Stykker',
|
||||
'Pack' => 'Pakke',
|
||||
'Packs' => 'Pakker',
|
||||
'Glass' => 'Glas',
|
||||
'Glasses' => 'Glas',
|
||||
'Tin' => 'Beholder',
|
||||
'Tins' => 'Beholdere',
|
||||
'Can' => 'Dåse',
|
||||
'Cans' => 'Dåser',
|
||||
'Bunch' => 'Bundt',
|
||||
'Bunches' => 'Bundt',
|
||||
'Gummy bears' => 'Vingummi bamser',
|
||||
'Crisps' => 'Chips',
|
||||
'Eggs' => 'Æg',
|
||||
'Noodles' => 'Nudler',
|
||||
'Pickles' => 'Syltede agurker',
|
||||
'Gulash soup' => 'Gulash',
|
||||
'Yogurt' => 'Yoghurt',
|
||||
'Cheese' => 'Ost',
|
||||
'Cold cuts' => 'Pålæg',
|
||||
'Paprika' => 'Paprika',
|
||||
'Cucumber' => 'Agurk',
|
||||
'Radish' => 'Radisse',
|
||||
'Tomato' => 'Tomat',
|
||||
'Changed towels in the bathroom' => 'Skiftede håndklæder i badeværelset',
|
||||
'Cleaned the kitchen floor' => 'Gjorde køkkengulvet rent',
|
||||
'Warranty ends' => 'Reklamationsret udløber',
|
||||
'TV remote control' => 'Fjernbetjening',
|
||||
'Alarm clock' => 'Vægge ur',
|
||||
'Heat remote control' => 'Varmefjernbetjening',
|
||||
'Lawn mowed in the garden' => 'Græs slået',
|
||||
'Some good snacks' => 'Nogle gode snacks',
|
||||
'Pizza dough' => 'Pizza dej',
|
||||
'Sieved tomatoes' => 'Sigtede tomater',
|
||||
'Salami' => 'Salami',
|
||||
'Toast' => 'Toast',
|
||||
'Minced meat' => 'Hakkekød',
|
||||
'Pizza' => 'Pizza',
|
||||
'Spaghetti bolognese' => 'Spaghetti bolognese',
|
||||
'Sandwiches' => 'Sandwiches',
|
||||
'English' => 'Engelsk',
|
||||
'German' => 'Tysk',
|
||||
'Italian' => 'Italiænsk',
|
||||
'Demo in different language' => 'Demo i et andet sprog',
|
||||
'This is the note content of the recipe ingredient' => 'Dette er indholdet af opskrift ingrediensens notefelt',
|
||||
'Demo User' => 'Demo Bruger',
|
||||
'Gram' => 'Gram',
|
||||
'Grams' => 'Gram',
|
||||
'Flour' => 'Mel',
|
||||
'Pancakes' => 'Pandekager',
|
||||
'Sugar' => 'Sukker',
|
||||
'Home' => 'Hjem',
|
||||
'Life' => 'Liv',
|
||||
'Projects' => 'Projekter',
|
||||
'Repair the garage door' => 'Reparér garagedøren',
|
||||
'Fork and improve grocy' => 'Fork og forbedre grocy',
|
||||
'Find a solution for what to do when I forget the door keys' => 'Find en løsning for når jeg glemmer husnøglen',
|
||||
'Sweets' => 'Slik',
|
||||
'Bakery products' => 'Bageriprodukter',
|
||||
'Tinned food' => 'Dåsemad',
|
||||
'Butchery products' => 'Slagteriprodukter',
|
||||
'Vegetables/Fruits' => 'Frugt og grønt',
|
||||
'Refrigerated products' => 'Nedkølede produkter',
|
||||
'Coffee machine' => 'Kaffemaskine',
|
||||
'Dishwasher' => 'Opvasker',
|
||||
'Liter' => 'Liter',
|
||||
'Liters' => 'Liter',
|
||||
'Bottle' => 'Flaske',
|
||||
'Bottles' => 'Flasker',
|
||||
'Milk' => 'Mælk',
|
||||
'Chocolate sauce' => 'Chokoladesauce',
|
||||
'Milliliters' => 'Milliliter',
|
||||
'Milliliter' => 'Milliliter',
|
||||
'Bottom' => 'Bund',
|
||||
'Topping' => 'Topping',
|
||||
'French' => 'Fransk',
|
||||
'Turkish' => 'Turkish',
|
||||
'Spanish' => 'Spanish',
|
||||
'Russian' => 'Russian'
|
||||
);
|
8
localization/da/stock_transaction_types.php
Normal file
8
localization/da/stock_transaction_types.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
'purchase' => 'Køb',
|
||||
'consume' => 'Brug',
|
||||
'inventory-correction' => 'Beholdningsrettelse',
|
||||
'product-opened' => 'Produkt åbnet'
|
||||
);
|
348
localization/da/strings.php
Normal file
348
localization/da/strings.php
Normal file
@@ -0,0 +1,348 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
'Stock overview' => 'Beholdnings oversigt',
|
||||
'#1 products expiring within the next #2 days' => '#1 produkter der udløber inden for de næste #2 dage',
|
||||
'#1 products are already expired' => '#1 produkter er allerede udløbede',
|
||||
'#1 products are below defined min. stock amount' => 'Beholdningen af #1 produkter er under minimums antallet',
|
||||
'Product' => 'Produkt',
|
||||
'Amount' => 'Mængde',
|
||||
'Next best before date' => 'Næste bedst før dato',
|
||||
'Logout' => 'Log ud',
|
||||
'Chores overview' => 'Pligt oversigt',
|
||||
'Batteries overview' => 'Batteri oversigt',
|
||||
'Purchase' => 'Køb',
|
||||
'Consume' => 'Brug',
|
||||
'Inventory' => 'Beholdning',
|
||||
'Shopping list' => 'Indkøbsliste',
|
||||
'Chore tracking' => 'Pligt overvågning',
|
||||
'Battery tracking' => 'Batteri overvågning',
|
||||
'Products' => 'Produkter',
|
||||
'Locations' => 'Steder',
|
||||
'Quantity units' => 'Mængde enheder',
|
||||
'Chores' => 'Pligter',
|
||||
'Batteries' => 'Batterier',
|
||||
'Chore' => 'Pligt',
|
||||
'Next estimated tracking' => 'Next estimated tracking',
|
||||
'Last tracked' => 'Sidst overvåget',
|
||||
'Battery' => 'Batteri',
|
||||
'Last charged' => 'Sidst opladt',
|
||||
'Next planned charge cycle' => 'Næste planlagte opladning',
|
||||
'Best before' => 'Bedst før',
|
||||
'OK' => 'OK',
|
||||
'Product overview' => 'Produkt oversigt',
|
||||
'Stock quantity unit' => 'Standard enhed',
|
||||
'Stock amount' => 'Standard mængde',
|
||||
'Last purchased' => 'Sidst købt',
|
||||
'Last used' => 'Sidst brugt',
|
||||
'Spoiled' => 'Udløbet',
|
||||
'Barcode lookup is disabled' => 'Stregkode opslag er slået fra',
|
||||
'will be added to the list of barcodes for the selected product on submit' => 'Bliver tilføjet til stregkodelisten for det valgte produkt når du sender',
|
||||
'New amount' => 'Ny mængde',
|
||||
'Note' => 'Note',
|
||||
'Tracked time' => 'Overvåget tid',
|
||||
'Chore overview' => 'Pligt oversigt',
|
||||
'Tracked count' => 'Antal overvågede',
|
||||
'Battery overview' => 'Batteri oversigt',
|
||||
'Charge cycles count' => 'Antal opladninger',
|
||||
'Create shopping list item' => 'Lav indkøbsliste punkt',
|
||||
'Edit shopping list item' => 'Ændr indkøbsliste punkt',
|
||||
'Save' => 'Gem',
|
||||
'Add' => 'Tilføj',
|
||||
'Name' => 'Navn',
|
||||
'Location' => 'Sted',
|
||||
'Min. stock amount' => 'Mindste beholdning',
|
||||
'QU purchase' => 'QU køb',
|
||||
'QU stock' => 'QU beholdning',
|
||||
'QU factor' => 'QU factor',
|
||||
'Description' => 'Beskrivelse',
|
||||
'Create product' => 'Lav produkt',
|
||||
'Barcode(s)' => 'Stegkode(r)',
|
||||
'Minimum stock amount' => 'Minimum mængde',
|
||||
'Default best before days' => 'Standard bedst før dage',
|
||||
'Quantity unit purchase' => 'Quantity unit purchase',
|
||||
'Quantity unit stock' => 'Quantity unit stock',
|
||||
'Factor purchase to stock quantity unit' => 'Factor purchase to stock quantity unit',
|
||||
'Create location' => 'Lav placering',
|
||||
'Create quantity unit' => 'Lav mængde enhed',
|
||||
'Period type' => 'Periode type',
|
||||
'Period days' => 'Period days',
|
||||
'Create chore' => 'Lav pligt',
|
||||
'Used in' => 'Brugt i',
|
||||
'Create battery' => 'Lav batteri',
|
||||
'Edit battery' => 'Ændr batteri',
|
||||
'Edit chore' => 'Ændr pligt',
|
||||
'Edit quantity unit' => 'Ændr mængde enhed',
|
||||
'Edit product' => 'Ændr produkt',
|
||||
'Edit location' => 'Ændr placering',
|
||||
'Record data' => 'Optag data',
|
||||
'Manage master data' => 'Manage master data',
|
||||
'This will apply to added products' => 'Dette vil gælde tilføjede produkter',
|
||||
'never' => 'aldrig',
|
||||
'Add products that are below defined min. stock amount' => 'Tilføj produkter der er under minimumsantallet',
|
||||
'For purchases this amount of days will be added to today for the best before date suggestion' => 'For purchases this amount of days will be added to today for the best before date suggestion',
|
||||
'This means 1 #1 purchased will be converted into #2 #3 in stock' => 'Dette betyder at 1 #1 bliver lavet om til #2 #3 i beholdningen',
|
||||
'Login' => 'Login',
|
||||
'Username' => 'Brugernavn',
|
||||
'Password' => 'Kode',
|
||||
'Invalid credentials, please try again' => 'Ugyldige informationer, prøv igen',
|
||||
'Are you sure to delete battery "#1"?' => 'Er du sikker på du vil slette batteriet "#1"?',
|
||||
'Yes' => 'Ja',
|
||||
'No' => 'Nej',
|
||||
'Are you sure to delete chore "#1"?' => 'Er du sikker på du vil slette pligten "#1"?',
|
||||
'"#1" could not be resolved to a product, how do you want to proceed?' => '"#1" kunne ikke findes som produkt. Hvordan vil du fortsætte?',
|
||||
'Create or assign product' => 'Lav eller tilknyt produkt',
|
||||
'Cancel' => 'Afbryd',
|
||||
'Add as new product' => 'Tilføj som nyt produkt',
|
||||
'Add as barcode to existing product' => 'Tilføj som stregkode til et eksisterende produkt',
|
||||
'Add as new product and prefill barcode' => 'Tilføj som nyt produkt og udfyld stregkoden på forhånd',
|
||||
'Are you sure to delete quantity unit "#1"?' => 'Er du sikker på du vil slette mængde enheden "#1"?',
|
||||
'Are you sure to delete product "#1"?' => 'Er du sikker på du vil slette produktet "#1"?',
|
||||
'Are you sure to delete location "#1"?' => 'Er du sikker på du vil slette placeringen "#1"?',
|
||||
'Manage API keys' => 'Styr API nøgler',
|
||||
'REST API & data model documentation' => 'REST API & datamodel dokumentation',
|
||||
'API keys' => 'API nøgler',
|
||||
'Create new API key' => 'Lav ny API nøgle',
|
||||
'API key' => 'API nøgle',
|
||||
'Expires' => 'Udløber',
|
||||
'Created' => 'Lavet',
|
||||
'This product is not in stock' => 'Dette produkt er ikke i beholdningen',
|
||||
'This means #1 will be added to stock' => 'Dette betyder #1 bliver tilføjet til beholdningen',
|
||||
'This means #1 will be removed from stock' => 'Dette betyder at #1 bliver fjernet fra beholdningen',
|
||||
'This means it is estimated that a new execution of this chore is tracked #1 days after the last was tracked' => 'This means it is estimated that a new execution of this chore is tracked #1 days after the last was tracked',
|
||||
'Removed #1 #2 of #3 from stock' => 'Fjernede #1 #2 af #3 fra beholdningen',
|
||||
'About grocy' => 'Omkring Grocy',
|
||||
'Close' => 'Luk',
|
||||
'#1 batteries are due to be charged within the next #2 days' => '#1 batterier skal oplades indenfor de næste #2 dage',
|
||||
'#1 batteries are overdue to be charged' => '#1 batterier trænger til at blive opladt',
|
||||
'#1 chores are due to be done within the next #2 days' => '#1 pligter skal udfyldes indenfor de næste #2 dage',
|
||||
'#1 chores are overdue to be done' => '#1 pligter skulle have været gjort',
|
||||
'Released on' => 'Released on',
|
||||
'Consume #3 #1 of #2' => 'Brug #3 #1 af #2',
|
||||
'Added #1 #2 of #3 to stock' => 'Tilføjede #1 #2 af #3 til beholdningen',
|
||||
'Stock amount of #1 is now #2 #3' => 'Mængden af #1 er nu #2 #3',
|
||||
'Tracked execution of chore #1 on #2' => 'Overvågede udførslen af pligt #1 på #2',
|
||||
'Tracked charge cycle of battery #1 on #2' => 'Tracked charge cycle of battery #1 on #2',
|
||||
'Consume all #1 which are currently in stock' => 'Brug alle #1 i beholdningen',
|
||||
'All' => 'Alle',
|
||||
'Track charge cycle of battery #1' => 'Overvåg opladningscyklus af batteri #1',
|
||||
'Track execution of chore #1' => 'Track execution of chore #1',
|
||||
'Filter by location' => 'Filtre med placering',
|
||||
'Search' => 'Søg',
|
||||
'Not logged in' => 'Ikke logget ind',
|
||||
'You have to select a product' => 'Du skal vælge et produkt',
|
||||
'You have to select a chore' => 'Du skal vælge en pligt',
|
||||
'You have to select a battery' => 'Du skal vælge et batteri',
|
||||
'A name is required' => 'Du skal vælge et navn',
|
||||
'A location is required' => 'Du skal vælge en placering',
|
||||
'The amount cannot be lower than #1' => 'Mængden kan ikek kvære lavere end #1',
|
||||
'This cannot be negative' => 'Dette kan ikke være negativt',
|
||||
'A quantity unit is required' => 'Du skal vælge en enhed for mængden',
|
||||
'A period type is required' => 'Du skal vælge en slags periode',
|
||||
'A best before date is required and must be later than today' => 'Du skal vælge en bedst før dato som er senere end i dag',
|
||||
'Settings' => 'Indstillinger',
|
||||
'This can only be before now' => 'Dette skal være før nu',
|
||||
'Calendar' => 'Kalender',
|
||||
'Recipes' => 'Opskrifter',
|
||||
'Edit recipe' => 'Ændr opskrift',
|
||||
'New recipe' => 'Ny opskrift',
|
||||
'Ingredients list' => 'Ingrediens liste',
|
||||
'Add recipe ingredient' => 'Tilføj ingrediens til opskrift',
|
||||
'Edit recipe ingredient' => 'Ændr ingrediens til opskrift',
|
||||
'Are you sure to delete recipe "#1"?' => 'Er du sikker på du vil slette opskriften "#1"?',
|
||||
'Are you sure to delete recipe ingredient "#1"?' => 'Er du sikker på du vil slette ingrediensen "#1" fra opskriften?',
|
||||
'Are you sure to empty the shopping list?' => 'Er du sikker på du vil tømme indkøbslisten?',
|
||||
'Clear list' => 'Ryd liste',
|
||||
'Requirements fulfilled' => 'Skal udfyldes',
|
||||
'Put missing products on shopping list' => 'Sæt manglende produkter på en indkøbsliste',
|
||||
'Not enough in stock, #1 ingredients missing' => 'Der er ikke nok i beholdningen. Der mangler #1 ingredienser. ',
|
||||
'Enough in stock' => 'Der er nok i beholdningen',
|
||||
'Not enough in stock, #1 ingredients missing but already on the shopping list' => 'Der er ikke nok i beholdningen. Der mangler #1 ingredienser som allerede er på indkøbslisten',
|
||||
'Expand to fullscreen' => 'Udvid til fuldskærm',
|
||||
'Ingredients' => 'Ingredienser',
|
||||
'Preparation' => 'Tilberedning',
|
||||
'Recipe' => 'Opskrift',
|
||||
'Not enough in stock, #1 missing, #2 already on shopping list' => 'Der er ikke nok i beholdningen. Der mangler #1, #2 er allerede i beholdningen',
|
||||
'Show notes' => 'Vis noter',
|
||||
'Put missing amount on shopping list' => 'Put manglende mængde på indkøbsliste',
|
||||
'Are you sure to put all missing ingredients for recipe "#1" on the shopping list?' => 'Er du sikker på du vil sætte alle manglende ingredienser til "#1" på indkøbslisten?',
|
||||
'Added for recipe #1' => 'Tilføjet til opskriften #1',
|
||||
'Manage users' => 'Manage users',
|
||||
'User' => 'Bruger',
|
||||
'Users' => 'Brugere',
|
||||
'Are you sure to delete user "#1"?' => 'Er du sikker på du vil slette brugeren "#1"?',
|
||||
'Create user' => 'Lav bruger',
|
||||
'Edit user' => 'Ændr bruger',
|
||||
'First name' => 'First name',
|
||||
'Last name' => 'Last name',
|
||||
'A username is required' => 'A username is required',
|
||||
'Confirm password' => 'Confirm password',
|
||||
'Passwords do not match' => 'Passwords do not match',
|
||||
'Change password' => 'Change password',
|
||||
'Done by' => 'Done by',
|
||||
'Last done by' => 'Last done by',
|
||||
'Unknown' => 'Unknown',
|
||||
'Filter by chore' => 'Filter by chore',
|
||||
'Chores journal' => 'Chores journal',
|
||||
'0 means suggestions for the next charge cycle are disabled' => '0 means suggestions for the next charge cycle are disabled',
|
||||
'Charge cycle interval (days)' => 'Charge cycle interval (days)',
|
||||
'Last price' => 'Last price',
|
||||
'Price history' => 'Price history',
|
||||
'No price history available' => 'No price history available',
|
||||
'Price' => 'Price',
|
||||
'in #1 per purchase quantity unit' => 'in #1 per purchase quantity unit',
|
||||
'The price cannot be lower than #1' => 'The price cannot be lower than #1',
|
||||
'#1 product expires within the next #2 days' => '#1 product expires within the next #2 days',
|
||||
'#1 product is already expired' => '#1 product is already expired',
|
||||
'#1 product is below defined min. stock amount' => '#1 product is below defined min. stock amount',
|
||||
'Unit' => 'Unit',
|
||||
'Units' => 'Units',
|
||||
'#1 chore is due to be done within the next #2 days' => '#1 chore is due to be done within the next #2 days',
|
||||
'#1 chore is overdue to be done' => '#1 chore is overdue to be done',
|
||||
'#1 battery is due to be charged within the next #2 days' => '#1 battery is due to be charged within the next #2 days',
|
||||
'#1 battery is overdue to be charged' => '#1 battery is overdue to be charged',
|
||||
'#1 unit was automatically added and will apply in addition to the amount entered here' => '#1 unit was automatically added and will apply in addition to the amount entered here',
|
||||
'in singular form' => 'in singular form',
|
||||
'in plural form' => 'in plural form',
|
||||
'Never expires' => 'Never expires',
|
||||
'This cannot be lower than #1' => 'This cannot be lower than #1',
|
||||
'-1 means that this product never expires' => '-1 means that this product never expires',
|
||||
'Quantity unit' => 'Quantity unit',
|
||||
'Only check if a single unit is in stock (a different quantity can then be used above)' => 'Only check if a single unit is in stock (a different quantity can then be used above)',
|
||||
'Are you sure to consume all ingredients needed by recipe "#1" (ingredients marked with "check only if a single unit is in stock" will be ignored)?' => 'Are you sure to consume all ingredients needed by recipe "#1" (ingredients marked with "check only if a single unit is in stock" will be ignored)?',
|
||||
'Removed all ingredients of recipe "#1" from stock' => 'Removed all ingredients of recipe "#1" from stock',
|
||||
'Consume all ingredients needed by this recipe' => 'Consume all ingredients needed by this recipe',
|
||||
'Click to show technical details' => 'Click to show technical details',
|
||||
'Error while saving, probably this item already exists' => 'Error while saving, probably this item already exists',
|
||||
'Error details' => 'Error details',
|
||||
'Tasks' => 'Tasks',
|
||||
'Show done tasks' => 'Show done tasks',
|
||||
'Task' => 'Task',
|
||||
'Due' => 'Due',
|
||||
'Assigned to' => 'Assigned to',
|
||||
'Mark task "#1" as completed' => 'Mark task "#1" as completed',
|
||||
'Uncategorized' => 'Uncategorized',
|
||||
'Task categories' => 'Task categories',
|
||||
'Create task' => 'Create task',
|
||||
'A due date is required' => 'A due date is required',
|
||||
'Category' => 'Category',
|
||||
'Edit task' => 'Edit task',
|
||||
'Are you sure to delete task "#1"?' => 'Are you sure to delete task "#1"?',
|
||||
'#1 task is due to be done within the next #2 days' => '#1 task is due to be done within the next #2 days',
|
||||
'#1 tasks are due to be done within the next #2 days' => '#1 tasks are due to be done within the next #2 days',
|
||||
'#1 task is overdue to be done' => '#1 task is overdue to be done',
|
||||
'#1 tasks are overdue to be done' => '#1 tasks are overdue to be done',
|
||||
'Edit task category' => 'Edit task category',
|
||||
'Create task category' => 'Create task category',
|
||||
'Product groups' => 'Product groups',
|
||||
'Ungrouped' => 'Ungrouped',
|
||||
'Create product group' => 'Create product group',
|
||||
'Edit product group' => 'Edit product group',
|
||||
'Product group' => 'Product group',
|
||||
'Are you sure to delete product group "#1"?' => 'Are you sure to delete product group "#1"?',
|
||||
'Stay logged in permanently' => 'Stay logged in permanently',
|
||||
'When not set, you will get logged out at latest after 30 days' => 'When not set, you will get logged out at latest after 30 days',
|
||||
'Filter by status' => 'Filter by status',
|
||||
'Below min. stock amount' => 'Below min. stock amount',
|
||||
'Expiring soon' => 'Expiring soon',
|
||||
'Already expired' => 'Already expired',
|
||||
'Due soon' => 'Due soon',
|
||||
'Overdue' => 'Overdue',
|
||||
'View settings' => 'View settings',
|
||||
'Auto reload on external changes' => 'Auto reload on external changes',
|
||||
'Enable night mode' => 'Enable night mode',
|
||||
'Auto enable in time range' => 'Auto enable in time range',
|
||||
'From' => 'From',
|
||||
'in format' => 'in format',
|
||||
'To' => 'To',
|
||||
'Time range goes over midnight' => 'Time range goes over midnight',
|
||||
'Product picture' => 'Product picture',
|
||||
'No file selected' => 'No file selected',
|
||||
'If you don\'t select a file, the current picture will not be altered' => 'If you don\'t select a file, the current picture will not be altered',
|
||||
'Delete' => 'Delete',
|
||||
'The current picture will be deleted when you save the product' => 'The current picture will be deleted when you save the product',
|
||||
'Select file' => 'Select file',
|
||||
'Image of product #1' => 'Image of product #1',
|
||||
'This product cannot be deleted because it is in stock, please remove the stock amount first.' => 'This product cannot be deleted because it is in stock, please remove the stock amount first.',
|
||||
'Delete not possible' => 'Delete not possible',
|
||||
'Equipment' => 'Equipment',
|
||||
'Instruction manual' => 'Instruction manual',
|
||||
'The selected equipment has no instruction manual' => 'The selected equipment has no instruction manual',
|
||||
'Notes' => 'Notes',
|
||||
'Edit equipment' => 'Edit equipment',
|
||||
'Create equipment' => 'Create equipment',
|
||||
'If you don\'t select a file, the current instruction manual will not be altered' => 'If you don\'t select a file, the current instruction manual will not be altered',
|
||||
'No instruction manual available' => 'No instruction manual available',
|
||||
'The current instruction manual will be deleted when you save the equipment' => 'The current instruction manual will be deleted when you save the equipment',
|
||||
'No picture available' => 'No picture available',
|
||||
'Filter by product group' => 'Filter by product group',
|
||||
'Presets for new products' => 'Presets for new products',
|
||||
'Included recipes' => 'Included recipes',
|
||||
'A recipe is required' => 'A recipe is required',
|
||||
'Add included recipe' => 'Add included recipe',
|
||||
'Edit included recipe' => 'Edit included recipe',
|
||||
'Group' => 'Group',
|
||||
'This will be used as a headline to group ingredients together' => 'This will be used as a headline to group ingredients together',
|
||||
'Journal' => 'Journal',
|
||||
'Stock journal' => 'Stock journal',
|
||||
'Filter by product' => 'Filter by product',
|
||||
'Booking time' => 'Booking time',
|
||||
'Booking type' => 'Booking type',
|
||||
'Undo booking' => 'Undo booking',
|
||||
'Undone on' => 'Undone on',
|
||||
'Batteries journal' => 'Batteries journal',
|
||||
'Filter by battery' => 'Filter by battery',
|
||||
'Undo charge cycle' => 'Undo charge cycle',
|
||||
'Undo chore execution' => 'Undo chore execution',
|
||||
'Chore execution successfully undone' => 'Chore execution successfully undone',
|
||||
'Undo' => 'Undo',
|
||||
'Booking successfully undone' => 'Booking successfully undone',
|
||||
'Charge cycle successfully undone' => 'Charge cycle successfully undone',
|
||||
'This cannot be negative and must be an integral number' => 'This cannot be negative and must be an integral number',
|
||||
'Disable stock fulfillment checking for this ingredient' => 'Disable stock fulfillment checking for this ingredient',
|
||||
'Add all list items to stock' => 'Add all list items to stock',
|
||||
'Add #3 #1 of #2 to stock' => 'Add #3 #1 of #2 to stock',
|
||||
'Adding shopping list item #1 of #2' => 'Adding shopping list item #1 of #2',
|
||||
'Use a specific stock item' => 'Use a specific stock item',
|
||||
'The first item in this list would be picked by the default rule which is "First expiring first, then first in first out"' => 'The first item in this list would be picked by the default rule which is "First expiring first, then first in first out"',
|
||||
'Mark #3 #1 of #2 as open' => 'Mark #3 #1 of #2 as open',
|
||||
'When a product was marked as opened, the best before date will be replaced by today + this amount of days (a value of 0 disables this)' => 'When a product was marked as opened, the best before date will be replaced by today + this amount of days (a value of 0 disables this)',
|
||||
'Default best before days after opened' => 'Default best before days after opened',
|
||||
'Marked #1 #2 of #3 as opened' => 'Marked #1 #2 of #3 as opened',
|
||||
'Mark as opened' => 'Mark as opened',
|
||||
'Expires on #1; Bought on #2' => 'Expires on #1; Bought on #2',
|
||||
'Not opened' => 'Not opened',
|
||||
'Opened' => 'Opened',
|
||||
'Mark #3 #1 of #2 as open' => 'Mark #3 #1 of #2 as open',
|
||||
'#1 opened' => '#1 opened',
|
||||
'Product expires' => 'Product expires',
|
||||
'Task due' => 'Task due',
|
||||
'Chore due' => 'Chore due',
|
||||
'Battery charge cycle due' => 'Battery charge cycle due',
|
||||
'Show clock in header' => 'Show clock in header',
|
||||
'Stock settings' => 'Stock settings',
|
||||
'Shopping list to stock workflow' => 'Shopping list to stock workflow',
|
||||
'Automatically do the booking using the last price and the amount of the shopping list item, if the product has "Default best before days" set' => 'Automatically do the booking using the last price and the amount of the shopping list item, if the product has "Default best before days" set',
|
||||
'Skip' => 'Skip',
|
||||
'Servings' => 'Servings',
|
||||
'Costs' => 'Costs',
|
||||
'Based on the prices of the last purchase per product' => 'Based on the prices of the last purchase per product',
|
||||
'The ingredients listed here result in this amount of servings' => 'The ingredients listed here result in this amount of servings',
|
||||
'Do not check against the shopping list when adding missing items to it' => 'Do not check against the shopping list when adding missing items to it',
|
||||
'By default the amount to be added to the shopping list is "needed amount - stock amount - shopping list amount" - when this is enabled, it is only checked against the stock amount, not against what is already on the shopping list' => 'By default the amount to be added to the shopping list is "needed amount - stock amount - shopping list amount" - when this is enabled, it is only checked against the stock amount, not against what is already on the shopping list',
|
||||
'Picture' => 'Picture',
|
||||
'Uncheck ingredients to not put them on the shopping list' => 'Uncheck ingredients to not put them on the shopping list',
|
||||
'This is for statistical purposes only' => 'This is for statistical purposes only',
|
||||
'You have to select a recipe' => 'You have to select a recipe',
|
||||
'Key type' => 'Key type',
|
||||
'Share/Integrate calendar (iCal)' => 'Share/Integrate calendar (iCal)',
|
||||
'Use the following (public) URL to share or integrate the calendar in iCal format' => 'Use the following (public) URL to share or integrate the calendar in iCal format',
|
||||
'Allow partial units in stock' => 'Allow partial units in stock',
|
||||
'Enable tare weight handling' => 'Enable tare weight handling',
|
||||
'This is useful e.g. for flour in jars - on purchase/consume/inventory you always weigh the whole jar, the amount to be posted is then automatically calculated based on what is in stock and the tare weight defined below' => 'This is useful e.g. for flour in jars - on purchase/consume/inventory you always weigh the whole jar, the amount to be posted is then automatically calculated based on what is in stock and the tare weight defined below',
|
||||
'Tare weight' => 'Tare weight',
|
||||
'Tare weight handling enabled - please weigh the whole container, the amount to be posted will be automatically calculcated' => 'Tare weight handling enabled - please weigh the whole container, the amount to be posted will be automatically calculcated',
|
||||
'You have to select a location' => 'You have to select a location',
|
||||
'List' => 'List',
|
||||
'Gallery' => 'Gallery'
|
||||
);
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user