Compare commits
602 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
8676b86575 | ||
|
6036786153 | ||
|
88950f00d5 | ||
|
f90ced5a39 | ||
|
2b2dd0568b | ||
|
3f60a2b5fa | ||
|
3070448555 | ||
|
80a873da3e | ||
|
e8f76e5694 | ||
|
fa49b449dd | ||
|
121050960c | ||
|
bb0cc50ffc | ||
|
e1967bd603 | ||
|
a5c2157320 | ||
|
ff056f8d81 | ||
|
af4715e17f | ||
|
68aad90a59 | ||
|
24c9247663 | ||
|
7e2f30396f | ||
|
e8dc334758 | ||
|
f1bc2cc40f | ||
|
c0d0b8fc90 | ||
|
d883474f03 | ||
|
c396c2a84c | ||
|
52e2c6d480 | ||
|
2fbd559105 | ||
|
58c6b72d77 | ||
|
dfe9868a48 | ||
|
06968ac289 | ||
|
9b52168b94 | ||
|
54d91b8b76 | ||
|
312dd8a200 | ||
|
57d70851c8 | ||
|
5b53175ed6 | ||
|
721a0ce417 | ||
|
0b532f7624 | ||
|
e64df711e2 | ||
|
8cb9157c73 | ||
|
b57ba59243 | ||
|
a85af22d6a | ||
|
9b2c96c085 | ||
|
a80e048c2d | ||
|
bef261d869 | ||
|
dbf660f953 | ||
|
2de87eb446 | ||
|
9498dd9c67 | ||
|
7cb19f2c66 | ||
|
8faa76e965 | ||
|
264ed3887a | ||
|
fe92caaed4 | ||
|
48e9467a99 | ||
|
27582611c1 | ||
|
337ca7d4ba | ||
|
1ef64025c5 | ||
|
cd41c27ee1 | ||
|
fd7a4e02be | ||
|
3d3e4bac75 | ||
|
3b8944d61b | ||
|
6da637ab66 | ||
|
e757cab0da | ||
|
aeae1b0db3 | ||
|
dd966fd198 | ||
|
dfdf45fa56 | ||
|
af7de61c43 | ||
|
5406448be0 | ||
|
e21875bf2a | ||
|
a5e3442602 | ||
|
9c1fd176c0 | ||
|
8ab511361a | ||
|
845e69fb96 | ||
|
c4388a6f8f | ||
|
6ad761e067 | ||
|
900a49a36a | ||
|
44c6865ba1 | ||
|
5e30e89737 | ||
|
0152f1c69d | ||
|
00ac935367 | ||
|
d4bd6b2fb3 | ||
|
f7eb8cc127 | ||
|
c0a727fcfc | ||
|
e9421e9102 | ||
|
04d6496c05 | ||
|
893cfe13cd | ||
|
150cfba455 | ||
|
632db0d8d1 | ||
|
e0c72c05c2 | ||
|
01a43f59ca | ||
|
e1928a7265 | ||
|
73e539604f | ||
|
35474f2466 | ||
|
ca77ba6d19 | ||
|
6ecf94073d | ||
|
cefc1b7b9c | ||
|
cab34df2d6 | ||
|
e91fa02974 | ||
|
59277c898a | ||
|
36b8309943 | ||
|
76d6342156 | ||
|
4da546fc80 | ||
|
af4dd446ab | ||
|
5df81a74c6 | ||
|
03bba4b9e5 | ||
|
adaa54ba8b | ||
|
4d4ae9812b | ||
|
59cd071512 | ||
|
a676e06c65 | ||
|
bbaaf4c17d | ||
|
efbb0ebf6a | ||
|
6f5eb42f2a | ||
|
cca35a302c | ||
|
e336f24225 | ||
|
d871fe7aa8 | ||
|
b6d7ef403c | ||
|
7ddfe83ffa | ||
|
70f5e616c1 | ||
|
61ed756dd0 | ||
|
e69e7a9a9a | ||
|
5c6f84a68e | ||
|
3091a06194 | ||
|
49a2b8232f | ||
|
d4eb5f07db | ||
|
97626b4a59 | ||
|
3efecb8bed | ||
|
a5294262e6 | ||
|
34859ada02 | ||
|
35ed7299af | ||
|
2042db29ee | ||
|
3e4f2eaf5d | ||
|
6a50f74a14 | ||
|
7ad979cba9 | ||
|
a5ff947936 | ||
|
05485b3a4c | ||
|
8c1deefebf | ||
|
ba289d6e6a | ||
|
f7c33a4579 | ||
|
ebfc55064e | ||
|
ccc59dfc8b | ||
|
b53d1a076f | ||
|
cd60c239af | ||
|
fbb84277bf | ||
|
77d75d16df | ||
|
62fcc89ddc | ||
|
d3a39270de | ||
|
2983687f34 | ||
|
8e68477a78 | ||
|
91b984d52d | ||
|
acebed5aae | ||
|
f41a219760 | ||
|
fa07b861ad | ||
|
d65734c896 | ||
|
033cd306c1 | ||
|
585ec1212d | ||
|
7c3e7daa56 | ||
|
81b54182de | ||
|
6aae97de73 | ||
|
f0db2a7709 | ||
|
9db66048d1 | ||
|
5dc745f301 | ||
|
00466972e2 | ||
|
bda230537a | ||
|
dce14b8999 | ||
|
23f285c3fb | ||
|
790368cdf4 | ||
|
e2c1d2e226 | ||
|
a4b1a80cdc | ||
|
0ba1a82e01 | ||
|
7ea9984fd3 | ||
|
7532626123 | ||
|
632a542236 | ||
|
1a82d0599c | ||
|
620f938065 | ||
|
54a8c331c2 | ||
|
45d1c87975 | ||
|
cc2a137783 | ||
|
bab0e1d5fb | ||
|
a027077211 | ||
|
5bfdddd52b | ||
|
777fcbae77 | ||
|
8abb55b058 | ||
|
823088b9cd | ||
|
1aa7db9c2a | ||
|
e220b3e9f3 | ||
|
01c7d4e49a | ||
|
486a58909d | ||
|
db43a4bf3a | ||
|
424bfa9313 | ||
|
926b7d8aea | ||
|
e9a7b10730 | ||
|
8338421912 | ||
|
21d5952950 | ||
|
c5b47badad | ||
|
66bd3f0d59 | ||
|
2457c2c2fd | ||
|
d38a5efb3d | ||
|
6aa3dcc44a | ||
|
37744822d8 | ||
|
1344e84534 | ||
|
8e3a9d6c04 | ||
|
9b2a551ee4 | ||
|
f52b8e11bb | ||
|
79b2dc3ed8 | ||
|
222c518a5f | ||
|
51fdefaede | ||
|
a5a53d1d1e | ||
|
8e033d035a | ||
|
88452a187c | ||
|
cfaf2838d4 | ||
|
107f51f4ae | ||
|
c304578443 | ||
|
84476ad093 | ||
|
0f7d57d0a0 | ||
|
b2b04c843d | ||
|
296897d91a | ||
|
a7cc867cf0 | ||
|
69a7ea6057 | ||
|
091a93ff4e | ||
|
f88bad4bde | ||
|
7d4c9fefa9 | ||
|
10d7d44825 | ||
|
c9a2041fae | ||
|
0d1f2ad09d | ||
|
aaf248c1b3 | ||
|
ce74062a9f | ||
|
61a1b1428a | ||
|
411dbabc90 | ||
|
66cf7e4ffa | ||
|
4279bf6445 | ||
|
dd36301460 | ||
|
d1d52aea44 | ||
|
12e5377c40 | ||
|
28f7700dac | ||
|
9eb46df517 | ||
|
e6a6d7ae42 | ||
|
da54b945da | ||
|
7e6efb4a14 | ||
|
fa3e705673 | ||
|
cf52e5ec96 | ||
|
04a3069294 | ||
|
8f7f88c8ad | ||
|
aef646e9df | ||
|
dfd6262f4a | ||
|
49f44d241b | ||
|
f6c750a1ea | ||
|
1950e4b513 | ||
|
c190002ebb | ||
|
3b3f079754 | ||
|
dfc274643f | ||
|
e3808c71b9 | ||
|
187654d8b3 | ||
|
8ec0d9319b | ||
|
ec75779bf3 | ||
|
894568d2ee | ||
|
c1952e98bc | ||
|
789e6a5291 | ||
|
ae5fad290f | ||
|
003a416b74 | ||
|
3a6f04f770 | ||
|
0b36d02aa1 | ||
|
5f8299cf4a | ||
|
ad0dbdfc22 | ||
|
8455b5a64a | ||
|
a711bbd8f6 | ||
|
3e20c2cc3d | ||
|
1e8a1d7ffb | ||
|
c8c63bea5d | ||
|
4ea20ce076 | ||
|
b2eec2b111 | ||
|
8876c6cf95 | ||
|
98bf36dbc8 | ||
|
b83e4f53b1 | ||
|
33ca6070f4 | ||
|
c2b675eb06 | ||
|
e552f4b730 | ||
|
12f6296c75 | ||
|
3842f05ce9 | ||
|
4d21668265 | ||
|
693dcc1020 | ||
|
f5562602f0 | ||
|
86aa8f19f7 | ||
|
43ba3b4920 | ||
|
6070507b04 | ||
|
fc413a05d1 | ||
|
89b87156de | ||
|
a7f3f64d89 | ||
|
10bd5ce900 | ||
|
a6ffe8480a | ||
|
2a2335c8f4 | ||
|
4338ccc132 | ||
|
f2bef554a4 | ||
|
ab53a157e4 | ||
|
beae32ef23 | ||
|
787c885ccf | ||
|
286351b6d2 | ||
|
29371163ad | ||
|
3f88b8dfa2 | ||
|
1c161b2b29 | ||
|
5ea8ec2dda | ||
|
eb8c9848eb | ||
|
2b97ac7c1c | ||
|
3c656ba618 | ||
|
edddfe234c | ||
|
8105dea17f | ||
|
dc1954cb05 | ||
|
ea63246a12 | ||
|
196bdbe246 | ||
|
01ddeb4dfd | ||
|
282168f92c | ||
|
3c74d92eb0 | ||
|
fe622cacb2 | ||
|
5ddb438134 | ||
|
35469c3d98 | ||
|
b32a26cf7e | ||
|
bed7965989 | ||
|
19ff782c00 | ||
|
cebb368a28 | ||
|
038917b030 | ||
|
04d826943c | ||
|
e0735ce2e4 | ||
|
849c281912 | ||
|
c06bb7784a | ||
|
b9fff4954a | ||
|
7aa9e5748e | ||
|
6175afa6be | ||
|
5563e7ed4c | ||
|
305f846dbf | ||
|
3f850c540b | ||
|
2c3af45f5c | ||
|
230901a28a | ||
|
30e1a5c9b0 | ||
|
616e1dd5d7 | ||
|
a323bca9ec | ||
|
14bb04d285 | ||
|
edd372f8c4 | ||
|
b4a7642af5 | ||
|
580f49e69f | ||
|
22db124624 | ||
|
e88294eb40 | ||
|
ae3bacf8fe | ||
|
90305ca8d7 | ||
|
3967b28481 | ||
|
2d67adedd7 | ||
|
ef271c6247 | ||
|
2c0b6368e1 | ||
|
1d5ca5ed64 | ||
|
4d0c5502a1 | ||
|
a0cf58b974 | ||
|
61a58ddef0 | ||
|
3608eec8fb | ||
|
cebf7a3e54 | ||
|
23be96b5d6 | ||
|
7f70f0ec07 | ||
|
8e552f1146 | ||
|
95cb9ffb90 | ||
|
d23f730a0b | ||
|
b539c93319 | ||
|
eecb321086 | ||
|
1891bc6f32 | ||
|
10c1ccd6e4 | ||
|
12af9a944b | ||
|
1fafd32aaf | ||
|
9f9b9d864e | ||
|
a79247a30c | ||
|
53e405c4f8 | ||
|
cf382bb47f | ||
|
8225215e39 | ||
|
f47ca963ab | ||
|
d871ed7b53 | ||
|
3e31450532 | ||
|
5478bec2c7 | ||
|
edfa404ed6 | ||
|
2d1d5d46f6 | ||
|
45fe6a6362 | ||
|
23f697f812 | ||
|
263181baa0 | ||
|
9132e222fe | ||
|
2bc108fe3e | ||
|
02d0121f4d | ||
|
b5acb4c49b | ||
|
cd05a95a0f | ||
|
2d2700cacb | ||
|
1bacd8e13d | ||
|
f6986fac18 | ||
|
8b6f882edc | ||
|
91d8eaeb74 | ||
|
8d2c3ae584 | ||
|
18e8fc8293 | ||
|
e1c702f3d0 | ||
|
71cede74a3 | ||
|
7b0bc9e472 | ||
|
8cb8611b4f | ||
|
c048f403e6 | ||
|
4aee175105 | ||
|
cf8604e984 | ||
|
cdf6ac78e2 | ||
|
70433aace5 | ||
|
247221950d | ||
|
866d6647d2 | ||
|
f1da3ef5e8 | ||
|
2cc4f4d382 | ||
|
6659a5cd08 | ||
|
21c221b520 | ||
|
55807bfc94 | ||
|
696e9b3e28 | ||
|
198216f38b | ||
|
27b46e1abf | ||
|
7380175093 | ||
|
1ad0360e42 | ||
|
2503590463 | ||
|
40e16db01f | ||
|
684aef0a42 | ||
|
dd9cae5482 | ||
|
7ee15946c7 | ||
|
6660e1ff73 | ||
|
2847908523 | ||
|
9b37c450ed | ||
|
003aea6047 | ||
|
9d1440fb45 | ||
|
832d83dfde | ||
|
90a0caf1dc | ||
|
d3c134e13f | ||
|
269ae34db3 | ||
|
8ff8c1ac5d | ||
|
2638bce851 | ||
|
72e6ed76bf | ||
|
8348438148 | ||
|
338a5016cf | ||
|
11b71e3af2 | ||
|
8c5c12cb47 | ||
|
8b977644f7 | ||
|
7595d640f5 | ||
|
14cd6ca3bf | ||
|
633b26bf7e | ||
|
1ead23cb87 | ||
|
6530d0f9df | ||
|
135ac118b0 | ||
|
70d51c757b | ||
|
ffad8bfa7f | ||
|
ffc5ba013f | ||
|
aaa054e0a5 | ||
|
54bf7ed659 | ||
|
6462dd8af6 | ||
|
079437384e | ||
|
10fcd9177c | ||
|
b0d38b87de | ||
|
d9470cb377 | ||
|
b4ce0555d9 | ||
|
9ba7ee54a7 | ||
|
cb24a7149f | ||
|
9abb92763d | ||
|
54d4c90ec4 | ||
|
76037d1f4e | ||
|
735743047f | ||
|
82c474d0ae | ||
|
0dc37fb361 | ||
|
734e174442 | ||
|
4086a63ebd | ||
|
f2a0b7cded | ||
|
bda40dfbb9 | ||
|
fbb0064505 | ||
|
4b02ac8f35 | ||
|
47c936e026 | ||
|
bcf963ac49 | ||
|
765ba77621 | ||
|
0f88eed08c | ||
|
766eae5a7a | ||
|
90b8ea15ff | ||
|
34ffb96ae3 | ||
|
74d745cfc4 | ||
|
cc9345136c | ||
|
5ba9bbbcd1 | ||
|
cae924eb81 | ||
|
187d48f93d | ||
|
9f833b9bd5 | ||
|
b856911f0f | ||
|
d18a8d8b56 | ||
|
416c138017 | ||
|
76cfe7fece | ||
|
7587ead732 | ||
|
69f8c237ff | ||
|
b8e15b990b | ||
|
35fb87ab1e | ||
|
acb81187d9 | ||
|
5153818b4e | ||
|
5c3809aa33 | ||
|
95d212a076 | ||
|
7133c85deb | ||
|
7ab59273da | ||
|
33ea1e56cf | ||
|
b7a6b91039 | ||
|
e646dd9332 | ||
|
30e5cc3bc3 | ||
|
e44f4802d5 | ||
|
9ef48e79cd | ||
|
3acad5056a | ||
|
44d6173569 | ||
|
9a0cad079c | ||
|
f5da53a761 | ||
|
f8fa5db3e7 | ||
|
5e189c8a4a | ||
|
9e3c68982b | ||
|
b3ed80d186 | ||
|
a4f7aac963 | ||
|
c45034e6b1 | ||
|
5ad4d9f421 | ||
|
eb135aee39 | ||
|
fe59fac1c3 | ||
|
26979a4321 | ||
|
a0e5f45da3 | ||
|
739379fabb | ||
|
96fff2e5f4 | ||
|
2471e78188 | ||
|
d23fda245e | ||
|
791a17fcad | ||
|
dabc48fed3 | ||
|
980778e599 | ||
|
68c5fd0617 | ||
|
7bbcec91aa | ||
|
c483c34598 | ||
|
906a9db628 | ||
|
5583074001 | ||
|
e4c8f6b023 | ||
|
4555bf3b63 | ||
|
2aca551692 | ||
|
f5eff8ab49 | ||
|
36f5fb23e9 | ||
|
33dcd17fbd | ||
|
3d82c9abbd | ||
|
779ac31ffe | ||
|
0a6c7d73a7 | ||
|
fc05044353 | ||
|
55ac768521 | ||
|
a455a01204 | ||
|
8b963ae0f1 | ||
|
a1adc80c29 | ||
|
760914bf82 | ||
|
42689ecefe | ||
|
c889416c0a | ||
|
bfb5525ec1 | ||
|
20380faeb3 | ||
|
5ecd3a585e | ||
|
bfa3347a20 | ||
|
e42f4b405d | ||
|
27169e1428 | ||
|
4a4d9c451f | ||
|
ced709bbf9 | ||
|
4a8d4120e1 | ||
|
8f877dc716 | ||
|
45abc99a77 | ||
|
d78e156609 | ||
|
030939e013 | ||
|
a646f2c6bd | ||
|
4e1531e4ee | ||
|
7d07b382fd | ||
|
621bbf79ab | ||
|
65f0253307 | ||
|
fdeb4fd4d7 | ||
|
97fdb0553c | ||
|
bd21e3a8d6 | ||
|
966211b71a | ||
|
fe665ac766 | ||
|
43ef9b793b | ||
|
8c0ff04caa | ||
|
c57e554369 | ||
|
c65f375a68 | ||
|
1459f8c441 | ||
|
1e27f6c127 | ||
|
97b93f23bd | ||
|
5cd3fb092a | ||
|
200964edff | ||
|
17a4d04053 | ||
|
d79adc4660 | ||
|
9f1692e31f | ||
|
d9e42331f9 | ||
|
87754830f7 | ||
|
278a5f004a | ||
|
b6139a6991 | ||
|
6263715c53 | ||
|
b7349e287e | ||
|
7e8f460dad | ||
|
6fcc0636e8 | ||
|
447b86b27f | ||
|
590cbd2460 | ||
|
d8069c569e | ||
|
4766c81580 | ||
|
2e3c237648 | ||
|
bd185cfa32 | ||
|
80acc7deea | ||
|
2f8207ab5f | ||
|
c9f40782de | ||
|
904848d09a | ||
|
97b95803b8 | ||
|
f1efd08bc6 | ||
|
5f09d4def1 | ||
|
cf05be35fe | ||
|
937bd6b702 | ||
|
159ab253dd | ||
|
b42bcaaa44 | ||
|
2afa0c304d | ||
|
affe7de842 | ||
|
c54ae89212 | ||
|
7ba48d5160 | ||
|
9d76859469 |
@@ -10,9 +10,9 @@ for /f "tokens=*" %%a in ('jq .Version versiontemp.json --raw-output') do set ve
|
||||
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
|
||||
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!docs
|
||||
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\*
|
||||
7za d "%releasePath%\grocy_%version%.zip" data\*.* data\storage data\viewcache\* changelog\__TEMPLATE.md
|
||||
7za a "%releasePath%\grocy_%version%.zip" "%projectPath%\data\.htaccess"
|
||||
7za rn "%releasePath%\grocy_%version%.zip" .htaccess data\.htaccess
|
||||
|
27
.devtools/data_generation_scripts/9999_big_stock.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
// This is executed inside DatabaseMigrationService class/context
|
||||
|
||||
use Grocy\Services\StockService;
|
||||
|
||||
$PRODUCTS = [3, 4, 5, 6, 7, 8];
|
||||
|
||||
$i = 1;
|
||||
$days = -1;
|
||||
while ($i <= 500)
|
||||
{
|
||||
$productId = $PRODUCTS[array_rand($PRODUCTS)];
|
||||
$transactionId1 = $this->getStockService()->AddProduct($productId, 1, date('Y-m-d', strtotime('+180 days')), StockService::TRANSACTION_TYPE_PURCHASE, date('Y-m-d', strtotime("$days days")), XRandomPrice());
|
||||
$transactionId2 = $this->getStockService()->ConsumeProduct($productId, 1, false, StockService::TRANSACTION_TYPE_CONSUME);
|
||||
|
||||
$this->getDatabaseService()->ExecuteDbStatement("UPDATE stock_log SET row_created_timestamp = DATETIME(row_created_timestamp, '$days days') WHERE transaction_id = '$transactionId1'");
|
||||
$this->getDatabaseService()->ExecuteDbStatement("UPDATE stock_log SET row_created_timestamp = DATETIME(row_created_timestamp, '$days days') WHERE transaction_id = '$transactionId2'");
|
||||
|
||||
$days--;
|
||||
$i++;
|
||||
}
|
||||
|
||||
function XRandomPrice()
|
||||
{
|
||||
return mt_rand(2 * 100, 25 * 100) / 100 / 4;
|
||||
}
|
16
.devtools/data_generation_scripts/9999_lots_recipes.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
// This is executed inside DatabaseMigrationService class/context
|
||||
|
||||
use Grocy\Services\RecipesService;
|
||||
|
||||
$recipesService = RecipesService::getInstance();
|
||||
|
||||
for ($i = 1; $i <= 87; $i++)
|
||||
{
|
||||
$recipesService->CopyRecipe(1);
|
||||
$recipesService->CopyRecipe(2);
|
||||
$recipesService->CopyRecipe(3);
|
||||
$recipesService->CopyRecipe(4);
|
||||
$recipesService->CopyRecipe(5);
|
||||
}
|
BIN
.devtools/data_generation_scripts/big_meal_plan.xlsx
Normal file
3
.devtools/transifex_check_for_new_languages.bat
Normal file
@@ -0,0 +1,3 @@
|
||||
pushd ..
|
||||
tx pull --all --resources grocy.strings --minimum-perc=70
|
||||
popd
|
@@ -1,6 +1,9 @@
|
||||
pushd ..
|
||||
tx pull --all --minimum-perc=70
|
||||
tx pull --language en_GB
|
||||
for /d %%d in (localization\*) do (
|
||||
if %%~nxd neq en (
|
||||
tx pull --languages %%~nxd --force
|
||||
)
|
||||
)
|
||||
copy /Y localization\en\userfield_types.po localization\en_GB\userfield_types.po
|
||||
copy /Y localization\en\stock_transaction_types.po localization\en_GB\stock_transaction_types.po
|
||||
copy /Y localization\en\component_translations.po localization\en_GB\component_translations.po
|
||||
|
@@ -1,3 +1,3 @@
|
||||
pushd ..
|
||||
tx push --source
|
||||
tx push --source --force
|
||||
popd
|
||||
|
1
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
custom: ["https://grocy.info/#say-thanks"]
|
22
.github/ISSUE_TEMPLATE/bug-report.md
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
name: Bug Report
|
||||
about: If you've found something that does not work, please report it to help improve
|
||||
grocy
|
||||
title: 'Bug: '
|
||||
labels: bug
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
Please make sure to:
|
||||
|
||||
- Describe the bug as detailed as possible by providing the exact steps how to reproduce it
|
||||
- Attach screenshots where useful
|
||||
- Check if the problem was maybe already reported or fixed by searching open and closed issues here
|
||||
- Keep it to one topic per issue
|
||||
|
||||
Please also try to reproduce the problem on the pre-release demo: => https://demo-prerelease.grocy.info
|
||||
- Use a private demo instance to make your example persistent
|
||||
- If the problem is not reproducible there, it's most likely not a bug - please use the r/grocy subreddit for general questions / help: => https://www.reddit.com/r/grocy
|
||||
-->
|
10
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -1,10 +0,0 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: If you've found something that does not work, please report it to help improve grocy
|
||||
title: 'Bug: '
|
||||
labels: bug, ui-bug
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
Please describe the bug as detailed as possible, provide the steps how to reproduce it and maybe attach screenshots where useful.
|
2
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -1,5 +1,5 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: Question / Help
|
||||
- name: Questions / Help
|
||||
url: https://www.reddit.com/r/grocy
|
||||
about: Please use the r/grocy subreddit for general questions / help
|
||||
|
17
.github/ISSUE_TEMPLATE/feature-request.md
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
name: Feature Request
|
||||
about: Ideas for improvements or new things which you would find useful are always
|
||||
welcome
|
||||
title: 'Feature Request: '
|
||||
labels: enhancement
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
Please make sure to:
|
||||
|
||||
- Describe what you would find useful
|
||||
- Check if your idea was maybe already requested by searching open requests here
|
||||
- Keep it to one topic per request
|
||||
-->
|
10
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -1,10 +0,0 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Ideas for improvements or new things which you would find useful are always welcome
|
||||
title: 'Feature request: '
|
||||
labels: enhancement
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
Please describe what you would find useful and please also check (by searching open requests here) if that was maybe already requested.
|
5
.github/SECURITY.md
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
grocy is not an enterprise application and neither one you (should) host publicly (means without authentication) on the internet.
|
||||
|
||||
So unless something really bad can be abused _unauthenticated_, please just open a regular issue on the [Issue Tracker](https://github.com/grocy/grocy/issues/new/choose).
|
||||
|
||||
You can also contact me directly, please see [berrnd.de](https://berrnd.de) for any contact information.
|
BIN
.github/publication_assets/chores.png
vendored
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 85 KiB |
BIN
.github/publication_assets/mealplan.png
vendored
Before Width: | Height: | Size: 637 KiB After Width: | Height: | Size: 499 KiB |
BIN
.github/publication_assets/shoppinglist.png
vendored
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 121 KiB |
BIN
.github/publication_assets/stock.png
vendored
Before Width: | Height: | Size: 118 KiB After Width: | Height: | Size: 174 KiB |
1
.gitignore
vendored
@@ -2,3 +2,4 @@
|
||||
/vendor
|
||||
/.release
|
||||
embedded.txt
|
||||
.DS_Store
|
||||
|
95
.php-cs-fixer.php
Normal file
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
|
||||
$finder = PhpCsFixer\Finder::create()
|
||||
->exclude(['vendor'])
|
||||
->ignoreVCSIgnored(true)
|
||||
->files()->name('*.php')
|
||||
->in(__DIR__)
|
||||
;
|
||||
|
||||
$cfg = new PhpCsFixer\Config();
|
||||
return $cfg
|
||||
->setRules([
|
||||
'@PSR2' => true,
|
||||
'array_indentation' => true,
|
||||
'array_syntax' => ['syntax' => 'short'],
|
||||
'combine_consecutive_unsets' => true,
|
||||
'class_attributes_separation' => true,
|
||||
'multiline_whitespace_before_semicolons' => false,
|
||||
'single_quote' => true,
|
||||
// 'blank_line_after_opening_tag' => true,
|
||||
// 'blank_line_before_return' => true,
|
||||
'braces' => [
|
||||
'allow_single_line_closure' => true,
|
||||
'position_after_anonymous_constructs' => 'same',
|
||||
'position_after_control_structures' => 'next',
|
||||
'position_after_functions_and_oop_constructs' => 'next',
|
||||
],
|
||||
// 'cast_spaces' => true,
|
||||
// 'class_definition' => array('singleLine' => true),
|
||||
'concat_space' => ['spacing' => 'one'],
|
||||
'declare_equal_normalize' => true,
|
||||
'function_typehint_space' => true,
|
||||
'single_line_comment_style' => ['comment_types' => ['hash']],
|
||||
'include' => true,
|
||||
'lowercase_cast' => true,
|
||||
// 'native_function_casing' => true,
|
||||
// 'new_with_braces' => true,
|
||||
// 'no_blank_lines_after_class_opening' => true,
|
||||
// 'no_blank_lines_after_phpdoc' => true,
|
||||
// 'no_empty_comment' => true,
|
||||
// 'no_empty_phpdoc' => true,
|
||||
// 'no_empty_statement' => true,
|
||||
'no_leading_import_slash' => true,
|
||||
'no_leading_namespace_whitespace' => true,
|
||||
// 'no_mixed_echo_print' => array('use' => 'echo'),
|
||||
'no_multiline_whitespace_around_double_arrow' => true,
|
||||
// 'no_short_bool_cast' => true,
|
||||
// 'no_singleline_whitespace_before_semicolons' => true,
|
||||
'no_spaces_around_offset' => true,
|
||||
// 'no_trailing_comma_in_list_call' => true,
|
||||
// 'no_trailing_comma_in_singleline_array' => true,
|
||||
// 'no_unneeded_control_parentheses' => true,
|
||||
// 'no_unused_imports' => true,
|
||||
'no_whitespace_before_comma_in_array' => true,
|
||||
'no_whitespace_in_blank_line' => true,
|
||||
// 'normalize_index_brace' => true,
|
||||
'object_operator_without_whitespace' => true,
|
||||
// 'php_unit_fqcn_annotation' => true,
|
||||
// 'phpdoc_align' => true,
|
||||
// 'phpdoc_annotation_without_dot' => true,
|
||||
// 'phpdoc_indent' => true,
|
||||
// 'phpdoc_inline_tag' => true,
|
||||
// 'phpdoc_no_access' => true,
|
||||
// 'phpdoc_no_alias_tag' => true,
|
||||
// 'phpdoc_no_empty_return' => true,
|
||||
// 'phpdoc_no_package' => true,
|
||||
// 'phpdoc_no_useless_inheritdoc' => true,
|
||||
// 'phpdoc_return_self_reference' => true,
|
||||
// 'phpdoc_scalar' => true,
|
||||
// 'phpdoc_separation' => true,
|
||||
// 'phpdoc_single_line_var_spacing' => true,
|
||||
// 'phpdoc_summary' => true,
|
||||
// 'phpdoc_to_comment' => true,
|
||||
// 'phpdoc_trim' => true,
|
||||
// 'phpdoc_types' => true,
|
||||
// 'phpdoc_var_without_name' => true,
|
||||
// 'pre_increment' => true,
|
||||
// 'return_type_declaration' => true,
|
||||
// 'self_accessor' => true,
|
||||
// 'short_scalar_cast' => true,
|
||||
'single_blank_line_before_namespace' => true,
|
||||
// 'single_class_element_per_statement' => true,
|
||||
// 'space_after_semicolon' => true,
|
||||
// 'standardize_not_equals' => true,
|
||||
'ternary_operator_spaces' => true,
|
||||
// 'trailing_comma_in_multiline_array' => true,
|
||||
'trim_array_spaces' => true,
|
||||
'unary_operator_spaces' => true,
|
||||
'whitespace_after_comma_in_array' => true,
|
||||
])
|
||||
->setIndent("\t")
|
||||
->setLineEnding("\n")
|
||||
->setUsingCache(false)
|
||||
->setFinder($finder)
|
||||
;
|
97
.php_cs
@@ -1,97 +0,0 @@
|
||||
<?php
|
||||
|
||||
return PhpCsFixer\Config::create()
|
||||
->setRules(array(
|
||||
'@PSR2' => true,
|
||||
'array_indentation' => true,
|
||||
'array_syntax' => array('syntax' => 'short'),
|
||||
'combine_consecutive_unsets' => true,
|
||||
'method_separation' => true,
|
||||
'no_multiline_whitespace_before_semicolons' => true,
|
||||
'single_quote' => true,
|
||||
|
||||
'binary_operator_spaces' => array(
|
||||
'align_double_arrow' => false,
|
||||
'align_equals' => false,
|
||||
),
|
||||
// 'blank_line_after_opening_tag' => true,
|
||||
// 'blank_line_before_return' => true,
|
||||
'braces' => array(
|
||||
'allow_single_line_closure' => true,
|
||||
'position_after_anonymous_constructs' => 'same',
|
||||
'position_after_control_structures' => 'next',
|
||||
'position_after_functions_and_oop_constructs' => 'next',
|
||||
),
|
||||
// 'cast_spaces' => true,
|
||||
// 'class_definition' => array('singleLine' => true),
|
||||
'concat_space' => array('spacing' => 'one'),
|
||||
'declare_equal_normalize' => true,
|
||||
'function_typehint_space' => true,
|
||||
'hash_to_slash_comment' => true,
|
||||
'include' => true,
|
||||
'lowercase_cast' => true,
|
||||
// 'native_function_casing' => true,
|
||||
// 'new_with_braces' => true,
|
||||
// 'no_blank_lines_after_class_opening' => true,
|
||||
// 'no_blank_lines_after_phpdoc' => true,
|
||||
// 'no_empty_comment' => true,
|
||||
// 'no_empty_phpdoc' => true,
|
||||
// 'no_empty_statement' => true,
|
||||
'no_extra_consecutive_blank_lines' => array(
|
||||
'extra',
|
||||
'parenthesis_brace_block',
|
||||
'square_brace_block',
|
||||
'throw',
|
||||
'use',
|
||||
),
|
||||
'no_leading_import_slash' => true,
|
||||
'no_leading_namespace_whitespace' => true,
|
||||
// 'no_mixed_echo_print' => array('use' => 'echo'),
|
||||
'no_multiline_whitespace_around_double_arrow' => true,
|
||||
// 'no_short_bool_cast' => true,
|
||||
// 'no_singleline_whitespace_before_semicolons' => true,
|
||||
'no_spaces_around_offset' => true,
|
||||
// 'no_trailing_comma_in_list_call' => true,
|
||||
// 'no_trailing_comma_in_singleline_array' => true,
|
||||
// 'no_unneeded_control_parentheses' => true,
|
||||
// 'no_unused_imports' => true,
|
||||
'no_whitespace_before_comma_in_array' => true,
|
||||
'no_whitespace_in_blank_line' => true,
|
||||
// 'normalize_index_brace' => true,
|
||||
'object_operator_without_whitespace' => true,
|
||||
// 'php_unit_fqcn_annotation' => true,
|
||||
// 'phpdoc_align' => true,
|
||||
// 'phpdoc_annotation_without_dot' => true,
|
||||
// 'phpdoc_indent' => true,
|
||||
// 'phpdoc_inline_tag' => true,
|
||||
// 'phpdoc_no_access' => true,
|
||||
// 'phpdoc_no_alias_tag' => true,
|
||||
// 'phpdoc_no_empty_return' => true,
|
||||
// 'phpdoc_no_package' => true,
|
||||
// 'phpdoc_no_useless_inheritdoc' => true,
|
||||
// 'phpdoc_return_self_reference' => true,
|
||||
// 'phpdoc_scalar' => true,
|
||||
// 'phpdoc_separation' => true,
|
||||
// 'phpdoc_single_line_var_spacing' => true,
|
||||
// 'phpdoc_summary' => true,
|
||||
// 'phpdoc_to_comment' => true,
|
||||
// 'phpdoc_trim' => true,
|
||||
// 'phpdoc_types' => true,
|
||||
// 'phpdoc_var_without_name' => true,
|
||||
// 'pre_increment' => true,
|
||||
// 'return_type_declaration' => true,
|
||||
// 'self_accessor' => true,
|
||||
// 'short_scalar_cast' => true,
|
||||
'single_blank_line_before_namespace' => true,
|
||||
// 'single_class_element_per_statement' => true,
|
||||
// 'space_after_semicolon' => true,
|
||||
// 'standardize_not_equals' => true,
|
||||
'ternary_operator_spaces' => true,
|
||||
// 'trailing_comma_in_multiline_array' => true,
|
||||
'trim_array_spaces' => true,
|
||||
'unary_operator_spaces' => true,
|
||||
'whitespace_after_comma_in_array' => true,
|
||||
))
|
||||
->setIndent("\t")
|
||||
->setLineEnding("\n")
|
||||
;
|
56
.tx/config
@@ -1,56 +1,56 @@
|
||||
[main]
|
||||
host = https://www.transifex.com
|
||||
|
||||
[grocy.chore_period_types]
|
||||
file_filter = localization/<lang>/chore_period_types.po
|
||||
source_file = localization/chore_period_types.pot
|
||||
source_lang = en
|
||||
type = PO
|
||||
|
||||
[grocy.chore_assignment_types]
|
||||
[o:grocy:p:grocy:r:chore_assignment_types]
|
||||
file_filter = localization/<lang>/chore_assignment_types.po
|
||||
source_file = localization/chore_assignment_types.pot
|
||||
source_lang = en
|
||||
type = PO
|
||||
|
||||
[grocy.component_translations]
|
||||
[o:grocy:p:grocy:r:chore_period_types]
|
||||
file_filter = localization/<lang>/chore_period_types.po
|
||||
source_file = localization/chore_period_types.pot
|
||||
source_lang = en
|
||||
type = PO
|
||||
|
||||
[o:grocy:p:grocy:r:component_translations]
|
||||
file_filter = localization/<lang>/component_translations.po
|
||||
source_file = localization/component_translations.pot
|
||||
source_lang = en
|
||||
type = PO
|
||||
|
||||
[grocy.demo_data]
|
||||
[o:grocy:p:grocy:r:demo_data]
|
||||
file_filter = localization/<lang>/demo_data.po
|
||||
source_file = localization/demo_data.pot
|
||||
source_lang = en
|
||||
type = PO
|
||||
|
||||
[grocy.stock_transaction_types]
|
||||
file_filter = localization/<lang>/stock_transaction_types.po
|
||||
source_file = localization/stock_transaction_types.pot
|
||||
[o:grocy:p:grocy:r:locales]
|
||||
file_filter = localization/<lang>/locales.po
|
||||
source_file = localization/locales.pot
|
||||
source_lang = en
|
||||
type = PO
|
||||
|
||||
[grocy.strings]
|
||||
file_filter = localization/<lang>/strings.po
|
||||
source_file = localization/strings.pot
|
||||
source_lang = en
|
||||
type = PO
|
||||
|
||||
[grocy.userfield_types]
|
||||
file_filter = localization/<lang>/userfield_types.po
|
||||
source_file = localization/userfield_types.pot
|
||||
source_lang = en
|
||||
type = PO
|
||||
|
||||
[grocy.permissions]
|
||||
[o:grocy:p:grocy:r:permissions]
|
||||
file_filter = localization/<lang>/permissions.po
|
||||
source_file = localization/permissions.pot
|
||||
source_lang = en
|
||||
type = PO
|
||||
|
||||
[grocy.locales]
|
||||
file_filter = localization/<lang>/locales.po
|
||||
source_file = localization/locales.pot
|
||||
[o:grocy:p:grocy:r:stock_transaction_types]
|
||||
file_filter = localization/<lang>/stock_transaction_types.po
|
||||
source_file = localization/stock_transaction_types.pot
|
||||
source_lang = en
|
||||
type = PO
|
||||
|
||||
[o:grocy:p:grocy:r:strings]
|
||||
file_filter = localization/<lang>/strings.po
|
||||
source_file = localization/strings.pot
|
||||
source_lang = en
|
||||
type = PO
|
||||
|
||||
[o:grocy:p:grocy:r:userfield_types]
|
||||
file_filter = localization/<lang>/userfield_types.po
|
||||
source_file = localization/userfield_types.pot
|
||||
source_lang = en
|
||||
type = PO
|
||||
|
3
.vscode/settings.json
vendored
@@ -12,6 +12,5 @@
|
||||
"html.format.wrapAttributes": "force",
|
||||
"html.format.wrapLineLength": 0,
|
||||
"php-cs-fixer.formatHtml": true,
|
||||
"php-cs-fixer.autoFixBySemicolon": true,
|
||||
"php-cs-fixer.onsave": true,
|
||||
"php-cs-fixer.autoFixBySemicolon": true
|
||||
}
|
||||
|
83
README.md
@@ -1,34 +1,34 @@
|
||||
<div align="center">
|
||||
<img alt="Logo" height="50" src="https://raw.githubusercontent.com/grocy/grocy/master/public/img/grocy_logo.svg?sanitize=true" />
|
||||
<h3>ERP beyond your fridge</h3>
|
||||
<h5> grocy is a web-based self-hosted groceries & household management solution for your home</h5>
|
||||
<h4>grocy is a web-based self-hosted groceries & household management solution for your home<br>Created by <a href="https://github.com/berrnd">@berrnd</a></h4>
|
||||
</div>
|
||||
|
||||
-----
|
||||
|
||||
## Give it a try
|
||||
|
||||
- Public demo of the latest stable version (`release` branch) → [https://demo.grocy.info](https://demo.grocy.info)
|
||||
- Public demo of the current development version (`master` branch) → [https://demo-prerelease.grocy.info](https://demo-prerelease.grocy.info)
|
||||
|
||||
## Questions / Help / Bug reporting / Feature requests
|
||||
There is the [r/grocy subreddit](https://www.reddit.com/r/grocy) to connect with other grocy users and getting help.
|
||||
## Questions / Help / Bug Reports / Feature Requests
|
||||
|
||||
If you've found something that does not work or if you have an idea for an improvement or new things which you would find useful, feel free to open a request on the [issue tracker](https://github.com/grocy/grocy/issues) here.
|
||||
- General help and usage questions → [r/grocy subreddit](https://www.reddit.com/r/grocy)
|
||||
- Bug Reports and Feature Requests → [Issue Tracker](https://github.com/grocy/grocy/issues/new/choose)
|
||||
|
||||
Please don't send me private messages regarding grocy help. I check the issue tracker and the subreddit pretty much daily, but don't provide grocy support beyond that.
|
||||
_Please don't send me private messages or call me regarding grocy help. I check the issue tracker and the subreddit pretty much daily, but don't provide grocy support beyond that._
|
||||
|
||||
## Community contributions
|
||||
See the website for a list of community contributed Add-ons / Tools: [https://grocy.info/addons](https://grocy.info/addons)
|
||||
|
||||
## 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 household management"-thing. ERP your fridge!
|
||||
See the website for a list of community contributed Add-ons / Tools. → [https://grocy.info/addons](https://grocy.info/addons)
|
||||
|
||||
## How to install
|
||||
> Checkout [grocy-desktop](https://github.com/grocy/grocy-desktop), if you want to run grocy without having to manage a webserver just like a normal ("indows) desktop application.
|
||||
|
||||
> Checkout [grocy-desktop](https://github.com/grocy/grocy-desktop), if you want to run grocy without having to manage a webserver just like a normal (Windows) desktop application.
|
||||
>
|
||||
> Directly download the [latest release](https://releases.grocy.info/latest-desktop) - the installation is nothing more than just clicking 2 times "next".
|
||||
|
||||
See [https://grocy.info/links](https://grocy.info/links) for some installation guides and troubleshooting help.
|
||||
See the website for some installation guides and troubleshooting help. → [https://grocy.info/links](https://grocy.info/links)
|
||||
|
||||
grocy is technically a pretty simple PHP application, so the basic notes to get it running are:
|
||||
- Unpack the [latest release](https://releases.grocy.info/latest)
|
||||
@@ -37,8 +37,8 @@ grocy is technically a pretty simple PHP application, so the basic notes to get
|
||||
- The webserver root should point to the `public` directory
|
||||
- Include `try_files $uri /index.php$is_args$query_string;` in your location block if you use nginx
|
||||
- Or disable URL rewriting (see the option `DISABLE_URL_REWRITING` in `data/config.php`)
|
||||
- SQLite 3.8.3 or higher is required and everything is currently only tested against PHP 7.4
|
||||
- → Default login is user `admin` with password `admin`, please change the password immediately (user menu at the top right corner)
|
||||
- _Currently everything is only tested against (means 100 % works with) PHP 8.0 with SQLite 3.27.2_
|
||||
|
||||
Alternatively clone this repository (the `release` branch always references the latest released version, or checkout the latest tagged revision) and install Composer and Yarn dependencies manually.
|
||||
|
||||
@@ -47,27 +47,40 @@ Alternatively clone this repository (the `release` branch always references the
|
||||
See [grocy/grocy-docker](https://github.com/grocy/grocy-docker) or [linuxserver/docker-grocy](https://github.com/linuxserver/docker-grocy) 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` where appropriate (the default values from `config-dist.php` will be used for not in `data/config.php` defined settings). Just to be sure, please empty `data/viewcache`.
|
||||
|
||||
- Overwrite everything with the [latest release](https://releases.grocy.info/latest) while keeping the `data` directory
|
||||
- Check `config-dist.php` for new configuration options and add them to your `data/config.php` where appropriate (the default values from `config-dist.php` will be used for not in `data/config.php` defined settings)
|
||||
- Empty the `data/viewcache` directory
|
||||
- Visit the main route once to apply database migrations ([see below](https://github.com/grocy/grocy#database-migrations))
|
||||
|
||||
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.
|
||||
(The default language can be set in `data/config.php`, e. g. `Setting('DEFAULT_LOCALE', 'it');` and there is also a user setting (see the user settings page) to set a different language per user).
|
||||
|
||||
You can easily help translating grocy on [Transifex](https://www.transifex.com/grocy/grocy/dashboard/) if your language is incomplete or not available yet.
|
||||
|
||||
The default language can be set in `data/config.php`, e. g. `Setting('DEFAULT_LOCALE', 'it');` and there is also a user setting (see the user settings page) to set a different language per user.
|
||||
|
||||
The [pre-release demo](https://demo-prerelease.grocy.info) is available for any translation which is at least 70 % complete and will pull the translations from Transifex 10 minutes past every hour, so you can have a kind of instant preview of your contributed translations. Thank you!
|
||||
|
||||
Also any translation which once reached a completion level of 70 % will be included in releases.
|
||||
Also any translation which once reached a completion level of 70 % ([`strings` resource](https://www.transifex.com/grocy/grocy/strings/)) will be included in releases.
|
||||
|
||||
_RTL languages are unfortunately not yet supported._
|
||||
|
||||
## 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 was a pain to use at the end 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!
|
||||
|
||||
## Things worth to know
|
||||
|
||||
### REST API & data model documentation
|
||||
### REST API
|
||||
|
||||
See the integrated Swagger UI instance on [/api](https://demo.grocy.info/api).
|
||||
|
||||
### Barcode readers & camera scanning
|
||||
|
||||
Some fields (with a barcode icon above) 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.
|
||||
|
||||
Additionally it's also possible to use your device camera to scan a barcode by using the camera button on the right side of the corresponding field (powered by [Quagga2](https://github.com/ericblade/quagga2), totally offline / client-side camera stream processing, please note due to browser security restrictions, this only works when serving grocy via a secure connection (`https://`)). Quick video demo: https://www.youtube.com/watch?v=Y5YH6IJFnfc
|
||||
@@ -75,69 +88,87 @@ Additionally it's also possible to use your device camera to scan a barcode by u
|
||||
_My personal recommendation: Use a USB barcode laser scanner. They are cheap and work 1000 % better, faster, under any lighting condition and from any angle._
|
||||
|
||||
### Input shorthands for date fields
|
||||
|
||||
For (productivity) reasons all date (and time) input (and display) 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, if > today, or to the given day next year, if < today, in proper notation
|
||||
- Example: `0517` will be converted to `2018-05-17`
|
||||
- Example: `0517` will be converted to `2021-05-17`
|
||||
- `YYYYMMDD` gets expanded to the proper ISO-8601 notation
|
||||
- Example: `20190417` will be converted to `2019-04-17`
|
||||
- Example: `20210417` will be converted to `2021-04-17`
|
||||
- `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 are never overdue)
|
||||
- Example: `202107e` will be converted to `2021-07-31`
|
||||
- `[+/-]n[d/m/y]` gets expanded to a date relative to today, while adding (**+**) or subtracting (**-**) the **n**umber of**d**ays/**m**onths/**y**ears, in proper notation
|
||||
- Example: `+1m` will be converted to the same day next month
|
||||
- `x` gets expanded to `2999-12-31` (which is an alias for "never overdue")
|
||||
- Down/up arrow keys will increase/decrease the date by 1 day
|
||||
- Right/left arrow keys will increase/decrease the date by 1 week
|
||||
- Shift + down/up arrow keys will increase/decrease the date by 1 month
|
||||
- Shift + right/left arrow keys will increase/decrease the date by 1 year
|
||||
|
||||
### Keyboard shorthands for buttons
|
||||
|
||||
Wherever a button contains a bold highlighted letter, this is a shortcut key.
|
||||
Example: Button "**P** Add as new product" 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).
|
||||
|
||||
_Please note: Database migrations are supposed to work between releases, not between every commit. If you want to run the current `master` branch (which is the development version), however, you need to handle that (and maybe more) yourself._
|
||||
|
||||
### 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`)
|
||||
|
||||
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 `MODE` setting is set to `dev`, `demo` or `prerelease`, 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).
|
||||
|
||||
## Contributing / Say thanks
|
||||
## Contributing / Say Thanks
|
||||
|
||||
Any help is more than appreciated. Feel free to pick any open unassigned issue and submit a pull request, but please leave a short comment or assign the issue yourself, to avoid working on the same thing.
|
||||
|
||||
See https://grocy.info/#say-thanks for more ideas if you just want to say thanks.
|
||||
|
||||
## Roadmap
|
||||
|
||||
There is none. The progress of a specific bug/enhancement is always tracked in the corresponding issue, at least by commit comment references.
|
||||
|
||||
## Screenshots
|
||||
#### Stock overview
|
||||
|
||||
### Stock overview
|
||||
|
||||

|
||||
|
||||
#### Shopping List
|
||||
### Shopping List
|
||||
|
||||

|
||||
|
||||
#### Meal Plan
|
||||
### Meal Plan
|
||||
|
||||

|
||||
|
||||
#### Chores overview
|
||||
### Chores overview
|
||||
|
||||

|
||||
|
||||
## License
|
||||
|
||||
The MIT License (MIT)
|
||||
|
35
app.php
@@ -5,6 +5,7 @@ use Grocy\Helpers\UrlManager;
|
||||
use Grocy\Middleware\CorsMiddleware;
|
||||
use Psr\Container\ContainerInterface as Container;
|
||||
use Slim\Factory\AppFactory;
|
||||
use Slim\Views\Blade;
|
||||
|
||||
// Load composer dependencies
|
||||
require_once __DIR__ . '/vendor/autoload.php';
|
||||
@@ -12,12 +13,22 @@ require_once __DIR__ . '/vendor/autoload.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
|
||||
require_once __DIR__ . '/helpers/ConfigurationValidator.php';
|
||||
|
||||
// Error reporting definitions
|
||||
if (GROCY_MODE === 'dev')
|
||||
{
|
||||
error_reporting(E_ALL);
|
||||
}
|
||||
else
|
||||
{
|
||||
error_reporting(E_ALL ^ (E_NOTICE | E_WARNING | E_DEPRECATED));
|
||||
}
|
||||
|
||||
// Definitions for dev/demo/prerelease mode
|
||||
if ((GROCY_MODE === 'dev' || GROCY_MODE === 'demo' || GROCY_MODE === 'prerelease') && !defined('GROCY_USER_ID'))
|
||||
{
|
||||
define('GROCY_USER_ID', 1);
|
||||
define('GROCY_SHOW_AUTH_VIEWS', true);
|
||||
}
|
||||
|
||||
// Definitions for disabled authentication mode
|
||||
@@ -27,8 +38,22 @@ if (GROCY_DISABLE_AUTH === true)
|
||||
{
|
||||
define('GROCY_USER_ID', 1);
|
||||
}
|
||||
}
|
||||
|
||||
define('GROCY_SHOW_AUTH_VIEWS', false);
|
||||
// Check if any invalid entries in config.php have been made
|
||||
try
|
||||
{
|
||||
(new ConfigurationValidator())->validateConfig();
|
||||
}
|
||||
catch (EInvalidConfig $ex)
|
||||
{
|
||||
exit('Invalid setting in config.php: ' . $ex->getMessage());
|
||||
}
|
||||
|
||||
// Create data/viewcache folder if it doesn't exist
|
||||
if (!file_exists(GROCY_DATAPATH . '/viewcache'))
|
||||
{
|
||||
mkdir(GROCY_DATAPATH . '/viewcache');
|
||||
}
|
||||
|
||||
// Setup base application
|
||||
@@ -37,11 +62,13 @@ $app = AppFactory::create();
|
||||
|
||||
$container = $app->getContainer();
|
||||
$container->set('view', function (Container $container) {
|
||||
return new Slim\Views\Blade(__DIR__ . '/views', GROCY_DATAPATH . '/viewcache');
|
||||
return new Blade(__DIR__ . '/views', GROCY_DATAPATH . '/viewcache');
|
||||
});
|
||||
|
||||
$container->set('UrlManager', function (Container $container) {
|
||||
return new UrlManager(GROCY_BASE_URL);
|
||||
});
|
||||
|
||||
$container->set('ApiKeyHeaderName', function (Container $container) {
|
||||
return 'GROCY-API-KEY';
|
||||
});
|
||||
@@ -74,4 +101,6 @@ $errorMiddleware->setDefaultErrorHandler(
|
||||
);
|
||||
|
||||
$app->add(new CorsMiddleware($app->getResponseFactory()));
|
||||
|
||||
ob_clean(); // No response output before here
|
||||
$app->run();
|
||||
|
@@ -3,7 +3,7 @@
|
||||
- Fixed that the "X products are already expired" count on the stock overview page was wrong
|
||||
- Fixed that after product actions (consume/purchase/etc.) on the stock overview page the highlighting of the row was maybe wrong
|
||||
- After product actions (consume/purchase/etc.) on the stock overview page on a sub product, now also the parent product (row) is refreshed
|
||||
- It's now possible to accumulate min. stock amounts on parent product level (new option per product, means the sub product will never be "missing" then, only the parent product)
|
||||
- It's now possible to accumulate min. stock amounts on parent product level (new option per product, means the sub product will never be missing then, only the parent product)
|
||||
- On the purchase page there is now an option to select that the price is the total price (for the whole amount) - below the price field, defaults to "Unit price" (as it was until now), when set to "Total price", the entered price will be divided by the amount before posting
|
||||
- "Average shelf life" on the product card now displays just "Unlimited" when the resulting value would be > 200 years (for products which never expire, as they have a best before date of 2999-12-31)
|
||||
|
||||
|
@@ -1,5 +1,13 @@
|
||||
> ⚠️ The major version bump is due to breaking API changes, please see below if you use the API
|
||||
|
||||
> ⚠️⚠️ SQLite >= 3.9.0 (was released in late 2015) is required
|
||||
>
|
||||
> [Here](https://github.com/grocy/grocy/issues/1209#issuecomment-749760765) is a workaround if you still run a SQLite version >= 3.8.3 < 3.9.0
|
||||
>
|
||||
> _PHP 7.2 with SQLite 3.8.3 was the formerly in [README mentioned](https://github.com/grocy/grocy#how-to-install) minimum runtime requirement, any future release will only be tested against a reasonable recent runtime (currently PHP 7.4 with SQLite 3.27.2) - supporting those (very) old runtime stuff is too time consuming..._
|
||||
|
||||
> ❗ If some pages/tables doesn't load at all, please check that your `/data/config.php` setting `CURRENCY` is a valid ISO 4217 currency code - that's most probably the issue then.
|
||||
|
||||
### New feature: Use any product related quantity unit anywhere
|
||||
- Finally it's possible to use any product related quantity unit on any page
|
||||
- Products still have one quantity unit stock and one (default) quantity unit purchase, but any QU, which has a direct or indirect conversion for that product, can be used to pick an amount
|
||||
@@ -196,7 +204,7 @@
|
||||
- All prices are now related to the products stock quantity unit (instead of the products purchase QU)
|
||||
- All (product) amounts are now related to the products stock quantity unit (was related to the products purchase QU for the shopping list before)
|
||||
- The product object no longer has a field `barcodes` with a comma separated barcode list, instead barcodes are now stored in a separate table/entity `product_barcodes` (use the existing "Generic entity interactions" endpoints to access them)
|
||||
- The endpoint `/objects/{entity}/search` was removed (use the existing `/objects/{entity}` endpoint with new new filter capabilities mentioned below)
|
||||
- The endpoint `/objects/{entity}/search` was removed (use the existing `/objects/{entity}` endpoint with the new filter capabilities mentioned below)
|
||||
- The output / field names of `ProductDetailsResponse` have slightly changed (endpoint `/stock/products/{productId}`)
|
||||
- Endpoint `/stock/volatile`
|
||||
- The query parameter `expring_days` was renamed to `due_soon_days`
|
||||
|
19
changelog/61_3.0.1_2021-01-05.md
Normal file
@@ -0,0 +1,19 @@
|
||||
> ⚠️⚠️ SQLite >= 3.9.0 (was released in late 2015) is required
|
||||
>
|
||||
> [Here](https://github.com/grocy/grocy/issues/1209#issuecomment-749760765) is a workaround if you still run a SQLite version >= 3.8.3 < 3.9.0
|
||||
>
|
||||
> _PHP 7.2 with SQLite 3.8.3 was the formerly in [README mentioned](https://github.com/grocy/grocy#how-to-install) minimum runtime requirement, any future release will only be tested against a reasonable recent runtime (currently PHP 7.4 with SQLite 3.27.2) - supporting those (very) old runtime stuff is too time consuming..._
|
||||
|
||||
- Improved the prerequisites checker (added missing required PHP extension `ctype`) (thanks @Forceu)
|
||||
- Added validation checks for most `data/config.php` settings to prevent using invalid ones (thanks @Forceu)
|
||||
- When using reverse proxy authentication (`ReverseProxyAuthMiddleware`), _additionally_ a valid API key can now also be used for authentication (if you don't want to protect the API endpoints via your reverse proxy, however)
|
||||
- Added a new API endpoint `/system/time` to get the current server time (thanks @Forceu)
|
||||
- An amount attached to a barcode is now also prefiled when scanning the product on the Consume/Transfer/Inventory page
|
||||
- Fixed that some number inputs were broken when the new decimal places setting were set to `0`
|
||||
- Fixed that browser camera barcode scanning did not work on the product edit page for adding product barcodes
|
||||
- Fixed that indirect unit conversions (those between units, not product overrides) could not be used/selected
|
||||
- Fixed that the new product option "Never show on stock overview" was unintentionally set by default for new products
|
||||
- Fixed that adding items to the shopping list from the context/more menu on the stock overview page did not work
|
||||
- Fixed that consuming was not possible when `FEATURE_FLAG_STOCK_LOCATION_TRACKING` was disabled
|
||||
- Fixed that adding images in text editor fields did not work
|
||||
- Fixed some other minor UI glitches
|
127
changelog/62_3.1.0_2021-07-16.md
Normal file
@@ -0,0 +1,127 @@
|
||||
> ⚠️ The following PHP extensions are now additionally required: `json`, `intl`, `zlib`
|
||||
|
||||
> ⚠️ PHP 8 is now supported and from now on the only tested runtime version (although currently PHP 7.2 should still work).
|
||||
|
||||
### New feature: grocycode / label printer support
|
||||
#### (Own) Product/stock entry/chores/batteries labels/barcodes
|
||||
- Print own labels/barcodes for products/stock entries/chores/batteries and then scan that code on every place a product/stock entry/chore/battery can be selected
|
||||
- Can be printed (or downloaded) via
|
||||
- The product/chore/battery edit page
|
||||
- The context/more menu per line on the overview pages and for stock entries on the stock entries page
|
||||
- Automatically on purchase (new option on the purchase page, defaults can be configured per product) for stock entries
|
||||
- The used barcode type can be configured via the `config.php` option `GROCYCODE_TYPE`:
|
||||
- `1D` (default) will produce a `Code128` 1D barcode (supported by the integrated camera barcode scanner)
|
||||
- `2D` will produce a `DataMatrix` 2D barcode (currently not supported by the integrated camera barcode scanner, but can be probably printed smaller)
|
||||
- Label printer functionality can be enabled via the new feature flag `FEATURE_FLAG_LABEL_PRINTER` (defaults to disabled)
|
||||
- Label printer communication happens via WebHooks - see the new `LABEL_PRINTER*` `config.php` options
|
||||
- grocycodes can also be used without a label printer - you can view or download thm as pictures and print them manually
|
||||
- More information:
|
||||
- https://github.com/grocy/grocy/tree/v3.1.0/docs/grocycode.md
|
||||
- https://github.com/grocy/grocy/tree/v3.1.0/docs/label-printing.md
|
||||
- (Thanks a lot @mistressofjellyfish for the initial work on this)
|
||||
|
||||
### New feature: Meal plan sections
|
||||
- Split the meal plan into sections like Breakfast/Lunch/Dinner
|
||||
- => New button "Configure sections" on the meal plan page to configure the sections (top right corner)
|
||||
- => Each meal plan entry can be assigned to a section
|
||||
|
||||
### New feature: Shopping list thermal printer support
|
||||
- The shopping list can now be printed on a thermal printer
|
||||
- The printer must be compatible to the `ESC/POS` protocol and needs to be locally attached or network reachable to/by the machine hosting grocy (so the server)
|
||||
- See the new `TPRINTER*` `config.php` options to configure the printer connection and other options
|
||||
- => New button on the shopping list print dialog
|
||||
- Can be enabled via the new feature flag `FEATURE_FLAG_THERMAL_PRINTER` (defaults to disabled)
|
||||
- (Thanks a lot @Forceu)
|
||||
|
||||
### Stock improvements/fixes
|
||||
- Product barcodes are now enforced to be unique across products
|
||||
- On the stock overview page it's now also possible to search/filter by product barcodes (via the general search field)
|
||||
- The product picker on the consume and transfer page now only shows products which are currently in stock
|
||||
- Added a filter option to only show in-stock products on the stock overview and products list (master data) page
|
||||
- Added new columns on the stock overview page (hidden by default): Product description, product default location, parent product, product picture
|
||||
- Added a new product option "Should not be frozen" (defaults to disabled and only visible when `FEATURE_FLAG_STOCK_PRODUCT_FREEZING` is enabled)
|
||||
- When enabled, on moving the product to a freezer location (so when freezing it), a corresponding warning will be shown
|
||||
- Optimized that when opening a product which has "Default due days after opened" set, the resulting date now never extends the original due date
|
||||
- Added a new stock setting (top right corner settings menu) "Add decimal separator automatically for price inputs" (defaults to disabled)
|
||||
- When enabled, you always have to enter the value including decimal places, the decimal separator will be automatically added based on the amount of allowed decimal places
|
||||
- Fixed that editing stock entries was not possible
|
||||
- Fixed that consuming with Scan Mode was not possible
|
||||
- Fixed that the current stock total value (header of the stock overview page) didn't include decimal amounts (thanks @Ape)
|
||||
- Fixed that the transfer page was not fully populated when opening it from the stock entries page
|
||||
- Fixed that undoing a consume/open action from the success notification on the stock entries page was not possible
|
||||
- Fixed that adding a barcode to a product didn't save the selected quantity unit when the product only has a single one
|
||||
- Fixed that the store information on a stock entry was lost when transferring a partial amount to a different location
|
||||
- Fixed that the "Spoil rate" on the product card was wrong in some cases
|
||||
- Fixed that the stock journal showed always the products default location (instead of the location of the transaction)
|
||||
- Fixed that the aggregated amount of parent products was wrong when indirect quantity unit conversions were used
|
||||
|
||||
### Shopping list improvements/fixes
|
||||
- The amount now defaults to `1` for adding items quicker
|
||||
- Added a status filter for only _done_ items
|
||||
- The total value is now also shown (based on "Last price (Total)" per item, displayed on the page header and only when `FEATURE_FLAG_STOCK_PRICE_TRACKING` is enabled)
|
||||
- Fixed that shopping list prints had a grey background (thanks @Forceu)
|
||||
- Fixed the form validation on the shopping list item page (thanks @Forceu)
|
||||
- Fixed that when adding products to the shopping list from the stock overview page, the used quantity unit was always the products default purchase QU (and not the selected one)
|
||||
- Fixed that the displayed last unit/total price was wrong when the used quantity unit was not the products stock QU
|
||||
- Fixed that the "Add as barcode to existing product" productpicker workflow did not work
|
||||
|
||||
### Recipe improvements/fixes
|
||||
- Recipe printing improvements (thanks @Ape)
|
||||
- Calories are now always displayed per single serving (on the recipe and meal plan page)
|
||||
- The note of an ingredient will now also be added to the corresponding shopping list item when using "Put missing products on the shopping list"
|
||||
- It's now possible to copy a recipe (button/dropdown menu item per recipe)
|
||||
- Fixed that the recipe page was slow when there were a lot meal plan recipe entries
|
||||
- Fixed that "Only check if any amount is in stock" (recipe ingredient option) didn't work for stock amounts < 1
|
||||
- Fixed that when adding missing items to the shopping list, on the popup deselected items got also added
|
||||
- Fixed that the amount of self produced products with tare weight handling enabled was wrong ("Produces product" recipe option)
|
||||
- Fixed that the ingredient amount calculation for included/nested recipes was (for most cases) wrong
|
||||
- Fixed that the ingredient amount was wrong when using a to the product indirectly related quantity unit
|
||||
- Fixed that the calories amount calculation was wrong when quantity unit conversions were involved
|
||||
|
||||
### Meal plan improvements/fixes
|
||||
- Improved the meal plan page loading time (drastically when having a big history of meal plan entries)
|
||||
- Meal plan entries can now be visually marked as "done" (new button per entry)
|
||||
- This happens automatically on consuming a recipe/product from the meal plan page
|
||||
- It's now possible to copy all entries of a day to another day (in the dropdown of the add button in the header of each day column)
|
||||
- The "Display recipe" button was removed, instead clicking the recipe title now displays the recipe (and this now also works for products; shows the product card)
|
||||
- Fixed that stock fulfillment checking used the desired servings of the recipe (those selected on the recipes page, not them from the meal plan entry)
|
||||
|
||||
### Chores improvements/fixes
|
||||
- It's now possible to track any addtional info on a chore execution by using Userfields
|
||||
- => Configure the desired Userfields for the entity `chores_log`
|
||||
- => The on chore execution tracking entered information is then visible on the corresponding chore journal entry
|
||||
- Fixed that tracking chores with "Done by" a different user was not possible
|
||||
|
||||
### Userfield improvements/fixes
|
||||
- Userfields can now be configured as mandatory (new Userfield option, defaults to disabled)
|
||||
- Fixed that numeric Userfields were initialised with `1.0`
|
||||
- Fixed that shortcuts (up/down key) and the format did not work correctly when using multiple date/time Userfields per object
|
||||
- Fixed that Userfields were not saved when adding a product or a recipe (only on editing)
|
||||
|
||||
### General & other improvements/fixes
|
||||
- LDAP authentication improvements / OpenLDAP support (thanks @tank0226)
|
||||
- A read only service account can now be used for binding
|
||||
- The username attribute is now configurable
|
||||
- Filtering of accounts is now possible
|
||||
- => See the new `LDAP*` `config.php` options
|
||||
- Improved the page loading time of all journal pages (stock/chores/batteries) by adding a new date range filter
|
||||
- Some night mode style improvements (thanks @BlizzWave and @KTibow)
|
||||
- Help tooltips are now additionally also triggered by clicking on them (instead of only hovering them, which doesn't work on mobile / touch devices)
|
||||
- The camera barcode scanner now also supports Code 39 barcodes (used for example in Germany on pharma products (PZN)) (thanks @andreheuer)
|
||||
- Fixed that the number picker up/down buttons did not work when the input field was empty or contained an invalid number
|
||||
- Fixed that links and embeds (e.g. YouTube videos) did not work in the text editor
|
||||
- Fixed that the "Manage users" and "Manage API keys" menu was not shown when using reverse proxy authentication
|
||||
|
||||
### API improvements/fixes
|
||||
> ~~❗ Numbers are now returned as numbers (so technically without quotes around them, were strings for nearly all endpoints before - should practically be no real difference)~~
|
||||
>
|
||||
> => ❗❗❗ This has been reverted after this (v3.1.0) release since it had unintended side effects
|
||||
- Added a new endpoint `/system/localization-strings` to get the localization strings (gettext JSON representation; in the by the user desired language)
|
||||
- Added a new endpoint `/recipes/{recipeId}/copy` to copy a recipe
|
||||
- The `GET /chores` endpoint now also returns the `next_execution_assigned_user` object per chore (like the endpoint `GET /chores/{choreId}` already did for a single chore)
|
||||
- The `GET /tasks` endpoint now also returns the assigned user and category object per task
|
||||
- Empty Userfields are now also returned (were previously omitted, endpoint `GET /objects/{entity}` and `GET /objects/{entity}/{objectId}`)
|
||||
- Fixed that due soon products with `due_type` = "Expiration date" were missing in `due_products` of the `/stock/volatile` endpoint
|
||||
- Fixed that `PUT/DELETE /objects/{entity}/{objectId}` produced an internal server error when the given object id was invalid (now returns `400 Bad Request`)
|
||||
- Fixed that hyphens in filter values did not work
|
||||
- Fixed that cyrillic letters were not allowed in filter values
|
16
changelog/63_3.1.1_2021-08-21.md
Normal file
@@ -0,0 +1,16 @@
|
||||
- Fixed that the upgrade failed when having "> 2 times duplicate" (means the same barcode was added more than 2 times) product barcodes
|
||||
- Fixed that the upgrade failed when having unsupported parent/child product nesting levels
|
||||
- More information on this: Only 1 level is currently supported; creating > 1 level nestings was _never_ possible via the UI/frontend, but not checked/enforced by the backend before `v3.0.0` - so it was potentially possible via the API (or any third party app/tool which utilizes it) to create such a nesting which then made this upgrade to fail
|
||||
- Fixed that it was not possible to select a chore/battery on the corresponding tracking pages by mouse/touch
|
||||
- Fixed that grouping by columns in tables may caused duplicate groups
|
||||
- Fixed that grocycode camera barcode scanning didn't recognize the scanned code for chore/battery tracking
|
||||
- Fixed that when having any "Track date only" chore on the calendar, the iCal export was broken
|
||||
- Optimized the meal plan page to be properly printable (thanks @MrKrisKrisu)
|
||||
|
||||
### API
|
||||
> ❗ The release before (v3.1.0) introduced that "numbers are now returned as numbers": **This was reverted** since it had unintended side effects (so all fields are technically strings now again, just like before - sorry for that)
|
||||
- Fixed that `missing_products` of the `/stock/volatile` endpoint also contained inactive products
|
||||
- Fixed that when having multiple Userfields for an entity, the `/objects/{entity}` endpoint returned wrong Userfield values
|
||||
- Fixed that the `/stock/products/by-barcode/{barcode}/consume` and `/stock/products/by-barcode/{barcode}/transfer` endpoints haven't used the stock entry given by a stock entry grocycode (thanks @lowlee for the initial work on this)
|
||||
- Fixed that the "Stock by-barcode" API routes were broken for normal barcodes (only grocycodes were accepted) (thanks @larsverp)
|
||||
- Fixed that the "Stock by-barcode" API routes also accepted chore or battery grocycodes (thanks @lowlee)
|
12
changelog/64_3.1.2_2021-09-27.md
Normal file
@@ -0,0 +1,12 @@
|
||||
- Fixed that the "Add all list items to stock" shopping list workflow did not work for more than ~6 items (thanks @tjhowse)
|
||||
- Fixed that plural form handling (e.g. for quantity units) was wrong for negative numbers
|
||||
- Fixed that the context menu entries `Consume` and `Transfer` on the stock overview page were disabled when the amount in stock was < 1
|
||||
- Fixed that on consuming a product from not the products default location, the products default location was recorded in the stock journal
|
||||
- Fixed that when undoing a stock consume transaction from not the products default location, the corresponding amount was always added back to to the products defaullt location
|
||||
- Fixed that when having multiple quantity unit conversions for a products default QU purchase, on purchase was potentially a wrong conversion factor picked
|
||||
- Fixed that when there was any chore with a schedule, but without a "next estimated tracking" date/time, the iCal export was broken
|
||||
- The product and chore edit pages now have bottom-sticky save buttons
|
||||
- A product picture can now be added when creating a product (was currently only possible when editing a product)
|
||||
|
||||
### API
|
||||
- Fixed that international characters and spaces were not allowed in API query filters
|
19
changelog/65_3.1.3_2021-11-14.md
Normal file
@@ -0,0 +1,19 @@
|
||||
- The "Below min. stock amount" filter on the stock overview page now also includes due-soon, overdue or already expired products
|
||||
- The default shopping list (named "Shopping list"; localized) can now be renamed
|
||||
- Added the products average price as a (hidden by default) column on the stock overview page
|
||||
- Added a new "Presets for new products" stock setting for the "Default due days" option of new products
|
||||
- When adding (purchase) a product with "Default due days after freezing" set directly to a freezer location, the due date is now prefilled by that (instead of the normal "Default due days") (thanks @grahamc for the initial work on this)
|
||||
- Chores can now be merged (new item in the context-/more-menu on the chores list page)
|
||||
- Fixed that "Label per unit" stock entry labels (on purchase) weren't unique per unit
|
||||
- Fixed that the "Add as new product" productpicker workflow, started from the shopping list item form, always selected the default shopping list after finishing the flow
|
||||
- Fixed that when undoing a product opened transaction and when the product has "Default due days after opened" set, the original due date wasn't restored
|
||||
- Fixed that "Track date only"-chores were shown as overdue on the due day on the chores overview page
|
||||
- Fixed that dropdown filters for tables maybe did not work after reordering columns
|
||||
- Fixed that auto night mode over midnight did not always work
|
||||
- Fixed that the labels of context-/more-menu items were not readable in Night Mode (thanks @corbolais)
|
||||
- Fixed that the "Stay logged in permanently" checkbox on the login page had no effect (thanks @0)
|
||||
|
||||
### API
|
||||
- New endpoint `/chores/{choreIdToKeep}/merge/{choreIdToRemove}` for merging chores
|
||||
- Endpoint `/stock/products/{productId}/add` API endpoint: The (optional) request body parameter `print_stock_label` was renamed to `stock_label_type`
|
||||
- Fixed that backslashes were not allowed in API query filters
|
79
changelog/66_3.2.0_2022-02-11.md
Normal file
@@ -0,0 +1,79 @@
|
||||
### Stock
|
||||
|
||||
- The `config.php` option `FEATURE_SETTING_STOCK_COUNT_OPENED_PRODUCTS_AGAINST_MINIMUM_STOCK_AMOUNT` was removed and is now a new product option `Treat opened as out of stock`, means, if opened stock entries will be counted as missing for calculating if a product is below its minimum stock amount, can now be configured per product
|
||||
- The existing option will be migrated to all existing products, so no changed behavior after the update
|
||||
- There is also a new stock setting (section "Presets for new products") which can be used to configure the default when adding products (also that will be set based on the old setting on migration)
|
||||
- When using/scanning a stock entry grocycode on the consume page, the amount is now prefilled by the stock entry amount (making it essentially possible to consume the corresponding stock entry in one go)
|
||||
- Stock entry labels get now also printed on inventory (only when adding products, same option "Stock entry label" like on the purchase page)
|
||||
- Fixed that stock entry labels on purchase were printed, even when "No label" was selected (was only a problem when running label printer WebHooks server side)
|
||||
- Fixed that formatted (HTML) text for the (hidden by default) product description column on the stock overview page was not correctly displayed
|
||||
- Fixed that numeric and date-time sorting of table columns on the stock entries page did not work correctly (thanks @MasterofJOKers)
|
||||
- Fixed that the consume page/dialog wasn't properly initialized when opening it from the stock entries page
|
||||
- Fixed that entries for not existing users were missing on the stock journal
|
||||
|
||||
### Recipes
|
||||
|
||||
- Optimized recipe costs calculation to better reflect the current real costs: Out of stock ingredients now use the last price
|
||||
- Background: Before v3.0.0 recipe costs were only based on the last price per product and since v3.0.0 the "real costs" (based on the default consume rule "Opened first, then first due first, then first in first out") are used, means out of stock items have no price - so using the last price for out of stock items should reflect the current real costs better
|
||||
- Added a new recipes setting (top right corner settings menu) "Show the recipe list and the recipe side by side" (defaults to enabled, so no changed behaviour when not configured)
|
||||
- When disabled, on the recipes page, the recipe list is displayed full-width and the recipe will be shown in a popup instead of on the right side
|
||||
- Recipes are now also grocycode enabled (works like any other grocycode; download/print it via the recipes edit page or the more/context menu on the recipes page; use/scan it at any place a recipe can be selected)
|
||||
- Performance improvements (page loading time) of the recipes page
|
||||
- Fixed that when adding missing recipe ingredients, with the option "Only check if any amount is in stock" enabled, to the shopping list, unit conversions (if any) weren't considered
|
||||
- Fixed that the recipe stock fulfillment information about shopping list amounts was not correct when the ingredient had a decimal amount
|
||||
|
||||
### Meal plan
|
||||
|
||||
- Meal plan sections can now (optionally) define a time, which will then be displayed on the meal plan section header and used for the corresponding calendar events
|
||||
- Additionally the correspnding calendar event now also mentions the meal plan section name
|
||||
- The day/week view can now be toggled
|
||||
- New button on top right corner of the meal plan (only visible on bigger screens)
|
||||
- On smaller screen the day view is still the default (no change)
|
||||
- Fixed that the meal plan showed the total calories per recipe (instead of per serving as stated by the suffix)
|
||||
|
||||
### Chores
|
||||
|
||||
- Chore schedules can now be skipped
|
||||
- New button on the chores overview and chore tracking page
|
||||
- Skipped schedules will be highlighted accordingly on the chore journal
|
||||
- Added a new chore option "Start date" which is used as a schedule starting point when the chore was never tracked
|
||||
- Until now, the schedule starting point was the first tracked execution
|
||||
- For all existing chores, the start date will be set to the first tracked execution time (or today, for chores which were never tracked) on migration
|
||||
- The `Yearly` period type has been changed to be schedule the chore on the _same day_ each year
|
||||
- This period type scheduled chores 1 year _after the last execution_ before, which is also possible by using the `Daily` period type and a period interval of 365 days; all existing `Yearly` schedules will be converted to that on migration
|
||||
- Added a new `Hourly` period type (to schedule chores every `x` hours)
|
||||
- Added a new `Adaptive` period type (to schedule chores dynamically based on the past average execution frequency)
|
||||
- Removed the period type `Dynamic regular`, since it's the same as `Daily`
|
||||
- All existing `Dynamic regular` schedules will be converted to that on migration
|
||||
- The chorecard now also shows the average execution frequency (how often the chore was executed in the past on average)
|
||||
|
||||
### Calendar
|
||||
|
||||
- Fixed that when having a task without a due date, the iCal export was broken
|
||||
|
||||
### Tasks
|
||||
|
||||
- Added a "Save & add another task"-button on the add task dialog to quickly create multiple tasks without having to close/reopen the dialog
|
||||
- Fixed that when editing a task without a due date, `1970-01-01` was shown
|
||||
|
||||
### General
|
||||
|
||||
- Added a separate status filter and table row highlighting (blue) on the chores, tasks and batteries overview pages for items due today
|
||||
- Additionally, the "due soon" days of chores/tasks/batteries (top right corner settings menu) can be set to `0` to disable that filter/highlighting
|
||||
- Optimized relative time display (also fixed a phrasing problem for some languages, e.g. Hungarian) (thanks @Tallyrald)
|
||||
- New input shorthand `[+/-]n[d/m/y]` for date fields to quickly input a date relative to today (adding (**+**) or subtracting (**-**) the **n**umber of **d**ays/**m**onths/**y**ears, see the full list of available shorthands [here](https://github.com/grocy/grocy#input-shorthands-for-date-fields))
|
||||
- When using LDAP authentication, the configured `LDAP_UID_ATTR` is now used to compare if the user already exists instead of the username entered on the login page (that prevents creating multiple users if you enter the username in different notations) (thanks @FloSet)
|
||||
- When using reverse proxy authentication (`ReverseProxyAuthMiddleware`), it's now also possible to pass the username in an environment variable instead of an HTTP header (new `config.php` option `REVERSE_PROXY_AUTH_USE_ENV`) (thanks @Forceu)
|
||||
- The `config.php` option `DISABLE_BROWSER_BARCODE_CAMERA_SCANNING` has been renamed to `FEATURE_FLAG_DISABLE_BROWSER_BARCODE_CAMERA_SCANNING`
|
||||
- Fixed that when having a quantity unit matching any application string, the translation of that string was used to display that unit
|
||||
- Fixed that the logout button/menu was missing when using external authentication (e.g. LDAP)
|
||||
- New translations: (thanks all the translators)
|
||||
- Catalan (demo available at https://ca.demo.grocy.info)
|
||||
|
||||
### API
|
||||
|
||||
- The API endpoint `/stock/shoppinglist/clear` has now a new optional request body parameter `done_only` (to only remove done items from the given shopping list, defaults to `false`)
|
||||
- The API endpoint `/chores/{choreId}/execute` has now a new optional request body parameter `skipped` (to skip the next chore schedule, defaults to `false`)
|
||||
- The API endpoint `/chores/{choreId}` has new response field/property `average_execution_frequency_hours` (contains the average past execution frequency in hours or `null`, when the chore was never executed before)
|
||||
- New API endpoint `/recipes/{recipeId}/printlabel` (to print recipe grocycodes on the configured label printer)
|
||||
- Fixed that the barcode lookup for the "Stock by-barcode" API endpoints was case sensitive
|
121
changelog/67_3.3.0_2022-04-08.md
Normal file
@@ -0,0 +1,121 @@
|
||||
### New feature: Notes and Userfields for stock entries
|
||||
|
||||
- Stock entries can now have notes
|
||||
- For example to distinguish between same, yet different products (e.g. having only a generic product "Chocolate" and note in that field what special one it is exactly this time - as an alternative to have sub products)
|
||||
- Or for example to track ownership of stock items when sharing the fridge with your flatmates
|
||||
- => New field on the purchase and inventory (and stock entry edit) page
|
||||
- => New column on the stock entries and stock journal page
|
||||
- => Visible also in the "Use a specific stock item" dropdown on the consume and transfer page
|
||||
- Additionally it's also possible to add arbitrary own fields by using Userfields
|
||||
- => Configure the desired Userfields for the entity `stock`
|
||||
- => Those Userfields are then visible on the same places as mentioned above for the built-in "Note" field
|
||||
|
||||
### New feature: Recipes "Due score"
|
||||
|
||||
- A number (new column on the recipes page) which represents a score which is higher the more ingredients, of the corresponding recipe, currently in stock are due soon, overdue or already expired
|
||||
- Or in other words: A score to see which recipes to cook to not waste already overdue/expired or due soon products
|
||||
- The score is in detail based on:
|
||||
- 1 point for each due soon ingredient (based on the stock setting "Due soon days")
|
||||
- 10 points per overdue ingredient
|
||||
- 20 points per expired ingredient
|
||||
- (or else 0)
|
||||
- The corresponding ingredient is also highlighted in red/yellow/grey (same colors as on the stock overview page)
|
||||
|
||||
### Stock
|
||||
|
||||
- It's now possible to change a products stock QU, even after it was once added to stock
|
||||
- When the product was once added to stock, there needs to exist a corresponding unit conversion for the new QU
|
||||
- Product card, stock overiew and stock entries page optimizations regarding displaying prices:
|
||||
- Prices are now shown per default purchase quantity unit, instead of per stock QU and when clicking/hovering, a tooltip shows the price per stock QU
|
||||
- The price history chart is now based on the value per purchase QU, instead of per stock QU
|
||||
- New product option "Default consume location" (not mandatory, defaults to not set / empty)
|
||||
- When set, stock entries at that location will be consumed first
|
||||
- => This will be automatically taken into account when consuming from the stock overview page and all other places where no specific location can be selected
|
||||
- => On the consume page the location is preselected in the following order:
|
||||
1. The new default consume location, if the product currently has any stock there, otherwise
|
||||
2. The products default location, if the product currently has any stock there, otherwise
|
||||
3. The first location where the product currently has any stock
|
||||
- Optimized quantity unit conversion handling:
|
||||
- The option "Create inverse QU conversion" was removed when creating a QU conversion
|
||||
- => Instead the corresponding inverse conversion is now always created/updated/deleted automatically
|
||||
- New product option "Disable own stock" (defaults to disabled)
|
||||
- When enabled, the corresponding product can't have own stock, means it will not be selectable on purchase (useful for parent products which are just used as a summary/total view of the sub products)
|
||||
- The location content sheet can now optionally list also out of stock products (at the products default location, new checkbox "Show only in-stock products" at the top of the page, defaults to enabled)
|
||||
- Added a location filter to the stock entries page
|
||||
- Added the product grocycode as a (hidden by default) column to the products list (master data)
|
||||
- The price entered on the inventory page is now related to the selected quantity unit (like on the purchase page, was always related to the products stock QU before)
|
||||
- Fixed that consuming via the consume page was not possible when `FEATURE_FLAG_STOCK_LOCATION_TRACKING` was disabled
|
||||
|
||||
### Shopping list
|
||||
|
||||
- Added a new shopping list setting (top right corner settings menu) to automatically add products, that are below their defined min. stock amount, to the shopping list (defaults to disabled)
|
||||
- Fixed that when using "Add products that are below defined min. stock amount", the calculated missing amount was wrong for products which had the new product option `Treat opened as out of stock` set and when having at least one opened stock entry
|
||||
|
||||
### Recipes
|
||||
|
||||
- When a parent product is used as an ingredient, which is currently not in stock itself, the substituted product (so the one which was already taken into account when consuming the recipe) is now displayed below the ingredient and the costs (and calories) are taken from that one, to reflect the current real costs even better
|
||||
- Added a new recipes setting (top right corner settings menu) "Show a little checkbox next to each ingredient to mark it as done" (defaults to disabled)
|
||||
- When enabled, next to each ingredient a little checkbox will be shown
|
||||
- When clicked, the ingredient is crossed out
|
||||
- This status is not saved, means reset when the page is reloaded
|
||||
- Fixed that consuming recipes was possible when not all ingredients were in stock (and this potentially consumed some of the in stock ingredients; not matching the message "nothing removed")
|
||||
- Fixed that the price of the "Produces product"-product, which is added to stock on consuming a recipe, was wrong (was the recipe total costs multiplied by the serving amount instead of only the recipe total costs)
|
||||
- Fixed that calories of recipe ingredients were displayed with an indefinite number of decimal places
|
||||
- Fixed that ingredient amounts were wrong for multi-nested (> 2 levels) recipes, when the included recipe used an serving amount other than 1
|
||||
- Fixed that searching/filtering the recipe gallery view did not work correctly
|
||||
- Fixed that searching/filtering recipes by products did not work (e.g. via the context-/more menu option "Search for recipes containing this product" on the stock overview page)
|
||||
|
||||
### Meal plan
|
||||
|
||||
- The day is now editable on the edit dialog of any meal plan entry, which makes it possible to move entries to a different day
|
||||
- Fixed that it was not possible to print the meal plan (and other pages) in landscape (thanks @miguelangel-nubla)
|
||||
|
||||
### Chores
|
||||
|
||||
- The `Daily` period type has been changed to schedule the chore at the _same time_ (based on the start date) each `n` days
|
||||
- This period type scheduled chores `n` days _after the last execution_ before, which is also possible by using the `Hourly` period type and a corresponding period interval; all existing `Daily` schedules will be converted to that on migration
|
||||
- It's now possible to manually reschedule / assign chores
|
||||
- New entry "Reschedule next execution" in the context/more menu on the chores overview page
|
||||
- If you have rescheduled a chore and want to continue the normal schedule/assignment instead, use the "Clear" button in the same dialog
|
||||
- Rescheduled/reassigned chores will be highlighted with an corresponding icon next to the "Next estimated tracking date" / "Assigned to"
|
||||
- Optimized that when skipping chores via the chore tracking page, the given time is used as the "skipped time", not the scheduled next estimated tracking time of the corresponding chore (making it essentially possible to skip more then one schedule at once)
|
||||
- Fixed that when consuming a parent product on chore execution (chore option "Consume product on chore execution"), no child products were used if the parent product itself is not in stock
|
||||
- Fixed that the upgrade to v3.2.0 failed when having any former "Dynamic Regular" chore with a "Period interval" of `0` (which makes absolutely no sense in reality)
|
||||
|
||||
### Tasks
|
||||
|
||||
- Fixed that tasks without a due date were highlighted in red (like overdue tasks)
|
||||
|
||||
### Batteries
|
||||
|
||||
- Fixed that the batteries overview page was broken when there was any battery Userfield with enabled "Show as column in tables" option
|
||||
- Fixed that grocycode label printer printing didn't work from the battery edit page (master data) (thanks @andreheuer)
|
||||
- Fixed that undoing a battery charge cycle had no effect on "Last charged" and "Next planned charge cycle" of the corresponding battery
|
||||
|
||||
### Equipment
|
||||
|
||||
- It's now possible to add multiple files (PDFs / manuals) to each equipment
|
||||
- Define as many Userfields for the entity `equipment` and use the type `File`
|
||||
- => Each of those File-Userfields will be shown as a separate tab on the equipment page
|
||||
|
||||
### Userfields
|
||||
|
||||
- Userfields of type "Date & time" and "Date (without time)" have now the option to default to now / today for new objects (new Userfield option "Default value")
|
||||
|
||||
### General
|
||||
|
||||
- Optimized form validation: Save / submit buttons are now not disabled when the form is invalid, the invalid / missing fields are instead highlighted when trying to submit / save the form (making it more obvious which fields are invalid / missing exactly)
|
||||
- Night mode can now use / follow the system preferred color scheme
|
||||
- The view/user setting "Enable night mode" has been removed and replaced by "Night mode" which now defaults to "Use system setting" (which uses the system preferred color scheme, "On" and "Off" are other possible options to always enable/disable night mode)
|
||||
- Some night mode style refinements
|
||||
- Fixed an server error (on every page) when not having any quantity unit
|
||||
- New translations: (thanks all the translators)
|
||||
- Slovenian (demo available at <https://sl.demo.grocy.info>)
|
||||
|
||||
### API
|
||||
|
||||
- Added a new endpoint `GET /stock/locations/{locationId}/entries` to get all stock entries of a given location (similar to the already existing endpoint `GET /stock/products/{productId}/entries`)
|
||||
- Endpoint `/recipes/{recipeId}/consume`: Fixed that consuming partially fulfilled recipes was possible, although an error was already returned in that case (and potentially some of the in stock ingredients were consumed in fact)
|
||||
- Endpoint `/stock/products/{productId}`:
|
||||
- New field/property `current_price` which returns the current price of the corresponding product, based on the stock entry to use next (defined by the default consume rule "Opened first, then first due first, then first in first out") or on the last price if the product is currently not in stock
|
||||
- The field/property `oldest_price` is deprecated and will be removed in a future version (this had no real sense, currently returns the same as `current_price`)
|
33
changelog/68_3.3.1_2022-06-10.md
Normal file
@@ -0,0 +1,33 @@
|
||||
### Stock
|
||||
|
||||
- New product option "Move on open" (defaults to disabled)
|
||||
- When enabled, on marking the product as opened, the corresponding amount will be moved to the products default consume location
|
||||
- (Thanks @RosemaryOrchard)
|
||||
- The stock setting "Decimal places allowed for prices" has been split into separate settings for input and displaying prices (the existing setting will be set for both new options on migration, so no changed behavior when not configured)
|
||||
- Optimized that when the plural form(s) of a quantity unit is/are not provided, the singular form is used to display plural amounts
|
||||
- Fixed that "Automatically add products that are below their defined min. stock amount to the shopping list" (stock setting) was only done when consuming products, not when opening them
|
||||
- Fixed that the price history chart (product card) showed the price on a wrong date when having multiple purchases on the same date from different stores
|
||||
|
||||
### Recipes
|
||||
|
||||
- Fixed that when a substituted product is used to display costs and calories (so when a parent product ingredient is currently not in stock itself), no unit conversions were considered for costs/calories calculation
|
||||
- Fixed that the displayed "already on the shopping list"-amount (for missing ingredients) was wrong when the products "Factor purchase to stock quantity unit" wasn't 1
|
||||
|
||||
### Chores
|
||||
|
||||
- Fixed that rescheduling of "Track date only"-chores for today was not possible
|
||||
|
||||
### Calendar
|
||||
|
||||
- Fixed that clicking on meal plan product and notes calendar entries redirected to an invalid page
|
||||
|
||||
### General
|
||||
|
||||
- LDAP authentication: Optimized that it's not required that LDAP accounts need to have a first-/lastname
|
||||
|
||||
### API
|
||||
|
||||
- Endpoint `/stock/products/{productId}`: New field/property `default_consume_location` (contains the products default consume location object)
|
||||
- Endpoint `/stock/products/{productId}/add`: Fixed that the request body parameter `transaction_type` was ignored / always set to `purchase`
|
||||
- Fixed that the endpoint `/stock/products/by-barcode/{barcode}/open` didn't handle stock entries provided by a grocycode (thanks @jtommi)
|
||||
- Fixed that less or equal (`<=`) and greater or equal (`>=`) filter comparisons didn't work (optional `query[]` request query parameter on most endpoints)
|
42
changelog/69_3.3.2_2022-11-12.md
Normal file
@@ -0,0 +1,42 @@
|
||||
### Stock
|
||||
|
||||
- Improved that when editing a unit conversion, the "Quantity unit from" and "Quantity unit to" of the corresponding inverse conversion is now also updated accordingly if changed (until now only the factor was updated automatically)
|
||||
- Changed that the "Move on open" product option can now always be used/set, even when the "Default location" and "Default conume location" are the same
|
||||
- Fixed that stock entry notes were lost when consuming/opening/transferring a partial amount of the corresponding stock entry (thanks @akoshpinter)
|
||||
- Fixed that the average shelf life of a product (on the productcard) was wrong when the corresponding stock entry was edited
|
||||
- Fixed that when the stock setting "Decimal places allowed for amounts" was set to `0`, unit conversion (if any) failed when adding the corresponding product to stock
|
||||
- Fixed that consuming a parent product which is not in stock itself (so essentially using any of the child products) may failed when unit conversions were involved (the current stock amount check was wrong in that case)
|
||||
- Fixed that the status button counters on the stock overview page ("X products are overdue" and so on) included products which have the option `Never show on stock overview` enabled
|
||||
- Fixed that adding Userfields to existing stock entries was not possible (only editing existing Userfield values, e.g. added during purchase or inventory, was possible)
|
||||
- Fixed that it was not possible to change a products stock QU, when the needed unit conversion (old QU => new QU) was only defined globally (means on QU level) or by the products "Factor purchase to stock quantity unit"
|
||||
- Fixed that when changing a products stock QU, the products "Quick consume mount", "Energy (kcal)" and "Tare weight" wasn't updated according to the corresponding unit conversion factor
|
||||
- Fixed that when changing a products stock QU, the product barcode amounts were also changed based on the corresponding unit conversion factor
|
||||
|
||||
### Shopping list
|
||||
|
||||
- Fixed that products could not be added to the shopping list via barcode scanning
|
||||
|
||||
### Recipes
|
||||
|
||||
- Fixed that headlines in the recipe description (preparation text) were removed on saving
|
||||
- Fixed that the default consume rule was not always applied correctly when a recipe consumed a substituted ingredient (so when having a parent product in the recipe which is currently not in stock itself)
|
||||
|
||||
### Userfields
|
||||
|
||||
- Fixed that edit forms were broken when editing an object with `null` Userfields (so when the field for that object was not set before / on the initial object creation)
|
||||
|
||||
### General
|
||||
|
||||
- It's now possible to edit a user without necessarily updating the users password
|
||||
- Fixed that column reordering didn't work on the stock overview, stock entries and shopping list page when showing column which are not shown by default
|
||||
- Fixed that when running label printer WebHooks client side (so when `LABEL_PRINTER_RUN_SERVER` = `false`), the setting `LABEL_PRINTER_HOOK_JSON` was ignored (the WebHook data was always sent as form data)
|
||||
- Fixed that granular user permissions (like "Shopping list / Add items" or "Equipment") didn't allow to add/edit the corresponding items without also having the "Edit master data" permission
|
||||
- New translations: (thanks all the translators)
|
||||
- Lithuanian (demo available at <https://lt.demo.grocy.info>)
|
||||
- Ukrainian (demo available at <https://uk.demo.grocy.info>)
|
||||
|
||||
### API
|
||||
|
||||
- Endpoint `/stock/volatile`
|
||||
- The field/property `missing_products` now also contains the `product` object
|
||||
- Endpoint `/recipes/{recipeId}/consume`: Fixed (again) that consuming partially fulfilled recipes was possible, although an error was already returned in that case (and potentially some of the in stock ingredients were consumed in fact)
|
55
changelog/__TEMPLATE.md
Normal file
@@ -0,0 +1,55 @@
|
||||
> ⚠️ xxxBREAKING CHANGESxxx
|
||||
|
||||
> ❗ xxxImportant upgrade informationXXX
|
||||
|
||||
### New feature: xxxx
|
||||
|
||||
- xxx
|
||||
|
||||
### Stock
|
||||
|
||||
- xxx
|
||||
|
||||
### Shopping list
|
||||
|
||||
- xxx
|
||||
|
||||
### Recipes
|
||||
|
||||
- xxx
|
||||
|
||||
### Meal plan
|
||||
|
||||
- xxx
|
||||
|
||||
### Chores
|
||||
|
||||
- xxx
|
||||
|
||||
### Calendar
|
||||
|
||||
- xxx
|
||||
|
||||
### Tasks
|
||||
|
||||
- xxx
|
||||
|
||||
### Batteries
|
||||
|
||||
- xxx
|
||||
|
||||
### Equipment
|
||||
|
||||
- xxx
|
||||
|
||||
### Userfields
|
||||
|
||||
- xxx
|
||||
|
||||
### General
|
||||
|
||||
- xxx
|
||||
|
||||
### API
|
||||
|
||||
- xxx
|
@@ -1,17 +1,20 @@
|
||||
{
|
||||
"require": {
|
||||
"php": ">=7.2",
|
||||
"php": "^8.0",
|
||||
"slim/slim": "^4.0",
|
||||
"slim/psr7": "^1.0",
|
||||
"slim/http": "^1.0",
|
||||
"php-di/php-di": "^6.0",
|
||||
"rubellum/slim-blade-view": "^0.1.1",
|
||||
"morris/lessql": "^0.4.1",
|
||||
"berrnd/slim-blade-view": "^1.0.0",
|
||||
"morris/lessql": "^1.0",
|
||||
"gettext/gettext": "^4.8",
|
||||
"eluceo/ical": "^0.16.0",
|
||||
"eluceo/ical": "^2.2.0",
|
||||
"erusev/parsedown": "^1.7",
|
||||
"gumlet/php-image-resize": "^1.9",
|
||||
"ezyang/htmlpurifier": "^4.13"
|
||||
"gumlet/php-image-resize": "^2.0",
|
||||
"ezyang/htmlpurifier": "^4.13",
|
||||
"interficieis/php-barcode": "^2.0.2",
|
||||
"guzzlehttp/guzzle": "^7.0",
|
||||
"mike42/escpos-php": "^3.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
@@ -23,5 +26,8 @@
|
||||
"files": [
|
||||
"helpers/extensions.php"
|
||||
]
|
||||
},
|
||||
"config": {
|
||||
"platform-check": false
|
||||
}
|
||||
}
|
||||
|
2200
composer.lock
generated
208
config-dist.php
@@ -1,16 +1,16 @@
|
||||
<?php
|
||||
|
||||
// Settings can also be overwritten in two ways
|
||||
// Settings can also be overwritten in two ways:
|
||||
//
|
||||
// First priority
|
||||
// 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
|
||||
// Second priority:
|
||||
// An environment variable with the same name as the setting and prefix "GROCY_"
|
||||
// so for example "GROCY_BASE_URL"
|
||||
//
|
||||
// Third priority
|
||||
// Third priority:
|
||||
// The settings defined here below
|
||||
|
||||
// Either "production", "dev", "demo" or "prerelease"
|
||||
@@ -18,11 +18,11 @@
|
||||
// demo data will be populated during database migrations
|
||||
Setting('MODE', 'production');
|
||||
|
||||
// Either "en" or "de" or the directory name of
|
||||
// one of the other available localization folders in the "/localization" directory
|
||||
// The directory name of one of the available localization folders
|
||||
// in the "/localization" directory (e.g. "en" or "de")
|
||||
Setting('DEFAULT_LOCALE', 'en');
|
||||
|
||||
// This is used to define the first day of a week for calendar views in the frontend,
|
||||
// This is used to define the first day of a week for calendar views,
|
||||
// leave empty to use the locale default
|
||||
// Needs to be a number where Sunday = 0, Monday = 1 and so forth
|
||||
Setting('CALENDAR_FIRST_DAY_OF_WEEK', '');
|
||||
@@ -30,14 +30,19 @@ Setting('CALENDAR_FIRST_DAY_OF_WEEK', '');
|
||||
// If calendars should show week numbers
|
||||
Setting('CALENDAR_SHOW_WEEK_OF_YEAR', true);
|
||||
|
||||
// Set this if you want to have a different start day for the weekly meal plan view,
|
||||
// leave empty to use CALENDAR_FIRST_DAY_OF_WEEK (see above)
|
||||
// Needs to be a number where Sunday = 0, Monday = 1 and so forth
|
||||
Setting('MEAL_PLAN_FIRST_DAY_OF_WEEK', '');
|
||||
|
||||
// To keep it simple: grocy does not handle any currency conversions,
|
||||
// this here is used to format all money values,
|
||||
// so doesn't really matter, but should be the
|
||||
// so doesn't really matter, but needs to be the
|
||||
// ISO 4217 code of the currency ("USD", "EUR", "GBP", etc.)
|
||||
Setting('CURRENCY', 'USD');
|
||||
|
||||
// When running grocy in a subdirectory, this should be set to the relative path, otherwise empty
|
||||
// It needs to be set to the part (of the URL) after the document root,
|
||||
// It needs to be set to the part (of the URL) AFTER the document root,
|
||||
// if URL rewriting is disabled, including index.php
|
||||
// Example with URL Rewriting support:
|
||||
// Root URL = https://example.com/grocy
|
||||
@@ -53,15 +58,15 @@ Setting('BASE_PATH', '');
|
||||
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,
|
||||
// must be the filename (folder /data/plugins) without the .php extension,
|
||||
// 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);
|
||||
|
||||
// Specify an custom homepage if desired - by default the homepage will be set to the stock overview page,
|
||||
// this needs to be one of the following values:
|
||||
// Specify an custom homepage if desired, by default the homepage will be set to the stock overview page
|
||||
// This needs to be one of the following values:
|
||||
// stock, shoppinglist, recipes, chores, tasks, batteries, equipment, calendar, mealplan
|
||||
Setting('ENTRY_PAGE', 'stock');
|
||||
|
||||
@@ -73,96 +78,49 @@ Setting('DISABLE_AUTH', false);
|
||||
// or any class that implements Grocy\Middleware\AuthMiddleware
|
||||
Setting('AUTH_CLASS', 'Grocy\Middleware\DefaultAuthMiddleware');
|
||||
|
||||
// When using ReverseProxyAuthMiddleware,
|
||||
// the name of the HTTP header which your reverse proxy uses to pass the username (on successful authentication)
|
||||
Setting('REVERSE_PROXY_AUTH_HEADER', 'REMOTE_USER');
|
||||
// Options when using ReverseProxyAuthMiddleware
|
||||
Setting('REVERSE_PROXY_AUTH_HEADER', 'REMOTE_USER'); // The name of the HTTP header which your reverse proxy uses to pass the username (on successful authentication)
|
||||
Setting('REVERSE_PROXY_AUTH_USE_ENV', false); // Set to true if the username is passed as environment variable
|
||||
|
||||
// When using LdapAuthMiddleware
|
||||
Setting('LDAP_DOMAIN', ''); // Example value "local"
|
||||
// Options when using LdapAuthMiddleware
|
||||
Setting('LDAP_ADDRESS', ''); // Example value "ldap://vm-dc2019.local.berrnd.net"
|
||||
Setting('LDAP_BASE_DN', ''); // Example value "OU=OU_Users,DC=local,DC=berrnd,DC=net"
|
||||
|
||||
// Set this to true if you want to disable the ability to scan a barcode via the device camera (Browser API)
|
||||
Setting('DISABLE_BROWSER_BARCODE_CAMERA_SCANNING', false);
|
||||
|
||||
// Set this if you want to have a different start day for the weekly meal plan view,
|
||||
// leave empty to use CALENDAR_FIRST_DAY_OF_WEEK (see above)
|
||||
// Needs to be a number where Sunday = 0, Monday = 1 and so forth
|
||||
Setting('MEAL_PLAN_FIRST_DAY_OF_WEEK', '');
|
||||
Setting('LDAP_BASE_DN', ''); // Example value "DC=local,DC=berrnd,DC=net"
|
||||
Setting('LDAP_BIND_DN', ''); // Example value "CN=grocy_bind_account,OU=service_accounts,DC=local,DC=berrnd,DC=net"
|
||||
Setting('LDAP_BIND_PW', ''); // Password for the above account
|
||||
Setting('LDAP_USER_FILTER', ''); // Example value "(OU=grocy_users)"
|
||||
Setting('LDAP_UID_ATTR', ''); // Windows AD: "sAMAccountName", OpenLDAP: "uid", GLAuth: "cn"
|
||||
|
||||
// Default permissions for new users
|
||||
// the array needs to contain the technical/constant names
|
||||
// see the file controllers/Users/User.php for possible values
|
||||
// See the file controllers/Users/User.php for possible values
|
||||
Setting('DEFAULT_PERMISSIONS', ['ADMIN']);
|
||||
|
||||
// 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
|
||||
// "1D" (=> Code128) or "2D" (=> DataMatrix)
|
||||
Setting('GROCYCODE_TYPE', '1D');
|
||||
|
||||
// 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)
|
||||
|
||||
// Keep screen on settings
|
||||
DefaultUserSetting('keep_screen_on', false); // Keep the screen always on
|
||||
DefaultUserSetting('keep_screen_on_when_fullscreen_card', false); // Keep the screen on when a "fullscreen-card" is displayed
|
||||
// Label printer settings
|
||||
Setting('LABEL_PRINTER_WEBHOOK', ''); // The URI that grocy will POST to when asked to print a label
|
||||
Setting('LABEL_PRINTER_RUN_SERVER', true); // Whether the webhook will be called server- or client-side
|
||||
Setting('LABEL_PRINTER_PARAMS', ['font_family' => 'Source Sans Pro (Regular)']); // Additional parameters supplied to the webhook
|
||||
Setting('LABEL_PRINTER_HOOK_JSON', false); // TRUE to use JSON or FALSE to use normal POST request variables
|
||||
|
||||
// Stock settings
|
||||
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)
|
||||
DefaultUserSetting('stock_decimal_places_amounts', 4); // Default decimal places allowed for amounts
|
||||
DefaultUserSetting('stock_decimal_places_prices', 2); // Default decimal places allowed for prices
|
||||
DefaultUserSetting('stock_due_soon_days', 5);
|
||||
DefaultUserSetting('stock_default_purchase_amount', 0);
|
||||
DefaultUserSetting('stock_default_consume_amount', 1);
|
||||
DefaultUserSetting('stock_default_consume_amount_use_quick_consume_amount', false);
|
||||
DefaultUserSetting('scan_mode_consume_enabled', false);
|
||||
DefaultUserSetting('scan_mode_purchase_enabled', false);
|
||||
DefaultUserSetting('show_icon_on_stock_overview_page_when_product_is_on_shopping_list', true);
|
||||
DefaultUserSetting('show_purchased_date_on_purchase', false); // Wheter the purchased date should be editable on purchase (defaults to today otherwise)
|
||||
DefaultUserSetting('show_warning_on_purchase_when_due_date_is_earlier_than_next', true); // Show a warning on purchase when the due date of the purchased product is earlier than the next due date in stock
|
||||
|
||||
// Shopping list settings
|
||||
DefaultUserSetting('shopping_list_to_stock_workflow_auto_submit_when_prefilled', false); // Automatically do the booking using the last price and the amount of the shopping list item, if the product has "Default due days" set
|
||||
DefaultUserSetting('shopping_list_show_calendar', false);
|
||||
// Thermal printer options
|
||||
// Thermal printers are receipt printers, not regular printers,
|
||||
// the printer must support the ESC/POS protocol, see https://github.com/mike42/escpos-php
|
||||
Setting('TPRINTER_IS_NETWORK_PRINTER', false); // Set to true if it's a network printer
|
||||
Setting('TPRINTER_PRINT_QUANTITY_NAME', true); // Set to false if you do not want to print the quantity names (related to the shopping list)
|
||||
Setting('TPRINTER_PRINT_NOTES', true); // Set to false if you do not want to print notes (related to the shopping list)
|
||||
Setting('TPRINTER_IP', '127.0.0.1'); // IP of the network printer (does only matter if it's a network printer)
|
||||
Setting('TPRINTER_PORT', 9100); // Port of the network printer (does only matter if it's a network printer)
|
||||
Setting('TPRINTER_CONNECTOR', '/dev/usb/lp0'); // Printer device (does only matter if you use a locally attached printer)
|
||||
// For USB on Linux this is often '/dev/usb/lp0', for serial printers it could be similar to '/dev/ttyS0'
|
||||
// Make sure that the user that runs the webserver has permissions to write to the printer - on Linux add your webserver user to the LP group with usermod -a -G lp www-data
|
||||
|
||||
// Recipe settings
|
||||
DefaultUserSetting('recipe_ingredients_group_by_product_group', false); // Group recipe ingredients by their product group
|
||||
|
||||
// Chores settings
|
||||
DefaultUserSetting('chores_due_soon_days', 5);
|
||||
|
||||
// Batteries settings
|
||||
DefaultUserSetting('batteries_due_soon_days', 5);
|
||||
|
||||
// Tasks settings
|
||||
DefaultUserSetting('tasks_due_soon_days', 5);
|
||||
|
||||
// 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);
|
||||
|
||||
// Component configuration for Quagga2 - read https://github.com/ericblade/quagga2#configobject for details
|
||||
// Below is a generic good configuration,
|
||||
// for an iPhone 7 Plus, halfsample = true, patchsize = small, frequency = 5 yields very good results
|
||||
DefaultUserSetting('quagga2_numofworkers', 4);
|
||||
DefaultUserSetting('quagga2_halfsample', false);
|
||||
DefaultUserSetting('quagga2_patchsize', 'medium');
|
||||
DefaultUserSetting('quagga2_frequency', 10);
|
||||
DefaultUserSetting('quagga2_debug', true);
|
||||
|
||||
// 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
|
||||
// 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_STOCK', true);
|
||||
Setting('FEATURE_FLAG_SHOPPINGLIST', true);
|
||||
@@ -172,6 +130,7 @@ Setting('FEATURE_FLAG_TASKS', true);
|
||||
Setting('FEATURE_FLAG_BATTERIES', true);
|
||||
Setting('FEATURE_FLAG_EQUIPMENT', true);
|
||||
Setting('FEATURE_FLAG_CALENDAR', true);
|
||||
Setting('FEATURE_FLAG_LABEL_PRINTER', false);
|
||||
|
||||
// Sub feature flags
|
||||
Setting('FEATURE_FLAG_STOCK_PRICE_TRACKING', true);
|
||||
@@ -182,7 +141,76 @@ Setting('FEATURE_FLAG_STOCK_PRODUCT_FREEZING', true);
|
||||
Setting('FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_FIELD_NUMBER_PAD', true); // Activate the number pad in due date fields on (supported) mobile browsers
|
||||
Setting('FEATURE_FLAG_SHOPPINGLIST_MULTIPLE_LISTS', true);
|
||||
Setting('FEATURE_FLAG_CHORES_ASSIGNMENTS', true);
|
||||
Setting('FEATURE_FLAG_THERMAL_PRINTER', false);
|
||||
|
||||
// Feature settings
|
||||
Setting('FEATURE_SETTING_STOCK_COUNT_OPENED_PRODUCTS_AGAINST_MINIMUM_STOCK_AMOUNT', true); // When set to true, opened items will be counted as missing for calculating if a product is below its minimum stock amount
|
||||
Setting('FEATURE_FLAG_AUTO_TORCH_ON_WITH_CAMERA', true); // Enables the torch automaticaly (if the device has one)
|
||||
Setting('FEATURE_FLAG_DISABLE_BROWSER_BARCODE_CAMERA_SCANNING', false); // Set this to true if you want to disable the ability to scan a barcode via the device camera (Browser API)
|
||||
Setting('FEATURE_FLAG_AUTO_TORCH_ON_WITH_CAMERA', true); // Enables the torch automatically (if the device has one)
|
||||
|
||||
|
||||
// Default user settings
|
||||
// These settings can be changed per user and via the UI,
|
||||
// below are the defaults which are used when the user has not changed the setting so far
|
||||
|
||||
// Night mode related
|
||||
DefaultUserSetting('night_mode', 'follow-system'); // "on" = Night mode is always on ; "off" = Night mode is always off / "follow-system" = System preferred color schema is used
|
||||
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('night_mode_enabled_internal', false); // Internal setting if night mode is actually enabled (based on the other settings)
|
||||
|
||||
// Generic settings
|
||||
DefaultUserSetting('auto_reload_on_db_change', false); // If the page should be automatically reloaded when there was an external change
|
||||
DefaultUserSetting('show_clock_in_header', false); // Show a clock in the header next to the logo or not
|
||||
DefaultUserSetting('keep_screen_on', false); // If the screen should always be kept on
|
||||
DefaultUserSetting('keep_screen_on_when_fullscreen_card', false); // If the screen should be kept on when a "fullscreen-card" is displayed
|
||||
|
||||
// Stock settings
|
||||
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)
|
||||
DefaultUserSetting('product_presets_default_due_days', 0); // Default due days for new products (-1 means that the product will be never overdue)
|
||||
DefaultUserSetting('product_presets_treat_opened_as_out_of_stock', true); // Default "Treat opened as out of stock" option for new products
|
||||
DefaultUserSetting('stock_decimal_places_amounts', 4); // Default decimal places allowed for amounts
|
||||
DefaultUserSetting('stock_decimal_places_prices_input', 2); // Default decimal places allowed for prices (input)
|
||||
DefaultUserSetting('stock_decimal_places_prices_display', 2); // Default decimal places allowed for prices (display)
|
||||
DefaultUserSetting('stock_auto_decimal_separator_prices', false); // If the decimal separator should be set automatically for amount inputs
|
||||
DefaultUserSetting('stock_due_soon_days', 5); // The "expiring soon" days
|
||||
DefaultUserSetting('stock_default_purchase_amount', 0); // The default amount prefilled on the purchase page
|
||||
DefaultUserSetting('stock_default_consume_amount', 1); // The default amount prefilled on the consume page
|
||||
DefaultUserSetting('stock_default_consume_amount_use_quick_consume_amount', false); // If the products quick consume amount should be prefilled on the consume page
|
||||
DefaultUserSetting('scan_mode_consume_enabled', false); // If scan mode on the consume page is enabled
|
||||
DefaultUserSetting('scan_mode_purchase_enabled', false); // If scan mode on the purchase page is enabled
|
||||
DefaultUserSetting('show_icon_on_stock_overview_page_when_product_is_on_shopping_list', true); // When enabled, an icon is shown on the stock overview page (next to the product name) when the prodcut is currently on a shopping list
|
||||
DefaultUserSetting('show_purchased_date_on_purchase', false); // Whether the purchased date should be editable on purchase (defaults to today otherwise)
|
||||
DefaultUserSetting('show_warning_on_purchase_when_due_date_is_earlier_than_next', true); // Show a warning on purchase when the due date of the purchased product is earlier than the next due date in stock
|
||||
|
||||
// Shopping list settings
|
||||
DefaultUserSetting('shopping_list_to_stock_workflow_auto_submit_when_prefilled', false); // Automatically do the booking using the last price and the amount of the shopping list item, if the product has "Default due days" set
|
||||
DefaultUserSetting('shopping_list_show_calendar', false); // When enabled, a small (month view) calendar will be shown on the shopping list page
|
||||
DefaultUserSetting('shopping_list_auto_add_below_min_stock_amount', false); // If products should be automatically added to the shopping list when they are below their min. stock amount
|
||||
DefaultUserSetting('shopping_list_auto_add_below_min_stock_amount_list_id', 1); // When the above setting is enabled, the id of the shopping list to which the products will be added
|
||||
|
||||
// Recipe settings
|
||||
DefaultUserSetting('recipe_ingredients_group_by_product_group', false); // Group recipe ingredients by their product group
|
||||
DefaultUserSetting('recipes_show_list_side_by_side', true); // If the recipe should be displayed next to recipe list on the recipes page
|
||||
DefaultUserSetting('recipes_show_ingredient_checkbox', false); // When enabled, a little checkbox will be shown next to each ingredient to mark it as done
|
||||
|
||||
// Chores settings
|
||||
DefaultUserSetting('chores_due_soon_days', 5); // The "due soon" days
|
||||
|
||||
// Batteries settings
|
||||
DefaultUserSetting('batteries_due_soon_days', 5); // The "due soon" days
|
||||
|
||||
// Tasks settings
|
||||
DefaultUserSetting('tasks_due_soon_days', 5); // The "due soon" days
|
||||
|
||||
// Component configuration for Quagga2 - read https://github.com/ericblade/quagga2#configobject for details
|
||||
// Below is a generic good configuration,
|
||||
// for an iPhone 7 Plus, halfsample = true, patchsize = small, frequency = 5 yields very good results
|
||||
DefaultUserSetting('quagga2_numofworkers', 4);
|
||||
DefaultUserSetting('quagga2_halfsample', false);
|
||||
DefaultUserSetting('quagga2_patchsize', 'medium');
|
||||
DefaultUserSetting('quagga2_frequency', 10);
|
||||
DefaultUserSetting('quagga2_debug', true);
|
||||
|
@@ -6,19 +6,21 @@ use LessQL\Result;
|
||||
|
||||
class BaseApiController extends BaseController
|
||||
{
|
||||
const PATTERN_FIELD = '[A-Za-z_][A-Za-z0-9_]+';
|
||||
|
||||
const PATTERN_OPERATOR = '!?((>=)|(<=)|=|~|<|>|(§))';
|
||||
|
||||
const PATTERN_VALUE = '[A-Za-z\p{L}\p{M}0-9*_.$#^| -\\\]+';
|
||||
|
||||
protected $OpenApiSpec = null;
|
||||
|
||||
const PATTERN_FIELD = '[A-Za-z_][A-Za-z0-9_]+';
|
||||
const PATTERN_OPERATOR = '!?(=|~|<|>|(>=)|(<=)|(§))';
|
||||
const PATTERN_VALUE = '[A-Za-z_0-9.$#^|]+';
|
||||
|
||||
public function __construct(\DI\Container $container)
|
||||
protected function ApiResponse(\Psr\Http\Message\ResponseInterface $response, $data, $cache = false)
|
||||
{
|
||||
parent::__construct($container);
|
||||
if ($cache)
|
||||
{
|
||||
$response = $response->withHeader('Cache-Control', 'max-age=2592000');
|
||||
}
|
||||
|
||||
protected function ApiResponse(\Psr\Http\Message\ResponseInterface $response, $data)
|
||||
{
|
||||
$response->getBody()->write(json_encode($data));
|
||||
return $response;
|
||||
}
|
||||
@@ -83,7 +85,7 @@ class BaseApiController extends BaseController
|
||||
preg_match(
|
||||
'/(?P<field>' . self::PATTERN_FIELD . ')'
|
||||
. '(?P<op>' . self::PATTERN_OPERATOR . ')'
|
||||
. '(?P<value>' . self::PATTERN_VALUE . ')/',
|
||||
. '(?P<value>' . self::PATTERN_VALUE . ')/u',
|
||||
$q,
|
||||
$matches
|
||||
);
|
||||
|
@@ -11,6 +11,7 @@ use Grocy\Services\ChoresService;
|
||||
use Grocy\Services\DatabaseService;
|
||||
use Grocy\Services\FilesService;
|
||||
use Grocy\Services\LocalizationService;
|
||||
use Grocy\Services\PrintService;
|
||||
use Grocy\Services\RecipesService;
|
||||
use Grocy\Services\SessionService;
|
||||
use Grocy\Services\StockService;
|
||||
@@ -20,14 +21,14 @@ use Grocy\Services\UsersService;
|
||||
|
||||
class BaseController
|
||||
{
|
||||
protected $AppContainer;
|
||||
|
||||
public function __construct(\DI\Container $container)
|
||||
{
|
||||
$this->AppContainer = $container;
|
||||
$this->View = $container->get('view');
|
||||
}
|
||||
|
||||
protected $AppContainer;
|
||||
|
||||
protected function getApiKeyService()
|
||||
{
|
||||
return ApiKeyService::getInstance();
|
||||
@@ -93,6 +94,11 @@ class BaseController
|
||||
return StockService::getInstance();
|
||||
}
|
||||
|
||||
protected function getPrintService()
|
||||
{
|
||||
return PrintService::getInstance();
|
||||
}
|
||||
|
||||
protected function getTasksService()
|
||||
{
|
||||
return TasksService::getInstance();
|
||||
@@ -120,10 +126,11 @@ class BaseController
|
||||
$this->View->set('__t', function (string $text, ...$placeholderValues) use ($localizationService) {
|
||||
return $localizationService->__t($text, $placeholderValues);
|
||||
});
|
||||
$this->View->set('__n', function ($number, $singularForm, $pluralForm) use ($localizationService) {
|
||||
return $localizationService->__n($number, $singularForm, $pluralForm);
|
||||
$this->View->set('__n', function ($number, $singularForm, $pluralForm, $isQu = false) use ($localizationService) {
|
||||
return $localizationService->__n($number, $singularForm, $pluralForm, $isQu);
|
||||
});
|
||||
$this->View->set('GettextPo', $localizationService->GetPoAsJsonString());
|
||||
$this->View->set('LocalizationStrings', $localizationService->GetPoAsJsonString());
|
||||
$this->View->set('LocalizationStringsQu', $localizationService->GetPoAsJsonStringQu());
|
||||
|
||||
// TODO: Better handle this generically based on the current language (header in .po file?)
|
||||
$dir = 'ltr';
|
||||
@@ -157,6 +164,17 @@ class BaseController
|
||||
if (GROCY_AUTHENTICATED)
|
||||
{
|
||||
$this->View->set('permissions', User::PermissionList());
|
||||
|
||||
$decimalPlacesAmounts = intval($this->getUsersService()->GetUserSetting(GROCY_USER_ID, 'stock_decimal_places_amounts'));
|
||||
if ($decimalPlacesAmounts <= 0)
|
||||
{
|
||||
$defaultMinAmount = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$defaultMinAmount = '0.' . str_repeat('0', $decimalPlacesAmounts - 1) . '1';
|
||||
}
|
||||
$this->View->set('DEFAULT_MIN_AMOUNT', $defaultMinAmount);
|
||||
}
|
||||
|
||||
return $this->View->render($response, $page, $data);
|
||||
@@ -168,7 +186,6 @@ class BaseController
|
||||
try
|
||||
{
|
||||
$usersService = $this->getUsersService();
|
||||
|
||||
if (defined('GROCY_USER_ID'))
|
||||
{
|
||||
$this->View->set('userSettings', $usersService->GetUserSettings(GROCY_USER_ID));
|
||||
@@ -192,17 +209,33 @@ class BaseController
|
||||
{
|
||||
if (self::$htmlPurifierInstance == null)
|
||||
{
|
||||
self::$htmlPurifierInstance = new \HTMLPurifier(\HTMLPurifier_Config::createDefault());
|
||||
$htmlPurifierConfig = \HTMLPurifier_Config::createDefault();
|
||||
$htmlPurifierConfig->set('Cache.SerializerPath', GROCY_DATAPATH . '/viewcache');
|
||||
$htmlPurifierConfig->set('HTML.Allowed', 'div,b,strong,i,em,u,a[href|title|target],iframe[src|width|height|frameborder],ul,ol,li,p[style],br,span[style],img[style|width|height|alt|src],table[border|width|style],tbody,tr,td,th,blockquote,*[style|class|id],h1,h2,h3,h4,h5,h6');
|
||||
$htmlPurifierConfig->set('Attr.EnableID', true);
|
||||
$htmlPurifierConfig->set('HTML.SafeIframe', true);
|
||||
$htmlPurifierConfig->set('CSS.AllowedProperties', 'font,font-size,font-weight,font-style,font-family,text-decoration,padding-left,color,background-color,text-align,width,height');
|
||||
$htmlPurifierConfig->set('URI.AllowedSchemes', ['data' => true, 'http' => true, 'https' => true]);
|
||||
$htmlPurifierConfig->set('URI.SafeIframeRegexp', '%^.*%'); // Allow any iframe source
|
||||
$htmlPurifierConfig->set('CSS.MaxImgLength', null);
|
||||
|
||||
self::$htmlPurifierInstance = new \HTMLPurifier($htmlPurifierConfig);
|
||||
}
|
||||
|
||||
$requestBody = $request->getParsedBody();
|
||||
foreach ($requestBody as $key => &$value)
|
||||
{
|
||||
// HTMLPurifier removes boolean values (true/false), so explicitly keep them
|
||||
// HTMLPurifier removes boolean values (true/false) and arrays, so explicitly keep them
|
||||
// Maybe also possible through HTMLPurifier config (http://htmlpurifier.org/live/configdoc/plain.html)
|
||||
if (!is_bool($value))
|
||||
if (!is_bool($value) && !is_array($value))
|
||||
{
|
||||
$value = self::$htmlPurifierInstance->purify($value);
|
||||
|
||||
// Allow some special chars
|
||||
// Maybe also possible through HTMLPurifier config (http://htmlpurifier.org/live/configdoc/plain.html)
|
||||
$value = str_replace('&', '&', $value);
|
||||
$value = str_replace('>', '>', $value);
|
||||
$value = str_replace('<', '<', $value);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -3,6 +3,8 @@
|
||||
namespace Grocy\Controllers;
|
||||
|
||||
use Grocy\Controllers\Users\User;
|
||||
use Grocy\Helpers\WebhookRunner;
|
||||
use Grocy\Helpers\Grocycode;
|
||||
|
||||
class BatteriesApiController extends BaseApiController
|
||||
{
|
||||
@@ -32,7 +34,6 @@ class BatteriesApiController extends BaseApiController
|
||||
try
|
||||
{
|
||||
$trackedTime = date('Y-m-d H:i:s');
|
||||
|
||||
if (array_key_exists('tracked_time', $requestBody) && IsIsoDateTime($requestBody['tracked_time']))
|
||||
{
|
||||
$trackedTime = $requestBody['tracked_time'];
|
||||
@@ -62,8 +63,27 @@ class BatteriesApiController extends BaseApiController
|
||||
}
|
||||
}
|
||||
|
||||
public function __construct(\DI\Container $container)
|
||||
public function BatteryPrintLabel(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
parent::__construct($container);
|
||||
try
|
||||
{
|
||||
$battery = $this->getDatabase()->batteries()->where('id', $args['batteryId'])->fetch();
|
||||
|
||||
$webhookData = array_merge([
|
||||
'battery' => $battery->name,
|
||||
'grocycode' => (string)(new Grocycode(Grocycode::BATTERY, $args['batteryId'])),
|
||||
], GROCY_LABEL_PRINTER_PARAMS);
|
||||
|
||||
if (GROCY_LABEL_PRINTER_RUN_SERVER)
|
||||
{
|
||||
(new WebhookRunner())->run(GROCY_LABEL_PRINTER_WEBHOOK, $webhookData, GROCY_LABEL_PRINTER_HOOK_JSON);
|
||||
}
|
||||
|
||||
return $this->ApiResponse($response, $webhookData);
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
{
|
||||
return $this->GenericErrorResponse($response, $ex->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -2,8 +2,12 @@
|
||||
|
||||
namespace Grocy\Controllers;
|
||||
|
||||
use Grocy\Helpers\Grocycode;
|
||||
|
||||
class BatteriesController extends BaseController
|
||||
{
|
||||
use GrocycodeTrait;
|
||||
|
||||
public function BatteriesList(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
if (isset($request->getQueryParams()['include_disabled']))
|
||||
@@ -48,8 +52,25 @@ class BatteriesController extends BaseController
|
||||
|
||||
public function Journal(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
if (isset($request->getQueryParams()['months']) && filter_var($request->getQueryParams()['months'], FILTER_VALIDATE_INT) !== false)
|
||||
{
|
||||
$months = $request->getQueryParams()['months'];
|
||||
$where = "tracked_time > DATE(DATE('now', 'localtime'), '-$months months')";
|
||||
}
|
||||
else
|
||||
{
|
||||
// Default 2 years
|
||||
$where = "tracked_time > DATE(DATE('now', 'localtime'), '-24 months')";
|
||||
}
|
||||
|
||||
if (isset($request->getQueryParams()['battery']) && filter_var($request->getQueryParams()['battery'], FILTER_VALIDATE_INT) !== false)
|
||||
{
|
||||
$batteryId = $request->getQueryParams()['battery'];
|
||||
$where .= " AND battery_id = $batteryId";
|
||||
}
|
||||
|
||||
return $this->renderPage($response, 'batteriesjournal', [
|
||||
'chargeCycles' => $this->getDatabase()->battery_charge_cycles()->orderBy('tracked_time', 'DESC'),
|
||||
'chargeCycles' => $this->getDatabase()->battery_charge_cycles()->where($where)->orderBy('tracked_time', 'DESC'),
|
||||
'batteries' => $this->getDatabase()->batteries()->where('active = 1')->orderBy('name', 'COLLATE NOCASE')
|
||||
]);
|
||||
}
|
||||
@@ -59,9 +80,30 @@ class BatteriesController extends BaseController
|
||||
$usersService = $this->getUsersService();
|
||||
$nextXDays = $usersService->GetUserSettings(GROCY_USER_ID)['batteries_due_soon_days'];
|
||||
|
||||
$batteries = $this->getDatabase()->batteries()->where('active = 1')->orderBy('name', 'COLLATE NOCASE');
|
||||
$currentBatteries = $this->getBatteriesService()->GetCurrent();
|
||||
foreach ($currentBatteries as $currentBattery)
|
||||
{
|
||||
if (FindObjectInArrayByPropertyValue($batteries, 'id', $currentBattery->battery_id)->charge_interval_days > 0)
|
||||
{
|
||||
if ($currentBattery->next_estimated_charge_time < date('Y-m-d H:i:s'))
|
||||
{
|
||||
$currentBattery->due_type = 'overdue';
|
||||
}
|
||||
elseif ($currentBattery->next_estimated_charge_time <= date('Y-m-d 23:59:59'))
|
||||
{
|
||||
$currentBattery->due_type = 'duetoday';
|
||||
}
|
||||
elseif ($nextXDays > 0 && $currentBattery->next_estimated_charge_time <= date('Y-m-d H:i:s', strtotime('+' . $nextXDays . ' days')))
|
||||
{
|
||||
$currentBattery->due_type = 'duesoon';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $this->renderPage($response, 'batteriesoverview', [
|
||||
'batteries' => $this->getDatabase()->batteries()->where('active = 1')->orderBy('name', 'COLLATE NOCASE'),
|
||||
'current' => $this->getBatteriesService()->GetCurrent(),
|
||||
'batteries' => $batteries,
|
||||
'current' => $currentBatteries,
|
||||
'nextXDays' => $nextXDays,
|
||||
'userfields' => $this->getUserfieldsService()->GetFields('batteries'),
|
||||
'userfieldValues' => $this->getUserfieldsService()->GetAllValues('batteries')
|
||||
@@ -75,8 +117,9 @@ class BatteriesController extends BaseController
|
||||
]);
|
||||
}
|
||||
|
||||
public function __construct(\DI\Container $container)
|
||||
public function BatteryGrocycodeImage(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
parent::__construct($container);
|
||||
$gc = new Grocycode(Grocycode::BATTERY, $args['batteryId']);
|
||||
return $this->ServeGrocycodeImage($request, $response, $gc);
|
||||
}
|
||||
}
|
||||
|
@@ -2,24 +2,33 @@
|
||||
|
||||
namespace Grocy\Controllers;
|
||||
|
||||
use Eluceo\iCal\Domain\Entity\Calendar;
|
||||
use Eluceo\iCal\Domain\Entity\Event;
|
||||
use Eluceo\iCal\Domain\Entity\TimeZone;
|
||||
use Eluceo\iCal\Domain\ValueObject\Date;
|
||||
use Eluceo\iCal\Domain\ValueObject\DateTime;
|
||||
use Eluceo\iCal\Domain\ValueObject\SingleDay;
|
||||
use Eluceo\iCal\Domain\ValueObject\TimeSpan;
|
||||
use Eluceo\iCal\Presentation\Factory\CalendarFactory;
|
||||
|
||||
class CalendarApiController extends BaseApiController
|
||||
{
|
||||
public function Ical(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
try
|
||||
{
|
||||
$vCalendar = new \Eluceo\iCal\Component\Calendar('grocy');
|
||||
|
||||
$events = $this->getCalendarService()->GetEvents();
|
||||
$minDate = null;
|
||||
$maxDate = null;
|
||||
|
||||
$vCalendar = new Calendar();
|
||||
$vCalendar->setProductIdentifier('grocy');
|
||||
|
||||
foreach ($events as $event)
|
||||
{
|
||||
$date = new \DateTime($event['start']);
|
||||
$date->setTimezone(new \DateTimeZone(date_default_timezone_get()));
|
||||
|
||||
if ($event['date_format'] === 'date')
|
||||
if (!isset($event['start']) || empty($event['start']))
|
||||
{
|
||||
$date->setTime(23, 59, 59);
|
||||
continue;
|
||||
}
|
||||
|
||||
$description = '';
|
||||
@@ -28,18 +37,47 @@ class CalendarApiController extends BaseApiController
|
||||
$description = $event['description'];
|
||||
}
|
||||
|
||||
$vEvent = new \Eluceo\iCal\Component\Event();
|
||||
$vEvent->setDtStart($date)
|
||||
->setDtEnd($date)
|
||||
->setSummary($event['title'])
|
||||
->setDescription($description)
|
||||
->setNoTime($event['date_format'] === 'date' || (isset($event['allDay']) && $event['allDay']))
|
||||
->setUseTimezone(true);
|
||||
if ($event['date_format'] === 'date' || (isset($event['allDay']) && $event['allDay']))
|
||||
{
|
||||
// All-day event
|
||||
$date = new Date(\DateTimeImmutable::createFromFormat('Y-m-d', substr($event['start'], 0, 10)));
|
||||
$vEventOccurrence = new SingleDay($date);
|
||||
|
||||
$vCalendar->addComponent($vEvent);
|
||||
$compareDate = \DateTimeImmutable::createFromFormat('Y-m-d', substr($event['start'], 0, 10));
|
||||
}
|
||||
else
|
||||
{
|
||||
// Time-point event
|
||||
$start = new DateTime(\DateTimeImmutable::createFromFormat('Y-m-d H:i:s', $event['start']), true);
|
||||
$end = new DateTime(\DateTimeImmutable::createFromFormat('Y-m-d H:i:s', $event['start']), true);
|
||||
$vEventOccurrence = new TimeSpan($start, $end);
|
||||
|
||||
$compareDate = \DateTimeImmutable::createFromFormat('Y-m-d H:i:s', $event['start']);
|
||||
}
|
||||
|
||||
$response->write($vCalendar->render());
|
||||
$vEvent = new Event();
|
||||
$vEvent->setOccurrence($vEventOccurrence)
|
||||
->setSummary($event['title'])
|
||||
->setDescription($description);
|
||||
|
||||
$vCalendar->addEvent($vEvent);
|
||||
|
||||
if ($minDate == null || $compareDate < $minDate)
|
||||
{
|
||||
$minDate = $compareDate;
|
||||
}
|
||||
if ($maxDate == null || $compareDate > $maxDate)
|
||||
{
|
||||
$maxDate = $compareDate;
|
||||
}
|
||||
}
|
||||
|
||||
if ($minDate != null && $maxDate != null)
|
||||
{
|
||||
$vCalendar->addTimeZone(TimeZone::createFromPhpDateTimeZone(new \DateTimeZone(date_default_timezone_get()), $minDate, $maxDate));
|
||||
}
|
||||
|
||||
$response->write((new CalendarFactory())->createCalendar($vCalendar));
|
||||
$response = $response->withHeader('Content-Type', 'text/calendar; charset=utf-8');
|
||||
return $response->withHeader('Content-Disposition', 'attachment; filename="grocy.ics"');
|
||||
}
|
||||
@@ -62,9 +100,4 @@ class CalendarApiController extends BaseApiController
|
||||
return $this->GenericErrorResponse($response, $ex->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public function __construct(\DI\Container $container)
|
||||
{
|
||||
parent::__construct($container);
|
||||
}
|
||||
}
|
||||
|
@@ -10,9 +10,4 @@ class CalendarController extends BaseController
|
||||
'fullcalendarEventSources' => $this->getCalendarService()->GetEvents()
|
||||
]);
|
||||
}
|
||||
|
||||
public function __construct(\DI\Container $container)
|
||||
{
|
||||
parent::__construct($container);
|
||||
}
|
||||
}
|
||||
|
@@ -3,6 +3,8 @@
|
||||
namespace Grocy\Controllers;
|
||||
|
||||
use Grocy\Controllers\Users\User;
|
||||
use Grocy\Helpers\WebhookRunner;
|
||||
use Grocy\Helpers\Grocycode;
|
||||
|
||||
class ChoresApiController extends BaseApiController
|
||||
{
|
||||
@@ -66,14 +68,18 @@ class ChoresApiController extends BaseApiController
|
||||
User::checkPermission($request, User::PERMISSION_CHORE_TRACK_EXECUTION);
|
||||
|
||||
$trackedTime = date('Y-m-d H:i:s');
|
||||
|
||||
if (array_key_exists('tracked_time', $requestBody) && (IsIsoDateTime($requestBody['tracked_time']) || IsIsoDate($requestBody['tracked_time'])))
|
||||
{
|
||||
$trackedTime = $requestBody['tracked_time'];
|
||||
}
|
||||
|
||||
$doneBy = GROCY_USER_ID;
|
||||
$skipped = false;
|
||||
if (array_key_exists('skipped', $requestBody) && filter_var($requestBody['skipped'], FILTER_VALIDATE_BOOLEAN) !== false)
|
||||
{
|
||||
$skipped = $requestBody['skipped'];
|
||||
}
|
||||
|
||||
$doneBy = GROCY_USER_ID;
|
||||
if (array_key_exists('done_by', $requestBody) && !empty($requestBody['done_by']))
|
||||
{
|
||||
$doneBy = $requestBody['done_by'];
|
||||
@@ -81,10 +87,10 @@ class ChoresApiController extends BaseApiController
|
||||
|
||||
if ($doneBy != GROCY_USER_ID)
|
||||
{
|
||||
User::checkPermission($request, User::PERMISSION_CHORE_TRACK_EXECUTION_EXECUTION);
|
||||
User::checkPermission($request, User::PERMISSION_CHORE_TRACK_EXECUTION);
|
||||
}
|
||||
|
||||
$choreExecutionId = $this->getChoresService()->TrackChore($args['choreId'], $trackedTime, $doneBy);
|
||||
$choreExecutionId = $this->getChoresService()->TrackChore($args['choreId'], $trackedTime, $doneBy, $skipped);
|
||||
return $this->ApiResponse($response, $this->getDatabase()->chores_log($choreExecutionId));
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
@@ -108,8 +114,47 @@ class ChoresApiController extends BaseApiController
|
||||
}
|
||||
}
|
||||
|
||||
public function __construct(\DI\Container $container)
|
||||
public function ChorePrintLabel(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
parent::__construct($container);
|
||||
try
|
||||
{
|
||||
$chore = $this->getDatabase()->chores()->where('id', $args['choreId'])->fetch();
|
||||
|
||||
$webhookData = array_merge([
|
||||
'chore' => $chore->name,
|
||||
'grocycode' => (string)(new Grocycode(Grocycode::CHORE, $args['choreId'])),
|
||||
], GROCY_LABEL_PRINTER_PARAMS);
|
||||
|
||||
if (GROCY_LABEL_PRINTER_RUN_SERVER)
|
||||
{
|
||||
(new WebhookRunner())->run(GROCY_LABEL_PRINTER_WEBHOOK, $webhookData, GROCY_LABEL_PRINTER_HOOK_JSON);
|
||||
}
|
||||
|
||||
return $this->ApiResponse($response, $webhookData);
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
{
|
||||
return $this->GenericErrorResponse($response, $ex->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public function MergeChores(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
User::checkPermission($request, User::PERMISSION_MASTER_DATA_EDIT);
|
||||
|
||||
try
|
||||
{
|
||||
if (filter_var($args['choreIdToKeep'], FILTER_VALIDATE_INT) === false || filter_var($args['choreIdToRemove'], FILTER_VALIDATE_INT) === false)
|
||||
{
|
||||
throw new \Exception('Provided {choreIdToKeep} or {choreIdToRemove} is not a valid integer');
|
||||
}
|
||||
|
||||
$this->ApiResponse($response, $this->getChoresService()->MergeChores($args['choreIdToKeep'], $args['choreIdToRemove']));
|
||||
return $this->EmptyApiResponse($response);
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
{
|
||||
return $this->GenericErrorResponse($response, $ex->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -2,8 +2,12 @@
|
||||
|
||||
namespace Grocy\Controllers;
|
||||
|
||||
use Grocy\Helpers\Grocycode;
|
||||
|
||||
class ChoresController extends BaseController
|
||||
{
|
||||
use GrocycodeTrait;
|
||||
|
||||
public function ChoreEditForm(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
$usersService = $this->getUsersService();
|
||||
@@ -59,10 +63,29 @@ class ChoresController extends BaseController
|
||||
|
||||
public function Journal(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
if (isset($request->getQueryParams()['months']) && filter_var($request->getQueryParams()['months'], FILTER_VALIDATE_INT) !== false)
|
||||
{
|
||||
$months = $request->getQueryParams()['months'];
|
||||
$where = "tracked_time > DATE(DATE('now', 'localtime'), '-$months months')";
|
||||
}
|
||||
else
|
||||
{
|
||||
// Default 1 year
|
||||
$where = "tracked_time > DATE(DATE('now', 'localtime'), '-12 months')";
|
||||
}
|
||||
|
||||
if (isset($request->getQueryParams()['chore']) && filter_var($request->getQueryParams()['chore'], FILTER_VALIDATE_INT) !== false)
|
||||
{
|
||||
$choreId = $request->getQueryParams()['chore'];
|
||||
$where .= " AND chore_id = $choreId";
|
||||
}
|
||||
|
||||
return $this->renderPage($response, 'choresjournal', [
|
||||
'choresLog' => $this->getDatabase()->chores_log()->orderBy('tracked_time', 'DESC'),
|
||||
'choresLog' => $this->getDatabase()->chores_log()->where($where)->orderBy('tracked_time', 'DESC'),
|
||||
'chores' => $this->getDatabase()->chores()->where('active = 1')->orderBy('name', 'COLLATE NOCASE'),
|
||||
'users' => $this->getDatabase()->users()->orderBy('username')
|
||||
'users' => $this->getDatabase()->users()->orderBy('username'),
|
||||
'userfields' => $this->getUserfieldsService()->GetFields('chores_log'),
|
||||
'userfieldValues' => $this->getUserfieldsService()->GetAllValues('chores_log')
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -71,9 +94,30 @@ class ChoresController extends BaseController
|
||||
$usersService = $this->getUsersService();
|
||||
$nextXDays = $usersService->GetUserSettings(GROCY_USER_ID)['chores_due_soon_days'];
|
||||
|
||||
$chores = $this->getDatabase()->chores()->orderBy('name', 'COLLATE NOCASE');
|
||||
$currentChores = $this->getChoresService()->GetCurrent();
|
||||
foreach ($currentChores as $currentChore)
|
||||
{
|
||||
if (!empty($currentChore->next_estimated_execution_time))
|
||||
{
|
||||
if ($currentChore->next_estimated_execution_time < date('Y-m-d H:i:s'))
|
||||
{
|
||||
$currentChore->due_type = 'overdue';
|
||||
}
|
||||
elseif ($currentChore->next_estimated_execution_time <= date('Y-m-d 23:59:59'))
|
||||
{
|
||||
$currentChore->due_type = 'duetoday';
|
||||
}
|
||||
elseif ($nextXDays > 0 && $currentChore->next_estimated_execution_time <= date('Y-m-d H:i:s', strtotime('+' . $nextXDays . ' days')))
|
||||
{
|
||||
$currentChore->due_type = 'duesoon';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $this->renderPage($response, 'choresoverview', [
|
||||
'chores' => $this->getDatabase()->chores()->orderBy('name', 'COLLATE NOCASE'),
|
||||
'currentChores' => $this->getChoresService()->GetCurrent(),
|
||||
'chores' => $chores,
|
||||
'currentChores' => $currentChores,
|
||||
'nextXDays' => $nextXDays,
|
||||
'userfields' => $this->getUserfieldsService()->GetFields('chores'),
|
||||
'userfieldValues' => $this->getUserfieldsService()->GetAllValues('chores'),
|
||||
@@ -85,12 +129,14 @@ class ChoresController extends BaseController
|
||||
{
|
||||
return $this->renderPage($response, 'choretracking', [
|
||||
'chores' => $this->getDatabase()->chores()->where('active = 1')->orderBy('name', 'COLLATE NOCASE'),
|
||||
'users' => $this->getDatabase()->users()->orderBy('username')
|
||||
'users' => $this->getDatabase()->users()->orderBy('username'),
|
||||
'userfields' => $this->getUserfieldsService()->GetFields('chores_log'),
|
||||
]);
|
||||
}
|
||||
|
||||
public function __construct(\DI\Container $container)
|
||||
public function ChoreGrocycodeImage(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
parent::__construct($container);
|
||||
$gc = new Grocycode(Grocycode::CHORE, $args['choreId']);
|
||||
return $this->ServeGrocycodeImage($request, $response, $gc);
|
||||
}
|
||||
}
|
||||
|
@@ -33,9 +33,4 @@ class EquipmentController extends BaseController
|
||||
'userfieldValues' => $this->getUserfieldsService()->GetAllValues('equipment')
|
||||
]);
|
||||
}
|
||||
|
||||
public function __construct(\DI\Container $container)
|
||||
{
|
||||
parent::__construct($container);
|
||||
}
|
||||
}
|
||||
|
@@ -11,17 +11,17 @@ use Throwable;
|
||||
|
||||
class ExceptionController extends BaseApiController
|
||||
{
|
||||
/**
|
||||
* @var \Slim\App
|
||||
*/
|
||||
private $app;
|
||||
|
||||
public function __construct(\Slim\App $app, \DI\Container $container)
|
||||
{
|
||||
parent::__construct($container);
|
||||
$this->app = $app;
|
||||
}
|
||||
|
||||
/**
|
||||
* @var \Slim\App
|
||||
*/
|
||||
private $app;
|
||||
|
||||
public function __invoke(ServerRequestInterface $request, Throwable $exception, bool $displayErrorDetails, bool $logErrors, bool $logErrorDetails, ?LoggerInterface $logger = null)
|
||||
{
|
||||
$response = $this->app->getResponseFactory()->createResponse();
|
||||
@@ -58,8 +58,11 @@ class ExceptionController extends BaseApiController
|
||||
}
|
||||
|
||||
if ($exception instanceof HttpNotFoundException)
|
||||
{
|
||||
if (!defined('GROCY_AUTHENTICATED'))
|
||||
{
|
||||
define('GROCY_AUTHENTICATED', false);
|
||||
}
|
||||
|
||||
return $this->renderPage($response->withStatus(404), 'errors/404', [
|
||||
'exception' => $exception
|
||||
@@ -74,7 +77,8 @@ class ExceptionController extends BaseApiController
|
||||
}
|
||||
|
||||
return $this->renderPage($response->withStatus(500), 'errors/500', [
|
||||
'exception' => $exception
|
||||
'exception' => $exception,
|
||||
'system_info' => $this->getApplicationService()->GetSystemInfo()
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
@@ -11,6 +11,11 @@ class FilesApiController extends BaseApiController
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!in_array($args['group'], $this->getOpenApiSpec()->components->schemas->FileGroups->enum))
|
||||
{
|
||||
throw new \Exception('Invalid file group');
|
||||
}
|
||||
|
||||
if (IsValidFileName(base64_decode($args['fileName'])))
|
||||
{
|
||||
$fileName = base64_decode($args['fileName']);
|
||||
@@ -20,12 +25,7 @@ class FilesApiController extends BaseApiController
|
||||
throw new \Exception('Invalid filename');
|
||||
}
|
||||
|
||||
$filePath = $this->getFilesService()->GetFilePath($args['group'], $fileName);
|
||||
|
||||
if (file_exists($filePath))
|
||||
{
|
||||
unlink($filePath);
|
||||
}
|
||||
$this->getFilesService()->DeleteFile($args['group'], $fileName);
|
||||
|
||||
return $this->EmptyApiResponse($response);
|
||||
}
|
||||
@@ -39,8 +39,12 @@ class FilesApiController extends BaseApiController
|
||||
{
|
||||
try
|
||||
{
|
||||
$fileName = $this->checkFileName($args['fileName']);
|
||||
if (!in_array($args['group'], $this->getOpenApiSpec()->components->schemas->FileGroups->enum))
|
||||
{
|
||||
throw new \Exception('Invalid file group');
|
||||
}
|
||||
|
||||
$fileName = $this->checkFileName($args['fileName']);
|
||||
$filePath = $this->getFilePath($args['group'], $fileName, $request->getQueryParams());
|
||||
|
||||
if (file_exists($filePath))
|
||||
@@ -65,9 +69,13 @@ class FilesApiController extends BaseApiController
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!in_array($args['group'], $this->getOpenApiSpec()->components->schemas->FileGroups->enum))
|
||||
{
|
||||
throw new \Exception('Invalid file group');
|
||||
}
|
||||
|
||||
$fileInfo = explode('_', $args['fileName']);
|
||||
$fileName = $this->checkFileName($fileInfo[1]);
|
||||
|
||||
$filePath = $this->getFilePath($args['group'], base64_decode($fileInfo[0]), $request->getQueryParams());
|
||||
|
||||
if (file_exists($filePath))
|
||||
@@ -92,9 +100,14 @@ class FilesApiController extends BaseApiController
|
||||
{
|
||||
try
|
||||
{
|
||||
$fileName = $this->checkFileName($args['fileName']);
|
||||
if (!in_array($args['group'], $this->getOpenApiSpec()->components->schemas->FileGroups->enum))
|
||||
{
|
||||
throw new \Exception('Invalid file group');
|
||||
}
|
||||
|
||||
$fileName = $this->checkFileName($args['fileName']);
|
||||
$data = $request->getBody()->getContents();
|
||||
|
||||
file_put_contents($this->getFilesService()->GetFilePath($args['group'], $fileName), $data);
|
||||
|
||||
return $this->EmptyApiResponse($response);
|
||||
@@ -105,11 +118,6 @@ class FilesApiController extends BaseApiController
|
||||
}
|
||||
}
|
||||
|
||||
public function __construct(\DI\Container $container)
|
||||
{
|
||||
parent::__construct($container);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $fileName base64-encoded file-name
|
||||
* @return false|string the decoded file-name
|
||||
@@ -138,7 +146,6 @@ class FilesApiController extends BaseApiController
|
||||
protected function getFilePath(string $group, string $fileName, array $queryParams = [])
|
||||
{
|
||||
$forceServeAs = null;
|
||||
|
||||
if (isset($queryParams['force_serve_as']) && !empty($queryParams['force_serve_as']))
|
||||
{
|
||||
$forceServeAs = $queryParams['force_serve_as'];
|
||||
@@ -147,14 +154,12 @@ class FilesApiController extends BaseApiController
|
||||
if ($forceServeAs == FilesService::FILE_SERVE_TYPE_PICTURE)
|
||||
{
|
||||
$bestFitHeight = null;
|
||||
|
||||
if (isset($queryParams['best_fit_height']) && !empty($queryParams['best_fit_height']) && is_numeric($queryParams['best_fit_height']))
|
||||
{
|
||||
$bestFitHeight = $queryParams['best_fit_height'];
|
||||
}
|
||||
|
||||
$bestFitWidth = null;
|
||||
|
||||
if (isset($queryParams['best_fit_width']) && !empty($queryParams['best_fit_width']) && is_numeric($queryParams['best_fit_width']))
|
||||
{
|
||||
$bestFitWidth = $queryParams['best_fit_width'];
|
||||
|
@@ -8,8 +8,27 @@ use Slim\Exception\HttpBadRequestException;
|
||||
class GenericEntityApiController extends BaseApiController
|
||||
{
|
||||
public function AddObject(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
if ($args['entity'] == 'shopping_list' || $args['entity'] == 'shopping_lists')
|
||||
{
|
||||
User::checkPermission($request, User::PERMISSION_SHOPPINGLIST_ITEMS_ADD);
|
||||
}
|
||||
elseif ($args['entity'] == 'recipes' || $args['entity'] == 'recipes_pos' || $args['entity'] == 'recipes_nestings')
|
||||
{
|
||||
User::checkPermission($request, User::PERMISSION_RECIPES);
|
||||
}
|
||||
elseif ($args['entity'] == 'meal_plan')
|
||||
{
|
||||
User::checkPermission($request, User::PERMISSION_RECIPES_MEALPLAN);
|
||||
}
|
||||
elseif ($args['entity'] == 'equipment')
|
||||
{
|
||||
User::checkPermission($request, User::PERMISSION_EQUIPMENT);
|
||||
}
|
||||
else
|
||||
{
|
||||
User::checkPermission($request, User::PERMISSION_MASTER_DATA_EDIT);
|
||||
}
|
||||
|
||||
if ($this->IsValidExposedEntity($args['entity']) && !$this->IsEntityWithNoEdit($args['entity']))
|
||||
{
|
||||
@@ -47,8 +66,27 @@ class GenericEntityApiController extends BaseApiController
|
||||
}
|
||||
|
||||
public function DeleteObject(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
if ($args['entity'] == 'shopping_list' || $args['entity'] == 'shopping_lists')
|
||||
{
|
||||
User::checkPermission($request, User::PERMISSION_SHOPPINGLIST_ITEMS_DELETE);
|
||||
}
|
||||
elseif ($args['entity'] == 'recipes' || $args['entity'] == 'recipes_pos' || $args['entity'] == 'recipes_nestings')
|
||||
{
|
||||
User::checkPermission($request, User::PERMISSION_RECIPES);
|
||||
}
|
||||
elseif ($args['entity'] == 'meal_plan')
|
||||
{
|
||||
User::checkPermission($request, User::PERMISSION_RECIPES_MEALPLAN);
|
||||
}
|
||||
elseif ($args['entity'] == 'equipment')
|
||||
{
|
||||
User::checkPermission($request, User::PERMISSION_EQUIPMENT);
|
||||
}
|
||||
else
|
||||
{
|
||||
User::checkPermission($request, User::PERMISSION_MASTER_DATA_EDIT);
|
||||
}
|
||||
|
||||
if ($this->IsValidExposedEntity($args['entity']) && !$this->IsEntityWithNoDelete($args['entity']))
|
||||
{
|
||||
@@ -58,6 +96,11 @@ class GenericEntityApiController extends BaseApiController
|
||||
}
|
||||
|
||||
$row = $this->getDatabase()->{$args['entity']}($args['objectId']);
|
||||
if ($row == null)
|
||||
{
|
||||
return $this->GenericErrorResponse($response, 'Object not found', 400);
|
||||
}
|
||||
|
||||
$row->delete();
|
||||
$success = $row->isClean();
|
||||
|
||||
@@ -70,8 +113,27 @@ class GenericEntityApiController extends BaseApiController
|
||||
}
|
||||
|
||||
public function EditObject(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
if ($args['entity'] == 'shopping_list' || $args['entity'] == 'shopping_lists')
|
||||
{
|
||||
User::checkPermission($request, User::PERMISSION_SHOPPINGLIST_ITEMS_ADD);
|
||||
}
|
||||
elseif ($args['entity'] == 'recipes' || $args['entity'] == 'recipes_pos' || $args['entity'] == 'recipes_nestings')
|
||||
{
|
||||
User::checkPermission($request, User::PERMISSION_RECIPES);
|
||||
}
|
||||
elseif ($args['entity'] == 'meal_plan')
|
||||
{
|
||||
User::checkPermission($request, User::PERMISSION_RECIPES_MEALPLAN);
|
||||
}
|
||||
elseif ($args['entity'] == 'equipment')
|
||||
{
|
||||
User::checkPermission($request, User::PERMISSION_EQUIPMENT);
|
||||
}
|
||||
else
|
||||
{
|
||||
User::checkPermission($request, User::PERMISSION_MASTER_DATA_EDIT);
|
||||
}
|
||||
|
||||
if ($this->IsValidExposedEntity($args['entity']) && !$this->IsEntityWithNoEdit($args['entity']))
|
||||
{
|
||||
@@ -90,6 +152,11 @@ class GenericEntityApiController extends BaseApiController
|
||||
}
|
||||
|
||||
$row = $this->getDatabase()->{$args['entity']}($args['objectId']);
|
||||
if ($row == null)
|
||||
{
|
||||
return $this->GenericErrorResponse($response, 'Object not found', 400);
|
||||
}
|
||||
|
||||
$row->update($requestBody);
|
||||
$success = $row->isClean();
|
||||
|
||||
@@ -111,14 +178,12 @@ class GenericEntityApiController extends BaseApiController
|
||||
if ($this->IsValidExposedEntity($args['entity']) && !$this->IsEntityWithNoListing($args['entity']))
|
||||
{
|
||||
$userfields = $this->getUserfieldsService()->GetValues($args['entity'], $args['objectId']);
|
||||
|
||||
if (count($userfields) === 0)
|
||||
{
|
||||
$userfields = null;
|
||||
}
|
||||
|
||||
$object = $this->getDatabase()->{$args['entity']}($args['objectId']);
|
||||
|
||||
if ($object == null)
|
||||
{
|
||||
return $this->GenericErrorResponse($response, 'Object not found', 404);
|
||||
@@ -136,34 +201,40 @@ class GenericEntityApiController extends BaseApiController
|
||||
|
||||
public function GetObjects(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
$objects = $this->queryData($this->getDatabase()->{$args['entity']}(), $request->getQueryParams());
|
||||
$allUserfields = $this->getUserfieldsService()->GetAllValues($args['entity']);
|
||||
|
||||
foreach ($objects as $object)
|
||||
if (!$this->IsValidExposedEntity($args['entity']) || $this->IsEntityWithNoListing($args['entity']))
|
||||
{
|
||||
$userfields = FindAllObjectsInArrayByPropertyValue($allUserfields, 'object_id', $object->id);
|
||||
$userfieldKeyValuePairs = null;
|
||||
return $this->GenericErrorResponse($response, 'Entity does not exist or is not exposed');
|
||||
}
|
||||
|
||||
$objects = $this->queryData($this->getDatabase()->{$args['entity']}(), $request->getQueryParams());
|
||||
$userfields = $this->getUserfieldsService()->GetFields($args['entity']);
|
||||
|
||||
if (count($userfields) > 0)
|
||||
{
|
||||
$allUserfieldValues = $this->getUserfieldsService()->GetAllValues($args['entity']);
|
||||
|
||||
foreach ($objects as $object)
|
||||
{
|
||||
$userfieldKeyValuePairs = null;
|
||||
foreach ($userfields as $userfield)
|
||||
{
|
||||
$userfieldKeyValuePairs[$userfield->name] = $userfield->value;
|
||||
$value = FindObjectInArrayByPropertyValue(FindAllObjectsInArrayByPropertyValue($allUserfieldValues, 'object_id', $object->id), 'name', $userfield->name);
|
||||
if ($value)
|
||||
{
|
||||
$userfieldKeyValuePairs[$userfield->name] = $value->value;
|
||||
}
|
||||
else
|
||||
{
|
||||
$userfieldKeyValuePairs[$userfield->name] = null;
|
||||
}
|
||||
}
|
||||
|
||||
$object->userfields = $userfieldKeyValuePairs;
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->IsValidExposedEntity($args['entity']) && !$this->IsEntityWithNoListing($args['entity']))
|
||||
{
|
||||
return $this->ApiResponse($response, $objects);
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->GenericErrorResponse($response, 'Entity does not exist or is not exposed');
|
||||
}
|
||||
}
|
||||
|
||||
public function GetUserfields(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
@@ -199,33 +270,28 @@ class GenericEntityApiController extends BaseApiController
|
||||
}
|
||||
}
|
||||
|
||||
public function __construct(\DI\Container $container)
|
||||
{
|
||||
parent::__construct($container);
|
||||
}
|
||||
|
||||
private function IsEntityWithEditRequiresAdmin($entity)
|
||||
{
|
||||
return in_array($entity, $this->getOpenApiSpec()->components->internalSchemas->ExposedEntityEditRequiresAdmin->enum);
|
||||
return in_array($entity, $this->getOpenApiSpec()->components->schemas->ExposedEntityEditRequiresAdmin->enum);
|
||||
}
|
||||
|
||||
private function IsEntityWithNoListing($entity)
|
||||
{
|
||||
return in_array($entity, $this->getOpenApiSpec()->components->internalSchemas->ExposedEntityNoListing->enum);
|
||||
return in_array($entity, $this->getOpenApiSpec()->components->schemas->ExposedEntityNoListing->enum);
|
||||
}
|
||||
|
||||
private function IsEntityWithNoEdit($entity)
|
||||
{
|
||||
return in_array($entity, $this->getOpenApiSpec()->components->internalSchemas->ExposedEntityNoEdit->enum);
|
||||
return in_array($entity, $this->getOpenApiSpec()->components->schemas->ExposedEntityNoEdit->enum);
|
||||
}
|
||||
|
||||
private function IsEntityWithNoDelete($entity)
|
||||
{
|
||||
return in_array($entity, $this->getOpenApiSpec()->components->internalSchemas->ExposedEntityNoDelete->enum);
|
||||
return in_array($entity, $this->getOpenApiSpec()->components->schemas->ExposedEntityNoDelete->enum);
|
||||
}
|
||||
|
||||
private function IsValidExposedEntity($entity)
|
||||
{
|
||||
return in_array($entity, $this->getOpenApiSpec()->components->internalSchemas->ExposedEntity->enum);
|
||||
return in_array($entity, $this->getOpenApiSpec()->components->schemas->ExposedEntity->enum);
|
||||
}
|
||||
}
|
||||
|
@@ -91,9 +91,4 @@ class GenericEntityController extends BaseController
|
||||
'userfieldValues' => $this->getUserfieldsService()->GetAllValues('userentity-' . $args['userentityName'])
|
||||
]);
|
||||
}
|
||||
|
||||
public function __construct(\DI\Container $container)
|
||||
{
|
||||
parent::__construct($container);
|
||||
}
|
||||
}
|
||||
|
45
controllers/GrocycodeTrait.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace Grocy\Controllers;
|
||||
|
||||
use Grocy\Helpers\Grocycode;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use jucksearm\barcode\lib\BarcodeFactory;
|
||||
use jucksearm\barcode\lib\DatamatrixFactory;
|
||||
|
||||
trait GrocycodeTrait
|
||||
{
|
||||
public function ServeGrocycodeImage(ServerRequestInterface $request, ResponseInterface $response, Grocycode $grocycode)
|
||||
{
|
||||
$size = $request->getQueryParam('size', null);
|
||||
|
||||
if (GROCY_GROCYCODE_TYPE == '2D')
|
||||
{
|
||||
$png = (new DatamatrixFactory())->setCode((string) $grocycode)->setSize($size)->getDatamatrixPngData();
|
||||
}
|
||||
else
|
||||
{
|
||||
$png = (new BarcodeFactory())->setType('C128')->setCode((string) $grocycode)->setHeight($size)->getBarcodePngData();
|
||||
}
|
||||
|
||||
$isDownload = $request->getQueryParam('download', false);
|
||||
if ($isDownload)
|
||||
{
|
||||
$response = $response->withHeader('Content-Type', 'application/octet-stream')
|
||||
->withHeader('Content-Disposition', 'attachment; filename=grocycode.png')
|
||||
->withHeader('Content-Length', strlen($png))
|
||||
->withHeader('Cache-Control', 'no-cache')
|
||||
->withHeader('Last-Modified', gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
}
|
||||
else
|
||||
{
|
||||
$response = $response->withHeader('Content-Type', 'image/png')
|
||||
->withHeader('Content-Length', strlen($png))
|
||||
->withHeader('Cache-Control', 'no-cache')
|
||||
->withHeader('Last-Modified', gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
}
|
||||
$response->getBody()->write($png);
|
||||
return $response;
|
||||
}
|
||||
}
|
@@ -6,11 +6,6 @@ use Grocy\Services\SessionService;
|
||||
|
||||
class LoginController extends BaseController
|
||||
{
|
||||
public function __construct(\DI\Container $container)
|
||||
{
|
||||
parent::__construct($container);
|
||||
}
|
||||
|
||||
public function LoginPage(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
return $this->renderPage($response, 'login');
|
||||
|
@@ -36,32 +36,53 @@ class OpenApiController extends BaseApiController
|
||||
$spec->info->description = str_replace('PlaceHolderManageApiKeysUrl', $this->AppContainer->get('UrlManager')->ConstructUrl('/manageapikeys'), $spec->info->description);
|
||||
$spec->servers[0]->url = $this->AppContainer->get('UrlManager')->ConstructUrl('/api');
|
||||
|
||||
$spec->components->internalSchemas->ExposedEntity_NotIncludingNotEditable = clone $spec->components->internalSchemas->StringEnumTemplate;
|
||||
foreach ($spec->components->internalSchemas->ExposedEntity->enum as $value)
|
||||
$spec->components->schemas->ExposedEntity_IncludingUserEntities = clone $spec->components->schemas->StringEnumTemplate;;
|
||||
foreach ($this->getUserfieldsService()->GetEntities() as $userEntity)
|
||||
{
|
||||
if (!in_array($value, $spec->components->internalSchemas->ExposedEntityNoEdit->enum))
|
||||
{
|
||||
array_push($spec->components->internalSchemas->ExposedEntity_NotIncludingNotEditable->enum, $value);
|
||||
}
|
||||
array_push($spec->components->schemas->ExposedEntity_IncludingUserEntities->enum, $userEntity);
|
||||
}
|
||||
sort($spec->components->schemas->ExposedEntity_IncludingUserEntities->enum);
|
||||
|
||||
$spec->components->internalSchemas->ExposedEntity_NotIncludingNotDeletable = clone $spec->components->internalSchemas->StringEnumTemplate;
|
||||
foreach ($spec->components->internalSchemas->ExposedEntity->enum as $value)
|
||||
$spec->components->schemas->ExposedEntity_NotIncludingNotEditable = clone $spec->components->schemas->StringEnumTemplate;
|
||||
foreach ($spec->components->schemas->ExposedEntity->enum as $value)
|
||||
{
|
||||
if (!in_array($value, $spec->components->internalSchemas->ExposedEntityNoDelete->enum))
|
||||
if (!in_array($value, $spec->components->schemas->ExposedEntityNoEdit->enum))
|
||||
{
|
||||
array_push($spec->components->internalSchemas->ExposedEntity_NotIncludingNotDeletable->enum, $value);
|
||||
array_push($spec->components->schemas->ExposedEntity_NotIncludingNotEditable->enum, $value);
|
||||
}
|
||||
}
|
||||
sort($spec->components->schemas->ExposedEntity_NotIncludingNotEditable->enum);
|
||||
|
||||
$spec->components->internalSchemas->ExposedEntity_NotIncludingNotListable = clone $spec->components->internalSchemas->StringEnumTemplate;
|
||||
foreach ($spec->components->internalSchemas->ExposedEntity->enum as $value)
|
||||
$spec->components->schemas->ExposedEntity_IncludingUserEntities_NotIncludingNotEditable = clone $spec->components->schemas->StringEnumTemplate;
|
||||
foreach ($spec->components->schemas->ExposedEntity_IncludingUserEntities->enum as $value)
|
||||
{
|
||||
if (!in_array($value, $spec->components->internalSchemas->ExposedEntityNoListing->enum))
|
||||
if (!in_array($value, $spec->components->schemas->ExposedEntityNoEdit->enum))
|
||||
{
|
||||
array_push($spec->components->internalSchemas->ExposedEntity_NotIncludingNotListable->enum, $value);
|
||||
array_push($spec->components->schemas->ExposedEntity_IncludingUserEntities_NotIncludingNotEditable->enum, $value);
|
||||
}
|
||||
}
|
||||
array_push($spec->components->schemas->ExposedEntity_IncludingUserEntities_NotIncludingNotEditable->enum, 'stock'); // TODO: Don't hardcode this here - stock entries are normally not editable, but the corresponding Userfields are
|
||||
sort($spec->components->schemas->ExposedEntity_IncludingUserEntities_NotIncludingNotEditable->enum);
|
||||
|
||||
$spec->components->schemas->ExposedEntity_NotIncludingNotDeletable = clone $spec->components->schemas->StringEnumTemplate;
|
||||
foreach ($spec->components->schemas->ExposedEntity->enum as $value)
|
||||
{
|
||||
if (!in_array($value, $spec->components->schemas->ExposedEntityNoDelete->enum))
|
||||
{
|
||||
array_push($spec->components->schemas->ExposedEntity_NotIncludingNotDeletable->enum, $value);
|
||||
}
|
||||
}
|
||||
sort($spec->components->schemas->ExposedEntity_NotIncludingNotDeletable->enum);
|
||||
|
||||
$spec->components->schemas->ExposedEntity_NotIncludingNotListable = clone $spec->components->schemas->StringEnumTemplate;
|
||||
foreach ($spec->components->schemas->ExposedEntity->enum as $value)
|
||||
{
|
||||
if (!in_array($value, $spec->components->schemas->ExposedEntityNoListing->enum))
|
||||
{
|
||||
array_push($spec->components->schemas->ExposedEntity_NotIncludingNotListable->enum, $value);
|
||||
}
|
||||
}
|
||||
sort($spec->components->schemas->ExposedEntity_NotIncludingNotListable->enum);
|
||||
|
||||
return $this->ApiResponse($response, $spec);
|
||||
}
|
||||
@@ -70,9 +91,4 @@ class OpenApiController extends BaseApiController
|
||||
{
|
||||
return $this->render($response, 'openapiui');
|
||||
}
|
||||
|
||||
public function __construct(\DI\Container $container)
|
||||
{
|
||||
parent::__construct($container);
|
||||
}
|
||||
}
|
||||
|
37
controllers/PrintApiController.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace Grocy\Controllers;
|
||||
|
||||
use Grocy\Controllers\Users\User;
|
||||
use Grocy\Services\StockService;
|
||||
|
||||
class PrintApiController extends BaseApiController
|
||||
{
|
||||
public function PrintShoppingListThermal(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
try
|
||||
{
|
||||
User::checkPermission($request, User::PERMISSION_SHOPPINGLIST);
|
||||
|
||||
$params = $request->getQueryParams();
|
||||
|
||||
$listId = 1;
|
||||
if (isset($params['list']))
|
||||
{
|
||||
$listId = $params['list'];
|
||||
}
|
||||
|
||||
$printHeader = true;
|
||||
if (isset($params['printHeader']))
|
||||
{
|
||||
$printHeader = ($params['printHeader'] === 'true');
|
||||
}
|
||||
$items = $this->getStockService()->GetShoppinglistInPrintableStrings($listId);
|
||||
return $this->ApiResponse($response, $this->getPrintService()->printShoppingList($printHeader, $items));
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
{
|
||||
return $this->GenericErrorResponse($response, $ex->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
@@ -3,6 +3,8 @@
|
||||
namespace Grocy\Controllers;
|
||||
|
||||
use Grocy\Controllers\Users\User;
|
||||
use Grocy\Helpers\WebhookRunner;
|
||||
use Grocy\Helpers\Grocycode;
|
||||
|
||||
class RecipesApiController extends BaseApiController
|
||||
{
|
||||
@@ -63,8 +65,41 @@ class RecipesApiController extends BaseApiController
|
||||
}
|
||||
}
|
||||
|
||||
public function __construct(\DI\Container $container)
|
||||
public function CopyRecipe(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
parent::__construct($container);
|
||||
try
|
||||
{
|
||||
return $this->ApiResponse($response, [
|
||||
'created_object_id' => $this->getRecipesService()->CopyRecipe($args['recipeId'])
|
||||
]);
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
{
|
||||
return $this->GenericErrorResponse($response, $ex->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public function RecipePrintLabel(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
try
|
||||
{
|
||||
$recipe = $this->getDatabase()->recipes()->where('id', $args['recipeId'])->fetch();
|
||||
|
||||
$webhookData = array_merge([
|
||||
'recipe' => $recipe->name,
|
||||
'grocycode' => (string)(new Grocycode(Grocycode::RECIPE, $args['recipeId'])),
|
||||
], GROCY_LABEL_PRINTER_PARAMS);
|
||||
|
||||
if (GROCY_LABEL_PRINTER_RUN_SERVER)
|
||||
{
|
||||
(new WebhookRunner())->run(GROCY_LABEL_PRINTER_WEBHOOK, $webhookData, GROCY_LABEL_PRINTER_HOOK_JSON);
|
||||
}
|
||||
|
||||
return $this->ApiResponse($response, $webhookData);
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
{
|
||||
return $this->GenericErrorResponse($response, $ex->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -3,16 +3,31 @@
|
||||
namespace Grocy\Controllers;
|
||||
|
||||
use Grocy\Services\RecipesService;
|
||||
use Grocy\Helpers\Grocycode;
|
||||
|
||||
class RecipesController extends BaseController
|
||||
{
|
||||
use GrocycodeTrait;
|
||||
|
||||
public function MealPlan(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
$start = date('Y-m-d');
|
||||
if (isset($request->getQueryParams()['start']) && IsIsoDate($request->getQueryParams()['start']))
|
||||
{
|
||||
$start = $request->getQueryParams()['start'];
|
||||
}
|
||||
|
||||
$days = 6;
|
||||
if (isset($request->getQueryParams()['days']) && filter_var($request->getQueryParams()['days'], FILTER_VALIDATE_INT) !== false)
|
||||
{
|
||||
$days = $request->getQueryParams()['days'];
|
||||
}
|
||||
|
||||
$mealPlanWhereTimespan = "day BETWEEN DATE('$start') AND DATE('$start', '+$days days')";
|
||||
|
||||
$recipes = $this->getDatabase()->recipes()->where('type', RecipesService::RECIPE_TYPE_NORMAL)->fetchAll();
|
||||
|
||||
$events = [];
|
||||
|
||||
foreach ($this->getDatabase()->meal_plan() as $mealPlanEntry)
|
||||
foreach ($this->getDatabase()->meal_plan()->where($mealPlanWhereTimespan) as $mealPlanEntry)
|
||||
{
|
||||
$recipe = FindObjectInArrayByPropertyValue($recipes, 'id', $mealPlanEntry['recipe_id']);
|
||||
$title = '';
|
||||
@@ -23,7 +38,6 @@ class RecipesController extends BaseController
|
||||
}
|
||||
|
||||
$productDetails = null;
|
||||
|
||||
if ($mealPlanEntry['product_id'] !== null)
|
||||
{
|
||||
$productDetails = $this->getStockService()->GetProductDetails($mealPlanEntry['product_id']);
|
||||
@@ -44,21 +58,22 @@ class RecipesController extends BaseController
|
||||
return $this->renderPage($response, 'mealplan', [
|
||||
'fullcalendarEventSources' => $events,
|
||||
'recipes' => $recipes,
|
||||
'internalRecipes' => $this->getDatabase()->recipes()->whereNot('type', RecipesService::RECIPE_TYPE_NORMAL)->fetchAll(),
|
||||
'recipesResolved' => $this->getRecipesService()->GetRecipesResolved(),
|
||||
'internalRecipes' => $this->getDatabase()->recipes()->where("id IN (SELECT recipe_id FROM meal_plan_internal_recipe_relation WHERE $mealPlanWhereTimespan)")->fetchAll(),
|
||||
'recipesResolved' => $this->getRecipesService()->GetRecipesResolved("recipe_id IN (SELECT recipe_id FROM meal_plan_internal_recipe_relation WHERE $mealPlanWhereTimespan)"),
|
||||
'products' => $this->getDatabase()->products()->orderBy('name', 'COLLATE NOCASE'),
|
||||
'quantityUnits' => $this->getDatabase()->quantity_units()->orderBy('name', 'COLLATE NOCASE'),
|
||||
'quantityUnitConversionsResolved' => $this->getDatabase()->quantity_unit_conversions_resolved()
|
||||
'quantityUnitConversionsResolved' => $this->getDatabase()->quantity_unit_conversions_resolved(),
|
||||
'mealplanSections' => $this->getDatabase()->meal_plan_sections()->orderBy('sort_number'),
|
||||
'usedMealplanSections' => $this->getDatabase()->meal_plan_sections()->where("id IN (SELECT section_id FROM meal_plan WHERE $mealPlanWhereTimespan)")->orderBy('sort_number')
|
||||
]);
|
||||
}
|
||||
|
||||
public function Overview(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
$recipes = $this->getDatabase()->recipes()->where('type', RecipesService::RECIPE_TYPE_NORMAL)->orderBy('name', 'COLLATE NOCASE');
|
||||
$recipesResolved = $this->getRecipesService()->GetRecipesResolved();
|
||||
$recipesResolved = $this->getRecipesService()->GetRecipesResolved('recipe_id > 0');
|
||||
|
||||
$selectedRecipe = null;
|
||||
|
||||
if (isset($request->getQueryParams()['recipe']))
|
||||
{
|
||||
$selectedRecipe = $this->getDatabase()->recipes($request->getQueryParams()['recipe']);
|
||||
@@ -72,12 +87,10 @@ class RecipesController extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
$selectedRecipePositionsResolved = null;
|
||||
$totalCosts = null;
|
||||
$totalCalories = null;
|
||||
if ($selectedRecipe)
|
||||
{
|
||||
$selectedRecipePositionsResolved = $this->getDatabase()->recipes_pos_resolved()->where('recipe_id = :1 AND is_nested_recipe_pos = 0', $selectedRecipe->id)->orderBy('ingredient_group', 'ASC', 'product_group', 'ASC');
|
||||
$totalCosts = FindObjectInArrayByPropertyValue($recipesResolved, 'recipe_id', $selectedRecipe->id)->costs;
|
||||
$totalCalories = FindObjectInArrayByPropertyValue($recipesResolved, 'recipe_id', $selectedRecipe->id)->calories;
|
||||
}
|
||||
@@ -85,9 +98,8 @@ class RecipesController extends BaseController
|
||||
$renderArray = [
|
||||
'recipes' => $recipes,
|
||||
'recipesResolved' => $recipesResolved,
|
||||
'recipePositionsResolved' => $this->getDatabase()->recipes_pos_resolved()->where('recipe_type', RecipesService::RECIPE_TYPE_NORMAL),
|
||||
'recipePositionsResolved' => $this->getDatabase()->recipes_pos_resolved()->where('recipe_id', $selectedRecipe->id),
|
||||
'selectedRecipe' => $selectedRecipe,
|
||||
'selectedRecipePositionsResolved' => $selectedRecipePositionsResolved,
|
||||
'products' => $this->getDatabase()->products(),
|
||||
'quantityUnits' => $this->getDatabase()->quantity_units(),
|
||||
'userfields' => $this->getUserfieldsService()->GetFields('recipes'),
|
||||
@@ -103,17 +115,26 @@ class RecipesController extends BaseController
|
||||
|
||||
$includedRecipeIdsAbsolute = [];
|
||||
$includedRecipeIdsAbsolute[] = $selectedRecipe->id;
|
||||
|
||||
foreach ($selectedRecipeSubRecipes as $subRecipe)
|
||||
{
|
||||
$includedRecipeIdsAbsolute[] = $subRecipe->id;
|
||||
}
|
||||
|
||||
// TODO: Why not directly use recipes_pos_resolved for all recipe positions here (parent and child)?
|
||||
// This view already correctly recolves child recipe amounts...
|
||||
$allRecipePositions = [];
|
||||
|
||||
foreach ($includedRecipeIdsAbsolute as $id)
|
||||
{
|
||||
$allRecipePositions[$id] = $this->getDatabase()->recipes_pos_resolved()->where('recipe_id = :1 AND is_nested_recipe_pos = 0', $id)->orderBy('ingredient_group', 'ASC', 'product_group', 'ASC');
|
||||
foreach ($allRecipePositions[$id] as $pos)
|
||||
{
|
||||
if ($id != $selectedRecipe->id)
|
||||
{
|
||||
$pos2 = $this->getDatabase()->recipes_pos_resolved()->where('recipe_id = :1 AND recipe_pos_id = :2 AND is_nested_recipe_pos = 1', $selectedRecipe->id, $pos->recipe_pos_id)->fetch();
|
||||
$pos->recipe_amount = $pos2->recipe_amount;
|
||||
$pos->missing_amount = $pos2->missing_amount;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$renderArray['selectedRecipeSubRecipes'] = $selectedRecipeSubRecipes;
|
||||
@@ -134,8 +155,6 @@ class RecipesController extends BaseController
|
||||
'mode' => $recipeId == 'new' ? 'create' : 'edit',
|
||||
'products' => $this->getDatabase()->products()->orderBy('name', 'COLLATE NOCASE'),
|
||||
'quantityunits' => $this->getDatabase()->quantity_units(),
|
||||
'recipePositionsResolved' => $this->getRecipesService()->GetRecipesPosResolved(),
|
||||
'recipesResolved' => $this->getRecipesService()->GetRecipesResolved(),
|
||||
'recipes' => $this->getDatabase()->recipes()->where('type', RecipesService::RECIPE_TYPE_NORMAL)->orderBy('name', 'COLLATE NOCASE'),
|
||||
'recipeNestings' => $this->getDatabase()->recipes_nestings()->where('recipe_id', $recipeId),
|
||||
'userfields' => $this->getUserfieldsService()->GetFields('recipes'),
|
||||
@@ -151,7 +170,7 @@ class RecipesController extends BaseController
|
||||
'mode' => 'create',
|
||||
'recipe' => $this->getDatabase()->recipes($args['recipeId']),
|
||||
'recipePos' => new \stdClass(),
|
||||
'products' => $this->getDatabase()->products()->orderBy('name', 'COLLATE NOCASE'),
|
||||
'products' => $this->getDatabase()->products()->where('active = 1')->orderBy('name', 'COLLATE NOCASE'),
|
||||
'quantityUnits' => $this->getDatabase()->quantity_units()->orderBy('name', 'COLLATE NOCASE'),
|
||||
'quantityUnitConversionsResolved' => $this->getDatabase()->quantity_unit_conversions_resolved()
|
||||
]);
|
||||
@@ -174,8 +193,33 @@ class RecipesController extends BaseController
|
||||
return $this->renderPage($response, 'recipessettings');
|
||||
}
|
||||
|
||||
public function __construct(\DI\Container $container)
|
||||
public function MealPlanSectionEditForm(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
parent::__construct($container);
|
||||
if ($args['sectionId'] == 'new')
|
||||
{
|
||||
return $this->renderPage($response, 'mealplansectionform', [
|
||||
'mode' => 'create'
|
||||
]);
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->renderPage($response, 'mealplansectionform', [
|
||||
'mealplanSection' => $this->getDatabase()->meal_plan_sections($args['sectionId']),
|
||||
'mode' => 'edit'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
public function MealPlanSectionsList(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
return $this->renderPage($response, 'mealplansections', [
|
||||
'mealplanSections' => $this->getDatabase()->meal_plan_sections()->where('id > 0')->orderBy('sort_number')
|
||||
]);
|
||||
}
|
||||
|
||||
public function RecipeGrocycodeImage(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
$gc = new Grocycode(Grocycode::RECIPE, $args['recipeId']);
|
||||
return $this->ServeGrocycodeImage($request, $response, $gc);
|
||||
}
|
||||
}
|
||||
|
@@ -4,6 +4,8 @@ namespace Grocy\Controllers;
|
||||
|
||||
use Grocy\Controllers\Users\User;
|
||||
use Grocy\Services\StockService;
|
||||
use Grocy\Helpers\WebhookRunner;
|
||||
use Grocy\Helpers\Grocycode;
|
||||
|
||||
class StockApiController extends BaseApiController
|
||||
{
|
||||
@@ -98,48 +100,55 @@ class StockApiController extends BaseApiController
|
||||
}
|
||||
|
||||
$bestBeforeDate = null;
|
||||
|
||||
if (array_key_exists('best_before_date', $requestBody) && IsIsoDate($requestBody['best_before_date']))
|
||||
{
|
||||
$bestBeforeDate = $requestBody['best_before_date'];
|
||||
}
|
||||
|
||||
$purchasedDate = date('Y-m-d');
|
||||
|
||||
if (array_key_exists('purchased_date', $requestBody) && IsIsoDate($requestBody['purchased_date']))
|
||||
{
|
||||
$purchasedDate = $requestBody['purchased_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'];
|
||||
}
|
||||
|
||||
$shoppingLocationId = null;
|
||||
|
||||
if (array_key_exists('shopping_location_id', $requestBody) && is_numeric($requestBody['shopping_location_id']))
|
||||
{
|
||||
$shoppingLocationId = $requestBody['shopping_location_id'];
|
||||
}
|
||||
|
||||
$transactionType = StockService::TRANSACTION_TYPE_PURCHASE;
|
||||
|
||||
if (array_key_exists('transaction_type', $requestBody) && !empty($requestBody['transactiontype']))
|
||||
if (array_key_exists('transaction_type', $requestBody) && !empty($requestBody['transaction_type']))
|
||||
{
|
||||
$transactionType = $requestBody['transactiontype'];
|
||||
$transactionType = $requestBody['transaction_type'];
|
||||
}
|
||||
|
||||
$transactionId = $this->getStockService()->AddProduct($args['productId'], $requestBody['amount'], $bestBeforeDate, $transactionType, $purchasedDate, $price, $locationId, $shoppingLocationId);
|
||||
$stockLabelType = 0;
|
||||
if (array_key_exists('stock_label_type', $requestBody) && is_numeric($requestBody['stock_label_type']))
|
||||
{
|
||||
$stockLabelType = intval($requestBody['stock_label_type']);
|
||||
}
|
||||
|
||||
$note = null;
|
||||
if (array_key_exists('note', $requestBody))
|
||||
{
|
||||
$note = $requestBody['note'];
|
||||
}
|
||||
|
||||
$transactionId = $this->getStockService()->AddProduct($args['productId'], $requestBody['amount'], $bestBeforeDate, $transactionType, $purchasedDate, $price, $locationId, $shoppingLocationId, $unusedTransactionId, $stockLabelType, false, $note);
|
||||
|
||||
$args['transactionId'] = $transactionId;
|
||||
return $this->StockTransactions($request, $response, $args);
|
||||
}
|
||||
@@ -172,6 +181,7 @@ class StockApiController extends BaseApiController
|
||||
|
||||
$listId = 1;
|
||||
$amount = 1;
|
||||
$quId = -1;
|
||||
$productId = null;
|
||||
$note = null;
|
||||
|
||||
@@ -195,12 +205,17 @@ class StockApiController extends BaseApiController
|
||||
$note = $requestBody['note'];
|
||||
}
|
||||
|
||||
if (array_key_exists('qu_id', $requestBody) && !empty($requestBody['qu_id']))
|
||||
{
|
||||
$quId = $requestBody['qu_id'];
|
||||
}
|
||||
|
||||
if ($productId == null)
|
||||
{
|
||||
throw new \Exception('No product id was supplied');
|
||||
}
|
||||
|
||||
$this->getStockService()->AddProductToShoppingList($productId, $amount, $note, $listId);
|
||||
$this->getStockService()->AddProductToShoppingList($productId, $amount, $quId, $note, $listId);
|
||||
return $this->EmptyApiResponse($response);
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
@@ -218,13 +233,18 @@ class StockApiController extends BaseApiController
|
||||
$requestBody = $this->GetParsedAndFilteredRequestBody($request);
|
||||
|
||||
$listId = 1;
|
||||
|
||||
if (array_key_exists('list_id', $requestBody) && !empty($requestBody['list_id']) && is_numeric($requestBody['list_id']))
|
||||
{
|
||||
$listId = intval($requestBody['list_id']);
|
||||
}
|
||||
|
||||
$this->getStockService()->ClearShoppingList($listId);
|
||||
$doneOnly = false;
|
||||
if (array_key_exists('done_only', $requestBody) && filter_var($requestBody['done_only'], FILTER_VALIDATE_BOOLEAN) !== false)
|
||||
{
|
||||
$doneOnly = boolval($requestBody['done_only']);
|
||||
}
|
||||
|
||||
$this->getStockService()->ClearShoppingList($listId, $doneOnly);
|
||||
return $this->EmptyApiResponse($response);
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
@@ -309,6 +329,18 @@ class StockApiController extends BaseApiController
|
||||
try
|
||||
{
|
||||
$args['productId'] = $this->getStockService()->GetProductIdFromBarcode($args['barcode']);
|
||||
|
||||
if (Grocycode::Validate($args['barcode']))
|
||||
{
|
||||
$gc = new Grocycode($args['barcode']);
|
||||
if ($gc->GetExtraData())
|
||||
{
|
||||
$requestBody = $request->getParsedBody();
|
||||
$requestBody['stock_entry_id'] = $gc->GetExtraData()[0];
|
||||
$request = $request->withParsedBody($requestBody);
|
||||
}
|
||||
}
|
||||
|
||||
return $this->ConsumeProduct($request, $response, $args);
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
@@ -362,34 +394,36 @@ class StockApiController extends BaseApiController
|
||||
}
|
||||
|
||||
$bestBeforeDate = null;
|
||||
|
||||
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'];
|
||||
}
|
||||
|
||||
$shoppingLocationId = null;
|
||||
|
||||
if (array_key_exists('shopping_location_id', $requestBody) && is_numeric($requestBody['shopping_location_id']))
|
||||
{
|
||||
$shoppingLocationId = $requestBody['shopping_location_id'];
|
||||
}
|
||||
|
||||
$transactionId = $this->getStockService()->EditStockEntry($args['entryId'], $requestBody['amount'], $bestBeforeDate, $locationId, $shoppingLocationId, $price, $requestBody['open'], $requestBody['purchased_date']);
|
||||
$note = null;
|
||||
if (array_key_exists('note', $requestBody))
|
||||
{
|
||||
$note = $requestBody['note'];
|
||||
}
|
||||
|
||||
$transactionId = $this->getStockService()->EditStockEntry($args['entryId'], $requestBody['amount'], $bestBeforeDate, $locationId, $shoppingLocationId, $price, $requestBody['open'], $requestBody['purchased_date'], $note);
|
||||
$args['transactionId'] = $transactionId;
|
||||
return $this->StockTransactions($request, $response, $args);
|
||||
}
|
||||
@@ -468,7 +502,19 @@ class StockApiController extends BaseApiController
|
||||
$shoppingLocationId = $requestBody['shopping_location_id'];
|
||||
}
|
||||
|
||||
$transactionId = $this->getStockService()->InventoryProduct($args['productId'], $requestBody['new_amount'], $bestBeforeDate, $locationId, $price, $shoppingLocationId, $purchasedDate);
|
||||
$stockLabelType = 0;
|
||||
if (array_key_exists('stock_label_type', $requestBody) && is_numeric($requestBody['stock_label_type']))
|
||||
{
|
||||
$stockLabelType = intval($requestBody['stock_label_type']);
|
||||
}
|
||||
|
||||
$note = null;
|
||||
if (array_key_exists('note', $requestBody))
|
||||
{
|
||||
$note = $requestBody['note'];
|
||||
}
|
||||
|
||||
$transactionId = $this->getStockService()->InventoryProduct($args['productId'], $requestBody['new_amount'], $bestBeforeDate, $locationId, $price, $shoppingLocationId, $purchasedDate, $stockLabelType, $note);
|
||||
$args['transactionId'] = $transactionId;
|
||||
return $this->StockTransactions($request, $response, $args);
|
||||
}
|
||||
@@ -537,6 +583,18 @@ class StockApiController extends BaseApiController
|
||||
try
|
||||
{
|
||||
$args['productId'] = $this->getStockService()->GetProductIdFromBarcode($args['barcode']);
|
||||
|
||||
if (Grocycode::Validate($args['barcode']))
|
||||
{
|
||||
$gc = new Grocycode($args['barcode']);
|
||||
if ($gc->GetExtraData())
|
||||
{
|
||||
$requestBody = $request->getParsedBody();
|
||||
$requestBody['stock_entry_id'] = $gc->GetExtraData()[0];
|
||||
$request = $request->withParsedBody($requestBody);
|
||||
}
|
||||
}
|
||||
|
||||
return $this->OpenProduct($request, $response, $args);
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
@@ -585,18 +643,23 @@ class StockApiController extends BaseApiController
|
||||
public function ProductStockEntries(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
$allowSubproductSubstitution = false;
|
||||
if (isset($request->getQueryParams()['include_sub_products']) && filter_var($request->getQueryParams()['include_sub_products'], FILTER_VALIDATE_BOOLEAN))
|
||||
if (isset($request->getQueryParams()['include_sub_products']) && filter_var($request->getQueryParams()['include_sub_products'], FILTER_VALIDATE_BOOLEAN) !== false)
|
||||
{
|
||||
$allowSubproductSubstitution = true;
|
||||
}
|
||||
|
||||
return $this->FilteredApiResponse($response, $this->getStockService()->GetProductStockEntries($args['productId'], false, $allowSubproductSubstitution, true), $request->getQueryParams());
|
||||
return $this->FilteredApiResponse($response, $this->getStockService()->GetProductStockEntries($args['productId'], false, $allowSubproductSubstitution), $request->getQueryParams());
|
||||
}
|
||||
|
||||
public function LocationStockEntries(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
return $this->FilteredApiResponse($response, $this->getStockService()->GetLocationStockEntries($args['locationId']), $request->getQueryParams());
|
||||
}
|
||||
|
||||
public function ProductStockLocations(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
$allowSubproductSubstitution = false;
|
||||
if (isset($request->getQueryParams()['include_sub_products']) && filter_var($request->getQueryParams()['include_sub_products'], FILTER_VALIDATE_BOOLEAN))
|
||||
if (isset($request->getQueryParams()['include_sub_products']) && filter_var($request->getQueryParams()['include_sub_products'], FILTER_VALIDATE_BOOLEAN) !== false)
|
||||
{
|
||||
$allowSubproductSubstitution = true;
|
||||
}
|
||||
@@ -604,6 +667,60 @@ class StockApiController extends BaseApiController
|
||||
return $this->FilteredApiResponse($response, $this->getStockService()->GetProductStockLocations($args['productId'], $allowSubproductSubstitution), $request->getQueryParams());
|
||||
}
|
||||
|
||||
public function ProductPrintLabel(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
try
|
||||
{
|
||||
$product = $this->getDatabase()->products()->where('id', $args['productId'])->fetch();
|
||||
|
||||
$webhookData = array_merge([
|
||||
'product' => $product->name,
|
||||
'grocycode' => (string)(new Grocycode(Grocycode::PRODUCT, $product->id)),
|
||||
], GROCY_LABEL_PRINTER_PARAMS);
|
||||
|
||||
if (GROCY_LABEL_PRINTER_RUN_SERVER)
|
||||
{
|
||||
(new WebhookRunner())->run(GROCY_LABEL_PRINTER_WEBHOOK, $webhookData, GROCY_LABEL_PRINTER_HOOK_JSON);
|
||||
}
|
||||
|
||||
return $this->ApiResponse($response, $webhookData);
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
{
|
||||
return $this->GenericErrorResponse($response, $ex->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public function StockEntryPrintLabel(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
try
|
||||
{
|
||||
$stockEntry = $this->getDatabase()->stock()->where('id', $args['entryId'])->fetch();
|
||||
$product = $this->getDatabase()->products()->where('id', $stockEntry->product_id)->fetch();
|
||||
|
||||
$webhookData = array_merge([
|
||||
'product' => $product->name,
|
||||
'grocycode' => (string)(new Grocycode(Grocycode::PRODUCT, $stockEntry->product_id, [$stockEntry->stock_id])),
|
||||
], GROCY_LABEL_PRINTER_PARAMS);
|
||||
|
||||
if (GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING)
|
||||
{
|
||||
$webhookData['due_date'] = $this->getLocalizationService()->__t('DD') . ': ' . $stockEntry->best_before_date;
|
||||
}
|
||||
|
||||
if (GROCY_LABEL_PRINTER_RUN_SERVER)
|
||||
{
|
||||
(new WebhookRunner())->run(GROCY_LABEL_PRINTER_WEBHOOK, $webhookData, GROCY_LABEL_PRINTER_HOOK_JSON);
|
||||
}
|
||||
|
||||
return $this->ApiResponse($response, $webhookData);
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
{
|
||||
return $this->GenericErrorResponse($response, $ex->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public function RemoveProductFromShoppingList(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
User::checkPermission($request, User::PERMISSION_SHOPPINGLIST_ITEMS_DELETE);
|
||||
@@ -737,6 +854,18 @@ class StockApiController extends BaseApiController
|
||||
try
|
||||
{
|
||||
$args['productId'] = $this->getStockService()->GetProductIdFromBarcode($args['barcode']);
|
||||
|
||||
if (Grocycode::Validate($args['barcode']))
|
||||
{
|
||||
$gc = new Grocycode($args['barcode']);
|
||||
if ($gc->GetExtraData())
|
||||
{
|
||||
$requestBody = $request->getParsedBody();
|
||||
$requestBody['stock_entry_id'] = $gc->GetExtraData()[0];
|
||||
$request = $request->withParsedBody($requestBody);
|
||||
}
|
||||
}
|
||||
|
||||
return $this->TransferProduct($request, $response, $args);
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
@@ -781,7 +910,7 @@ class StockApiController extends BaseApiController
|
||||
|
||||
try
|
||||
{
|
||||
if (!filter_var($args['productIdToKeep'], FILTER_VALIDATE_INT) || !filter_var($args['productIdToRemove'], FILTER_VALIDATE_INT))
|
||||
if (filter_var($args['productIdToKeep'], FILTER_VALIDATE_INT) === false || filter_var($args['productIdToRemove'], FILTER_VALIDATE_INT) === false)
|
||||
{
|
||||
throw new \Exception('Provided {productIdToKeep} or {productIdToRemove} is not a valid integer');
|
||||
}
|
||||
@@ -794,9 +923,4 @@ class StockApiController extends BaseApiController
|
||||
return $this->GenericErrorResponse($response, $ex->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public function __construct(\DI\Container $container)
|
||||
{
|
||||
parent::__construct($container);
|
||||
}
|
||||
}
|
||||
|
@@ -2,14 +2,17 @@
|
||||
|
||||
namespace Grocy\Controllers;
|
||||
|
||||
use Grocy\Helpers\Grocycode;
|
||||
use Grocy\Services\RecipesService;
|
||||
|
||||
class StockController extends BaseController
|
||||
{
|
||||
use GrocycodeTrait;
|
||||
|
||||
public function Consume(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
return $this->renderPage($response, 'consume', [
|
||||
'products' => $this->getDatabase()->products()->where('active = 1')->orderBy('name'),
|
||||
'products' => $this->getDatabase()->products()->where('active = 1')->where('id IN (SELECT product_id from stock_current WHERE amount_aggregated > 0)')->orderBy('name'),
|
||||
'barcodes' => $this->getDatabase()->product_barcodes_comma_separated(),
|
||||
'recipes' => $this->getDatabase()->recipes()->where('type', RecipesService::RECIPE_TYPE_NORMAL)->orderBy('name', 'COLLATE NOCASE'),
|
||||
'locations' => $this->getDatabase()->locations()->orderBy('name', 'COLLATE NOCASE'),
|
||||
@@ -21,25 +24,45 @@ class StockController extends BaseController
|
||||
public function Inventory(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
return $this->renderPage($response, 'inventory', [
|
||||
'products' => $this->getDatabase()->products()->where('active = 1')->orderBy('name', 'COLLATE NOCASE'),
|
||||
'products' => $this->getDatabase()->products()->where('active = 1 AND no_own_stock = 0')->orderBy('name', 'COLLATE NOCASE'),
|
||||
'barcodes' => $this->getDatabase()->product_barcodes_comma_separated(),
|
||||
'shoppinglocations' => $this->getDatabase()->shopping_locations()->orderBy('name', 'COLLATE NOCASE'),
|
||||
'locations' => $this->getDatabase()->locations()->orderBy('name', 'COLLATE NOCASE'),
|
||||
'quantityUnits' => $this->getDatabase()->quantity_units()->orderBy('name', 'COLLATE NOCASE'),
|
||||
'quantityUnitConversionsResolved' => $this->getDatabase()->quantity_unit_conversions_resolved()
|
||||
'quantityUnitConversionsResolved' => $this->getDatabase()->quantity_unit_conversions_resolved(),
|
||||
'userfields' => $this->getUserfieldsService()->GetFields('stock')
|
||||
]);
|
||||
}
|
||||
|
||||
public function Journal(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
if (isset($request->getQueryParams()['months']) && filter_var($request->getQueryParams()['months'], FILTER_VALIDATE_INT) !== false)
|
||||
{
|
||||
$months = $request->getQueryParams()['months'];
|
||||
$where = "row_created_timestamp > DATE(DATE('now', 'localtime'), '-$months months')";
|
||||
}
|
||||
else
|
||||
{
|
||||
// Default 6 months
|
||||
$where = "row_created_timestamp > DATE(DATE('now', 'localtime'), '-6 months')";
|
||||
}
|
||||
|
||||
if (isset($request->getQueryParams()['product']) && filter_var($request->getQueryParams()['product'], FILTER_VALIDATE_INT) !== false)
|
||||
{
|
||||
$productId = $request->getQueryParams()['product'];
|
||||
$where .= " AND product_id = $productId";
|
||||
}
|
||||
|
||||
$usersService = $this->getUsersService();
|
||||
|
||||
return $this->renderPage($response, 'stockjournal', [
|
||||
'stockLog' => $this->getDatabase()->uihelper_stock_journal()->orderBy('row_created_timestamp', 'DESC'),
|
||||
'stockLog' => $this->getDatabase()->uihelper_stock_journal()->where($where)->orderBy('row_created_timestamp', 'DESC'),
|
||||
'products' => $this->getDatabase()->products()->where('active = 1')->orderBy('name', 'COLLATE NOCASE'),
|
||||
'locations' => $this->getDatabase()->locations()->orderBy('name', 'COLLATE NOCASE'),
|
||||
'users' => $usersService->GetUsersAsDto(),
|
||||
'transactionTypes' => GetClassConstants('\Grocy\Services\StockService', 'TRANSACTION_TYPE_'),
|
||||
'userfieldsStock' => $this->getUserfieldsService()->GetFields('stock'),
|
||||
'userfieldValuesStock' => $this->getUserfieldsService()->GetAllValues('stock')
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -49,7 +72,7 @@ class StockController extends BaseController
|
||||
'products' => $this->getDatabase()->products()->where('active = 1')->orderBy('name', 'COLLATE NOCASE'),
|
||||
'quantityunits' => $this->getDatabase()->quantity_units()->orderBy('name', 'COLLATE NOCASE'),
|
||||
'locations' => $this->getDatabase()->locations()->orderBy('name', 'COLLATE NOCASE'),
|
||||
'currentStockLocationContent' => $this->getStockService()->GetCurrentStockLocationContent()
|
||||
'currentStockLocationContent' => $this->getStockService()->GetCurrentStockLocationContent(isset($request->getQueryParams()['include_out_of_stock']))
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -140,6 +163,7 @@ class StockController extends BaseController
|
||||
'locations' => $this->getDatabase()->locations()->orderBy('name'),
|
||||
'barcodes' => $this->getDatabase()->product_barcodes()->orderBy('barcode'),
|
||||
'quantityunits' => $this->getDatabase()->quantity_units()->orderBy('name', 'COLLATE NOCASE'),
|
||||
'quantityunitsStock' => $this->getDatabase()->quantity_units()->orderBy('name', 'COLLATE NOCASE'),
|
||||
'shoppinglocations' => $this->getDatabase()->shopping_locations()->orderBy('name', 'COLLATE NOCASE'),
|
||||
'productgroups' => $this->getDatabase()->product_groups()->orderBy('name', 'COLLATE NOCASE'),
|
||||
'userfields' => $this->getUserfieldsService()->GetFields('products'),
|
||||
@@ -157,6 +181,7 @@ class StockController extends BaseController
|
||||
'locations' => $this->getDatabase()->locations()->orderBy('name', 'COLLATE NOCASE'),
|
||||
'barcodes' => $this->getDatabase()->product_barcodes()->orderBy('barcode'),
|
||||
'quantityunits' => $this->getDatabase()->quantity_units()->orderBy('name', 'COLLATE NOCASE'),
|
||||
'quantityunitsStock' => $this->getDatabase()->quantity_units()->where('id IN (SELECT to_qu_id FROM quantity_unit_conversions_resolved WHERE product_id = :1) OR NOT EXISTS(SELECT 1 FROM stock_log WHERE product_id = :1)', $product->id)->orderBy('name', 'COLLATE NOCASE'),
|
||||
'shoppinglocations' => $this->getDatabase()->shopping_locations()->orderBy('name', 'COLLATE NOCASE'),
|
||||
'productgroups' => $this->getDatabase()->product_groups()->orderBy('name', 'COLLATE NOCASE'),
|
||||
'userfields' => $this->getUserfieldsService()->GetFields('products'),
|
||||
@@ -170,6 +195,12 @@ class StockController extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
public function ProductGrocycodeImage(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
$gc = new Grocycode(Grocycode::PRODUCT, $args['productId']);
|
||||
return $this->ServeGrocycodeImage($request, $response, $gc);
|
||||
}
|
||||
|
||||
public function ProductGroupEditForm(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
if ($args['productGroupId'] == 'new')
|
||||
@@ -201,15 +232,19 @@ class StockController extends BaseController
|
||||
|
||||
public function ProductsList(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
if (isset($request->getQueryParams()['include_disabled']))
|
||||
$products = $this->getDatabase()->products();
|
||||
if (!isset($request->getQueryParams()['include_disabled']))
|
||||
{
|
||||
$products = $this->getDatabase()->products()->orderBy('name', 'COLLATE NOCASE');
|
||||
$products = $products->where('active = 1');
|
||||
}
|
||||
else
|
||||
|
||||
if (isset($request->getQueryParams()['only_in_stock']))
|
||||
{
|
||||
$products = $this->getDatabase()->products()->where('active = 1')->orderBy('name', 'COLLATE NOCASE');
|
||||
$products = $products->where('id IN (SELECT product_id from stock_current WHERE amount_aggregated > 0)');
|
||||
}
|
||||
|
||||
$products = $products->orderBy('name', 'COLLATE NOCASE');
|
||||
|
||||
return $this->renderPage($response, 'products', [
|
||||
'products' => $products,
|
||||
'locations' => $this->getDatabase()->locations()->orderBy('name', 'COLLATE NOCASE'),
|
||||
@@ -224,12 +259,13 @@ class StockController extends BaseController
|
||||
public function Purchase(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
return $this->renderPage($response, 'purchase', [
|
||||
'products' => $this->getDatabase()->products()->where('active = 1')->orderBy('name', 'COLLATE NOCASE'),
|
||||
'products' => $this->getDatabase()->products()->where('active = 1 AND no_own_stock = 0')->orderBy('name', 'COLLATE NOCASE'),
|
||||
'barcodes' => $this->getDatabase()->product_barcodes_comma_separated(),
|
||||
'shoppinglocations' => $this->getDatabase()->shopping_locations()->orderBy('name', 'COLLATE NOCASE'),
|
||||
'locations' => $this->getDatabase()->locations()->orderBy('name', 'COLLATE NOCASE'),
|
||||
'quantityUnits' => $this->getDatabase()->quantity_units()->orderBy('name', 'COLLATE NOCASE'),
|
||||
'quantityUnitConversionsResolved' => $this->getDatabase()->quantity_unit_conversions_resolved()
|
||||
'quantityUnitConversionsResolved' => $this->getDatabase()->quantity_unit_conversions_resolved(),
|
||||
'userfields' => $this->getUserfieldsService()->GetFields('stock')
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -364,6 +400,7 @@ class StockController extends BaseController
|
||||
{
|
||||
return $this->renderPage($response, 'shoppinglistitemform', [
|
||||
'products' => $this->getDatabase()->products()->where('active = 1')->orderBy('name', 'COLLATE NOCASE'),
|
||||
'barcodes' => $this->getDatabase()->product_barcodes_comma_separated(),
|
||||
'shoppingLists' => $this->getDatabase()->shopping_lists()->orderBy('name', 'COLLATE NOCASE'),
|
||||
'mode' => 'create',
|
||||
'quantityUnits' => $this->getDatabase()->quantity_units()->orderBy('name', 'COLLATE NOCASE'),
|
||||
@@ -376,6 +413,7 @@ class StockController extends BaseController
|
||||
return $this->renderPage($response, 'shoppinglistitemform', [
|
||||
'listItem' => $this->getDatabase()->shopping_list($args['itemId']),
|
||||
'products' => $this->getDatabase()->products()->where('active = 1')->orderBy('name', 'COLLATE NOCASE'),
|
||||
'barcodes' => $this->getDatabase()->product_barcodes_comma_separated(),
|
||||
'shoppingLists' => $this->getDatabase()->shopping_lists()->orderBy('name', 'COLLATE NOCASE'),
|
||||
'mode' => 'edit',
|
||||
'quantityUnits' => $this->getDatabase()->quantity_units()->orderBy('name', 'COLLATE NOCASE'),
|
||||
@@ -387,7 +425,9 @@ class StockController extends BaseController
|
||||
|
||||
public function ShoppingListSettings(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
return $this->renderPage($response, 'shoppinglistsettings');
|
||||
return $this->renderPage($response, 'shoppinglistsettings', [
|
||||
'shoppingLists' => $this->getDatabase()->shopping_lists()->orderBy('name', 'COLLATE NOCASE')
|
||||
]);
|
||||
}
|
||||
|
||||
public function ShoppingLocationEditForm(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
@@ -424,7 +464,24 @@ class StockController extends BaseController
|
||||
'stockEntry' => $this->getDatabase()->stock()->where('id', $args['entryId'])->fetch(),
|
||||
'products' => $this->getDatabase()->products()->where('active = 1')->orderBy('name', 'COLLATE NOCASE'),
|
||||
'shoppinglocations' => $this->getDatabase()->shopping_locations()->orderBy('name', 'COLLATE NOCASE'),
|
||||
'locations' => $this->getDatabase()->locations()->orderBy('name', 'COLLATE NOCASE')
|
||||
'locations' => $this->getDatabase()->locations()->orderBy('name', 'COLLATE NOCASE'),
|
||||
'userfields' => $this->getUserfieldsService()->GetFields('stock')
|
||||
]);
|
||||
}
|
||||
|
||||
public function StockEntryGrocycodeImage(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
$stockEntry = $this->getDatabase()->stock()->where('id', $args['entryId'])->fetch();
|
||||
$gc = new Grocycode(Grocycode::PRODUCT, $stockEntry->product_id, [$stockEntry->stock_id]);
|
||||
return $this->ServeGrocycodeImage($request, $response, $gc);
|
||||
}
|
||||
|
||||
public function StockEntryGrocycodeLabel(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
$stockEntry = $this->getDatabase()->stock()->where('id', $args['entryId'])->fetch();
|
||||
return $this->renderPage($response, 'stockentrylabel', [
|
||||
'stockEntry' => $stockEntry,
|
||||
'product' => $this->getDatabase()->products($stockEntry->product_id),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -450,15 +507,17 @@ class StockController extends BaseController
|
||||
'stockEntries' => $this->getDatabase()->stock()->orderBy('product_id'),
|
||||
'currentStockLocations' => $this->getStockService()->GetCurrentStockLocations(),
|
||||
'nextXDays' => $nextXDays,
|
||||
'userfields' => $this->getUserfieldsService()->GetFields('products'),
|
||||
'userfieldValues' => $this->getUserfieldsService()->GetAllValues('products')
|
||||
'userfieldsProducts' => $this->getUserfieldsService()->GetFields('products'),
|
||||
'userfieldValuesProducts' => $this->getUserfieldsService()->GetAllValues('products'),
|
||||
'userfieldsStock' => $this->getUserfieldsService()->GetFields('stock'),
|
||||
'userfieldValuesStock' => $this->getUserfieldsService()->GetAllValues('stock')
|
||||
]);
|
||||
}
|
||||
|
||||
public function Transfer(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
return $this->renderPage($response, 'transfer', [
|
||||
'products' => $this->getDatabase()->products()->where('active = 1')->orderBy('name', 'COLLATE NOCASE'),
|
||||
'products' => $this->getDatabase()->products()->where('active = 1')->where('no_own_stock = 0 AND id IN (SELECT product_id from stock_current WHERE amount_aggregated > 0)')->orderBy('name', 'COLLATE NOCASE'),
|
||||
'barcodes' => $this->getDatabase()->product_barcodes_comma_separated(),
|
||||
'locations' => $this->getDatabase()->locations()->orderBy('name', 'COLLATE NOCASE'),
|
||||
'quantityUnits' => $this->getDatabase()->quantity_units()->orderBy('name', 'COLLATE NOCASE'),
|
||||
@@ -466,11 +525,6 @@ class StockController extends BaseController
|
||||
]);
|
||||
}
|
||||
|
||||
public function __construct(\DI\Container $container)
|
||||
{
|
||||
parent::__construct($container);
|
||||
}
|
||||
|
||||
public function JournalSummary(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
$entries = $this->getDatabase()->uihelper_stock_journal_summary();
|
||||
|
@@ -43,6 +43,30 @@ class SystemApiController extends BaseApiController
|
||||
return $this->ApiResponse($response, $this->getApplicationService()->GetSystemInfo());
|
||||
}
|
||||
|
||||
public function GetSystemTime(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
try
|
||||
{
|
||||
$offset = 0;
|
||||
$params = $request->getQueryParams();
|
||||
if (isset($params['offset']))
|
||||
{
|
||||
if (filter_var($params['offset'], FILTER_VALIDATE_INT) === false)
|
||||
{
|
||||
throw new \Exception('Query parameter "offset" is not a valid integer');
|
||||
}
|
||||
|
||||
$offset = $params['offset'];
|
||||
}
|
||||
|
||||
return $this->ApiResponse($response, $this->getApplicationService()->GetSystemTime($offset));
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
{
|
||||
return $this->GenericErrorResponse($response, $ex->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public function LogMissingLocalization(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
if (GROCY_MODE === 'dev')
|
||||
@@ -61,8 +85,8 @@ class SystemApiController extends BaseApiController
|
||||
}
|
||||
}
|
||||
|
||||
public function __construct(\DI\Container $container)
|
||||
public function GetLocalizationStrings(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
parent::__construct($container);
|
||||
return $this->ApiResponse($response, json_decode($this->getLocalizationService()->GetPoAsJsonString()), true);
|
||||
}
|
||||
}
|
||||
|
@@ -35,11 +35,6 @@ class SystemController extends BaseController
|
||||
return $response->withRedirect($this->AppContainer->get('UrlManager')->ConstructUrl($this->GetEntryPageRelative()));
|
||||
}
|
||||
|
||||
public function __construct(\DI\Container $container)
|
||||
{
|
||||
parent::__construct($container);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the entry page of the application based on the value of the entry page setting.
|
||||
*
|
||||
|
@@ -49,9 +49,4 @@ class TasksApiController extends BaseApiController
|
||||
return $this->GenericErrorResponse($response, $ex->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public function __construct(\DI\Container $container)
|
||||
{
|
||||
parent::__construct($container);
|
||||
}
|
||||
}
|
||||
|
@@ -6,6 +6,9 @@ class TasksController extends BaseController
|
||||
{
|
||||
public function Overview(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
$usersService = $this->getUsersService();
|
||||
$nextXDays = $usersService->GetUserSettings(GROCY_USER_ID)['tasks_due_soon_days'];
|
||||
|
||||
if (isset($request->getQueryParams()['include_done']))
|
||||
{
|
||||
$tasks = $this->getDatabase()->tasks()->orderBy('name', 'COLLATE NOCASE');
|
||||
@@ -15,8 +18,25 @@ class TasksController extends BaseController
|
||||
$tasks = $this->getTasksService()->GetCurrent();
|
||||
}
|
||||
|
||||
$usersService = $this->getUsersService();
|
||||
$nextXDays = $usersService->GetUserSettings(GROCY_USER_ID)['tasks_due_soon_days'];
|
||||
foreach ($tasks as $task)
|
||||
{
|
||||
if (empty($task->due_date))
|
||||
{
|
||||
$task->due_type = '';
|
||||
}
|
||||
elseif ($task->due_date < date('Y-m-d 23:59:59', strtotime('-1 days')))
|
||||
{
|
||||
$task->due_type = 'overdue';
|
||||
}
|
||||
elseif ($task->due_date <= date('Y-m-d 23:59:59'))
|
||||
{
|
||||
$task->due_type = 'duetoday';
|
||||
}
|
||||
elseif ($nextXDays > 0 && $task->due_date <= date('Y-m-d 23:59:59', strtotime('+' . $nextXDays . ' days')))
|
||||
{
|
||||
$task->due_type = 'duesoon';
|
||||
}
|
||||
}
|
||||
|
||||
return $this->renderPage($response, 'tasks', [
|
||||
'tasks' => $tasks,
|
||||
@@ -83,9 +103,4 @@ class TasksController extends BaseController
|
||||
{
|
||||
return $this->renderPage($response, 'taskssettings');
|
||||
}
|
||||
|
||||
public function __construct(\DI\Container $container)
|
||||
{
|
||||
parent::__construct($container);
|
||||
}
|
||||
}
|
||||
|
@@ -10,13 +10,17 @@ class User
|
||||
const PERMISSION_ADMIN = 'ADMIN';
|
||||
|
||||
const PERMISSION_BATTERIES = 'BATTERIES';
|
||||
|
||||
const PERMISSION_BATTERIES_TRACK_CHARGE_CYCLE = 'BATTERIES_TRACK_CHARGE_CYCLE';
|
||||
|
||||
const PERMISSION_BATTERIES_UNDO_CHARGE_CYCLE = 'BATTERIES_UNDO_CHARGE_CYCLE';
|
||||
|
||||
const PERMISSION_CALENDAR = 'CALENDAR';
|
||||
|
||||
const PERMISSION_CHORES = 'CHORES';
|
||||
|
||||
const PERMISSION_CHORE_TRACK_EXECUTION = 'CHORE_TRACK_EXECUTION';
|
||||
|
||||
const PERMISSION_CHORE_UNDO_EXECUTION = 'CHORE_UNDO_EXECUTION';
|
||||
|
||||
const PERMISSION_EQUIPMENT = 'EQUIPMENT';
|
||||
@@ -24,30 +28,50 @@ class User
|
||||
const PERMISSION_MASTER_DATA_EDIT = 'MASTER_DATA_EDIT';
|
||||
|
||||
const PERMISSION_RECIPES = 'RECIPES';
|
||||
|
||||
const PERMISSION_RECIPES_MEALPLAN = 'RECIPES_MEALPLAN';
|
||||
|
||||
const PERMISSION_SHOPPINGLIST = 'SHOPPINGLIST';
|
||||
|
||||
const PERMISSION_SHOPPINGLIST_ITEMS_ADD = 'SHOPPINGLIST_ITEMS_ADD';
|
||||
|
||||
const PERMISSION_SHOPPINGLIST_ITEMS_DELETE = 'SHOPPINGLIST_ITEMS_DELETE';
|
||||
|
||||
const PERMISSION_STOCK = 'STOCK';
|
||||
|
||||
const PERMISSION_STOCK_CONSUME = 'STOCK_CONSUME';
|
||||
|
||||
const PERMISSION_STOCK_EDIT = 'STOCK_EDIT';
|
||||
|
||||
const PERMISSION_STOCK_INVENTORY = 'STOCK_INVENTORY';
|
||||
|
||||
const PERMISSION_STOCK_OPEN = 'STOCK_OPEN';
|
||||
|
||||
const PERMISSION_STOCK_PURCHASE = 'STOCK_PURCHASE';
|
||||
|
||||
const PERMISSION_STOCK_TRANSFER = 'STOCK_TRANSFER';
|
||||
|
||||
const PERMISSION_TASKS = 'TASKS';
|
||||
|
||||
const PERMISSION_TASKS_MARK_COMPLETED = 'TASKS_MARK_COMPLETED';
|
||||
|
||||
const PERMISSION_TASKS_UNDO_EXECUTION = 'TASKS_UNDO_EXECUTION';
|
||||
|
||||
const PERMISSION_USERS = 'USERS';
|
||||
|
||||
const PERMISSION_USERS_CREATE = 'USERS_CREATE';
|
||||
|
||||
const PERMISSION_USERS_EDIT = 'USERS_EDIT';
|
||||
|
||||
const PERMISSION_USERS_EDIT_SELF = 'USERS_EDIT_SELF';
|
||||
|
||||
const PERMISSION_USERS_READ = 'USERS_READ';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->db = DatabaseService::getInstance()->GetDbConnection();
|
||||
}
|
||||
|
||||
/**
|
||||
* @var \LessQL\Database|null
|
||||
*/
|
||||
@@ -59,23 +83,14 @@ class User
|
||||
return $user->getPermissionList();
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->db = DatabaseService::getInstance()->GetDbConnection();
|
||||
}
|
||||
|
||||
public static function checkPermission($request, string ...$permissions): void
|
||||
public static function checkPermission($request, string $permission): void
|
||||
{
|
||||
$user = new self();
|
||||
|
||||
foreach ($permissions as $permission)
|
||||
{
|
||||
if (!$user->hasPermission($permission))
|
||||
{
|
||||
throw new PermissionMissingException($request, $permission);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getPermissionList()
|
||||
{
|
||||
|
@@ -231,9 +231,4 @@ class UsersApiController extends BaseApiController
|
||||
return $this->GenericErrorResponse($response, $ex->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public function __construct(\DI\Container $container)
|
||||
{
|
||||
parent::__construct($container);
|
||||
}
|
||||
}
|
||||
|
66
docs/grocycode.md
Normal file
@@ -0,0 +1,66 @@
|
||||
grocycode
|
||||
==========
|
||||
|
||||
grocycode is, in essence, a simple way to reference to arbitrary grocy entities.
|
||||
Each grocycode includes a magic, an entitiy identifier, an id and an ordered set of extra data.
|
||||
It is supported to be entered anywhere grocy expects one to read a barcode, but can also reference
|
||||
grocy-internal properties like specific stock entries, or specific batteries.
|
||||
|
||||
Serialization
|
||||
----
|
||||
|
||||
There are three mandatory parts in a grocycode:
|
||||
|
||||
1. The magic `grcy`
|
||||
2. An entity identifer matching the regular expression `[a-z]+` (that is, lowercase english alphabet without any fancy accents, minimum length 1 character).
|
||||
3. An object identifer matching the regular expression `[0-9]+`
|
||||
|
||||
Optionally, any number of further data without format restrictions besides not containing any double colons [0] may be appended.
|
||||
|
||||
These parts are then linearly appended, seperated by a double colon `:`.
|
||||
|
||||
Entity Identifers
|
||||
----
|
||||
|
||||
Currently, there are three different entity types defined:
|
||||
|
||||
- `p` for Products
|
||||
- `b` for Batteries
|
||||
- `c` for Chores
|
||||
|
||||
Example
|
||||
----
|
||||
|
||||
In this example, we encode a *Product* with ID *13*, which results in `grcy:p:13` when serialized.
|
||||
|
||||
Product grocycodes
|
||||
----
|
||||
|
||||
Product grocycodes extend the data format to include an optional stock id, thus may reference a specific stock entry directly.
|
||||
|
||||
Example: `grcy:p:13:60bf8b5244b04`
|
||||
|
||||
Battery grocycodes
|
||||
----
|
||||
|
||||
Currently, Battery grocycodes do not define any extra fields.
|
||||
|
||||
Chore grocycodes
|
||||
----
|
||||
|
||||
Currently, Chore grocycodes do not define any extra fields.
|
||||
|
||||
Visual Encoding
|
||||
----
|
||||
|
||||
Grocy uses DataMatrix 2D (or alternatively Code128 1D) Barcodes to encode grocycodes into a visual representation. In principle, there is no problem with using
|
||||
other encoding formats like QR codes; however DataMatrix uses less space for the same information and redundancy and is a bit
|
||||
easier read by 2D barcode scanners, especially on non-flat surfaces.
|
||||
|
||||
You can pick up cheap-ish used scanners from ebay (about 45€ in germany). Make sure to set them to the correct keyboard emulation,
|
||||
so that the double colons get entered correctly.
|
||||
|
||||
|
||||
Notes
|
||||
---
|
||||
[0]: Obviously, it needs to be encoded into some usable visual representation and then read. So probably you only want to encode stuff that can be typed on a keyboard.
|
40
docs/label-printing.md
Normal file
@@ -0,0 +1,40 @@
|
||||
Label printing
|
||||
====
|
||||
|
||||
To enable label printing, set `FEATURE_FLAG_LABEL_PRINTER` to `true`in your `config.php`. You also need to provide a webhook target that is responsible for printing.
|
||||
|
||||
Why webhook?
|
||||
---
|
||||
|
||||
Label printers come in all shapes and forms, and your particular one is probably not the one used by the author of this feature. Also, grocy may does not have a
|
||||
direct connection to a local label printer (e.g. grocy is hosted in a cloud vps). Thus, a lightweight implementation is provided by grocy: whenever something
|
||||
should print, a POST request to a configured URL is made. The target then is responsible for label printing.
|
||||
|
||||
Reference implementation
|
||||
---
|
||||
|
||||
The webhook was developed and tested against a Brother QL-600 label printer, using Brother DK-2205 endless 62mm label paper. The webhook provider implementation was
|
||||
implemented into [a fork of brother_ql_web](https://github.com/mistressofjellyfish/brother_ql_web).
|
||||
|
||||
Webhook request
|
||||
---
|
||||
|
||||
Requests can be configured to be sent server-side (that is, from the machine hosting grocy through GuzzleHttp) or by an AJAX request directly from the browser.
|
||||
The latter is neccesary for situations where the grocy hosting machine cannot reach your label printer, however server-side requests are a bit faster and
|
||||
tend to be more stable.
|
||||
|
||||
Both methods fire this request upon printing:
|
||||
|
||||
```
|
||||
POST /your/printing/api/endpoint HTTP/1.1
|
||||
|
||||
product=<productname>&grocycode=grocy:x:xxx&due_date=DD:%2021-06-09&...
|
||||
|
||||
```
|
||||
|
||||
If specified, the request body may also be JSON encoded, however the fields stay the same.
|
||||
|
||||
Additional POST parameters (like the font to use) may be supplied in `config.php`. Keep in mind that these config values will be distributed to all clients on all requests
|
||||
if the webhook is configured to run client-side.
|
||||
|
||||
The webhook receiver is required to layout and print the resulting label.
|
1057
grocy.openapi.json
@@ -4,6 +4,12 @@ namespace Grocy\Helpers;
|
||||
|
||||
abstract class BaseBarcodeLookupPlugin
|
||||
{
|
||||
final public function __construct($locations, $quantityUnits)
|
||||
{
|
||||
$this->Locations = $locations;
|
||||
$this->QuantityUnits = $quantityUnits;
|
||||
}
|
||||
|
||||
protected $Locations;
|
||||
|
||||
protected $QuantityUnits;
|
||||
@@ -50,28 +56,24 @@ abstract class BaseBarcodeLookupPlugin
|
||||
|
||||
// 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');
|
||||
@@ -80,11 +82,5 @@ abstract class BaseBarcodeLookupPlugin
|
||||
return $pluginOutput;
|
||||
}
|
||||
|
||||
final public function __construct($locations, $quantityUnits)
|
||||
{
|
||||
$this->Locations = $locations;
|
||||
$this->QuantityUnits = $quantityUnits;
|
||||
}
|
||||
|
||||
abstract protected function ExecuteLookup($barcode);
|
||||
}
|
||||
|
84
helpers/ConfigurationValidator.php
Normal file
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
|
||||
class EInvalidConfig extends Exception
|
||||
{
|
||||
}
|
||||
|
||||
class ConfigurationValidator
|
||||
{
|
||||
public function validateConfig()
|
||||
{
|
||||
self::checkMode();
|
||||
self::checkDefaultLocale();
|
||||
self::checkCurrencyFormat();
|
||||
self::checkFirstDayOfWeek();
|
||||
self::checkEntryPage();
|
||||
self::checkMealplanFirstDayOfWeek();
|
||||
self::checkAutoNightModeRange();
|
||||
}
|
||||
|
||||
private function checkMode()
|
||||
{
|
||||
$allowedModes = ['production', 'dev', 'demo', 'prerelease'];
|
||||
if (!in_array(GROCY_MODE, $allowedModes))
|
||||
{
|
||||
throw new EInvalidConfig('Invalid mode "' . GROCY_MODE . '" set, only ' . implode(', ', $allowedModes) . ' allowed');
|
||||
}
|
||||
}
|
||||
|
||||
private function checkDefaultLocale()
|
||||
{
|
||||
if (!file_exists(__DIR__ . '/../localization/' . GROCY_DEFAULT_LOCALE))
|
||||
{
|
||||
throw new EInvalidConfig('Invalid locale "' . GROCY_DEFAULT_LOCALE . '" set, locale needs to exist in folder localization');
|
||||
}
|
||||
}
|
||||
|
||||
private function checkFirstDayOfWeek()
|
||||
{
|
||||
if (!(GROCY_CALENDAR_FIRST_DAY_OF_WEEK == '' ||
|
||||
(is_numeric(GROCY_CALENDAR_FIRST_DAY_OF_WEEK) && GROCY_CALENDAR_FIRST_DAY_OF_WEEK >= 0 && GROCY_CALENDAR_FIRST_DAY_OF_WEEK <= 6)))
|
||||
{
|
||||
throw new EInvalidConfig('Invalid value for CALENDAR_FIRST_DAY_OF_WEEK');
|
||||
}
|
||||
}
|
||||
|
||||
private function checkCurrencyFormat()
|
||||
{
|
||||
if (!(preg_match('/^([A-z]){3}$/', GROCY_CURRENCY)))
|
||||
{
|
||||
throw new EInvalidConfig('CURRENCY is not in ISO 4217 format (three letter code)');
|
||||
}
|
||||
}
|
||||
|
||||
private function checkEntryPage()
|
||||
{
|
||||
$allowedPages = ['stock', 'shoppinglist', 'recipes', 'chores', 'tasks', 'batteries', 'equipment', 'calendar', 'mealplan'];
|
||||
if (!in_array(GROCY_ENTRY_PAGE, $allowedPages))
|
||||
{
|
||||
throw new EInvalidConfig('Invalid entry page "' . GROCY_ENTRY_PAGE . '" set, only ' . implode(', ', $allowedPages) . ' allowed');
|
||||
}
|
||||
}
|
||||
|
||||
private function checkMealplanFirstDayOfWeek()
|
||||
{
|
||||
if (!(GROCY_MEAL_PLAN_FIRST_DAY_OF_WEEK == '' ||
|
||||
(is_numeric(GROCY_MEAL_PLAN_FIRST_DAY_OF_WEEK) && GROCY_MEAL_PLAN_FIRST_DAY_OF_WEEK >= 0 && GROCY_MEAL_PLAN_FIRST_DAY_OF_WEEK <= 6)))
|
||||
{
|
||||
throw new EInvalidConfig('Invalid value for MEAL_PLAN_FIRST_DAY_OF_WEEK');
|
||||
}
|
||||
}
|
||||
|
||||
private function checkAutoNightModeRange()
|
||||
{
|
||||
global $GROCY_DEFAULT_USER_SETTINGS;
|
||||
if (!(preg_match('/^(?:2[0-3]|[01][0-9]):[0-5][0-9]$/', $GROCY_DEFAULT_USER_SETTINGS['auto_night_mode_time_range_from'])))
|
||||
{
|
||||
throw new EInvalidConfig('auto_night_mode_time_range_from is not in HH:mm format (' . $GROCY_DEFAULT_USER_SETTINGS['auto_night_mode_time_range_from'] . ')');
|
||||
}
|
||||
if (!(preg_match('/^(?:2[0-3]|[01][0-9]):[0-5][0-9]$/', $GROCY_DEFAULT_USER_SETTINGS['auto_night_mode_time_range_to'])))
|
||||
{
|
||||
throw new EInvalidConfig('auto_night_mode_time_range_to is not in HH:mm format (' . $GROCY_DEFAULT_USER_SETTINGS['auto_night_mode_time_range_to'] . ')');
|
||||
}
|
||||
}
|
||||
}
|
148
helpers/Grocycode.php
Normal file
@@ -0,0 +1,148 @@
|
||||
<?php
|
||||
|
||||
namespace Grocy\Helpers;
|
||||
|
||||
/**
|
||||
* A class that abstracts grocycode.
|
||||
*
|
||||
* grocycode is a simple, easily serializable format to reference
|
||||
* stuff within grocy. It consists of n (n ≥ 3) double-colon seperated parts:
|
||||
*
|
||||
* 1. The magic `grcy`
|
||||
* 2. A type identifer, must match `[a-z]+` (i.e. only lowercase ascii, minimum length 1 character)
|
||||
* 3. An object id
|
||||
* 4. Any number of further data fields, double-colon seperated.
|
||||
*
|
||||
* @author Katharina Bogad <katharina@hacked.xyz>
|
||||
*/
|
||||
class Grocycode
|
||||
{
|
||||
public const PRODUCT = 'p';
|
||||
|
||||
public const BATTERY = 'b';
|
||||
|
||||
public const CHORE = 'c';
|
||||
|
||||
public const RECIPE = 'r';
|
||||
|
||||
public const MAGIC = 'grcy';
|
||||
|
||||
/**
|
||||
* Constructs a new instance of the Grocycode class.
|
||||
*
|
||||
* Because php doesn't support overloading, this is a proxy
|
||||
* to either setFromCode($code) or setFromData($type, $id, $extra_data = []).
|
||||
*/
|
||||
public function __construct(...$args)
|
||||
{
|
||||
$argc = count($args);
|
||||
if ($argc == 1)
|
||||
{
|
||||
$this->setFromCode($args[0]);
|
||||
return;
|
||||
}
|
||||
elseif ($argc == 2 || $argc == 3)
|
||||
{
|
||||
if ($argc == 2)
|
||||
{
|
||||
$args[] = [];
|
||||
}
|
||||
$this->setFromData($args[0], $args[1], $args[2]);
|
||||
return;
|
||||
}
|
||||
|
||||
throw new \Exception('No suitable overload found.');
|
||||
}
|
||||
|
||||
/**
|
||||
* An array that registers all valid grocycode types. Register yours here by appending to this array.
|
||||
*/
|
||||
public static $Items = [self::PRODUCT, self::BATTERY, self::CHORE, self::RECIPE];
|
||||
|
||||
private $type;
|
||||
|
||||
private $id;
|
||||
|
||||
private $extra_data = [];
|
||||
|
||||
/**
|
||||
* Validates a grocycode.
|
||||
*
|
||||
* Returns true, if a supplied $code is a valid grocycode, false otherwise.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function Validate(string $code)
|
||||
{
|
||||
try
|
||||
{
|
||||
$gc = new self($code);
|
||||
return true;
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function GetId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function GetExtraData()
|
||||
{
|
||||
return $this->extra_data;
|
||||
}
|
||||
|
||||
public function GetType()
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
$arr = array_merge([self::MAGIC, $this->type, $this->id], $this->extra_data);
|
||||
|
||||
return implode(':', $arr);
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses a grocycode.
|
||||
*/
|
||||
private function setFromCode($code)
|
||||
{
|
||||
$parts = array_reverse(explode(':', $code));
|
||||
if (array_pop($parts) != self::MAGIC)
|
||||
{
|
||||
throw new \Exception('Not a grocycode');
|
||||
}
|
||||
|
||||
if (!in_array($this->type = array_pop($parts), self::$Items))
|
||||
{
|
||||
throw new \Exception('Unknown grocycode type');
|
||||
}
|
||||
|
||||
$this->id = array_pop($parts);
|
||||
$this->extra_data = array_reverse($parts);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a grocycode from data.
|
||||
*/
|
||||
private function setFromData($type, $id, $extra_data = [])
|
||||
{
|
||||
if (!is_array($extra_data))
|
||||
{
|
||||
throw new \Exception('Extra data must be array of string');
|
||||
}
|
||||
if (!in_array($type, self::$Items))
|
||||
{
|
||||
throw new \Exception('Unknown grocycode type');
|
||||
}
|
||||
|
||||
$this->type = $type;
|
||||
$this->id = $id;
|
||||
$this->extra_data = $extra_data;
|
||||
}
|
||||
}
|
@@ -4,8 +4,12 @@ class ERequirementNotMet extends Exception
|
||||
{
|
||||
}
|
||||
|
||||
const REQUIRED_PHP_EXTENSIONS = ['fileinfo', 'pdo_sqlite', 'gd'];
|
||||
const REQUIRED_SQLITE_VERSION = '3.8.3';
|
||||
const REQUIRED_PHP_EXTENSIONS = ['fileinfo', 'pdo_sqlite', 'gd', 'ctype', 'json', 'intl', 'zlib', 'mbstring',
|
||||
// These are core extensions, so normally can't be missing, but seems to be the case, however, on FreeBSD
|
||||
'filter', 'iconv', 'tokenizer'
|
||||
];
|
||||
|
||||
const REQUIRED_SQLITE_VERSION = '3.22.0';
|
||||
|
||||
class PrerequisiteChecker
|
||||
{
|
||||
|
@@ -4,6 +4,18 @@ namespace Grocy\Helpers;
|
||||
|
||||
class UrlManager
|
||||
{
|
||||
public function __construct(string $basePath)
|
||||
{
|
||||
if ($basePath === '/')
|
||||
{
|
||||
$this->BasePath = $this->GetBaseUrl();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->BasePath = $basePath;
|
||||
}
|
||||
}
|
||||
|
||||
protected $BasePath;
|
||||
|
||||
public function ConstructUrl($relativePath, $isResource = false)
|
||||
@@ -18,18 +30,6 @@ class UrlManager
|
||||
}
|
||||
}
|
||||
|
||||
public function __construct(string $basePath)
|
||||
{
|
||||
if ($basePath === '/')
|
||||
{
|
||||
$this->BasePath = $this->GetBaseUrl();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->BasePath = $basePath;
|
||||
}
|
||||
}
|
||||
|
||||
private function GetBaseUrl()
|
||||
{
|
||||
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false)
|
||||
|
48
helpers/WebhookRunner.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace Grocy\Helpers;
|
||||
|
||||
use GuzzleHttp\Client;
|
||||
use GuzzleHttp\ExceptionRequestException;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
|
||||
class WebhookRunner
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->client = new Client(['timeout' => 2.0]);
|
||||
}
|
||||
|
||||
private $client;
|
||||
|
||||
public function run($url, $args, $json = false)
|
||||
{
|
||||
$reqArgs = [];
|
||||
if ($json)
|
||||
{
|
||||
$reqArgs = ['json' => $args];
|
||||
}
|
||||
else
|
||||
{
|
||||
$reqArgs = ['form_params' => $args];
|
||||
}
|
||||
try
|
||||
{
|
||||
file_put_contents('php://stderr', 'Running Webhook: ' . $url . "\n" . print_r($reqArgs, true));
|
||||
|
||||
$this->client->request('POST', $url, $reqArgs);
|
||||
}
|
||||
catch (RequestException $e)
|
||||
{
|
||||
file_put_contents('php://stderr', 'Webhook failed: ' . $url . "\n" . $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public function runAll($urls, $args)
|
||||
{
|
||||
foreach ($urls as $url)
|
||||
{
|
||||
$this->run($url, $args);
|
||||
}
|
||||
}
|
||||
}
|
@@ -4,8 +4,7 @@ function FindObjectInArrayByPropertyValue($array, $propertyName, $propertyValue)
|
||||
{
|
||||
foreach ($array as $object)
|
||||
{
|
||||
if ($object->{$propertyName}
|
||||
== $propertyValue)
|
||||
if ($object->{$propertyName} == $propertyValue)
|
||||
{
|
||||
return $object;
|
||||
}
|
||||
@@ -17,37 +16,28 @@ function FindObjectInArrayByPropertyValue($array, $propertyName, $propertyValue)
|
||||
function FindAllObjectsInArrayByPropertyValue($array, $propertyName, $propertyValue, $operator = '==')
|
||||
{
|
||||
$returnArray = [];
|
||||
|
||||
foreach ($array as $object)
|
||||
{
|
||||
switch ($operator)
|
||||
{
|
||||
case '==':
|
||||
|
||||
if ($object->{$propertyName}
|
||||
== $propertyValue)
|
||||
if ($object->{$propertyName} == $propertyValue)
|
||||
{
|
||||
$returnArray[] = $object;
|
||||
}
|
||||
|
||||
break;
|
||||
case '>':
|
||||
|
||||
if ($object->{$propertyName}
|
||||
> $propertyValue)
|
||||
if ($object->{$propertyName} > $propertyValue)
|
||||
{
|
||||
$returnArray[] = $object;
|
||||
}
|
||||
|
||||
break;
|
||||
case '<':
|
||||
|
||||
if ($object->{$propertyName}
|
||||
< $propertyValue)
|
||||
if ($object->{$propertyName} < $propertyValue)
|
||||
{
|
||||
$returnArray[] = $object;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -58,7 +48,6 @@ function FindAllObjectsInArrayByPropertyValue($array, $propertyName, $propertyVa
|
||||
function FindAllItemsInArrayByValue($array, $value, $operator = '==')
|
||||
{
|
||||
$returnArray = [];
|
||||
|
||||
foreach ($array as $item)
|
||||
{
|
||||
switch ($operator)
|
||||
@@ -69,7 +58,6 @@ function FindAllItemsInArrayByValue($array, $value, $operator = '==')
|
||||
{
|
||||
$returnArray[] = $item;
|
||||
}
|
||||
|
||||
break;
|
||||
case '>':
|
||||
|
||||
@@ -77,7 +65,6 @@ function FindAllItemsInArrayByValue($array, $value, $operator = '==')
|
||||
{
|
||||
$returnArray[] = $item;
|
||||
}
|
||||
|
||||
break;
|
||||
case '<':
|
||||
|
||||
@@ -85,7 +72,6 @@ function FindAllItemsInArrayByValue($array, $value, $operator = '==')
|
||||
{
|
||||
$returnArray[] = $item;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -96,7 +82,6 @@ function FindAllItemsInArrayByValue($array, $value, $operator = '==')
|
||||
function SumArrayValue($array, $propertyName)
|
||||
{
|
||||
$sum = 0;
|
||||
|
||||
foreach ($array as $object)
|
||||
{
|
||||
$sum += floatval($object->{$propertyName});
|
||||
@@ -124,7 +109,6 @@ function GetClassConstants($className, $prefix = null)
|
||||
function RandomString($length, $allowedChars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ')
|
||||
{
|
||||
$randomString = '';
|
||||
|
||||
for ($i = 0; $i < $length; $i++)
|
||||
{
|
||||
$randomString .= $allowedChars[rand(0, strlen($allowedChars) - 1)];
|
||||
@@ -156,6 +140,11 @@ function BoolToString(bool $bool)
|
||||
return $bool ? 'true' : 'false';
|
||||
}
|
||||
|
||||
function BoolToInt(bool $bool)
|
||||
{
|
||||
return $bool ? 1 : 0;
|
||||
}
|
||||
|
||||
function ExternalSettingValue(string $value)
|
||||
{
|
||||
$tvalue = rtrim($value, "\r\n");
|
||||
@@ -185,7 +174,8 @@ function Setting(string $name, $value)
|
||||
define('GROCY_' . $name, ExternalSettingValue(file_get_contents($settingOverrideFile)));
|
||||
}
|
||||
elseif (getenv('GROCY_' . $name) !== false)
|
||||
{ // An environment variable with the same name and prefix GROCY_ overwrites the given setting
|
||||
{
|
||||
// An environment variable with the same name and prefix GROCY_ overwrites the given setting
|
||||
define('GROCY_' . $name, ExternalSettingValue(getenv('GROCY_' . $name)));
|
||||
}
|
||||
else
|
||||
|
31
localization/ca/chore_assignment_types.po
Normal file
@@ -0,0 +1,31 @@
|
||||
#
|
||||
# Translators:
|
||||
# gimy16 <gimy16@hotmail.com>, 2021
|
||||
# Carles Riera <blauigris@gmail.com>, 2022
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-05-01T17:59:17+00:00\n"
|
||||
"PO-Revision-Date: 2019-09-17 10:45+0000\n"
|
||||
"Last-Translator: Carles Riera <blauigris@gmail.com>, 2022\n"
|
||||
"Language-Team: Catalan (https://www.transifex.com/grocy/teams/93189/ca/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: ca\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Domain: grocy/chore_assignment_types\n"
|
||||
|
||||
msgid "no-assignment"
|
||||
msgstr "sense actius"
|
||||
|
||||
msgid "who-least-did-first"
|
||||
msgstr "qui menys ha fet primer"
|
||||
|
||||
msgid "random"
|
||||
msgstr "aleatori"
|
||||
|
||||
msgid "in-alphabetical-order"
|
||||
msgstr "en ordre alfabètic"
|
40
localization/ca/chore_period_types.po
Normal file
@@ -0,0 +1,40 @@
|
||||
#
|
||||
# Translators:
|
||||
# Joan Rodas <joanrc93@gmail.com>, 2020
|
||||
# gimy16 <gimy16@hotmail.com>, 2021
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-05-01T17:59:17+00:00\n"
|
||||
"PO-Revision-Date: 2019-05-01 17:42+0000\n"
|
||||
"Last-Translator: gimy16 <gimy16@hotmail.com>, 2021\n"
|
||||
"Language-Team: Catalan (https://www.transifex.com/grocy/teams/93189/ca/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: ca\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Domain: grocy/chore_types\n"
|
||||
|
||||
msgid "manually"
|
||||
msgstr "manualment"
|
||||
|
||||
msgid "daily"
|
||||
msgstr "diari"
|
||||
|
||||
msgid "weekly"
|
||||
msgstr "setmanalment"
|
||||
|
||||
msgid "monthly"
|
||||
msgstr "mensual"
|
||||
|
||||
msgid "yearly"
|
||||
msgstr "anual"
|
||||
|
||||
msgid "hourly"
|
||||
msgstr ""
|
||||
|
||||
msgid "adaptive"
|
||||
msgstr ""
|
99
localization/ca/component_translations.po
Normal file
@@ -0,0 +1,99 @@
|
||||
#
|
||||
# Translators:
|
||||
# Bernd Bestel <bernd@berrnd.de>, 2022
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-05-01T17:59:17+00:00\n"
|
||||
"PO-Revision-Date: 2019-05-01 17:42+0000\n"
|
||||
"Last-Translator: Bernd Bestel <bernd@berrnd.de>, 2022\n"
|
||||
"Language-Team: Catalan (https://www.transifex.com/grocy/teams/93189/ca/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: ca\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Domain: grocy/component_translations\n"
|
||||
|
||||
msgid "moment_locale"
|
||||
msgstr "ca"
|
||||
|
||||
msgid "datatables_localization"
|
||||
msgstr ""
|
||||
"{\"processing\":\"Processant...\",\"lengthMenu\":\"Mostra _MENU_ "
|
||||
"registres\",\"zeroRecords\":\"No s'han trobat "
|
||||
"registres\",\"emptyTable\":\"No hi ha registres disponible en aquesta "
|
||||
"taula\",\"info\":\"Mostrant del _START_ al _END_ d'un total de _TOTAL_ "
|
||||
"registres\",\"infoEmpty\":\"No hi ha registres "
|
||||
"disponibles\",\"infoFiltered\":\"(filtrat de _MAX_ "
|
||||
"registres)\",\"search\":\"Cerca:\",\"infoThousands\":\".\",\"decimal\":\",\",\"loadingRecords\":\"Carregant...\",\"paginate\":{\"first\":\"Primer\",\"previous\":\"Anterior\",\"next\":\"Següent\",\"last\":\"Últim\"},\"aria\":{\"sortAscending\":\":"
|
||||
" Activa per ordenar la columna de manera ascendent\",\"sortDescending\":\": "
|
||||
"Activa per ordenar la columna de manera "
|
||||
"descendent\"},\"buttons\":{\"print\":\"Imprimeix\",\"copy\":\"Copia\",\"colvis\":\"Columnes\",\"copyTitle\":\"Copia"
|
||||
" al portapapers\",\"copySuccess\":{\"1\":\"1 fila copiada\",\"_\":\"%d files"
|
||||
" copiades\"},\"pageLength\":{\"-1\":\"Mostra totes les "
|
||||
"files\",\"_\":\"Mostra %d "
|
||||
"files\"},\"pdf\":\"PDF\",\"collection\":\"Col·lecció\",\"colvisRestore\":\"Restaurar"
|
||||
" visibilitat\",\"copyKeys\":\"Pressiona ctrl o poma + C per copiar les dades"
|
||||
" de la tabla al teu "
|
||||
"portapaper\",\"csv\":\"CSV\",\"excel\":\"Excel\",\"renameState\":\"Cambiar "
|
||||
"nom\"},\"select\":{\"rows\":{\"1\":\"1 fila seleccionada\",\"_\":\"%d files "
|
||||
"seleccionades\"},\"cells\":{\"1\":\"1 fila seleccionada\",\"_\":\"%d files "
|
||||
"seleccionades\"},\"columns\":{\"1\":\"1 columna seleccionada\",\"_\":\"%d "
|
||||
"columnes "
|
||||
"seleccionades\"}},\"autoFill\":{\"cancel\":\"Cancel·lar\",\"fillHorizontal\":\"Omple"
|
||||
" les cel·les horitzontalment\",\"fillVertical\":\"Omple les cel·les "
|
||||
"verticalment\",\"fill\":\"Omple totes les cel·les amb "
|
||||
"<i>%d</i>\"},\"thousands\":\".\",\"datetime\":{\"hours\":\"Hora\",\"minutes\":\"Minut\",\"seconds\":\"Segons\",\"unknown\":\"Desconegut\",\"amPm\":[\"am\",\"pm\"],\"previous\":\"Anterior\",\"next\":\"Següent\",\"months\":{\"0\":\"Gener\",\"1\":\"Febrer\",\"2\":\"Març\",\"3\":\"Abril\",\"4\":\"Maig\",\"5\":\"Juny\",\"6\":\"Julio\",\"7\":\"Agost\",\"8\":\"Septembre\",\"9\":\"Octubre\",\"10\":\"Novembre\",\"11\":\"Desembre\"}},\"editor\":{\"close\":\"Tancar\",\"create\":{\"button\":\"Nou\",\"title\":\"Crear"
|
||||
" nova "
|
||||
"entrada\",\"submit\":\"Crear\"},\"edit\":{\"button\":\"Editar\",\"title\":\"Editar"
|
||||
" "
|
||||
"entrada\",\"submit\":\"Actualitzar\"},\"remove\":{\"button\":\"Eliminar\",\"title\":\"Eliminar\",\"submit\":\"Eliminar\",\"confirm\":{\"1\":\"Està"
|
||||
" segir de voler elmiminar 1 fila?\",\"_\":\"Està segur de voler eliminar %d "
|
||||
"files?\"}},\"error\":{\"system\":\"Ha ocurregut un error de sistema (Més "
|
||||
"informació)\"},\"multi\":{\"title\":\"Múltiples valors\",\"info\":\"El ítems"
|
||||
" seleccionts contenen diferent valors per aquesta entrada. Per editar i "
|
||||
"configurar tots els ítems per a aquesta entrada al mateix valor, prem o "
|
||||
"clica tabular aquí, d'altra vanda, mantindrán els seus valors "
|
||||
"individuals\",\"restore\":\"Desfés el canvi\",\"noMulti\":\"Aquest camp pot "
|
||||
"ser editat indifidualment; però no com a part d'un "
|
||||
"grup\"}},\"searchBuilder\":{\"add\":\"Afegir "
|
||||
"condició\",\"clearAll\":\"Eliminar "
|
||||
"tot\",\"condition\":\"Condició\",\"conditions\":{\"date\":{\"after\":\"Després\",\"before\":\"Abans\",\"between\":\"Entre\",\"empty\":\"Buit\",\"equals\":\"Iguals\",\"not\":\"No\",\"notBetween\":\"No"
|
||||
" entre\",\"notEmpty\":\"No "
|
||||
"buit\"},\"number\":{\"between\":\"Entre\",\"empty\":\"Buit\",\"equals\":\"Iguals\",\"gt\":\"Major"
|
||||
" que\",\"gte\":\"Mejor o igual a\",\"lt\":\"Menor que\",\"lte\":\"Menor o "
|
||||
"igual a\",\"not\":\"No\",\"notBetween\":\"No entre\",\"notEmpty\":\"No "
|
||||
"buit\"},\"string\":{\"contains\":\"Conté\",\"empty\":\"Buit\",\"endsWith\":\"Finalitza"
|
||||
" amb\",\"equals\":\"Iguals\",\"not\":\"No\",\"notEmpty\":\"No "
|
||||
"buit\",\"startsWith\":\"Comença amb\",\"notEnds\":\"No acaba "
|
||||
"amb\",\"notStarts\":\"No comença amb\",\"notContains\":\"No "
|
||||
"inclou\"},\"array\":{\"equals\":\"Iguals\",\"empty\":\"Buit\",\"contains\":\"Conté\",\"not\":\"No\",\"notEmpty\":\"No"
|
||||
" buit\",\"without\":\"Sense\"}},\"data\":\"Data\",\"deleteTitle\":\"Esborrar"
|
||||
" regla de filtrat\",\"leftTitle\":\"Criteri de "
|
||||
"desindentació\",\"logicAnd\":\"I\",\"logicOr\":\"O\",\"rightTitle\":\"Criteri"
|
||||
" d'indentació\",\"value\":\"Valor\",\"title\":{\"0\":\"Constructor de "
|
||||
"cerca\",\"_\":\"Constructor de cerca (%d)\"},\"button\":{\"0\":\"Constructor"
|
||||
" de cerca\",\"_\":\"Constructor de cerca "
|
||||
"(%d)\"}},\"searchPanes\":{\"clearMessage\":\"Eborrar "
|
||||
"tot\",\"collapse\":{\"0\":\"Panells de cerca\",\"_\":\"Panells de cerca "
|
||||
"(%d)\"},\"count\":\"{total}\",\"countFiltered\":\"{monstrat} "
|
||||
"({total})\",\"emptyPanes\":\"No panells de "
|
||||
"cerca\",\"loadMessage\":\"Carregant panells de cerca\",\"title\":\"Filtes "
|
||||
"actius - %d\",\"collapseMessage\":\"Colapsar Tot\",\"showMessage\":\"Mostrar"
|
||||
" tot\"},\"stateRestore\":{\"renameLabel\":\"Nuevo nomm perpara "
|
||||
"%s\",\"renameButton\":\"Cambiar "
|
||||
"nom\",\"removeSubmit\":\"Eliminar\",\"removeJoiner\":\"i\",\"removeError\":\"Error"
|
||||
" eliminant el registre\",\"removeConfirm\":\"¿Segur que vol eliminar aquest "
|
||||
"%s?\",\"emptyError\":\"El nom no pot estar buit\"}}"
|
||||
|
||||
msgid "summernote_locale"
|
||||
msgstr "ca-ES"
|
||||
|
||||
msgid "fullcalendar_locale"
|
||||
msgstr "ca"
|
||||
|
||||
msgid "bootstrap-select_locale"
|
||||
msgstr "en_US"
|
388
localization/ca/demo_data.po
Normal file
@@ -0,0 +1,388 @@
|
||||
#
|
||||
# Translators:
|
||||
# Joan Rodas <joanrc93@gmail.com>, 2020
|
||||
# gimy16 <gimy16@hotmail.com>, 2021
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-05-01T17:59:17+00:00\n"
|
||||
"PO-Revision-Date: 2019-05-01 17:42+0000\n"
|
||||
"Last-Translator: gimy16 <gimy16@hotmail.com>, 2021\n"
|
||||
"Language-Team: Catalan (https://www.transifex.com/grocy/teams/93189/ca/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: ca\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Domain: grocy/demo_data\n"
|
||||
|
||||
msgid "Cookies"
|
||||
msgstr "Galetes"
|
||||
|
||||
msgid "Chocolate"
|
||||
msgstr "Xocolata"
|
||||
|
||||
msgid "Pantry"
|
||||
msgstr "rebost"
|
||||
|
||||
msgid "Candy cupboard"
|
||||
msgstr ""
|
||||
|
||||
msgid "Tinned food cupboard"
|
||||
msgstr ""
|
||||
|
||||
msgid "Fridge"
|
||||
msgstr "Nevera"
|
||||
|
||||
msgid "Piece"
|
||||
msgid_plural "Pieces"
|
||||
msgstr[0] "Peces"
|
||||
msgstr[1] "Trossos"
|
||||
|
||||
msgid "Pack"
|
||||
msgid_plural "Packs"
|
||||
msgstr[0] "Paquet"
|
||||
msgstr[1] "Paquets"
|
||||
|
||||
msgid "Glass"
|
||||
msgid_plural "Glasses"
|
||||
msgstr[0] "Got"
|
||||
msgstr[1] "Gots"
|
||||
|
||||
msgid "Tin"
|
||||
msgid_plural "Tins"
|
||||
msgstr[0] "Pot"
|
||||
msgstr[1] "Pots"
|
||||
|
||||
msgid "Can"
|
||||
msgid_plural "Cans"
|
||||
msgstr[0] "Llauna"
|
||||
msgstr[1] "Llaunes"
|
||||
|
||||
msgid "Bunch"
|
||||
msgid_plural "Bunches"
|
||||
msgstr[0] ""
|
||||
msgstr[1] ""
|
||||
|
||||
msgid "Gummy bears"
|
||||
msgstr ""
|
||||
|
||||
msgid "Crisps"
|
||||
msgstr ""
|
||||
|
||||
msgid "Eggs"
|
||||
msgstr "Ous"
|
||||
|
||||
msgid "Noodles"
|
||||
msgstr "Fideus"
|
||||
|
||||
msgid "Pickles"
|
||||
msgstr "Encurtits"
|
||||
|
||||
msgid "Gulash soup"
|
||||
msgstr "Gulash"
|
||||
|
||||
msgid "Yogurt"
|
||||
msgstr "iogurt"
|
||||
|
||||
msgid "Cheese"
|
||||
msgstr "Formatge"
|
||||
|
||||
msgid "Cold cuts"
|
||||
msgstr "Embotits"
|
||||
|
||||
msgid "Paprika"
|
||||
msgstr "Pebrot"
|
||||
|
||||
msgid "Cucumber"
|
||||
msgstr "Cogombre"
|
||||
|
||||
msgid "Radish"
|
||||
msgstr "Rave"
|
||||
|
||||
msgid "Tomato"
|
||||
msgstr "Tomàquet"
|
||||
|
||||
msgid "Change towels in the bathroom"
|
||||
msgstr ""
|
||||
|
||||
msgid "Mop the kitchen floor"
|
||||
msgstr ""
|
||||
|
||||
msgid "Warranty ends"
|
||||
msgstr "S'acaba la garantia"
|
||||
|
||||
msgid "TV remote control"
|
||||
msgstr "Comandament a distància"
|
||||
|
||||
msgid "Alarm clock"
|
||||
msgstr "Alarma"
|
||||
|
||||
msgid "Heat remote control"
|
||||
msgstr ""
|
||||
|
||||
msgid "Take out the trash"
|
||||
msgstr ""
|
||||
|
||||
msgid "Some good snacks"
|
||||
msgstr "Uns bons aperitius"
|
||||
|
||||
msgid "Pizza dough"
|
||||
msgstr "Massa de pizza"
|
||||
|
||||
msgid "Sieved tomatoes"
|
||||
msgstr ""
|
||||
|
||||
msgid "Salami"
|
||||
msgstr "Salami"
|
||||
|
||||
msgid "Toast"
|
||||
msgstr "Torrada"
|
||||
|
||||
msgid "Minced meat"
|
||||
msgstr "Carn picada"
|
||||
|
||||
msgid "Pizza"
|
||||
msgstr "Pizza"
|
||||
|
||||
msgid "Spaghetti bolognese"
|
||||
msgstr "Espaguetis a la bolonyesa"
|
||||
|
||||
msgid "Sandwiches"
|
||||
msgstr "Entrepans"
|
||||
|
||||
msgid "English"
|
||||
msgstr "Anglès"
|
||||
|
||||
msgid "German"
|
||||
msgstr "Alemany"
|
||||
|
||||
msgid "Italian"
|
||||
msgstr "Italià"
|
||||
|
||||
msgid "This is the note content of the recipe ingredient"
|
||||
msgstr ""
|
||||
|
||||
msgid "Demo User"
|
||||
msgstr "Usuari de prova"
|
||||
|
||||
msgid "Gram"
|
||||
msgid_plural "Grams"
|
||||
msgstr[0] "Gram"
|
||||
msgstr[1] "Grams"
|
||||
|
||||
msgid "Flour"
|
||||
msgstr "Farina"
|
||||
|
||||
msgid "Pancakes"
|
||||
msgstr ""
|
||||
|
||||
msgid "Sugar"
|
||||
msgstr "Sucre"
|
||||
|
||||
msgid "Sweets"
|
||||
msgstr "Llaminadures"
|
||||
|
||||
msgid "Bakery products"
|
||||
msgstr "Productes de fleca"
|
||||
|
||||
msgid "Tinned food"
|
||||
msgstr "Menjar en conserva"
|
||||
|
||||
msgid "Butchery products"
|
||||
msgstr "Productes de carnisseria"
|
||||
|
||||
msgid "Vegetables/Fruits"
|
||||
msgstr "Verdures / Fruites"
|
||||
|
||||
msgid "Refrigerated products"
|
||||
msgstr "Productes refrigerats"
|
||||
|
||||
msgid "Coffee machine"
|
||||
msgstr "Màquina de cafè"
|
||||
|
||||
msgid "Dishwasher"
|
||||
msgstr "Rentaplats"
|
||||
|
||||
msgid "Liter"
|
||||
msgstr "Litre"
|
||||
|
||||
msgid "Liters"
|
||||
msgstr "Litres"
|
||||
|
||||
msgid "Bottle"
|
||||
msgstr "Ampolla"
|
||||
|
||||
msgid "Bottles"
|
||||
msgstr "Ampolles"
|
||||
|
||||
msgid "Milk"
|
||||
msgstr "Llet"
|
||||
|
||||
msgid "Chocolate sauce"
|
||||
msgstr ""
|
||||
|
||||
msgid "Milliliters"
|
||||
msgstr "Mil·lilitres"
|
||||
|
||||
msgid "Milliliter"
|
||||
msgstr "Mil·lilitre"
|
||||
|
||||
msgid "Bottom"
|
||||
msgstr "Fons"
|
||||
|
||||
msgid "Topping"
|
||||
msgstr "Cobertura"
|
||||
|
||||
msgid "French"
|
||||
msgstr "Francès"
|
||||
|
||||
msgid "Turkish"
|
||||
msgstr "Turc"
|
||||
|
||||
msgid "Spanish"
|
||||
msgstr "Espanyol"
|
||||
|
||||
msgid "Russian"
|
||||
msgstr "Rus"
|
||||
|
||||
msgid "Vacuum the living room floor"
|
||||
msgstr ""
|
||||
|
||||
msgid "Clean the litter box"
|
||||
msgstr ""
|
||||
|
||||
msgid "Change the bed sheets"
|
||||
msgstr ""
|
||||
|
||||
msgid "Swedish"
|
||||
msgstr "Suec"
|
||||
|
||||
msgid "Polish"
|
||||
msgstr "Polonès"
|
||||
|
||||
msgid "Milk Chocolate"
|
||||
msgstr "Xocolata amb llet"
|
||||
|
||||
msgid "Dark Chocolate"
|
||||
msgstr "Xocolata negra"
|
||||
|
||||
msgid "Slice"
|
||||
msgid_plural "Slices"
|
||||
msgstr[0] "Tall"
|
||||
msgstr[1] "Talls"
|
||||
|
||||
msgid "Example userentity"
|
||||
msgstr "Identitat d'usuari d'exemple"
|
||||
|
||||
msgid "This is an example user entity..."
|
||||
msgstr "Aquest és una identitat d'usuari d'exemple"
|
||||
|
||||
msgid "Custom field"
|
||||
msgstr "Camp personalitzat"
|
||||
|
||||
msgid "Example field value..."
|
||||
msgstr "Exemple de valor de camp"
|
||||
|
||||
msgid "Waffle rolls"
|
||||
msgstr "Gofres"
|
||||
|
||||
msgid "Danish"
|
||||
msgstr "Danès"
|
||||
|
||||
msgid "Dutch"
|
||||
msgstr "Holandès"
|
||||
|
||||
msgid "Norwegian"
|
||||
msgstr "Noruec"
|
||||
|
||||
msgid "Demo"
|
||||
msgstr "Demostració"
|
||||
|
||||
msgid "Stable version"
|
||||
msgstr "Versió estable"
|
||||
|
||||
msgid "Preview version"
|
||||
msgstr "Versió prèvia"
|
||||
|
||||
msgid "current release"
|
||||
msgstr "Versió actual"
|
||||
|
||||
msgid "not yet released"
|
||||
msgstr "Encara no publicat"
|
||||
|
||||
msgid "Portuguese (Brazil)"
|
||||
msgstr "Portuguès (Brasil)"
|
||||
|
||||
msgid "This is a note"
|
||||
msgstr "Això és una nota"
|
||||
|
||||
msgid "Freezer"
|
||||
msgstr "Congelador"
|
||||
|
||||
msgid "Hungarian"
|
||||
msgstr "Hongarès"
|
||||
|
||||
msgid "Slovak"
|
||||
msgstr "Eslovac"
|
||||
|
||||
msgid "Czech"
|
||||
msgstr "Txec"
|
||||
|
||||
msgid "Portuguese (Portugal)"
|
||||
msgstr "Portuguès (Portugal)"
|
||||
|
||||
# Use a in your country well known supermarket name
|
||||
msgid "DemoSupermarket1"
|
||||
msgstr "Supermercat de prova 1"
|
||||
|
||||
# Use a in your country well known supermarket name
|
||||
msgid "DemoSupermarket2"
|
||||
msgstr "Supermercat de prova 2"
|
||||
|
||||
msgid "Japanese"
|
||||
msgstr "Japonès"
|
||||
|
||||
msgid "Chinese (Taiwan)"
|
||||
msgstr "Xinès (Taiwan)"
|
||||
|
||||
msgid "Greek"
|
||||
msgstr "Grec"
|
||||
|
||||
msgid "Korean"
|
||||
msgstr "Coreà"
|
||||
|
||||
msgid "Chinese (China)"
|
||||
msgstr "Xinès (Xina)"
|
||||
|
||||
msgid "Hebrew (Israel)"
|
||||
msgstr "Hebreu (Israel)"
|
||||
|
||||
msgid "Tamil"
|
||||
msgstr "Tàmil"
|
||||
|
||||
msgid "Finnish"
|
||||
msgstr "Finès"
|
||||
|
||||
msgid "Breakfast"
|
||||
msgstr ""
|
||||
|
||||
msgid "Lunch"
|
||||
msgstr ""
|
||||
|
||||
msgid "Dinner"
|
||||
msgstr ""
|
||||
|
||||
msgid "Catalan"
|
||||
msgstr ""
|
||||
|
||||
msgid "Slovenian"
|
||||
msgstr ""
|
||||
|
||||
msgid "Lithuanian"
|
||||
msgstr ""
|
||||
|
||||
msgid "Ukrainian"
|
||||
msgstr ""
|
134
localization/ca/locales.po
Normal file
@@ -0,0 +1,134 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-05-01T17:59:17+00:00\n"
|
||||
"PO-Revision-Date: 2020-08-31 19:11+0000\n"
|
||||
"Language-Team: Catalan (https://www.transifex.com/grocy/teams/93189/ca/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: ca\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Domain: grocy/locales\n"
|
||||
|
||||
# Czech
|
||||
msgid "cs"
|
||||
msgstr ""
|
||||
|
||||
# Danish
|
||||
msgid "da"
|
||||
msgstr ""
|
||||
|
||||
# German
|
||||
msgid "de"
|
||||
msgstr ""
|
||||
|
||||
# Greek
|
||||
msgid "el_GR"
|
||||
msgstr ""
|
||||
|
||||
# English
|
||||
msgid "en"
|
||||
msgstr ""
|
||||
|
||||
# English (Great Britain)
|
||||
msgid "en_GB"
|
||||
msgstr ""
|
||||
|
||||
# Spanish
|
||||
msgid "es"
|
||||
msgstr ""
|
||||
|
||||
# French
|
||||
msgid "fr"
|
||||
msgstr ""
|
||||
|
||||
# Hungarian
|
||||
msgid "hu"
|
||||
msgstr ""
|
||||
|
||||
# Italian
|
||||
msgid "it"
|
||||
msgstr ""
|
||||
|
||||
# Japanese
|
||||
msgid "ja"
|
||||
msgstr ""
|
||||
|
||||
# Korean
|
||||
msgid "ko_KR"
|
||||
msgstr ""
|
||||
|
||||
# Dutch
|
||||
msgid "nl"
|
||||
msgstr ""
|
||||
|
||||
# Norwegian
|
||||
msgid "no"
|
||||
msgstr ""
|
||||
|
||||
# Polish
|
||||
msgid "pl"
|
||||
msgstr ""
|
||||
|
||||
# Portuguese (Brazil)
|
||||
msgid "pt_BR"
|
||||
msgstr ""
|
||||
|
||||
# Portuguese (Portugal)
|
||||
msgid "pt_PT"
|
||||
msgstr ""
|
||||
|
||||
# Russian
|
||||
msgid "ru"
|
||||
msgstr ""
|
||||
|
||||
# Slovak
|
||||
msgid "sk_SK"
|
||||
msgstr ""
|
||||
|
||||
# Slovenian
|
||||
msgid "sl"
|
||||
msgstr ""
|
||||
|
||||
# Swedish
|
||||
msgid "sv_SE"
|
||||
msgstr ""
|
||||
|
||||
# Turkish
|
||||
msgid "tr"
|
||||
msgstr ""
|
||||
|
||||
# Chinese (Taiwan)
|
||||
msgid "zh_TW"
|
||||
msgstr ""
|
||||
|
||||
# Chinese (China)
|
||||
msgid "zh_CN"
|
||||
msgstr ""
|
||||
|
||||
# Hebrew (Israel)
|
||||
msgid "he_IL"
|
||||
msgstr ""
|
||||
|
||||
# Tamil
|
||||
msgid "ta"
|
||||
msgstr ""
|
||||
|
||||
# Finnish
|
||||
msgid "fi"
|
||||
msgstr ""
|
||||
|
||||
# Catalan
|
||||
msgid "ca"
|
||||
msgstr ""
|
||||
|
||||
# Lithuanian
|
||||
msgid "lt"
|
||||
msgstr ""
|
||||
|
||||
# Ukrainian
|
||||
msgid "uk"
|
||||
msgstr ""
|
138
localization/ca/permissions.po
Normal file
@@ -0,0 +1,138 @@
|
||||
#
|
||||
# Translators:
|
||||
# gimy16 <gimy16@hotmail.com>, 2021
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-05-01T17:59:17+00:00\n"
|
||||
"PO-Revision-Date: 2020-08-29 16:33+0000\n"
|
||||
"Last-Translator: gimy16 <gimy16@hotmail.com>, 2021\n"
|
||||
"Language-Team: Catalan (https://www.transifex.com/grocy/teams/93189/ca/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: ca\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Domain: grocy/permissions\n"
|
||||
|
||||
# All permissions
|
||||
msgid "ADMIN"
|
||||
msgstr "ADMIN"
|
||||
|
||||
# Create users
|
||||
msgid "USERS_CREATE"
|
||||
msgstr "USUARIS_CREACIÓ"
|
||||
|
||||
# Edit users (including passwords)
|
||||
msgid "USERS_EDIT"
|
||||
msgstr "USUARIS_EDICIÓ"
|
||||
|
||||
# Show users
|
||||
msgid "USERS_READ"
|
||||
msgstr "USUARIS_LECTURA"
|
||||
|
||||
# Edit own user data / change own password
|
||||
msgid "USERS_EDIT_SELF"
|
||||
msgstr "USUARIS_EDICIÓ_PRÒPIA"
|
||||
|
||||
# Undo charge cycle
|
||||
msgid "BATTERIES_UNDO_CHARGE_CYCLE"
|
||||
msgstr "PILES-SENSE-CICLE-DE-CÀRREGA"
|
||||
|
||||
# Track charge cycle
|
||||
msgid "BATTERIES_TRACK_CHARGE_CYCLE"
|
||||
msgstr "CICLE DE CÀRREGA DE PILES"
|
||||
|
||||
# Track execution
|
||||
msgid "CHORE_TRACK_EXECUTION"
|
||||
msgstr "SEGUIMENT-D'EXECUCIÓ-DE-LA-FEINA"
|
||||
|
||||
# Undo execution
|
||||
msgid "CHORE_UNDO_EXECUTION"
|
||||
msgstr "EXECUCIÓ-NO-REALITZADA-DE-LA-FEINA"
|
||||
|
||||
# Edit master data
|
||||
msgid "MASTER_DATA_EDIT"
|
||||
msgstr ""
|
||||
|
||||
# Undo execution
|
||||
msgid "TASKS_UNDO_EXECUTION"
|
||||
msgstr "EXECUCIÓ-NO-REALITZADA-DE-LES-TASQUES"
|
||||
|
||||
# Mark completed
|
||||
msgid "TASKS_MARK_COMPLETED"
|
||||
msgstr "TASQUES_COMPLETADES"
|
||||
|
||||
# Edit stock entries
|
||||
msgid "STOCK_EDIT"
|
||||
msgstr "EDITAR_ESTOC"
|
||||
|
||||
# Transfer
|
||||
msgid "STOCK_TRANSFER"
|
||||
msgstr "TRANSFERÈNCIA_D'ESTOC"
|
||||
|
||||
# Inventory
|
||||
msgid "STOCK_INVENTORY"
|
||||
msgstr "ESTOC_A_L'INVENTARI"
|
||||
|
||||
# Consume
|
||||
msgid "STOCK_CONSUME"
|
||||
msgstr "ESTOC_CONSUMIT"
|
||||
|
||||
# Open products
|
||||
msgid "STOCK_OPEN"
|
||||
msgstr "ESTOC_OBERT"
|
||||
|
||||
# Purchase
|
||||
msgid "STOCK_PURCHASE"
|
||||
msgstr "COMPRA_ESTOCS"
|
||||
|
||||
# Add items
|
||||
msgid "SHOPPINGLIST_ITEMS_ADD"
|
||||
msgstr "ELEMENTS_AFEGITS_DE_LA_LLISTA_DE_LA_COMPRA"
|
||||
|
||||
# Remove items
|
||||
msgid "SHOPPINGLIST_ITEMS_DELETE"
|
||||
msgstr ""
|
||||
|
||||
# User management
|
||||
msgid "USERS"
|
||||
msgstr "USUARIS"
|
||||
|
||||
# Stock
|
||||
msgid "STOCK"
|
||||
msgstr "ESTOC"
|
||||
|
||||
# Shopping list
|
||||
msgid "SHOPPINGLIST"
|
||||
msgstr "LLISTA DE LA COMPRA"
|
||||
|
||||
# Chores
|
||||
msgid "CHORES"
|
||||
msgstr "FEINES"
|
||||
|
||||
# Batteries
|
||||
msgid "BATTERIES"
|
||||
msgstr "PILES"
|
||||
|
||||
# Tasks
|
||||
msgid "TASKS"
|
||||
msgstr "TASQUES"
|
||||
|
||||
# Recipes
|
||||
msgid "RECIPES"
|
||||
msgstr "RECEPTES"
|
||||
|
||||
# Equipment
|
||||
msgid "EQUIPMENT"
|
||||
msgstr "EQUIP"
|
||||
|
||||
# Calendar
|
||||
msgid "CALENDAR"
|
||||
msgstr "CALENDARI"
|
||||
|
||||
# Meal plan
|
||||
msgid "RECIPES_MEALPLAN"
|
||||
msgstr "RECEPTES_MENÚ"
|
45
localization/ca/stock_transaction_types.po
Normal file
@@ -0,0 +1,45 @@
|
||||
#
|
||||
# Translators:
|
||||
# gimy16 <gimy16@hotmail.com>, 2021
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-05-01T17:59:17+00:00\n"
|
||||
"PO-Revision-Date: 2019-05-01 17:42+0000\n"
|
||||
"Last-Translator: gimy16 <gimy16@hotmail.com>, 2021\n"
|
||||
"Language-Team: Catalan (https://www.transifex.com/grocy/teams/93189/ca/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: ca\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Domain: grocy/stock_transaction_types\n"
|
||||
|
||||
msgid "purchase"
|
||||
msgstr "compra"
|
||||
|
||||
msgid "transfer_from"
|
||||
msgstr "Transferència_des_de"
|
||||
|
||||
msgid "transfer_to"
|
||||
msgstr "Transferència_cap_a"
|
||||
|
||||
msgid "consume"
|
||||
msgstr "Consum"
|
||||
|
||||
msgid "inventory-correction"
|
||||
msgstr "Correcció_d'inventari"
|
||||
|
||||
msgid "product-opened"
|
||||
msgstr "Producte_obert"
|
||||
|
||||
msgid "stock-edit-old"
|
||||
msgstr "Edició_d'estoc_antic"
|
||||
|
||||
msgid "stock-edit-new"
|
||||
msgstr "Edició_d'estoc_nou"
|
||||
|
||||
msgid "self-production"
|
||||
msgstr "Producció_pròpia"
|
2562
localization/ca/strings.po
Normal file
70
localization/ca/userfield_types.po
Normal file
@@ -0,0 +1,70 @@
|
||||
#
|
||||
# Translators:
|
||||
# gimy16 <gimy16@hotmail.com>, 2021
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-05-01T17:59:17+00:00\n"
|
||||
"PO-Revision-Date: 2019-05-01 17:43+0000\n"
|
||||
"Last-Translator: gimy16 <gimy16@hotmail.com>, 2021\n"
|
||||
"Language-Team: Catalan (https://www.transifex.com/grocy/teams/93189/ca/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Language: ca\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Domain: grocy/userfield_types\n"
|
||||
|
||||
# Text (single line)
|
||||
msgid "text-single-line"
|
||||
msgstr "text-línia-única"
|
||||
|
||||
# Text (multi line)
|
||||
msgid "text-multi-line"
|
||||
msgstr "text-línies-múltiples"
|
||||
|
||||
# Number (integral)
|
||||
msgid "number-integral"
|
||||
msgstr "nombre-integral"
|
||||
|
||||
# Number (decimal)
|
||||
msgid "number-decimal"
|
||||
msgstr "nombre-decimal"
|
||||
|
||||
# Date (without time)
|
||||
msgid "date"
|
||||
msgstr "data"
|
||||
|
||||
# Date & time
|
||||
msgid "datetime"
|
||||
msgstr "data-hora"
|
||||
|
||||
# Checkbox
|
||||
msgid "checkbox"
|
||||
msgstr "casella-de-selecció"
|
||||
|
||||
# Select list (a single item can be selected)
|
||||
msgid "preset-list"
|
||||
msgstr "llista-preestablerta"
|
||||
|
||||
# Select list (multiple items can be selected)
|
||||
msgid "preset-checklist"
|
||||
msgstr "llistat-de-comprovació-predeterminat"
|
||||
|
||||
# Link
|
||||
msgid "link"
|
||||
msgstr "enllaç"
|
||||
|
||||
# Link (with title)
|
||||
msgid "link-with-title"
|
||||
msgstr "enllaç-amb-títol"
|
||||
|
||||
# File
|
||||
msgid "file"
|
||||
msgstr "arxiu"
|
||||
|
||||
# Image
|
||||
msgid "image"
|
||||
msgstr "imatge"
|
@@ -15,9 +15,6 @@ msgstr ""
|
||||
msgid "manually"
|
||||
msgstr ""
|
||||
|
||||
msgid "dynamic-regular"
|
||||
msgstr ""
|
||||
|
||||
msgid "daily"
|
||||
msgstr ""
|
||||
|
||||
@@ -29,3 +26,9 @@ msgstr ""
|
||||
|
||||
msgid "yearly"
|
||||
msgstr ""
|
||||
|
||||
msgid "hourly"
|
||||
msgstr ""
|
||||
|
||||
msgid "adaptive"
|
||||
msgstr ""
|
||||
|
@@ -12,12 +12,6 @@ msgstr ""
|
||||
"Language: en\n"
|
||||
"X-Domain: grocy/component_translations\n"
|
||||
|
||||
msgid "timeago_locale"
|
||||
msgstr ""
|
||||
|
||||
msgid "timeago_nan"
|
||||
msgstr ""
|
||||
|
||||
msgid "moment_locale"
|
||||
msgstr ""
|
||||
|
||||
|
@@ -1,5 +1,7 @@
|
||||
#
|
||||
# Translators:
|
||||
# Radim Kabeláč <radim.ekk@gmail.com>, 2020
|
||||
# Pavel Paseka, 2022
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
@@ -7,7 +9,7 @@ msgstr ""
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-05-01T17:59:17+00:00\n"
|
||||
"PO-Revision-Date: 2019-09-17 10:45+0000\n"
|
||||
"Last-Translator: Radim Kabeláč <radim.ekk@gmail.com>, 2020\n"
|
||||
"Last-Translator: Pavel Paseka, 2022\n"
|
||||
"Language-Team: Czech (https://www.transifex.com/grocy/teams/93189/cs/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
@@ -17,13 +19,13 @@ msgstr ""
|
||||
"X-Domain: grocy/chore_assignment_types\n"
|
||||
|
||||
msgid "no-assignment"
|
||||
msgstr "bez-přiřazení"
|
||||
msgstr "bez určení"
|
||||
|
||||
msgid "who-least-did-first"
|
||||
msgstr "poslední-je-první"
|
||||
msgstr "ten, kdo plnil povinnost nejméně"
|
||||
|
||||
msgid "random"
|
||||
msgstr "náhodně"
|
||||
|
||||
msgid "in-alphabetical-order"
|
||||
msgstr "řazení-podle-abecedy"
|
||||
msgstr "podle abecedy"
|
||||
|
@@ -1,6 +1,8 @@
|
||||
#
|
||||
# Translators:
|
||||
# Tomas Reznicek <tomas.reznicek@gmail.com>, 2019
|
||||
# Michal Petříček <michal@petricek.org>, 2019
|
||||
# Pavel Paseka, 2022
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
@@ -8,7 +10,7 @@ msgstr ""
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-05-01T17:59:17+00:00\n"
|
||||
"PO-Revision-Date: 2019-05-01 17:42+0000\n"
|
||||
"Last-Translator: Michal Petříček <michal@petricek.org>, 2019\n"
|
||||
"Last-Translator: Pavel Paseka, 2022\n"
|
||||
"Language-Team: Czech (https://www.transifex.com/grocy/teams/93189/cs/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
@@ -20,9 +22,6 @@ msgstr ""
|
||||
msgid "manually"
|
||||
msgstr "Manuální"
|
||||
|
||||
msgid "dynamic-regular"
|
||||
msgstr "Dynamický"
|
||||
|
||||
msgid "daily"
|
||||
msgstr "Denní"
|
||||
|
||||
@@ -34,3 +33,9 @@ msgstr "Měsíčně"
|
||||
|
||||
msgid "yearly"
|
||||
msgstr "Ročně"
|
||||
|
||||
msgid "hourly"
|
||||
msgstr "Každou hodinu"
|
||||
|
||||
msgid "adaptive"
|
||||
msgstr "Automatický"
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#
|
||||
# Translators:
|
||||
# Tomas Reznicek <tomas.reznicek@gmail.com>, 2019
|
||||
# Radim Kabeláč <radim.ekk@gmail.com>, 2020
|
||||
# Bernd Bestel <bernd@berrnd.de>, 2020
|
||||
#
|
||||
msgid ""
|
||||
@@ -18,12 +18,6 @@ msgstr ""
|
||||
"Plural-Forms: nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n >= 2 && n <= 4 && n % 1 == 0) ? 1: (n % 1 != 0 ) ? 2 : 3;\n"
|
||||
"X-Domain: grocy/component_translations\n"
|
||||
|
||||
msgid "timeago_locale"
|
||||
msgstr "cs"
|
||||
|
||||
msgid "timeago_nan"
|
||||
msgstr "před NaN lety"
|
||||
|
||||
msgid "moment_locale"
|
||||
msgstr "cs"
|
||||
|
||||
|
@@ -3,6 +3,7 @@
|
||||
# Michal Petříček <michal@petricek.org>, 2019
|
||||
# Ondřej Suk <ondra.suk.55@gmail.com>, 2020
|
||||
# Radim Kabeláč <radim.ekk@gmail.com>, 2020
|
||||
# Pavel Paseka, 2022
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
@@ -10,7 +11,7 @@ msgstr ""
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-05-01T17:59:17+00:00\n"
|
||||
"PO-Revision-Date: 2019-05-01 17:42+0000\n"
|
||||
"Last-Translator: Radim Kabeláč <radim.ekk@gmail.com>, 2020\n"
|
||||
"Last-Translator: Pavel Paseka, 2022\n"
|
||||
"Language-Team: Czech (https://www.transifex.com/grocy/teams/93189/cs/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
@@ -35,7 +36,7 @@ msgid "Tinned food cupboard"
|
||||
msgstr "Skříňka s konzervami"
|
||||
|
||||
msgid "Fridge"
|
||||
msgstr "Lednička"
|
||||
msgstr "Chladnička"
|
||||
|
||||
msgid "Piece"
|
||||
msgid_plural "Pieces"
|
||||
@@ -118,11 +119,11 @@ msgstr "Ředkev"
|
||||
msgid "Tomato"
|
||||
msgstr "Rajče"
|
||||
|
||||
msgid "Changed towels in the bathroom"
|
||||
msgstr "Vyměněny ručníky v koupeně"
|
||||
msgid "Change towels in the bathroom"
|
||||
msgstr "Vyměnit ručníky v koupelně"
|
||||
|
||||
msgid "Cleaned the kitchen floor"
|
||||
msgstr "Vytřena podlaha v kuchyni"
|
||||
msgid "Mop the kitchen floor"
|
||||
msgstr "Vytřít podlahu v kuchyni"
|
||||
|
||||
msgid "Warranty ends"
|
||||
msgstr "Záruka končí"
|
||||
@@ -136,8 +137,8 @@ msgstr "Budík"
|
||||
msgid "Heat remote control"
|
||||
msgstr "Dálkové ovládání k topení"
|
||||
|
||||
msgid "Lawn mowed in the garden"
|
||||
msgstr "Posekán trávník na zahradě"
|
||||
msgid "Take out the trash"
|
||||
msgstr "Vynést odpadkový koš"
|
||||
|
||||
msgid "Some good snacks"
|
||||
msgstr "Nějaké dobroty"
|
||||
@@ -183,10 +184,10 @@ msgstr "Demo uživatel"
|
||||
|
||||
msgid "Gram"
|
||||
msgid_plural "Grams"
|
||||
msgstr[0] "Gram"
|
||||
msgstr[1] "Gramů"
|
||||
msgstr[2] "Gramů"
|
||||
msgstr[3] "Gramů"
|
||||
msgstr[0] "gram"
|
||||
msgstr[1] "gramy"
|
||||
msgstr[2] "gramů"
|
||||
msgstr[3] "gramů"
|
||||
|
||||
msgid "Flour"
|
||||
msgstr "Mouka"
|
||||
@@ -197,24 +198,6 @@ msgstr "Palačinky"
|
||||
msgid "Sugar"
|
||||
msgstr "Cukr"
|
||||
|
||||
msgid "Home"
|
||||
msgstr "Domov"
|
||||
|
||||
msgid "Life"
|
||||
msgstr "Život"
|
||||
|
||||
msgid "Projects"
|
||||
msgstr "Projekty"
|
||||
|
||||
msgid "Repair the garage door"
|
||||
msgstr "Opravit garážová vrata"
|
||||
|
||||
msgid "Fork and improve grocy"
|
||||
msgstr "Forknout a vylepšit grocy"
|
||||
|
||||
msgid "Find a solution for what to do when I forget the door keys"
|
||||
msgstr "Najít řešení situace, když si zapomenu klíče od domova"
|
||||
|
||||
msgid "Sweets"
|
||||
msgstr "Sladkosti"
|
||||
|
||||
@@ -240,16 +223,16 @@ msgid "Dishwasher"
|
||||
msgstr "Myčka nádobí"
|
||||
|
||||
msgid "Liter"
|
||||
msgstr "Litr"
|
||||
msgstr "litr"
|
||||
|
||||
msgid "Liters"
|
||||
msgstr "Litry"
|
||||
msgstr "litry"
|
||||
|
||||
msgid "Bottle"
|
||||
msgstr "Láhev"
|
||||
msgstr "láhev"
|
||||
|
||||
msgid "Bottles"
|
||||
msgstr "Láhve"
|
||||
msgstr "láhve"
|
||||
|
||||
msgid "Milk"
|
||||
msgstr "Mléko"
|
||||
@@ -258,10 +241,10 @@ msgid "Chocolate sauce"
|
||||
msgstr "Čokoládová poleva"
|
||||
|
||||
msgid "Milliliters"
|
||||
msgstr "Mililitry"
|
||||
msgstr "mililitry"
|
||||
|
||||
msgid "Milliliter"
|
||||
msgstr "Mililitr"
|
||||
msgstr "mililitr"
|
||||
|
||||
msgid "Bottom"
|
||||
msgstr "Dno"
|
||||
@@ -281,14 +264,14 @@ msgstr "Španělština"
|
||||
msgid "Russian"
|
||||
msgstr "Ruština"
|
||||
|
||||
msgid "The thing which happens on the 5th of every month"
|
||||
msgstr "Událost opakující se 5. den každý měsíc"
|
||||
msgid "Vacuum the living room floor"
|
||||
msgstr "Vysát v obývacím pokoji"
|
||||
|
||||
msgid "The thing which happens daily"
|
||||
msgstr "Událost opakující se každý den"
|
||||
msgid "Clean the litter box"
|
||||
msgstr "Vyčistit odpadkový koš"
|
||||
|
||||
msgid "The thing which happens on Mondays and Wednesdays"
|
||||
msgstr "Událost opakující se každé pondělí a středu"
|
||||
msgid "Change the bed sheets"
|
||||
msgstr "Vyměnit povlečení"
|
||||
|
||||
msgid "Swedish"
|
||||
msgstr "Švédština"
|
||||
@@ -310,10 +293,10 @@ msgstr[2] "Plátky"
|
||||
msgstr[3] "Plátky"
|
||||
|
||||
msgid "Example userentity"
|
||||
msgstr "Příklad uživatelské entity"
|
||||
msgstr "Příklad uživatelské tabulky"
|
||||
|
||||
msgid "This is an example user entity..."
|
||||
msgstr "Toto je ukázková položka uživatelské entity"
|
||||
msgstr "Toto je ukázková položka uživatelské tabulky"
|
||||
|
||||
msgid "Custom field"
|
||||
msgstr "Vlastní pole"
|
||||
@@ -340,13 +323,13 @@ msgid "Stable version"
|
||||
msgstr "Stabilní verze"
|
||||
|
||||
msgid "Preview version"
|
||||
msgstr "Preview verze"
|
||||
msgstr "Vývojová verze"
|
||||
|
||||
msgid "current release"
|
||||
msgstr "aktuální vydání"
|
||||
msgstr "Aktuální verze"
|
||||
|
||||
msgid "not yet released"
|
||||
msgstr "zatím nevydáno"
|
||||
msgstr "zatím nevydaná"
|
||||
|
||||
msgid "Portuguese (Brazil)"
|
||||
msgstr "Portugalština (Brazílie)"
|
||||
@@ -390,13 +373,34 @@ msgid "Korean"
|
||||
msgstr "Korejština"
|
||||
|
||||
msgid "Chinese (China)"
|
||||
msgstr ""
|
||||
msgstr "Čínština (Čína)"
|
||||
|
||||
msgid "Hebrew (Israel)"
|
||||
msgstr ""
|
||||
msgstr "Hebrejština (Izrael)"
|
||||
|
||||
msgid "Tamil"
|
||||
msgstr ""
|
||||
msgstr "Tamilština"
|
||||
|
||||
msgid "Finnish"
|
||||
msgstr ""
|
||||
msgstr "Finština"
|
||||
|
||||
msgid "Breakfast"
|
||||
msgstr "Snídaně"
|
||||
|
||||
msgid "Lunch"
|
||||
msgstr "Oběd"
|
||||
|
||||
msgid "Dinner"
|
||||
msgstr "Večeře"
|
||||
|
||||
msgid "Catalan"
|
||||
msgstr "Katalánština"
|
||||
|
||||
msgid "Slovenian"
|
||||
msgstr "Slovinština"
|
||||
|
||||
msgid "Lithuanian"
|
||||
msgstr "Litevština"
|
||||
|
||||
msgid "Ukrainian"
|
||||
msgstr "Ukrajinština"
|
||||
|
@@ -1,6 +1,8 @@
|
||||
#
|
||||
# Translators:
|
||||
# Radim Kabeláč <radim.ekk@gmail.com>, 2020
|
||||
# Jarda Tesar <intossh@gmail.com>, 2021
|
||||
# Pavel Paseka, 2022
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
@@ -8,7 +10,7 @@ msgstr ""
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-05-01T17:59:17+00:00\n"
|
||||
"PO-Revision-Date: 2020-08-31 19:11+0000\n"
|
||||
"Last-Translator: Radim Kabeláč <radim.ekk@gmail.com>, 2020\n"
|
||||
"Last-Translator: Pavel Paseka, 2022\n"
|
||||
"Language-Team: Czech (https://www.transifex.com/grocy/teams/93189/cs/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
@@ -67,7 +69,7 @@ msgstr "Korejština"
|
||||
|
||||
# Dutch
|
||||
msgid "nl"
|
||||
msgstr "Nizozemština"
|
||||
msgstr "Holandština"
|
||||
|
||||
# Norwegian
|
||||
msgid "no"
|
||||
@@ -93,6 +95,10 @@ msgstr "Ruština"
|
||||
msgid "sk_SK"
|
||||
msgstr "Slovenština"
|
||||
|
||||
# Slovenian
|
||||
msgid "sl"
|
||||
msgstr "Slovinština"
|
||||
|
||||
# Swedish
|
||||
msgid "sv_SE"
|
||||
msgstr "Švédština"
|
||||
@@ -103,20 +109,32 @@ msgstr "Turečtina"
|
||||
|
||||
# Chinese (Taiwan)
|
||||
msgid "zh_TW"
|
||||
msgstr "Čínština (Tradiční)"
|
||||
msgstr "Čínština (Taiwan)"
|
||||
|
||||
# Chinese (China)
|
||||
msgid "zh_CN"
|
||||
msgstr ""
|
||||
msgstr "Čínština (Čína)"
|
||||
|
||||
# Hebrew (Israel)
|
||||
msgid "he_IL"
|
||||
msgstr ""
|
||||
msgstr "Hebrejština"
|
||||
|
||||
# Tamil
|
||||
msgid "ta"
|
||||
msgstr ""
|
||||
msgstr "Tamilština"
|
||||
|
||||
# Finnish
|
||||
msgid "fi"
|
||||
msgstr ""
|
||||
msgstr "Finština"
|
||||
|
||||
# Catalan
|
||||
msgid "ca"
|
||||
msgstr "Katalánština"
|
||||
|
||||
# Lithuanian
|
||||
msgid "lt"
|
||||
msgstr "Litevština"
|
||||
|
||||
# Ukrainian
|
||||
msgid "uk"
|
||||
msgstr "Ukrajinština"
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#
|
||||
# Translators:
|
||||
# Radim Kabeláč <radim.ekk@gmail.com>, 2020
|
||||
# Pavel Paseka, 2022
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
@@ -8,7 +8,7 @@ msgstr ""
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-05-01T17:59:17+00:00\n"
|
||||
"PO-Revision-Date: 2020-08-29 16:33+0000\n"
|
||||
"Last-Translator: Radim Kabeláč <radim.ekk@gmail.com>, 2020\n"
|
||||
"Last-Translator: Pavel Paseka, 2022\n"
|
||||
"Language-Team: Czech (https://www.transifex.com/grocy/teams/93189/cs/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
@@ -19,120 +19,120 @@ msgstr ""
|
||||
|
||||
# All permissions
|
||||
msgid "ADMIN"
|
||||
msgstr "ADMINISTRATOR"
|
||||
msgstr "Administrátor"
|
||||
|
||||
# Create users
|
||||
msgid "USERS_CREATE"
|
||||
msgstr "UZIVATELE_VYTVORIT"
|
||||
msgstr "Vytvořit uživatele"
|
||||
|
||||
# Edit users (including passwords)
|
||||
msgid "USERS_EDIT"
|
||||
msgstr "UZIVATELE_EDITACE"
|
||||
msgstr "Upravovat uživatele"
|
||||
|
||||
# Show users
|
||||
msgid "USERS_READ"
|
||||
msgstr "UZIVATEL_CTENI"
|
||||
msgstr "Zobrazení uživatelů"
|
||||
|
||||
# Edit own user data / change own password
|
||||
msgid "USERS_EDIT_SELF"
|
||||
msgstr "UZIVATELE_EDITOVAT_SEBE"
|
||||
msgstr "Smí editovat sebe"
|
||||
|
||||
# Undo charge cycle
|
||||
msgid "BATTERIES_UNDO_CHARGE_CYCLE"
|
||||
msgstr "BATERIE_VRACENI_NABIJECI_CYKLUS"
|
||||
msgstr "Odznačit provedení nabíjení/výměny baterií"
|
||||
|
||||
# Track charge cycle
|
||||
msgid "BATTERIES_TRACK_CHARGE_CYCLE"
|
||||
msgstr ""
|
||||
msgstr "Označit provedení nabíjení/výměny baterií"
|
||||
|
||||
# Track execution
|
||||
msgid "CHORE_TRACK_EXECUTION"
|
||||
msgstr ""
|
||||
msgstr "Označit povinnost jako splněnou"
|
||||
|
||||
# Undo execution
|
||||
msgid "CHORE_UNDO_EXECUTION"
|
||||
msgstr "POVINNOST_VYKONANI_VRACENI"
|
||||
msgstr "Odznačit povinnost jako splněnou"
|
||||
|
||||
# Edit master data
|
||||
msgid "MASTER_DATA_EDIT"
|
||||
msgstr "ZAKLADNI_DATA_EDIT"
|
||||
msgstr "Upravovat Základní data"
|
||||
|
||||
# Undo execution
|
||||
msgid "TASKS_UNDO_EXECUTION"
|
||||
msgstr "UKOL_VYKONANI_VRACENI"
|
||||
msgstr "Odznačit úkol jako splněný"
|
||||
|
||||
# Mark completed
|
||||
msgid "TASKS_MARK_COMPLETED"
|
||||
msgstr "UKOLY_OZNACIT_HOTOVO"
|
||||
msgstr "Označit úkol jako splněný"
|
||||
|
||||
# Edit stock entries
|
||||
msgid "STOCK_EDIT"
|
||||
msgstr "ZASOBY_EDITACE"
|
||||
msgstr "Upravovat stav zásob"
|
||||
|
||||
# Transfer
|
||||
msgid "STOCK_TRANSFER"
|
||||
msgstr "PREVOD_ZASOB"
|
||||
msgstr "Převádět zásoby"
|
||||
|
||||
# Inventory
|
||||
msgid "STOCK_INVENTORY"
|
||||
msgstr "ZASOBA_INVENTAR"
|
||||
msgstr "Provádět Inventuru zásob"
|
||||
|
||||
# Consume
|
||||
msgid "STOCK_CONSUME"
|
||||
msgstr "ZASOBY_SPOTREBOVAT"
|
||||
msgstr "Spotřebovávat zásoby"
|
||||
|
||||
# Open products
|
||||
msgid "STOCK_OPEN"
|
||||
msgstr "ZASOBY_OTEVRIT"
|
||||
msgstr "Otevřít balení"
|
||||
|
||||
# Purchase
|
||||
msgid "STOCK_PURCHASE"
|
||||
msgstr "ZASOBA_NAKUP"
|
||||
msgstr "Zaznamenat nákup"
|
||||
|
||||
# Add items
|
||||
msgid "SHOPPINGLIST_ITEMS_ADD"
|
||||
msgstr "NAKUPNISEZNAM_POLOZKA_PRIDANO"
|
||||
msgstr "Přidat položku nákupního seznamu"
|
||||
|
||||
# Remove items
|
||||
msgid "SHOPPINGLIST_ITEMS_DELETE"
|
||||
msgstr "NAKUPNISEZNAM_POLOZKA_SMAZANO"
|
||||
msgstr "Smazat položku nákupního seznamu"
|
||||
|
||||
# User management
|
||||
msgid "USERS"
|
||||
msgstr "UZIVATEL"
|
||||
msgstr "Uživatel"
|
||||
|
||||
# Stock
|
||||
msgid "STOCK"
|
||||
msgstr "ZASOBA"
|
||||
msgstr "Zásoby"
|
||||
|
||||
# Shopping list
|
||||
msgid "SHOPPINGLIST"
|
||||
msgstr "NAKUPNISEZNAM"
|
||||
msgstr "Nákupní seznam"
|
||||
|
||||
# Chores
|
||||
msgid "CHORES"
|
||||
msgstr "POVINOSTI"
|
||||
msgstr "Povinnosti"
|
||||
|
||||
# Batteries
|
||||
msgid "BATTERIES"
|
||||
msgstr "BATERIE"
|
||||
msgstr "Baterie"
|
||||
|
||||
# Tasks
|
||||
msgid "TASKS"
|
||||
msgstr "UKOL"
|
||||
msgstr "Úkoly"
|
||||
|
||||
# Recipes
|
||||
msgid "RECIPES"
|
||||
msgstr "RECEPTY"
|
||||
msgstr "Recepty"
|
||||
|
||||
# Equipment
|
||||
msgid "EQUIPMENT"
|
||||
msgstr "VYBAVENI"
|
||||
msgstr "Vybavení"
|
||||
|
||||
# Calendar
|
||||
msgid "CALENDAR"
|
||||
msgstr "KALENDAR"
|
||||
msgstr "Přístup ke kalendáři"
|
||||
|
||||
# Meal plan
|
||||
msgid "RECIPES_MEALPLAN"
|
||||
msgstr "RECEPTY_STRAVOVACIPLANY"
|
||||
msgstr "Jídelníček"
|
||||
|
@@ -1,9 +1,6 @@
|
||||
#
|
||||
# Translators:
|
||||
# Tomas Reznicek <tomas.reznicek@gmail.com>, 2019
|
||||
# Michal Franc, 2020
|
||||
# Ondřej Suk <ondra.suk.55@gmail.com>, 2020
|
||||
# Radim Kabeláč <radim.ekk@gmail.com>, 2020
|
||||
# Pavel Paseka, 2022
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
@@ -11,7 +8,7 @@ msgstr ""
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-05-01T17:59:17+00:00\n"
|
||||
"PO-Revision-Date: 2019-05-01 17:42+0000\n"
|
||||
"Last-Translator: Radim Kabeláč <radim.ekk@gmail.com>, 2020\n"
|
||||
"Last-Translator: Pavel Paseka, 2022\n"
|
||||
"Language-Team: Czech (https://www.transifex.com/grocy/teams/93189/cs/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
@@ -21,28 +18,28 @@ msgstr ""
|
||||
"X-Domain: grocy/stock_transaction_types\n"
|
||||
|
||||
msgid "purchase"
|
||||
msgstr "Nákup"
|
||||
msgstr "nákup"
|
||||
|
||||
msgid "transfer_from"
|
||||
msgstr "Převod z"
|
||||
msgstr "převod z"
|
||||
|
||||
msgid "transfer_to"
|
||||
msgstr "Převod do"
|
||||
msgstr "převod do"
|
||||
|
||||
msgid "consume"
|
||||
msgstr "Spotřeba"
|
||||
msgstr "spotřeba"
|
||||
|
||||
msgid "inventory-correction"
|
||||
msgstr "Úprava zásoby"
|
||||
msgstr "změna zásob"
|
||||
|
||||
msgid "product-opened"
|
||||
msgstr "Otevření balení"
|
||||
msgstr "otevření balení"
|
||||
|
||||
msgid "stock-edit-old"
|
||||
msgstr "zasoba-editace-stary"
|
||||
msgstr "změna zásob – stará"
|
||||
|
||||
msgid "stock-edit-new"
|
||||
msgstr "zasoba-editace-novy"
|
||||
msgstr "změna zásob – nová"
|
||||
|
||||
msgid "self-production"
|
||||
msgstr "vlastni-produkce"
|
||||
msgstr "vlastní výroba"
|
||||
|
@@ -2,7 +2,7 @@
|
||||
# Translators:
|
||||
# Tomas Reznicek <tomas.reznicek@gmail.com>, 2019
|
||||
# Michal Franc, 2020
|
||||
# Radim Kabeláč <radim.ekk@gmail.com>, 2020
|
||||
# Pavel Paseka, 2022
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
@@ -10,7 +10,7 @@ msgstr ""
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-05-01T17:59:17+00:00\n"
|
||||
"PO-Revision-Date: 2019-05-01 17:43+0000\n"
|
||||
"Last-Translator: Radim Kabeláč <radim.ekk@gmail.com>, 2020\n"
|
||||
"Last-Translator: Pavel Paseka, 2022\n"
|
||||
"Language-Team: Czech (https://www.transifex.com/grocy/teams/93189/cs/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
@@ -33,7 +33,7 @@ msgstr "Celé číslo"
|
||||
|
||||
# Number (decimal)
|
||||
msgid "number-decimal"
|
||||
msgstr "Číslo s desetinami"
|
||||
msgstr "Desetinné číslo"
|
||||
|
||||
# Date (without time)
|
||||
msgid "date"
|
||||
@@ -61,12 +61,12 @@ msgstr "Odkaz"
|
||||
|
||||
# Link (with title)
|
||||
msgid "link-with-title"
|
||||
msgstr ""
|
||||
msgstr "Odkaz s nadpisem"
|
||||
|
||||
# File
|
||||
msgid "file"
|
||||
msgstr "soubor"
|
||||
msgstr "Soubor"
|
||||
|
||||
# Image
|
||||
msgid "image"
|
||||
msgstr "obrazek"
|
||||
msgstr "Obrázek"
|
||||
|
@@ -1,5 +1,7 @@
|
||||
#
|
||||
# Translators:
|
||||
# Troels Siggaard <troels@siggaard.com>, 2019
|
||||
# klavslund <klavslund@gmail.com>, 2021
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
@@ -7,7 +9,7 @@ msgstr ""
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-05-01T17:59:17+00:00\n"
|
||||
"PO-Revision-Date: 2019-09-17 10:45+0000\n"
|
||||
"Last-Translator: Troels Siggaard <troels@siggaard.com>, 2019\n"
|
||||
"Last-Translator: klavslund <klavslund@gmail.com>, 2021\n"
|
||||
"Language-Team: Danish (https://www.transifex.com/grocy/teams/93189/da/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
@@ -20,7 +22,7 @@ msgid "no-assignment"
|
||||
msgstr "ingen-tildeling"
|
||||
|
||||
msgid "who-least-did-first"
|
||||
msgstr "hvem-mindst-gjorde-først"
|
||||
msgstr "hvem-gjorde-mindst-først"
|
||||
|
||||
msgid "random"
|
||||
msgstr "tilfældig"
|
||||
|
@@ -1,7 +1,8 @@
|
||||
#
|
||||
# Translators:
|
||||
# Troels Siggaard <troels@siggaard.com>, 2019
|
||||
# Rasmus Bojsen <rasmus@bojsen.cn>, 2019
|
||||
# Brian Moos Lindberg <brian@blueeel.dk>, 2019
|
||||
# Brian Moos Lindberg <brian@blueeel.dk>, 2022
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
@@ -9,7 +10,7 @@ msgstr ""
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-05-01T17:59:17+00:00\n"
|
||||
"PO-Revision-Date: 2019-05-01 17:42+0000\n"
|
||||
"Last-Translator: Brian Moos Lindberg <brian@blueeel.dk>, 2019\n"
|
||||
"Last-Translator: Brian Moos Lindberg <brian@blueeel.dk>, 2022\n"
|
||||
"Language-Team: Danish (https://www.transifex.com/grocy/teams/93189/da/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
@@ -21,9 +22,6 @@ msgstr ""
|
||||
msgid "manually"
|
||||
msgstr "manuelt"
|
||||
|
||||
msgid "dynamic-regular"
|
||||
msgstr "dynamisk-regelmæssig"
|
||||
|
||||
msgid "daily"
|
||||
msgstr "daglig"
|
||||
|
||||
@@ -35,3 +33,9 @@ msgstr "månedlig"
|
||||
|
||||
msgid "yearly"
|
||||
msgstr "årlig"
|
||||
|
||||
msgid "hourly"
|
||||
msgstr "timevis"
|
||||
|
||||
msgid "adaptive"
|
||||
msgstr "adaptiv"
|
||||
|
@@ -1,3 +1,4 @@
|
||||
#
|
||||
# Translators:
|
||||
# Bernd Bestel <bernd@berrnd.de>, 2019
|
||||
#
|
||||
@@ -16,12 +17,6 @@ msgstr ""
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Domain: grocy/component_translations\n"
|
||||
|
||||
msgid "timeago_locale"
|
||||
msgstr "da"
|
||||
|
||||
msgid "timeago_nan"
|
||||
msgstr "for NaN år"
|
||||
|
||||
msgid "moment_locale"
|
||||
msgstr "da"
|
||||
|
||||
|