Compare commits
1162 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
266c4bad25 | ||
|
|
f04e0d92aa | ||
|
|
cca3fa6b8a | ||
|
|
1bc1fadc56 | ||
|
|
e7eb89dfd9 | ||
|
|
25469113fd | ||
|
|
e474087257 | ||
|
|
75aea7c51b | ||
|
|
a64b44a74b | ||
|
|
d481f68266 | ||
|
|
8095ae298f | ||
|
|
99ad182358 | ||
|
|
f32448b9f5 | ||
|
|
f3b4078c6a | ||
|
|
ca846b5fbf | ||
|
|
63a3ae1147 | ||
|
|
5711c15eac | ||
|
|
a705703996 | ||
|
|
326dc64f65 | ||
|
|
974e1b3b5a | ||
|
|
f7f1765c2e | ||
|
|
aae31c567c | ||
|
|
49f307d605 | ||
|
|
f93d081a88 | ||
|
|
a230be77dd | ||
|
|
b62253e1f3 | ||
|
|
0e91dd886e | ||
|
|
6e0500972e | ||
|
|
8069e332fe | ||
|
|
cbd65f1f1d | ||
|
|
90a0fd8a22 | ||
|
|
95e06746bd | ||
|
|
1e492624cc | ||
|
|
6a524f9f7c | ||
|
|
84cc65b008 | ||
|
|
b8b3a3c8ab | ||
|
|
db0e555eae | ||
|
|
58a9facc6d | ||
|
|
11dac19c8c | ||
|
|
2d82f0400d | ||
|
|
94a6b99c57 | ||
|
|
2aa5eccc7c | ||
|
|
52f5e5640e | ||
|
|
d6c15bb1cb | ||
|
|
4f698f73dc | ||
|
|
e413325337 | ||
|
|
608a45408a | ||
|
|
323baa2d65 | ||
|
|
6235d18dab | ||
|
|
3d0f480d9e | ||
|
|
642d31432a | ||
|
|
421be6835e | ||
|
|
d58720252e | ||
|
|
0461539f4b | ||
|
|
78749ad3b4 | ||
|
|
8b4828f236 | ||
|
|
e5614b92a0 | ||
|
|
f5b725e32b | ||
|
|
006de60f66 | ||
|
|
14f4530de0 | ||
|
|
2022fa54d3 | ||
|
|
73ef090b9e | ||
|
|
6d7054c18c | ||
|
|
4549d826dd | ||
|
|
7eacb1dc3c | ||
|
|
5264dd111d | ||
|
|
a4f0b6a97e | ||
|
|
46af5e8ebf | ||
|
|
35fb15fe9f | ||
|
|
662259468d | ||
|
|
1e1b9a6919 | ||
|
|
5fa10dfdf1 | ||
|
|
a5556a0c63 | ||
|
|
0cefcf0e16 | ||
|
|
1959d4d8df | ||
|
|
1d445d9eb6 | ||
|
|
6cfcbccabc | ||
|
|
de39623378 | ||
|
|
96d0d4943b | ||
|
|
bfab6f42d0 | ||
|
|
b38fc96623 | ||
|
|
b7bade20ea | ||
|
|
283ab80fc7 | ||
|
|
d705287510 | ||
|
|
47d17af593 | ||
|
|
496a74f7a3 | ||
|
|
7eded6e126 | ||
|
|
4c9d3222d7 | ||
|
|
5a2b539003 | ||
|
|
a9252701c5 | ||
|
|
2fbbbe7260 | ||
|
|
1d1f5835da | ||
|
|
a04b72e866 | ||
|
|
3f4f63dc33 | ||
|
|
1763a2efff | ||
|
|
00906851b5 | ||
|
|
844a805de6 | ||
|
|
718e0b5c1e | ||
|
|
ad20fd1c64 | ||
|
|
0eb5c0a08a | ||
|
|
7c3a08057d | ||
|
|
c3a43fe677 | ||
|
|
1c613d0a52 | ||
|
|
303ec5be11 | ||
|
|
0e33da7760 | ||
|
|
64c752bea3 | ||
|
|
cb2938b5c2 | ||
|
|
1b8a26d36b | ||
|
|
afdcc88342 | ||
|
|
7238f404f7 | ||
|
|
1b8948a086 | ||
|
|
95ab9bda2d | ||
|
|
ed7f89cfe1 | ||
|
|
8d695d03df | ||
|
|
ad880b5b97 | ||
|
|
c0f3f31095 | ||
|
|
e2ac6a0b17 | ||
|
|
0dba83d8e9 | ||
|
|
245dd47082 | ||
|
|
dc40a05ebd | ||
|
|
0616506b31 | ||
|
|
196ca4f1cb | ||
|
|
2d9677eefa | ||
|
|
cd297150ea | ||
|
|
665f0d0ca7 | ||
|
|
bd1097f7b5 | ||
|
|
f30bb89597 | ||
|
|
9f1f7b989c | ||
|
|
aa8549b633 | ||
|
|
222056f973 | ||
|
|
e431a1ad9e | ||
|
|
452cc46d67 | ||
|
|
c956d075d9 | ||
|
|
cdf5a545eb | ||
|
|
a60df65062 | ||
|
|
f8cb8900d6 | ||
|
|
b46fdcefad | ||
|
|
3f827b3104 | ||
|
|
88bf534573 | ||
|
|
a93e78bd34 | ||
|
|
4eb1fffeb2 | ||
|
|
889e3c0d4a | ||
|
|
184026f5f1 | ||
|
|
3c14fee36c | ||
|
|
5fb326db4d | ||
|
|
d5f8655827 | ||
|
|
3e6100f368 | ||
|
|
3c71640547 | ||
|
|
913839727c | ||
|
|
9e2a295182 | ||
|
|
27c60d9fc4 | ||
|
|
f409ce5364 | ||
|
|
68cd879d1e | ||
|
|
c8098b2e00 | ||
|
|
100f8a5165 | ||
|
|
76899d2fdb | ||
|
|
41e8e196ec | ||
|
|
ef5977bcfe | ||
|
|
e94d47bf0f | ||
|
|
f8bbb3065c | ||
|
|
bc908b4534 | ||
|
|
a179719c3e | ||
|
|
2ca3a3f7db | ||
|
|
f2a8cf0930 | ||
|
|
966701f94e | ||
|
|
1a183a4825 | ||
|
|
3a7e3b2168 | ||
|
|
eb2664ac79 | ||
|
|
31743cf962 | ||
|
|
2c2ba2e32c | ||
|
|
4ff2153e15 | ||
|
|
3c6b5c6c1e | ||
|
|
6c1d79fe5b | ||
|
|
e5f1df8c70 | ||
|
|
d6b59f6799 | ||
|
|
4b069edd33 | ||
|
|
a8ac6b2eda | ||
|
|
5c925f0ca5 | ||
|
|
30c7782d6e | ||
|
|
f7480902b4 | ||
|
|
00b5a65859 | ||
|
|
317ac59f47 | ||
|
|
b08c156552 | ||
|
|
2ad7629c2a | ||
|
|
42963ead5c | ||
|
|
c0168ecc5b | ||
|
|
34649d809e | ||
|
|
ee0f6b0ccf | ||
|
|
c8b47d1033 | ||
|
|
3d3ae97af4 | ||
|
|
d7066a2bbc | ||
|
|
7f8545f1dc | ||
|
|
85a63c4b78 | ||
|
|
1852d71974 | ||
|
|
7da7468965 | ||
|
|
83a894823f | ||
|
|
4cb0ac37a6 | ||
|
|
7a6fab8624 | ||
|
|
6416b67c63 | ||
|
|
1e269a6f82 | ||
|
|
8694a3bfe4 | ||
|
|
9e320674c1 | ||
|
|
9047e9e785 | ||
|
|
b8d8f0c16d | ||
|
|
8b8e9b001e | ||
|
|
9c40bd98aa | ||
|
|
1a0608f49e | ||
|
|
3543e0a1b5 | ||
|
|
97c23f75dd | ||
|
|
49bb9980b8 | ||
|
|
fd4cbb43c1 | ||
|
|
40242b7dcc | ||
|
|
9731023014 | ||
|
|
0abbba7a56 | ||
|
|
cc809183ae | ||
|
|
f7b3f4ed76 | ||
|
|
04fc954769 | ||
|
|
3621b8c27c | ||
|
|
358959522d | ||
|
|
19cd5962aa | ||
|
|
961336f35c | ||
|
|
573fa9f7f3 | ||
|
|
22ce6b047a | ||
|
|
82525f382d | ||
|
|
ec9dd08970 | ||
|
|
9ec0280334 | ||
|
|
0861dbd75d | ||
|
|
f5949b6b9a | ||
|
|
99905497e1 | ||
|
|
4ae18b73d1 | ||
|
|
1da26e041d | ||
|
|
4e42911f3d | ||
|
|
b0045a910c | ||
|
|
9491f07ade | ||
|
|
d994339de5 | ||
|
|
0464054a2b | ||
|
|
b062164277 | ||
|
|
ff9acab0fc | ||
|
|
76e09447c8 | ||
|
|
9470699798 | ||
|
|
89bfa82c61 | ||
|
|
859131308a | ||
|
|
56d02673ed | ||
|
|
b28e9c120c | ||
|
|
c858edf5c9 | ||
|
|
99ebd1d503 | ||
|
|
f63a2c8ef6 | ||
|
|
95796ab256 | ||
|
|
a1992494d3 | ||
|
|
5896ae26c6 | ||
|
|
8978c181ee | ||
|
|
ae975d07db | ||
|
|
6b49535b52 | ||
|
|
8b0962e192 | ||
|
|
dce0578a2b | ||
|
|
a483184372 | ||
|
|
6e6c60b29a | ||
|
|
21dbfdb4f9 | ||
|
|
73ab26c7b7 | ||
|
|
3e61b60c4e | ||
|
|
bd2fe32d5a | ||
|
|
c8854b0775 | ||
|
|
042c119058 | ||
|
|
b92488e32f | ||
|
|
2bc76e7adc | ||
|
|
d4278996ae | ||
|
|
eb63dae405 | ||
|
|
1b35356f81 | ||
|
|
36c08b0dea | ||
|
|
1d32e4ecee | ||
|
|
40061e43bb | ||
|
|
7ed1998d04 | ||
|
|
fd2490c135 | ||
|
|
9ab098af86 | ||
|
|
64893e0a95 | ||
|
|
6fdc304313 | ||
|
|
fb265ed732 | ||
|
|
e2be5b401c | ||
|
|
8539938b8a | ||
|
|
bbf25823b8 | ||
|
|
6b066046c6 | ||
|
|
9226daa891 | ||
|
|
843cd8fb67 | ||
|
|
6d7d441d42 | ||
|
|
1c4da30b61 | ||
|
|
84e25851d3 | ||
|
|
3a52daedab | ||
|
|
b7cf9cd776 | ||
|
|
ccb184b17f | ||
|
|
162ff07bd5 | ||
|
|
7326a452c3 | ||
|
|
9453947309 | ||
|
|
d25653b6ed | ||
|
|
ea415e33f5 | ||
|
|
b6430d5622 | ||
|
|
6fcd50ecdf | ||
|
|
6857d92c4f | ||
|
|
4bb9edb2b5 | ||
|
|
dd881bb856 | ||
|
|
204e0bc179 | ||
|
|
d026460106 | ||
|
|
934a7855b9 | ||
|
|
54d7c4490f | ||
|
|
fa6af3d148 | ||
|
|
063753b569 | ||
|
|
baff2d78d9 | ||
|
|
8f832856a5 | ||
|
|
f2eec4f315 | ||
|
|
2536105ad0 | ||
|
|
98a3fc99a2 | ||
|
|
56524a9773 | ||
|
|
fae525c82f | ||
|
|
5023fa6189 | ||
|
|
f743503705 | ||
|
|
f6a82ba119 | ||
|
|
305d3ba6fe | ||
|
|
7873bd812e | ||
|
|
b31ded22b9 | ||
|
|
f80fe0e4d0 | ||
|
|
c063aed867 | ||
|
|
b2d3272151 | ||
|
|
e9986c92d6 | ||
|
|
3a7dba437c | ||
|
|
cefd747e91 | ||
|
|
21f785638c | ||
|
|
df62c8a428 | ||
|
|
37e02365c7 | ||
|
|
7352c9a394 | ||
|
|
5b8510be56 | ||
|
|
6d5244aa5d | ||
|
|
f1f60042d8 | ||
|
|
6558bcae1d | ||
|
|
828b9c8b4a | ||
|
|
7d052eba00 | ||
|
|
43a31efeac | ||
|
|
f12f1ae60d | ||
|
|
9dc94084c1 | ||
|
|
03d5d3c70c | ||
|
|
27cea996c0 | ||
|
|
7661d43327 | ||
|
|
a1f90ffaba | ||
|
|
2583fdf20e | ||
|
|
9ddb87a6fd | ||
|
|
cc6031bfde | ||
|
|
6d196879b4 | ||
|
|
3d1fba650b | ||
|
|
0d5e0b3e80 | ||
|
|
7460647d58 | ||
|
|
53e01177d9 | ||
|
|
6709ef4c4c | ||
|
|
0b519e9d08 | ||
|
|
7f20cb045c | ||
|
|
286b63e2c8 | ||
|
|
c1eb5ba90a | ||
|
|
4859ac8ecb | ||
|
|
df6bd30d03 | ||
|
|
70fd0ae269 | ||
|
|
dd83872339 | ||
|
|
f7aa3c1e13 | ||
|
|
a9da5f8476 | ||
|
|
06f3a1ecd4 | ||
|
|
bed3ade221 | ||
|
|
f2b32b211b | ||
|
|
f81f9ba492 | ||
|
|
f10aad927f | ||
|
|
4fcd97b142 | ||
|
|
dad1b8b772 | ||
|
|
22af82cb15 | ||
|
|
e4b176a4d5 | ||
|
|
bb94b11e37 | ||
|
|
67d23ec6b2 | ||
|
|
ff7a402bd4 | ||
|
|
305a2fd4f6 | ||
|
|
09c9a95fcf | ||
|
|
08a144ac31 | ||
|
|
7ddcde62dd | ||
|
|
b6462b406d | ||
|
|
0330f45c6a | ||
|
|
8664d94ea6 | ||
|
|
af9dea9226 | ||
|
|
2ce6e815ff | ||
|
|
cdad5913ca | ||
|
|
68bb01d064 | ||
|
|
f4dbdbb427 | ||
|
|
d84beb957c | ||
|
|
7029bde555 | ||
|
|
7427187647 | ||
|
|
f8a5ff7315 | ||
|
|
87d07ffaaf | ||
|
|
954ba7c937 | ||
|
|
16e8e8a5e5 | ||
|
|
75e62b800c | ||
|
|
e1c9af795c | ||
|
|
9a2fd9ba91 | ||
|
|
c0378b4f51 | ||
|
|
0a6ea6be42 | ||
|
|
ec0eca39ff | ||
|
|
3e9371bd6a | ||
|
|
db1344573f | ||
|
|
c34e9f576d | ||
|
|
0b7d551048 | ||
|
|
30ac5e4c24 | ||
|
|
70f7f35009 | ||
|
|
5583caa9e4 | ||
|
|
d3099aca39 | ||
|
|
765ea63aed | ||
|
|
adf8c09fd4 | ||
|
|
5a90b36734 | ||
|
|
2e7bfc822c | ||
|
|
607d09aefb | ||
|
|
9eb25c412e | ||
|
|
8d41fa20bd | ||
|
|
a034b3519e | ||
|
|
ebf0b4de51 | ||
|
|
c9ccdb5f77 | ||
|
|
88b4d3842f | ||
|
|
3cd7e01a2c | ||
|
|
bd39666759 | ||
|
|
67d5cba09f | ||
|
|
8d72d114c7 | ||
|
|
e2324b7d51 | ||
|
|
1eae149c75 | ||
|
|
2a986517f7 | ||
|
|
bf47bb1840 | ||
|
|
cb6924e6d6 | ||
|
|
1de6b5d385 | ||
|
|
4c73fc825c | ||
|
|
d0a0786cce | ||
|
|
b7390ece39 | ||
|
|
1aae4f4d0f | ||
|
|
244169d6d5 | ||
|
|
a5fdf81df5 | ||
|
|
c1a54abc58 | ||
|
|
7e649dff3b | ||
|
|
40eda01c22 | ||
|
|
74b3917e69 | ||
|
|
6ada0b649c | ||
|
|
e21fc656e4 | ||
|
|
f4f5c8fa88 | ||
|
|
64d1aecf16 | ||
|
|
26c2d5aa81 | ||
|
|
78d8212e57 | ||
|
|
7a3388646b | ||
|
|
c3fe8d1c39 | ||
|
|
fcd9974a7c | ||
|
|
53dc322fd1 | ||
|
|
4cab1d323c | ||
|
|
686d55de6e | ||
|
|
0d2d40791a | ||
|
|
4302ecd6ea | ||
|
|
fc12056ba2 | ||
|
|
72edce86ba | ||
|
|
288fc5dd08 | ||
|
|
7503899a9b | ||
|
|
49a4d1069a | ||
|
|
f916e0ce25 | ||
|
|
bd4efad22b | ||
|
|
66865b553e | ||
|
|
62bfe0af2b | ||
|
|
db8714a87b | ||
|
|
5868741fe3 | ||
|
|
08e284c51b | ||
|
|
1757ffd8ee | ||
|
|
2d3c46957f | ||
|
|
ae0a6ebfb5 | ||
|
|
aba06ba3f0 | ||
|
|
b012332d82 | ||
|
|
4a94525320 | ||
|
|
1444593bbd | ||
|
|
82e1d6b917 | ||
|
|
61c0cbc887 | ||
|
|
8c39b4197e | ||
|
|
e24c647b18 | ||
|
|
6db21d7b34 | ||
|
|
7ae55c1980 | ||
|
|
bd167b6088 | ||
|
|
b9b7bf845c | ||
|
|
fc5ebb619e | ||
|
|
abd31e3785 | ||
|
|
8a8f5cb6ce | ||
|
|
2ad8f8a4bb | ||
|
|
4533c994a3 | ||
|
|
6ed7ee76e7 | ||
|
|
167a826f50 | ||
|
|
032db11b48 | ||
|
|
996f05c73a | ||
|
|
0ce02b4f06 | ||
|
|
fb31319fcf | ||
|
|
46bf01d93e | ||
|
|
c2ec15aeb3 | ||
|
|
bb97611349 | ||
|
|
825e492891 | ||
|
|
0aa6baea2f | ||
|
|
cafd84cee4 | ||
|
|
0751c14907 | ||
|
|
de0a9f8303 | ||
|
|
145116f657 | ||
|
|
6a8c820e09 | ||
|
|
2b033710e2 | ||
|
|
23f484a14d | ||
|
|
4cfa7347e9 | ||
|
|
aa1ea98579 | ||
|
|
38249e6b5e | ||
|
|
c02a882eff | ||
|
|
9ef32e75c5 | ||
|
|
14b3de4300 | ||
|
|
02d54fd208 | ||
|
|
d1e9e3e43f | ||
|
|
f279302009 | ||
|
|
e2a742b5c1 | ||
|
|
217960de60 | ||
|
|
ed528eb19a | ||
|
|
b69ea0648c | ||
|
|
193d193352 | ||
|
|
8e801c6829 | ||
|
|
e7da2b408a | ||
|
|
14255d71f7 | ||
|
|
a258516322 | ||
|
|
d25bcfe29c | ||
|
|
8464cd925e | ||
|
|
c2c4f087e4 | ||
|
|
064d083db6 | ||
|
|
ede21fe46a | ||
|
|
5c79e68c77 | ||
|
|
e6d01f2a23 | ||
|
|
af4101c9fe | ||
|
|
b9ee811cbf | ||
|
|
7a1dada9dc | ||
|
|
1de76ba266 | ||
|
|
ec612d1046 | ||
|
|
15c3acfa0b | ||
|
|
6aac85bddb | ||
|
|
d8ae7635d1 | ||
|
|
fbb3dd89cf | ||
|
|
8d1e24ae90 | ||
|
|
367a901207 | ||
|
|
9597015413 | ||
|
|
08696651fd | ||
|
|
661c3897b0 | ||
|
|
4200208c7b | ||
|
|
aba7e05ee2 | ||
|
|
ed4b82f4b1 | ||
|
|
2d4cfbe821 | ||
|
|
34a1e07824 | ||
|
|
bb4233ddfe | ||
|
|
2449a1e8bf | ||
|
|
dc9bc8a8ca | ||
|
|
0914ebf737 | ||
|
|
dc162bf385 | ||
|
|
86add9b9f7 | ||
|
|
476e6ca150 | ||
|
|
6f8c0e3cb6 | ||
|
|
6bd2390acf | ||
|
|
599b18ac99 | ||
|
|
130e6ac057 | ||
|
|
ecea92942c | ||
|
|
12e348544d | ||
|
|
4b8f743fa6 | ||
|
|
aee063bb3c | ||
|
|
93a23f3fa3 | ||
|
|
7907b43ef7 | ||
|
|
c843dba29a | ||
|
|
5864c7e127 | ||
|
|
f57b314466 | ||
|
|
f2dd2331a5 | ||
|
|
164af7ae02 | ||
|
|
b97d9f692d | ||
|
|
32c1e3258e | ||
|
|
19e4ebf88c | ||
|
|
ea39d5c74d | ||
|
|
682681afa5 | ||
|
|
091740f407 | ||
|
|
e22830790b | ||
|
|
e566305426 | ||
|
|
8530a03449 | ||
|
|
1a24aabb6f | ||
|
|
381f46cdd8 | ||
|
|
470a6b30e0 | ||
|
|
ea4e930cbb | ||
|
|
a75bdc52f6 | ||
|
|
21d8e8bbb8 | ||
|
|
57b4473bc8 | ||
|
|
ae6beff5d8 | ||
|
|
da5563960b | ||
|
|
3b6df1cb84 | ||
|
|
91736e89cc | ||
|
|
e2a4998341 | ||
|
|
3c511df7f7 | ||
|
|
e61ffe4db4 | ||
|
|
9da46bbdcd | ||
|
|
e3749c8e8f | ||
|
|
4e1ffedc20 | ||
|
|
35f864256f | ||
|
|
ad2698dae2 | ||
|
|
46a7b13293 | ||
|
|
cbd7124cec | ||
|
|
0debc70ead | ||
|
|
f8331b74c7 | ||
|
|
12c4205785 | ||
|
|
8f5c4dc4ec | ||
|
|
711139ad4c | ||
|
|
cfe0724620 | ||
|
|
aeef1dae2e | ||
|
|
0f3fa8fdbe | ||
|
|
7b25e9acaf | ||
|
|
be00a519b3 | ||
|
|
4254c2590a | ||
|
|
57254bf175 | ||
|
|
fe8fecafeb | ||
|
|
0bc9e74853 | ||
|
|
1dfceeea99 | ||
|
|
68d703d1e3 | ||
|
|
82c713031e | ||
|
|
5579c3d04f | ||
|
|
5e7b0c7826 | ||
|
|
9e1e1a7a96 | ||
|
|
7becddc3a4 | ||
|
|
dfe949264f | ||
|
|
163fb1be4a | ||
|
|
33f76f426c | ||
|
|
1ca1b00d11 | ||
|
|
c89750fe94 | ||
|
|
fb2ce0d30a | ||
|
|
b8c5323ece | ||
|
|
7b13ea860a | ||
|
|
4b1cfa5840 | ||
|
|
6eeb01ad48 | ||
|
|
e6e6a1eeea | ||
|
|
dd64eb98f9 | ||
|
|
9cd111bae5 | ||
|
|
137dcbf7e1 | ||
|
|
fbdc668a22 | ||
|
|
7f931cbfd3 | ||
|
|
7b7a962e04 | ||
|
|
e4610af235 | ||
|
|
e7458e76e1 | ||
|
|
04a43378d8 | ||
|
|
809acb47bf | ||
|
|
ace2788b57 | ||
|
|
d60e738bd2 | ||
|
|
a50a59bbca | ||
|
|
76a6ea57a1 | ||
|
|
9907694ef6 | ||
|
|
20b3c31cbd | ||
|
|
25a74ffeee | ||
|
|
b8273c4441 | ||
|
|
8d3a305ec3 | ||
|
|
72b73bc9a6 | ||
|
|
ec31d206e2 | ||
|
|
bf11de82fc | ||
|
|
34d2228d5d | ||
|
|
0e507804b1 | ||
|
|
6c7477f1a9 | ||
|
|
886fc8d74e | ||
|
|
7b218c33f9 | ||
|
|
c67617262f | ||
|
|
057c824e9f | ||
|
|
1b4f4bba22 | ||
|
|
847798eec1 | ||
|
|
52c7437076 | ||
|
|
465d7166d4 | ||
|
|
733aa58de8 | ||
|
|
9620627ea6 | ||
|
|
e06314e802 | ||
|
|
986d922855 | ||
|
|
75dcae6fbe | ||
|
|
375691365e | ||
|
|
5c5af05408 | ||
|
|
69cf7015d8 | ||
|
|
6a533579b7 | ||
|
|
3ff46e06c0 | ||
|
|
9e2fccb105 | ||
|
|
f2c6d8aee1 | ||
|
|
836a530b86 | ||
|
|
a31e027c54 | ||
|
|
a1b554b3ac | ||
|
|
79c4c237fa | ||
|
|
85a35a3063 | ||
|
|
e0e391efbe | ||
|
|
9eff89963c | ||
|
|
352fac26f3 | ||
|
|
8c16bf126a | ||
|
|
42de968f8f | ||
|
|
ed8f024e42 | ||
|
|
e534369c5b | ||
|
|
fed797df93 | ||
|
|
6a44dbfe83 | ||
|
|
28c5357f11 | ||
|
|
a8824f92a1 | ||
|
|
e57b69973f | ||
|
|
d6798eed1e | ||
|
|
50383673ca | ||
|
|
022dbe32e5 | ||
|
|
baac4eb698 | ||
|
|
8aa8f452d5 | ||
|
|
54255cf923 | ||
|
|
bd3d82d224 | ||
|
|
b14ad9f3ab | ||
|
|
261b4646e4 | ||
|
|
d62e1c4468 | ||
|
|
5b0266c462 | ||
|
|
06118dcabb | ||
|
|
984c852ab6 | ||
|
|
47414cfd0e | ||
|
|
fdf4fdfb6a | ||
|
|
5ee0396a02 | ||
|
|
724eb9c658 | ||
|
|
936ab05882 | ||
|
|
817a43b178 | ||
|
|
0f16f42887 | ||
|
|
641c199c8c | ||
|
|
04dd6b900f | ||
|
|
536a05210e | ||
|
|
60d16016e8 | ||
|
|
9222075c7a | ||
|
|
641dcdff85 | ||
|
|
668649be7a | ||
|
|
0de936d474 | ||
|
|
47bd8b0ce7 | ||
|
|
2287c9951c | ||
|
|
94c28ebbc5 | ||
|
|
b4739f8f03 | ||
|
|
c32cd36861 | ||
|
|
945562b34d | ||
|
|
af0f89774e | ||
|
|
c6c4098759 | ||
|
|
fa1c79e15c | ||
|
|
0705c26513 | ||
|
|
140fa4b7c0 | ||
|
|
cd88901868 | ||
|
|
8eec97deb5 | ||
|
|
4331a7c9f4 | ||
|
|
f4fcfeba9d | ||
|
|
48aefb1862 | ||
|
|
bda9584346 | ||
|
|
ed1154af67 | ||
|
|
c368eacd87 | ||
|
|
949c59230f | ||
|
|
1114538f41 | ||
|
|
b0f83291ee | ||
|
|
e91e4ff430 | ||
|
|
4ad290d4bd | ||
|
|
37c6e2c0af | ||
|
|
b4a45afce9 | ||
|
|
330ff6eb47 | ||
|
|
c681eb1bdb | ||
|
|
de533e7031 | ||
|
|
ae6ed3f23f | ||
|
|
32aa209b75 | ||
|
|
e8c25d8ac5 | ||
|
|
718ad4b398 | ||
|
|
8d81a394ee | ||
|
|
d661c8b54e | ||
|
|
e45e782e7d | ||
|
|
5aa422dde1 | ||
|
|
24cbe3d281 | ||
|
|
13f5e76015 | ||
|
|
35c65ba890 | ||
|
|
8f2b82b832 | ||
|
|
7f1a206a52 | ||
|
|
8c503a226e | ||
|
|
cdcf9eaf67 | ||
|
|
a651e55dc9 | ||
|
|
d041a3f4f9 | ||
|
|
3ea05cb705 | ||
|
|
3f27ab1e44 | ||
|
|
e99b170d0a | ||
|
|
49e1a1c410 | ||
|
|
93ab3d5666 | ||
|
|
94f8159fdc | ||
|
|
8fb0b1445a | ||
|
|
15673555a2 | ||
|
|
ceeec7b8a6 | ||
|
|
46e5650882 | ||
|
|
405ea0076b | ||
|
|
8cd7f7de3f | ||
|
|
7cd17154fc | ||
|
|
299fcb091a | ||
|
|
025c6b0e7b | ||
|
|
388c3ec188 | ||
|
|
b6d9bb0d2a | ||
|
|
561ec3b1e9 | ||
|
|
9611646bc6 | ||
|
|
b5972bb680 | ||
|
|
455861ec69 | ||
|
|
5affa0de82 | ||
|
|
e11a2a6089 | ||
|
|
614a50ce0b | ||
|
|
66594b286a | ||
|
|
8e06f94bdd | ||
|
|
b0e03bb0b8 | ||
|
|
22e30b1871 | ||
|
|
8104a67e3e | ||
|
|
654ffda454 | ||
|
|
3f51437569 | ||
|
|
1bd784eef3 | ||
|
|
0d11aded40 | ||
|
|
00925d38aa | ||
|
|
12803b3957 | ||
|
|
7583498735 | ||
|
|
53eda31179 | ||
|
|
56e276939b | ||
|
|
39abccb35d | ||
|
|
dae8866053 | ||
|
|
a0e8aa3a43 | ||
|
|
e68b7da1f8 | ||
|
|
fcce7a531a | ||
|
|
f23dcbec17 | ||
|
|
8a1d28563d | ||
|
|
c33a87a07c | ||
|
|
b833e1ce27 | ||
|
|
6de1a55d73 | ||
|
|
cbf9086e10 | ||
|
|
eb4aa23577 | ||
|
|
bf9ae44775 | ||
|
|
f0822fa2b1 | ||
|
|
f966d34929 | ||
|
|
d51136f8f4 | ||
|
|
19843760e5 | ||
|
|
3457f93ed0 | ||
|
|
625ac2f1d7 | ||
|
|
061581c4ff | ||
|
|
a0116422c6 | ||
|
|
94e49ea86f | ||
|
|
040409eac7 | ||
|
|
baa2fca7ca | ||
|
|
1fd8139214 | ||
|
|
db5f9f639e | ||
|
|
90980f40f5 | ||
|
|
94d68c8b64 | ||
|
|
834a0a873f | ||
|
|
d8621f0b7a | ||
|
|
994c671fd8 | ||
|
|
7b95750dcf | ||
|
|
9fbbaf9b88 | ||
|
|
bb8572a364 | ||
|
|
bdd05a275d | ||
|
|
dcdbf23b6d | ||
|
|
ce6ad0bbb8 | ||
|
|
59d2946b91 | ||
|
|
92f3f4ee57 | ||
|
|
3311f17bbb | ||
|
|
e1f862507e | ||
|
|
7e040ac216 | ||
|
|
515c19422d | ||
|
|
5702d7afa8 | ||
|
|
833968a87d | ||
|
|
0c0e9c2f71 | ||
|
|
bcf1ebd778 | ||
|
|
4c82f9767f | ||
|
|
ab405f671e | ||
|
|
325d204332 | ||
|
|
97feed0be6 | ||
|
|
19636582ab | ||
|
|
393abe9e62 | ||
|
|
d9dca96a32 | ||
|
|
ebff4a765a | ||
|
|
d18019159b | ||
|
|
46905e9504 | ||
|
|
8b1c15ccb6 | ||
|
|
8873947a1b | ||
|
|
cdef22b4d1 | ||
|
|
29209105d3 | ||
|
|
fea3495098 | ||
|
|
871b2e52c7 | ||
|
|
ec174a38a9 | ||
|
|
46ff78a4c4 | ||
|
|
d2ad87d09c | ||
|
|
1903d6fb77 | ||
|
|
bbe1f9beda | ||
|
|
1f5710eaba | ||
|
|
392f8239f5 | ||
|
|
5c227888f2 | ||
|
|
e29e183e84 | ||
|
|
f31118292c | ||
|
|
5f4a5364b0 | ||
|
|
09da7cd242 | ||
|
|
e619b5fd31 | ||
|
|
b1855447b8 | ||
|
|
98f386dad6 | ||
|
|
80af3fb010 | ||
|
|
6e224c63ef | ||
|
|
aa113cc300 | ||
|
|
65df1ff909 | ||
|
|
e92c2d168e | ||
|
|
455d772095 | ||
|
|
e80973c4d2 | ||
|
|
721ecdbf3d | ||
|
|
e6b3d4349e | ||
|
|
b865add1b3 | ||
|
|
b35022d161 | ||
|
|
62b091c77b | ||
|
|
cdb112df05 | ||
|
|
6dc4fa0811 | ||
|
|
fb17af1afd | ||
|
|
b8811924c3 | ||
|
|
1b0b45649d | ||
|
|
e49bd05ae6 | ||
|
|
32f0d80729 | ||
|
|
f0f757cf75 | ||
|
|
ccf4e32523 | ||
|
|
56fe14c451 | ||
|
|
28801bf1ea | ||
|
|
460391136f | ||
|
|
215d4fc8bf | ||
|
|
46cb021260 | ||
|
|
f9c8028ea1 | ||
|
|
32b36f42f0 | ||
|
|
48f3ad842d | ||
|
|
3251b26d9e | ||
|
|
136df3724f | ||
|
|
0d6b8486c4 | ||
|
|
3a4aa5a001 | ||
|
|
5bea9915f5 | ||
|
|
26de367bc5 | ||
|
|
3c361c9414 | ||
|
|
0d4fdc38e4 | ||
|
|
6f7035e4cf | ||
|
|
38ae013e03 | ||
|
|
13d9f8f3f7 | ||
|
|
e990ae4800 | ||
|
|
6a68dc6e4f | ||
|
|
cfc19dca25 | ||
|
|
50318a8fc5 | ||
|
|
bde791fa55 | ||
|
|
2e6f3ed864 | ||
|
|
fb6bf4319f | ||
|
|
19bfff9899 | ||
|
|
f4d53e9006 | ||
|
|
46655ad462 | ||
|
|
1b6b957b23 | ||
|
|
0f6334314e | ||
|
|
3ac72a5c89 | ||
|
|
519be2d5a2 | ||
|
|
e8bc45f7dd | ||
|
|
76c3c5f2f6 | ||
|
|
54cd30c564 | ||
|
|
e260dd84ad | ||
|
|
bce85b04d6 | ||
|
|
642db480ce | ||
|
|
bea4be881b | ||
|
|
86832fb703 | ||
|
|
03aa4c9ddc | ||
|
|
36a158a805 | ||
|
|
32fbebd469 | ||
|
|
3d4b0c3fd6 | ||
|
|
1f7ec6769a | ||
|
|
239be527b8 | ||
|
|
fd4a87e3a6 | ||
|
|
3f535cc506 | ||
|
|
0b57bd51ca | ||
|
|
49c78ddd9d | ||
|
|
47b7046743 | ||
|
|
b4f1cae323 | ||
|
|
17856e0b96 | ||
|
|
8005679e60 | ||
|
|
ef33233624 | ||
|
|
2c6f57c7ce | ||
|
|
fd60d5bb17 | ||
|
|
742e6eb3a3 | ||
|
|
331ea586f1 | ||
|
|
afb0eabaa4 | ||
|
|
afa0aa5b3a | ||
|
|
1f99f69ecd | ||
|
|
d00596d297 | ||
|
|
8dcc18dde3 | ||
|
|
616d514d5a | ||
|
|
b2587c71b8 | ||
|
|
816866549c | ||
|
|
062735c9e3 | ||
|
|
aae9183de6 | ||
|
|
7f3e2d453f | ||
|
|
1b42aed34c | ||
|
|
974806d145 | ||
|
|
fe4c3c10d6 | ||
|
|
67dab35b57 | ||
|
|
55d8bc9ba5 | ||
|
|
572f01ed74 | ||
|
|
ee32d6f926 | ||
|
|
89abaa9dda | ||
|
|
a9ece209ae | ||
|
|
47ac50b4d0 | ||
|
|
5539f68a54 | ||
|
|
5b1ec1eb8f | ||
|
|
a609cbf84a | ||
|
|
1ad440f488 | ||
|
|
64330e6cc4 | ||
|
|
03421c099a | ||
|
|
b5c4084452 | ||
|
|
5d5b971f57 | ||
|
|
825d31af20 | ||
|
|
7880f980a8 | ||
|
|
137fd69f47 | ||
|
|
ed8efcf139 | ||
|
|
7fa3b67cc4 | ||
|
|
93c500fbf2 | ||
|
|
c58c12ea3d | ||
|
|
35305ad107 | ||
|
|
589d750e59 | ||
|
|
43b488f21f | ||
|
|
54d06462fc | ||
|
|
2d6109d587 | ||
|
|
8fddf627bf | ||
|
|
0334f6ce86 | ||
|
|
025558e58e | ||
|
|
f74547008d | ||
|
|
67dc1c7640 | ||
|
|
40322c6de4 | ||
|
|
417675b3df | ||
|
|
321ac74b6a | ||
|
|
b1c06eed7b | ||
|
|
8cb52e22b1 | ||
|
|
a073064900 | ||
|
|
07cceca67e | ||
|
|
540318fcd0 | ||
|
|
e9cbb872d0 | ||
|
|
f9dc42d1f9 | ||
|
|
1dabeedaa0 | ||
|
|
dc70ff128c | ||
|
|
b012b7170b | ||
|
|
0a1c2d8440 | ||
|
|
d72596f000 | ||
|
|
33029b2a11 | ||
|
|
bae24dd0ec | ||
|
|
db7de3aac1 | ||
|
|
c66dfbc653 | ||
|
|
51c207e025 | ||
|
|
e44e2442af | ||
|
|
86f40083ef | ||
|
|
f45fbbce60 | ||
|
|
c648866cb4 | ||
|
|
f8adafdabe | ||
|
|
ab4a1a0a1d | ||
|
|
34a3f4e275 | ||
|
|
55aedcd4a8 | ||
|
|
6633c550f5 | ||
|
|
0165658659 | ||
|
|
3075276a52 | ||
|
|
b46e752d0a | ||
|
|
ad171e7706 | ||
|
|
92c665436a | ||
|
|
2dbf433474 | ||
|
|
56ac642446 | ||
|
|
2f6c0d2208 | ||
|
|
a32614fff8 | ||
|
|
53053c127e | ||
|
|
a89ef41e81 | ||
|
|
eee7cb9bf4 | ||
|
|
98dc38ed99 | ||
|
|
7bcd6a6382 | ||
|
|
73e0a75585 | ||
|
|
71aa899f77 | ||
|
|
53f82a808b | ||
|
|
b035fc9ebd | ||
|
|
8cae5e8b3f | ||
|
|
6163f33abf | ||
|
|
a636faa4ab | ||
|
|
ee4df36735 | ||
|
|
4ede5463f9 | ||
|
|
4c277fe1b5 | ||
|
|
9f6079ad8a | ||
|
|
6fb6a16246 | ||
|
|
3af8070a57 | ||
|
|
ebe007eb78 | ||
|
|
55b7e192aa | ||
|
|
62f91f4d38 | ||
|
|
b1546c0568 | ||
|
|
af2d1c3a6e | ||
|
|
ca893b303a | ||
|
|
142369d651 | ||
|
|
3241c73e7c | ||
|
|
d6d9abd05e | ||
|
|
85ff2ff9de | ||
|
|
dbbb434723 | ||
|
|
7804ef83ce | ||
|
|
fb2d898e4c | ||
|
|
c6e99b35d5 | ||
|
|
3dcd38eca7 | ||
|
|
39ea44fdc3 | ||
|
|
2f84f3751a | ||
|
|
a7780dac9e | ||
|
|
e549a0824f | ||
|
|
8b8583d48b | ||
|
|
a8a8424ced | ||
|
|
0996eca3c5 | ||
|
|
e6f8bc8ae2 | ||
|
|
5ccc1c991b | ||
|
|
20a2d94996 | ||
|
|
f41eea2768 | ||
|
|
2cf7d976d3 | ||
|
|
194a1f204c | ||
|
|
75246e9db2 | ||
|
|
2d2525cff2 | ||
|
|
5160b640c4 | ||
|
|
d18ab3fe75 | ||
|
|
d15cf72474 | ||
|
|
d8f7a5dfa4 | ||
|
|
e68bef7ea7 | ||
|
|
7a0d690101 | ||
|
|
0eb8ae5117 | ||
|
|
b05d416e80 | ||
|
|
497a8f7a11 | ||
|
|
3bdf0dc6a6 | ||
|
|
b299302da4 | ||
|
|
2f0c64ae17 | ||
|
|
b58de9be9c | ||
|
|
d4a46cf257 | ||
|
|
f563e0703d | ||
|
|
c3251ee435 | ||
|
|
e9e61afc76 | ||
|
|
1dd5f2b72f | ||
|
|
cd7cbeae88 | ||
|
|
773d27bb0e | ||
|
|
0eaa81578a | ||
|
|
3dc054b839 | ||
|
|
8c686b0714 | ||
|
|
071abc8fc8 | ||
|
|
75a6bf3ef6 | ||
|
|
856e7ccaeb | ||
|
|
bfa32a90db | ||
|
|
4e629fcaf8 | ||
|
|
01bce05da4 | ||
|
|
8a19af4efc | ||
|
|
6eef9f6f37 | ||
|
|
0445a255d0 | ||
|
|
451cf4cd1d | ||
|
|
7206d064a5 | ||
|
|
db5b6f8e2e | ||
|
|
9d9860e495 | ||
|
|
1c0f8cdad1 | ||
|
|
4af0e277b4 | ||
|
|
5a4bb0d081 | ||
|
|
93e1cd5095 | ||
|
|
5527f29caf | ||
|
|
4c6158c1ea | ||
|
|
6431fbecf6 | ||
|
|
29699572bd | ||
|
|
2e60e14132 | ||
|
|
65790f1fb7 | ||
|
|
76d4cba596 | ||
|
|
974cee0b6e | ||
|
|
7deaba8368 | ||
|
|
e35d73eab5 | ||
|
|
9bbaf0ec71 | ||
|
|
1958bb9d09 | ||
|
|
7f5b5ac254 | ||
|
|
50b5e93a10 | ||
|
|
6ae9bc4df5 | ||
|
|
4cbc5391c0 | ||
|
|
9a161b8fd9 | ||
|
|
7df21f3f5a | ||
|
|
0a65965187 | ||
|
|
3f221fcdb8 | ||
|
|
827b1ae9ad | ||
|
|
49d8796f6b | ||
|
|
023fef6a70 | ||
|
|
d5e689e307 | ||
|
|
fc9ce52d69 | ||
|
|
c7935da16a | ||
|
|
1833a6632a | ||
|
|
4d7fe3d595 | ||
|
|
a87355695e |
30
.codecov.yml
Normal file
30
.codecov.yml
Normal file
@@ -0,0 +1,30 @@
|
||||
codecov:
|
||||
notify:
|
||||
require_ci_to_pass: yes
|
||||
|
||||
coverage:
|
||||
precision: 2
|
||||
round: down
|
||||
range: "80...100"
|
||||
status:
|
||||
project:
|
||||
default:
|
||||
threshold: 0.5%
|
||||
patch: off
|
||||
changes: no
|
||||
|
||||
parsers:
|
||||
gcov:
|
||||
branch_detection:
|
||||
conditional: yes
|
||||
loop: yes
|
||||
method: no
|
||||
macro: no
|
||||
|
||||
comment:
|
||||
layout: "diff, flags, files"
|
||||
behavior: default
|
||||
require_changes: yes
|
||||
require_base: no
|
||||
require_head: yes
|
||||
branches: null
|
||||
23
.editorconfig
Normal file
23
.editorconfig
Normal file
@@ -0,0 +1,23 @@
|
||||
; top-most EditorConfig file
|
||||
root = true
|
||||
|
||||
; Unix-style newlines
|
||||
[*]
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
|
||||
[*.php]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[*.twig]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[*.yaml]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[*.yml]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
47
.env.dist
Normal file
47
.env.dist
Normal file
@@ -0,0 +1,47 @@
|
||||
#
|
||||
# You should NOT use this file in production, but instead move the environment variables to your webserver configuration.
|
||||
# The .env file is only existing to simplify the initial setup!
|
||||
#
|
||||
|
||||
#================================================================================
|
||||
# Configure your database connection and set the correct server version.
|
||||
#
|
||||
# You have to replace the following values with your defaults:
|
||||
# - the version "5.7"
|
||||
# - the database username "user"
|
||||
# - the database password "password"
|
||||
# - the database schema name "database"
|
||||
# - you might have to adapt port "3306" and server IP "127.0.0.1" as well
|
||||
#
|
||||
# For MySQL that would be "serverVersion=5.7" as in:
|
||||
# DATABASE_URL=mysql://user:password@127.0.0.1:3306/database?charset=utf8&serverVersion=5.7
|
||||
#
|
||||
# For MariaDB it would be "serverVersion=mariadb-10.5.8":
|
||||
# DATABASE_URL=mysql://user:password@127.0.0.1:3306/database?charset=utf8&serverVersion=mariadb-10.5.8
|
||||
#
|
||||
DATABASE_URL=mysql://user:password@127.0.0.1:3306/database?charset=utf8&serverVersion=5.7
|
||||
|
||||
#================================================================================
|
||||
# The full documentation can be found at https://www.kimai.org/documentation/emails.html
|
||||
#
|
||||
# Email will be sent with this address as sender:
|
||||
MAILER_FROM=kimai@example.com
|
||||
# Email connection (disabled by default) - see documentation for the format
|
||||
MAILER_URL=null://null
|
||||
|
||||
#================================================================================
|
||||
# do not change, unless you are developing for Kimai
|
||||
APP_ENV=prod
|
||||
|
||||
#================================================================================
|
||||
# should be changed to a unique character sequence, used for hashing cookies
|
||||
APP_SECRET=change_this_to_something_unique
|
||||
|
||||
#================================================================================
|
||||
# Running behind reverse proxies? Try these:
|
||||
# TRUSTED_PROXIES=127.0.0.1,127.0.0.2
|
||||
# TRUSTED_HOSTS=localhost,example.com
|
||||
|
||||
#================================================================================
|
||||
# unlikely, that you need to change this one
|
||||
CORS_ALLOW_ORIGIN=^https?://localhost(:[0-9]+)?$
|
||||
11
.eslintrc.js
Normal file
11
.eslintrc.js
Normal file
@@ -0,0 +1,11 @@
|
||||
module.exports = {
|
||||
env: {
|
||||
"browser": true,
|
||||
"node": true,
|
||||
"es6": true,
|
||||
"amd": true,
|
||||
},
|
||||
parser: '@babel/eslint-parser',
|
||||
extends: ['eslint:recommended'],
|
||||
ignorePatterns: ["assets/*.js"],
|
||||
}
|
||||
2
.github/FUNDING.yml
vendored
Normal file
2
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
github: [kevinpapst]
|
||||
custom: ["https://www.kimai.org/donate/", "https://www.paypal.me/kevinpapst"]
|
||||
75
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
75
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
name: Bug report
|
||||
description: Create a report to help us improve Kimai
|
||||
labels: [ "bug" ]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thank you for reporting an issue on Kimai! This form will guide you to create a useful issue report.
|
||||
- type: textarea
|
||||
id: what-happened
|
||||
attributes:
|
||||
label: Describe the issue
|
||||
description: "A clear and concise description of the problem you are facing. Is that a browser issue? Then add device information: Ubuntu 20.04 with Brave 1.46, Windows 10 with Chrome 85, iPhone 10, Mac with Safari 16"
|
||||
placeholder: Tell us what you see! Include the steps necessary to reproduce the behavior (e.g. go to, scroll down and click here ...)
|
||||
validations:
|
||||
required: true
|
||||
- type: checkboxes
|
||||
id: tried
|
||||
attributes:
|
||||
label: I already tried
|
||||
description: If you didn’t try already, try to search the documentation and existing issues what you wrote above.
|
||||
options:
|
||||
- label: I've read and searched [the documentation](https://www.kimai.org/documentation/).
|
||||
required: true
|
||||
- label: I've searched for similar issues in this repository.
|
||||
required: true
|
||||
- label: I've searched for similar issues in [the discussions](https://github.com/kimai/kimai/discussions).
|
||||
required: true
|
||||
- type: input
|
||||
id: version
|
||||
attributes:
|
||||
label: Kimai version
|
||||
description: Which version of Kimai are you running (see Doctor/About/Kimai-Cloud screen)
|
||||
placeholder: 1.xx.x or 2.xx.x
|
||||
validations:
|
||||
required: true
|
||||
- type: dropdown
|
||||
id: installation
|
||||
attributes:
|
||||
label: How do you run Kimai?
|
||||
options:
|
||||
- Virtual Server or alike
|
||||
- KIMAI CLOUD
|
||||
- Docker
|
||||
- Synology
|
||||
- Plesk
|
||||
- Shared-Hosting
|
||||
- Other (please mention below)
|
||||
validations:
|
||||
required: true
|
||||
- type: dropdown
|
||||
id: php
|
||||
attributes:
|
||||
label: Which PHP version are you using?
|
||||
options:
|
||||
- "8.1"
|
||||
- Unknown
|
||||
- "8.2"
|
||||
- "8.0"
|
||||
- "7.4"
|
||||
- "7.3"
|
||||
- Other (please mention below)
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: logs
|
||||
attributes:
|
||||
label: Logfile
|
||||
description: Please paste the last lines from your logfile at "var/log/prod.log" or "Doctor > Logs", around the time when the problem happened.
|
||||
- type: textarea
|
||||
id: screenshots
|
||||
attributes:
|
||||
label: Screenshots
|
||||
description: If applicable, add screenshots to better explain your problem.
|
||||
|
||||
14
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
14
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: Read our documentation
|
||||
url: https://www.kimai.org/documentation/
|
||||
about: Save your time! There is an instant solution for many issues in the documentation.
|
||||
- name: Docker image issue tracker
|
||||
url: https://github.com/tobybatch/kimai2/issues
|
||||
about: For issues specific for Kimai Docker deployment
|
||||
- name: Ask a Question
|
||||
url: https://github.com/kimai/kimai/discussions
|
||||
about: Want to discuss something with a community? Do it in discussions!
|
||||
- name: Get Professional support
|
||||
url: https://www.kimai.org/store/custom-plugins.html
|
||||
about: As a customer, you will always receive fast and helpful replies from the developer.
|
||||
34
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
Normal file
34
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
name: Feature request
|
||||
description: Suggest an idea to make Kimai better
|
||||
labels: [ "feature request" ]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thank you for reporting an issue on Kimai! This form will guide you to create a useful issue report.
|
||||
- type: textarea
|
||||
id: describe
|
||||
attributes:
|
||||
label: Describe the problem
|
||||
description: >
|
||||
Is your feature request related to a problem? If so, please provide
|
||||
a clear and concise description of what the issue is.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: solution
|
||||
attributes:
|
||||
label: Describe the solution you'd like
|
||||
description: A clear and concise description of what the new feature should do.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: alternatives
|
||||
attributes:
|
||||
label: Describe alternatives you've considered
|
||||
description: A clear and concise description of any alternative solutions or features you've considered.
|
||||
- type: textarea
|
||||
id: screenshots
|
||||
attributes:
|
||||
label: Screenshots
|
||||
description: If applicable, add screenshots to better explain your problem.
|
||||
12
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
12
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
## Description
|
||||
A clear and concise description of what this pull request adds or changes.
|
||||
|
||||
## Types of changes
|
||||
- [ ] Bug fix (non-breaking change which fixes an issue)
|
||||
- [ ] New feature (non-breaking change which adds functionality)
|
||||
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
|
||||
|
||||
## Checklist
|
||||
- [ ] I verified that my code applies to the guidelines (`composer code-check`)
|
||||
- [ ] I updated the documentation (see [here](https://github.com/kimai/www.kimai.org/tree/master/_documentation))
|
||||
- [ ] I agree that this code is used in Kimai (see [license](https://github.com/kimai/kimai/blob/main/LICENSE))
|
||||
42
.github/release-drafter.yml
vendored
Normal file
42
.github/release-drafter.yml
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
name-template: '$RESOLVED_VERSION'
|
||||
tag-template: '$RESOLVED_VERSION'
|
||||
categories:
|
||||
- title: 'Enhancements'
|
||||
labels:
|
||||
- 'feature request'
|
||||
- 'technical debt'
|
||||
- 'translation'
|
||||
- title: 'Fixed bugs'
|
||||
labels:
|
||||
- 'bug'
|
||||
- title: 'Infrastructure'
|
||||
labels:
|
||||
- 'infrastructure'
|
||||
exclude-labels:
|
||||
- 'duplicate'
|
||||
- 'invalid'
|
||||
- 'wontfix'
|
||||
- 'release'
|
||||
exclude-contributors:
|
||||
- 'dependabot'
|
||||
change-template: '- $TITLE (#$NUMBER)'
|
||||
change-title-escapes: '\<*_&`#@'
|
||||
version-resolver:
|
||||
minor:
|
||||
labels:
|
||||
- 'feature request'
|
||||
- 'release'
|
||||
patch:
|
||||
labels:
|
||||
- 'technical debt'
|
||||
- 'bug'
|
||||
- 'translation'
|
||||
default: patch
|
||||
template: |
|
||||
[Upgrade Kimai](https://www.kimai.org/documentation/updates.html) - [Install Kimai](https://www.kimai.org/documentation/installation.html) - [Docker](https://tobybatch.github.io/kimai2/)
|
||||
|
||||
**Compatible with PHP 8.1 and 8.2**
|
||||
|
||||
$CHANGES
|
||||
|
||||
Involved in this release: $CONTRIBUTORS - thank you!
|
||||
16
.github/workflows/docker.yaml
vendored
Normal file
16
.github/workflows/docker.yaml
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
name: 'Docker Build'
|
||||
on:
|
||||
release:
|
||||
types: [released]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Trigger docker image build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Emit repository_dispatch
|
||||
uses: peter-evans/repository-dispatch@v2
|
||||
with:
|
||||
token: ${{ secrets.DOCKER_ACCESS_TOKEN }}
|
||||
repository: tobybatch/kimai2
|
||||
event_type: kimai_release
|
||||
56
.github/workflows/lock.yaml
vendored
Normal file
56
.github/workflows/lock.yaml
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
name: 'Lock Threads'
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
issues: write
|
||||
pull-requests: write
|
||||
|
||||
concurrency:
|
||||
group: lock
|
||||
|
||||
jobs:
|
||||
action:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: dessant/lock-threads@v4
|
||||
with:
|
||||
github-token: ${{ github.token }}
|
||||
issue-inactive-days: '90'
|
||||
exclude-issue-created-before: ''
|
||||
exclude-issue-created-after: ''
|
||||
exclude-issue-created-between: ''
|
||||
exclude-issue-closed-before: ''
|
||||
exclude-issue-closed-after: ''
|
||||
exclude-issue-closed-between: ''
|
||||
include-any-issue-labels: ''
|
||||
include-all-issue-labels: ''
|
||||
exclude-any-issue-labels: ''
|
||||
add-issue-labels: ''
|
||||
remove-issue-labels: ''
|
||||
issue-comment: >
|
||||
This thread has been automatically locked since there has not been
|
||||
any recent activity after it was closed. Please open a new issue for
|
||||
related bugs.
|
||||
If you use Kimai on a daily basis, please [consider donating](https://www.kimai.org/donate/) to
|
||||
support further development of Kimai.
|
||||
issue-lock-reason: 'resolved'
|
||||
pr-inactive-days: '180'
|
||||
exclude-pr-created-before: ''
|
||||
exclude-pr-created-after: ''
|
||||
exclude-pr-created-between: ''
|
||||
exclude-pr-closed-before: ''
|
||||
exclude-pr-closed-after: ''
|
||||
exclude-pr-closed-between: ''
|
||||
include-any-pr-labels: ''
|
||||
include-all-pr-labels: ''
|
||||
exclude-any-pr-labels: ''
|
||||
add-pr-labels: ''
|
||||
remove-pr-labels: ''
|
||||
pr-comment: ''
|
||||
pr-lock-reason: ''
|
||||
process-only: ''
|
||||
log-output: false
|
||||
23
.github/workflows/lockfiles.yaml
vendored
Normal file
23
.github/workflows/lockfiles.yaml
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
name: Check .lock files
|
||||
on:
|
||||
pull_request: null
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
jobs:
|
||||
lockfiles:
|
||||
runs-on: ubuntu-latest
|
||||
name: Verify lock file integrity
|
||||
steps:
|
||||
|
||||
- name: Clone Kimai
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Prevent file change
|
||||
uses: xalvarez/prevent-file-change-action@v1
|
||||
with:
|
||||
githubToken: ${{ secrets.GITHUB_TOKEN }}
|
||||
pattern: .*.lock
|
||||
trustedAuthors: kevinpapst, dependabot
|
||||
30
.github/workflows/release-drafter.yaml
vendored
Normal file
30
.github/workflows/release-drafter.yaml
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
name: Release Drafter
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
correct_repository:
|
||||
permissions:
|
||||
contents: none
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: fail on fork
|
||||
if: github.repository_owner != 'kimai'
|
||||
run: exit 1
|
||||
|
||||
update_release_draft:
|
||||
permissions:
|
||||
contents: write # for release-drafter/release-drafter to create a github release
|
||||
pull-requests: write # for release-drafter/release-drafter to add label to PR
|
||||
needs: correct_repository
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: release-drafter/release-drafter@v5
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
114
.github/workflows/testing.yaml
vendored
Normal file
114
.github/workflows/testing.yaml
vendored
Normal file
@@ -0,0 +1,114 @@
|
||||
name: Tests
|
||||
on:
|
||||
pull_request: null
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
jobs:
|
||||
integration:
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
mysql:
|
||||
image: mysql:latest
|
||||
env:
|
||||
MYSQL_ALLOW_EMPTY_PASSWORD: false
|
||||
MYSQL_ROOT_PASSWORD: kimai
|
||||
MYSQL_DATABASE: kimai
|
||||
ports:
|
||||
- 3306/tcp
|
||||
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
|
||||
strategy:
|
||||
matrix:
|
||||
php: ['8.1', '8.2']
|
||||
|
||||
name: Integration (${{ matrix.php }})
|
||||
steps:
|
||||
|
||||
- name: Clone Kimai
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php }}
|
||||
coverage: pcov
|
||||
extensions: ctype, gd, iconv, intl, ldap, mbstring, mysql, xml, zip
|
||||
tools: cs2pr, symfony-cli
|
||||
env:
|
||||
fail-fast: true
|
||||
|
||||
- name: Determine composer cache directory
|
||||
id: composer-cache
|
||||
run: echo "composer_cache_directory=$(composer config cache-dir)" >> $GITHUB_ENV
|
||||
|
||||
- name: Cache Composer dependencies
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: "${{ env.composer_cache_directory }}"
|
||||
key: ${{ runner.os }}-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: composer install
|
||||
|
||||
- name: Validate Composer
|
||||
run: composer validate --strict
|
||||
|
||||
- name: Warmup cache
|
||||
run: APP_ENV=dev bin/console kimai:reload -n
|
||||
|
||||
- name: Check codestyles
|
||||
run: PHP_CS_FIXER_IGNORE_ENV=1 vendor/bin/php-cs-fixer fix --dry-run --verbose --config=.php-cs-fixer.dist.php --using-cache=no --show-progress=none --format=checkstyle | cs2pr
|
||||
|
||||
- name: Run PHPStan for application
|
||||
run: vendor/bin/phpstan analyse -c phpstan.neon --no-progress --error-format=checkstyle | cs2pr
|
||||
|
||||
- name: Run PHPStan for tests
|
||||
run: vendor/bin/phpstan analyse -c tests/phpstan.neon --no-progress --error-format=checkstyle | cs2pr
|
||||
|
||||
- name: Lint codebase
|
||||
run: composer linting
|
||||
|
||||
- name: Install LDAP package (for tests)
|
||||
run: composer require laminas/laminas-ldap
|
||||
|
||||
- name: Setup problem matchers (for PHPUnit)
|
||||
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
|
||||
|
||||
- name: Run quick unit-tests
|
||||
run: composer tests-unit
|
||||
env:
|
||||
DATABASE_URL: mysql://root:kimai@127.0.0.1:${{ job.services.mysql.ports['3306'] }}/kimai?serverVersion=5.7
|
||||
APP_ENV: dev
|
||||
MAILER_URL: null://localhost
|
||||
|
||||
- name: Full test-suite with coverage
|
||||
run: vendor/bin/phpunit tests/ --coverage-clover=coverage.xml
|
||||
env:
|
||||
DATABASE_URL: mysql://root:kimai@127.0.0.1:${{ job.services.mysql.ports['3306'] }}/kimai?serverVersion=5.7
|
||||
APP_ENV: dev
|
||||
MAILER_URL: null://localhost
|
||||
TEST_WITH_BUNDLES: 1
|
||||
|
||||
- name: Upload code coverage
|
||||
if: matrix.php == '8.1'
|
||||
uses: codecov/codecov-action@v3
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
files: ./coverage.xml
|
||||
fail_ci_if_error: true
|
||||
|
||||
- name: Run migrations on MySQL
|
||||
run: |
|
||||
bin/console doctrine:database:drop --if-exists --force -n
|
||||
bin/console doctrine:database:create --if-not-exists -n
|
||||
bin/console doctrine:migrations:migrate -n
|
||||
bin/console doctrine:migrations:migrate first -n
|
||||
env:
|
||||
DATABASE_URL: mysql://root:kimai@127.0.0.1:${{ job.services.mysql.ports['3306'] }}/kimai?serverVersion=5.7
|
||||
APP_ENV: dev
|
||||
MAILER_URL: null://localhost
|
||||
|
||||
- name: Check for security issues in packages
|
||||
run: symfony security:check
|
||||
121
.gitignore
vendored
121
.gitignore
vendored
@@ -1,57 +1,70 @@
|
||||
# Cache and logs (Symfony2)
|
||||
/app/cache/*
|
||||
/app/logs/*
|
||||
!app/cache/.gitkeep
|
||||
!app/logs/.gitkeep
|
||||
|
||||
# Email spool folder
|
||||
/app/spool/*
|
||||
|
||||
# Cache, session files and logs (Symfony3)
|
||||
/var/cache/*
|
||||
/var/logs/*
|
||||
/var/sessions/*
|
||||
!var/cache/.gitkeep
|
||||
!var/logs/.gitkeep
|
||||
!var/sessions/.gitkeep
|
||||
|
||||
# Parameters
|
||||
/app/config/parameters.yml
|
||||
/app/config/parameters.ini
|
||||
|
||||
# Managed by Composer
|
||||
/app/bootstrap.php.cache
|
||||
/var/bootstrap.php.cache
|
||||
/bin/*
|
||||
!bin/console
|
||||
!bin/symfony_requirements
|
||||
/vendor/
|
||||
|
||||
# Assets and user uploads
|
||||
/web/bundles/
|
||||
/web/uploads/
|
||||
|
||||
# Assets managed by Bower
|
||||
/web/assets/vendor/
|
||||
|
||||
# PHPUnit
|
||||
/app/phpunit.xml
|
||||
/phpunit.xml
|
||||
|
||||
# Build data
|
||||
/build/
|
||||
|
||||
# Composer PHAR
|
||||
/composer.phar
|
||||
|
||||
# Backup entities generated with doctrine:generate:entities command
|
||||
*/Entity/*~
|
||||
|
||||
# IDE
|
||||
# some hosters require a htaccess to change the PHP version
|
||||
.htaccess
|
||||
.env-*
|
||||
.idea/
|
||||
.DS_Store
|
||||
rector.php
|
||||
phpstan.sh
|
||||
|
||||
# SQLite files
|
||||
/app/data/timesheet.sqlite
|
||||
# for symfony local webserver
|
||||
php.ini
|
||||
.php-version
|
||||
|
||||
# generated install and setup files
|
||||
/web/theme/
|
||||
# YARN 2
|
||||
.yarnrc.yml
|
||||
.yarn
|
||||
|
||||
# for keeping empty directories
|
||||
!.gitkeep
|
||||
|
||||
/bin/*
|
||||
!/bin/console
|
||||
*local.yaml
|
||||
/config/bundles-local.php
|
||||
|
||||
/templates/invoice/renderer/.~lock*
|
||||
/translations/branding.*.xlf
|
||||
|
||||
/var/data/*
|
||||
/var/coverage/
|
||||
/var/cache/*
|
||||
|
||||
/var/invoices/*
|
||||
/var/export/*
|
||||
/var/log/*
|
||||
/var/sessions/*
|
||||
/var/packages/*
|
||||
/var/plugins/*
|
||||
*.disabled
|
||||
|
||||
###> symfony/framework-bundle ###
|
||||
/.env.local
|
||||
/.env.local.php
|
||||
/.env.*.local
|
||||
/config/secrets/prod/prod.decrypt.private.php
|
||||
.env
|
||||
/public/bundles/
|
||||
/vendor/
|
||||
###< symfony/framework-bundle ###
|
||||
|
||||
###> phpunit/phpunit ###
|
||||
/phpunit.xml
|
||||
/.phpunit.result.cache
|
||||
###< phpunit/phpunit ###
|
||||
|
||||
###> friendsofphp/php-cs-fixer ###
|
||||
.php_cs
|
||||
.php_cs.cache
|
||||
.php-cs-fixer.cache
|
||||
###< friendsofphp/php-cs-fixer ###
|
||||
|
||||
###> symfony/phpunit-bridge ###
|
||||
.phpunit
|
||||
###< symfony/phpunit-bridge ###
|
||||
|
||||
###> symfony/webpack-encore-bundle ###
|
||||
/node_modules/
|
||||
npm-debug.log
|
||||
yarn-error.log
|
||||
###< symfony/webpack-encore-bundle ###
|
||||
/nbproject/*
|
||||
176
.php-cs-fixer.dist.php
Normal file
176
.php-cs-fixer.dist.php
Normal file
@@ -0,0 +1,176 @@
|
||||
<?php
|
||||
|
||||
$fileHeaderComment = <<<COMMENT
|
||||
This file is part of the Kimai time-tracking app.
|
||||
|
||||
For the full copyright and license information, please view the LICENSE
|
||||
file that was distributed with this source code.
|
||||
COMMENT;
|
||||
|
||||
$fixer = new PhpCsFixer\Config();
|
||||
$fixer
|
||||
->setRiskyAllowed(true)
|
||||
->setRules([
|
||||
'encoding' => true,
|
||||
'full_opening_tag' => true,
|
||||
'blank_line_after_namespace' => true,
|
||||
'braces' => true,
|
||||
'class_definition' => true,
|
||||
'elseif' => true,
|
||||
'function_declaration' => true,
|
||||
'indentation_type' => true,
|
||||
'line_ending' => true,
|
||||
'constant_case' => ['case' => 'lower'],
|
||||
'lowercase_keywords' => true,
|
||||
'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline', 'after_heredoc' => true],
|
||||
'header_comment' => ['header' => $fileHeaderComment, 'separate' => 'both'],
|
||||
'no_php4_constructor' => true,
|
||||
'ordered_imports' => true,
|
||||
'no_break_comment' => true,
|
||||
'no_closing_tag' => true,
|
||||
'no_spaces_after_function_name' => true,
|
||||
'no_spaces_inside_parenthesis' => true,
|
||||
'no_trailing_whitespace' => true,
|
||||
'no_trailing_whitespace_in_comment' => true,
|
||||
'single_blank_line_at_eof' => true,
|
||||
'single_class_element_per_statement' => ['elements' => ['property']],
|
||||
'single_import_per_statement' => true,
|
||||
'single_line_after_imports' => true,
|
||||
'switch_case_semicolon_to_colon' => true,
|
||||
'switch_case_space' => true,
|
||||
'array_syntax' => [
|
||||
'syntax' => 'short'
|
||||
],
|
||||
'binary_operator_spaces' => true,
|
||||
'blank_line_after_opening_tag' => true,
|
||||
'blank_line_before_statement' => [
|
||||
'statements' => ['return'],
|
||||
],
|
||||
'cast_spaces' => true,
|
||||
'class_attributes_separation' => ['elements' => ['method' => 'one']],
|
||||
'concat_space' => ['spacing' => 'one'],
|
||||
'declare_equal_normalize' => true,
|
||||
'function_typehint_space' => true,
|
||||
'include' => true,
|
||||
'lowercase_cast' => true,
|
||||
'lowercase_static_reference' => true,
|
||||
'magic_constant_casing' => 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_blank_lines' => ['tokens' => [
|
||||
'curly_brace_block',
|
||||
'extra',
|
||||
'parenthesis_brace_block',
|
||||
'square_brace_block',
|
||||
'throw',
|
||||
'use',
|
||||
]],
|
||||
'no_leading_import_slash' => true,
|
||||
'no_leading_namespace_whitespace' => true,
|
||||
'no_mixed_echo_print' => ['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_singleline' => true,
|
||||
'no_unneeded_curly_braces' => true,
|
||||
'no_unneeded_final_method' => 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' => [
|
||||
'align' => 'left',
|
||||
'tags' => [
|
||||
'method',
|
||||
'param',
|
||||
'property',
|
||||
'return',
|
||||
'throws',
|
||||
'type',
|
||||
'var',
|
||||
],
|
||||
],
|
||||
'phpdoc_annotation_without_dot' => true,
|
||||
'phpdoc_indent' => true,
|
||||
'phpdoc_inline_tag_normalizer' => true,
|
||||
'phpdoc_no_access' => true,
|
||||
'phpdoc_no_alias_tag' => true,
|
||||
'phpdoc_no_empty_return' => false,
|
||||
'phpdoc_no_package' => true,
|
||||
'phpdoc_no_useless_inheritdoc' => true,
|
||||
'phpdoc_return_self_reference' => true,
|
||||
'phpdoc_scalar' => true,
|
||||
'phpdoc_separation' => false,
|
||||
'phpdoc_single_line_var_spacing' => true,
|
||||
'phpdoc_summary' => false,
|
||||
'phpdoc_to_comment' => true,
|
||||
'phpdoc_trim' => true,
|
||||
'phpdoc_types' => true,
|
||||
'phpdoc_var_without_name' => true,
|
||||
'protected_to_private' => true,
|
||||
'return_type_declaration' => true,
|
||||
'semicolon_after_instruction' => true,
|
||||
'short_scalar_cast' => true,
|
||||
'single_blank_line_before_namespace' => true,
|
||||
'single_line_comment_style' => [
|
||||
'comment_types' => ['hash'],
|
||||
],
|
||||
'single_quote' => true,
|
||||
'space_after_semicolon' => [
|
||||
'remove_in_empty_for_expressions' => true,
|
||||
],
|
||||
'standardize_increment' => true,
|
||||
'standardize_not_equals' => true,
|
||||
'ternary_operator_spaces' => true,
|
||||
'trailing_comma_in_multiline' => false,
|
||||
'trim_array_spaces' => true,
|
||||
'unary_operator_spaces' => true,
|
||||
'whitespace_after_comma_in_array' => true,
|
||||
'yoda_style' => false,
|
||||
'ternary_to_null_coalescing' => true,
|
||||
'visibility_required' => ['elements' => [
|
||||
'const',
|
||||
'method',
|
||||
'property',
|
||||
]],
|
||||
'native_function_invocation' => [
|
||||
'include' => [
|
||||
'@compiler_optimized'
|
||||
],
|
||||
'scope' => 'namespaced'
|
||||
],
|
||||
'native_function_type_declaration_casing' => true,
|
||||
'no_alias_functions' => [
|
||||
'sets' => [
|
||||
'@internal'
|
||||
]
|
||||
],
|
||||
'list_syntax' => ['syntax' => 'short'],
|
||||
'assign_null_coalescing_to_coalesce_equal' => true,
|
||||
'non_printable_character' => true,
|
||||
'octal_notation' => true,
|
||||
'heredoc_indentation' => ['indentation' => 'start_plus_one'],
|
||||
'no_space_around_double_colon' => true,
|
||||
'no_useless_nullsafe_operator' => true,
|
||||
'clean_namespace' => true,
|
||||
'no_unset_cast' => true,
|
||||
])
|
||||
->setFinder(
|
||||
PhpCsFixer\Finder::create()
|
||||
->in([
|
||||
__DIR__ . '/src/',
|
||||
__DIR__ . '/tests/',
|
||||
])
|
||||
)
|
||||
->setFormat('checkstyle')
|
||||
;
|
||||
|
||||
return $fixer;
|
||||
26
.travis.yml
26
.travis.yml
@@ -1,26 +0,0 @@
|
||||
language: php
|
||||
sudo: false
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.composer/cache/files
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
include:
|
||||
- php: 5.5
|
||||
- php: 5.6
|
||||
- php: 7.0
|
||||
- php: hhvm
|
||||
allow_failures:
|
||||
- php: hhvm
|
||||
|
||||
before_install:
|
||||
- if [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then phpenv config-rm xdebug.ini; fi
|
||||
- composer self-update
|
||||
|
||||
install:
|
||||
- composer install
|
||||
|
||||
script:
|
||||
- phpunit
|
||||
3
CHANGELOG.md
Normal file
3
CHANGELOG.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# Changelog
|
||||
|
||||
See [GitHub release page](https://github.com/kimai/kimai/releases).
|
||||
@@ -1,20 +1,15 @@
|
||||
Contributing
|
||||
============
|
||||
# Contributing
|
||||
|
||||
The Kimai application is an open source project. Contributions made by
|
||||
the community are welcome. Send us your ideas, code reviews, pull requests and
|
||||
feature requests to help us improve this project.
|
||||
Kimai is an open source project, contributions made by the community are welcome.
|
||||
Send your ideas, code reviews, pull requests and feature requests to help to improve this project.
|
||||
|
||||
Web Assets Management
|
||||
---------------------
|
||||
## Pull request rules
|
||||
|
||||
This project manages its web assets in a special way to allow them to work
|
||||
without configuring any option, installing any tool or executing any command.
|
||||
If your contribution changes CSS styles or JavaScript code in any way, make
|
||||
sure to regenerate the `web/css/app.css` and `web/js/app.js` files. To do so,
|
||||
uncomment the Assetic blocks in the `app/Resources/views/base.html.twig` and
|
||||
execute the following command:
|
||||
- Apply our code-style by running `composer codestyle-fix`
|
||||
- Run the static code analysis with `composer phpstan`
|
||||
- Verify everything still works with `composer tests-unit` and `composer tests-integration`
|
||||
- Add tests for your changes
|
||||
- When sending in a PR, you must accept that your contributions/code will be published under MIT license (see the [LICENSE](LICENSE) file as well), otherwise your PR will be closed
|
||||
- If one of the PR checks/builds fails, fix it before asking for a review
|
||||
|
||||
```bash
|
||||
$ php bin/console assetic:dump --no-debug
|
||||
```
|
||||
Further documentation can be found in the [developer documentation](https://www.kimai.org/documentation/developers.html).
|
||||
|
||||
674
LICENSE
674
LICENSE
@@ -1,19 +1,661 @@
|
||||
Copyright (c) 2016 Kevin Papst
|
||||
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
Version 3, 19 November 2007
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is furnished
|
||||
to do so, subject to the following conditions:
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
Preamble
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
The GNU Affero General Public License is a free, copyleft license for
|
||||
software and other kinds of works, specifically designed to ensure
|
||||
cooperation with the community in the case of network server software.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
our General Public Licenses are intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
Developers that use our General Public Licenses protect your rights
|
||||
with two steps: (1) assert copyright on the software, and (2) offer
|
||||
you this License which gives you legal permission to copy, distribute
|
||||
and/or modify the software.
|
||||
|
||||
A secondary benefit of defending all users' freedom is that
|
||||
improvements made in alternate versions of the program, if they
|
||||
receive widespread use, become available for other developers to
|
||||
incorporate. Many developers of free software are heartened and
|
||||
encouraged by the resulting cooperation. However, in the case of
|
||||
software used on network servers, this result may fail to come about.
|
||||
The GNU General Public License permits making a modified version and
|
||||
letting the public access it on a server without ever releasing its
|
||||
source code to the public.
|
||||
|
||||
The GNU Affero General Public License is designed specifically to
|
||||
ensure that, in such cases, the modified source code becomes available
|
||||
to the community. It requires the operator of a network server to
|
||||
provide the source code of the modified version running there to the
|
||||
users of that server. Therefore, public use of a modified version, on
|
||||
a publicly accessible server, gives the public access to the source
|
||||
code of the modified version.
|
||||
|
||||
An older license, called the Affero General Public License and
|
||||
published by Affero, was designed to accomplish similar goals. This is
|
||||
a different license, not a version of the Affero GPL, but Affero has
|
||||
released a new version of the Affero GPL which permits relicensing under
|
||||
this license.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU Affero General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Remote Network Interaction; Use with the GNU General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, if you modify the
|
||||
Program, your modified version must prominently offer all users
|
||||
interacting with it remotely through a computer network (if your version
|
||||
supports such interaction) an opportunity to receive the Corresponding
|
||||
Source of your version by providing access to the Corresponding Source
|
||||
from a network server at no charge, through some standard or customary
|
||||
means of facilitating copying of software. This Corresponding Source
|
||||
shall include the Corresponding Source for any work covered by version 3
|
||||
of the GNU General Public License that is incorporated pursuant to the
|
||||
following paragraph.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the work with which it is combined will remain governed by version
|
||||
3 of the GNU General Public License.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU Affero General Public License from time to time. Such new versions
|
||||
will be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU Affero General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU Affero General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU Affero General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If your software can interact with users remotely through a computer
|
||||
network, you should also make sure that it provides a way for users to
|
||||
get its source. For example, if your program is a web application, its
|
||||
interface could display a "Source" link that leads users to an archive
|
||||
of the code. There are many ways you could offer source, and different
|
||||
solutions will be better for different programs; see section 13 for the
|
||||
specific requirements.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU AGPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
155
README.md
155
README.md
@@ -1,114 +1,99 @@
|
||||
# Kimai v2 - Time Tracking
|
||||
<p align="center">
|
||||
<img src="https://raw.githubusercontent.com/kimai/images/main/repository-header.png" alt="Kimai logo">
|
||||
</p>
|
||||
|
||||
Kimai v2 - the reloaded open source Time-Tracking application.
|
||||
<p align="center">
|
||||
<a href="https://github.com/kimai/kimai/actions"><img alt="CI Status" src="https://github.com/kimai/kimai/workflows/CI/badge.svg"></a>
|
||||
<a href="https://codecov.io/gh/kimai/kimai"><img alt="Code Coverage" src="https://codecov.io/gh/kimai/kimai/branch/main/graph/badge.svg"></a>
|
||||
<a href="https://packagist.org/packages/kimai/kimai"><img alt="Latest stable version" src="https://poser.pugx.org/kimai/kimai/v/stable"></a>
|
||||
<a href="https://www.gnu.org/licenses/agpl-3.0.en.html"><img alt="License" src="https://poser.pugx.org/kimai/kimai/license"></a>
|
||||
<a href="https://phpc.social/@kimai" rel="me"><img alt="Mastodon" src="https://img.shields.io/badge/toot-%40kimai-8c8dff"></a>
|
||||
</p>
|
||||
|
||||
[](https://travis-ci.org/kevinpapst/kimai2)
|
||||
<h1 align="center">Kimai - time-tracker</h1>
|
||||
|
||||
## Introduction
|
||||
Kimai is a professional grade time-tracking application, free and open-source.
|
||||
It handles use-cases of freelancers as well as companies with dozens or hundreds of users.
|
||||
Kimai was build to track your project times and ships with many advanced features, including but not limited to:
|
||||
|
||||
This is (or will be in the future, currently a lot of features are still missing) the reloaded version of the open source time-tracking application [Kimai](http://www.kimai.org).
|
||||
JSON API, invoicing, data exports, multi-timer and punch-in punch-out mode, tagging, multi-user - multi-timezones - multi-language ([over 30 translations existing](https://hosted.weblate.org/projects/kimai/)!),
|
||||
authentication via SAML/LDAP/Database, two-factor authentication (2FA) with TOTP, customizable role and team permissions, responsive design,
|
||||
user/customer/project specific rates, advanced search & filtering, money and time budgets, advanced reporting, support for [plugins](https://www.kimai.org/store/)
|
||||
and so much more.
|
||||
|
||||
It is based on the following PHP components:
|
||||
- [Symfony Framework 3.4](https://github.com/symfony/symfony)
|
||||
- [AdminThemeBundle](https://github.com/avanzu/AdminThemeBundle/) (based on [AdminLTE](https://github.com/almasaeed2010/AdminLTE/))
|
||||
- [Doctrine](https://github.com/doctrine/)
|
||||
- Bower
|
||||
### Versions
|
||||
|
||||
## Requirements
|
||||
There are two versions of Kimai existing:
|
||||
|
||||
- PHP 7 or higher
|
||||
- One PHP extension of PDO-SQLite and/or PDO-MySQL enabled
|
||||
- and the [usual Symfony application requirements](http://symfony.com/doc/current/reference/requirements.html)
|
||||
- [Version 1](https://github.com/kimai/kimai/tree/1.x) — compatible with PHP 7.4, which is in maintenance mode since 2023
|
||||
- [Version 2](https://github.com/kimai/kimai) — stable and "almost released" (waiting for some major plugins, which are not yet migrated)
|
||||
|
||||
If unsure about meeting these requirements, download the demo application and
|
||||
browse to the <http://localhost:8000/config.php> script to get more detailed information.
|
||||
### Links
|
||||
|
||||
- [Home](https://www.kimai.org) — Kimai project homepage
|
||||
- [Blog](https://www.kimai.org/blog/) — Read the latest news
|
||||
- [Documentation](https://www.kimai.org/documentation/) — Learn how to use Kimai
|
||||
|
||||
### Requirements
|
||||
|
||||
- PHP 8.1 minimum
|
||||
- MariaDB or MySQL
|
||||
- A webserver and subdomain (subdirectory is not supported)
|
||||
- PHP extensions: `gd`, `intl`, `json`, `mbstring`, `pdo`, `tokenizer`, `xml`, `xsl`, `zip`
|
||||
|
||||
## Installation
|
||||
|
||||
First, install Git and [Composer](https://getcomposer.org/doc/00-intro.md)
|
||||
if you haven't already. Then, clone this repo and execute this command in the cloned directory:
|
||||
- [Recommended setup](https://www.kimai.org/documentation/installation.html#recommended-setup) — with Git and Composer
|
||||
- [Docker](https://hub.docker.com/r/kimai/kimai2) — containerized by [@tobybatch](https://github.com/tobybatch/kimai2)
|
||||
|
||||
```bash
|
||||
$ git clone https://github.com/kevinpapst/kimai2.git
|
||||
$ cd kimai2/
|
||||
```
|
||||
There are also documentations for:
|
||||
- [developer setups](https://www.kimai.org/documentation/developers.html) — on your local machine
|
||||
- [shared hostings](https://www.kimai.org/documentation/installation.html#shared-hosting) — the least favorable option
|
||||
- [Synology](https://www.kimai.org/documentation/synology.html) — you could try to host the Docker version instead
|
||||
- [1-click installer](https://www.kimai.org/documentation/installation.html#hosting-and-1-click-installations) — hosted environments
|
||||
|
||||
Lets prepare the environment by installing all dependencies. You will be asked for your application parameter,
|
||||
like the database connection afterwards (if you don't have a [app/config/parameters.yml](blob/master/app/config/parameters.yml.dist) yet):
|
||||
And if you don't want to host Kimai, you can use [the Cloud version](https://www.kimai.cloud/) of it.
|
||||
|
||||
```bash
|
||||
$ composer install
|
||||
```
|
||||
### Updating Kimai
|
||||
|
||||
The next command will create the database, the schema and install all web assets:
|
||||
```bash
|
||||
$ bin/console kimai:install --relative
|
||||
```
|
||||
- [Update Kimai](https://www.kimai.org/documentation/updates.html) — get the latest version
|
||||
- [UPGRADING guide](UPGRADING.md) — version specific steps
|
||||
|
||||
### Installation (live)
|
||||
### Plugins
|
||||
|
||||
All thats left to do is to create your first user:
|
||||
- [Plugin marketplace](https://www.kimai.org/store/) — find existing plugins here
|
||||
- [Developer documentation](https://www.kimai.org/documentation/developers.html) — how to create a plugin
|
||||
|
||||
```bash
|
||||
$ bin/console kimai:create-user admin admin@example.com password en ROLE_SUPER_ADMIN
|
||||
```
|
||||
## Roadmap and releases
|
||||
|
||||
For available roles, please refer to [the user documentation](app/Resources/docs/users.md).
|
||||
You can see a rough development roadmap in the [Milestones](https://github.com/kimai/kimai/milestones) sections.
|
||||
It is open for changes and input from the community, your [ideas and questions](https://github.com/kimai/kimai/issues) are welcome.
|
||||
|
||||
### Installation (development / demo)
|
||||
Release versions will be created on a regular basis, every couple of weeks latest.
|
||||
Every code change, whether it's a new feature or a bugfix, will be done on the `main` branch.
|
||||
|
||||
Lets boostrap your environment by executing this commands (which is only available in dev environment):
|
||||
```bash
|
||||
$ bin/console kimai:dev:reset
|
||||
```
|
||||
For the time being and until 2.0 is widely adopted, the [1.x branch](https://github.com/kimai/kimai/tree/1.x) will receive bug fixes.
|
||||
|
||||
You just imported demo data, to test the application in its full beauty and with several different user accounts and permission sets.
|
||||
## Contributing
|
||||
|
||||
You can now login with these accounts:
|
||||
You want to contribute to this repository? This is so great!
|
||||
The best way to start is to [open a new issue](https://github.com/kimai/kimai/issues) for bugs or feature requests or a [discussion](https://github.com/kimai/kimai/discussions) for questions, support and such.
|
||||
|
||||
| Username | Password | Role |
|
||||
|---|:---:|---|
|
||||
| clara_customer | kitten | Customer |
|
||||
| john_user | kitten | User |
|
||||
| chris_user | kitten | User (deactivated) |
|
||||
| tony_teamlead | kitten | Teamlead |
|
||||
| anna_admin | kitten | Administrator |
|
||||
| susan_super | kitten | Super-Administrator |
|
||||
In case you want to contribute, but you wouldn't know how, here are some suggestions:
|
||||
|
||||
Demo data can always be deleted by dropping the schema and re-creating it.
|
||||
ATTENTION - this will erase all your data:
|
||||
- Spread the word: More user means more people testing and contributing to Kimai, which in turn means better stability and more and better features. Please vote for Kimai on any software platform, you can toot or tweet about it, share it on LinkedIn, Reddit or any of your favorite social media platforms. Every bit helps!
|
||||
- Answer questions: You know the answer to another user's problem? Share your knowledge.
|
||||
- Something can be done better? An essential feature is missing? Create a feature request.
|
||||
- Report bugs makes Kimai better for everyone.
|
||||
- You don't have to be programmer, the documentation and translation could always use some attention.
|
||||
- Sponsor the project: free software costs money to create!
|
||||
|
||||
```bash
|
||||
$ bin/console doctrine:schema:drop --force
|
||||
$ bin/console doctrine:schema:create
|
||||
```
|
||||
There is one simple rule in our "Code of conduct": Don't be an ass!
|
||||
|
||||
The `kimai:dev:reset` command can always be executed later on to reset your dev database and cache. I use it very frequently.
|
||||
### Credits
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
There is no need to configure a virtual host in your web server to access the application for testing.
|
||||
Just use the built-in web server for your first tests:
|
||||
|
||||
```bash
|
||||
$ APP_FRONT_CONTROLLER=app.php bin/console server:run
|
||||
```
|
||||
|
||||
This command will start a web server for Kimai. Now you can access the application in your browser at <http://127.0.0.1:8000/>.
|
||||
You can stop the built-in web server by pressing `Ctrl + C` while you're in the terminal.
|
||||
|
||||
> **NOTE**
|
||||
>
|
||||
> If you want to use a fully-featured web server (like Nginx or Apache) to run
|
||||
> Kimai, configure it to point at the `web/` directory of the project.
|
||||
> For more details, see:
|
||||
> http://symfony.com/doc/current/cookbook/configuration/web_server_configuration.html
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
Cannot see any assets (like images) and/or missing styles? Try executing:
|
||||
```bash
|
||||
$ php bin/console assets:install --symlink
|
||||
```
|
||||
Kimai is based on modern technologies and frameworks such as [PHP](https://www.php.net/),
|
||||
[Symfony](https://github.com/symfony/symfony) and [Doctrine](https://github.com/doctrine/),
|
||||
[Bootstrap](https://github.com/twbs/bootstrap) and [Tabler](https://tabler.io/),
|
||||
and [countless](composer.json) [others](package.json).
|
||||
|
||||
|
||||
24
SECURITY.md
Normal file
24
SECURITY.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# Security Policy
|
||||
|
||||
## Supported Versions
|
||||
|
||||
As announced in the [README](README.md) I only support the latest available release and `main` branch.
|
||||
|
||||
| Version | Supported |
|
||||
|----------------------|--------------------|
|
||||
| main branch | :white_check_mark: |
|
||||
| latest minor release | :white_check_mark: |
|
||||
| older releases | :x: |
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
Please read the [Bughunter](https://www.kimai.org/documentation/bughunter.html) documentation before posting.
|
||||
You can report any security related vulnerability in the [advisory section at GitHub](https://github.com/kimai/kimai/security/advisories) or via email to kpapst@gmx.net.
|
||||
|
||||
I will work as fast as I can to fix the problem and publish a bugfix release / security update.
|
||||
Depending on the size of the required fixes, this might take a couple of hours or a couple of days.
|
||||
|
||||
You can expect that your message will be answered ASAP.
|
||||
|
||||
You will be mentioned in the release notes if your issue is valid.
|
||||
I am grateful for any (discrete) disclosure of vulnerabilities!
|
||||
399
UPGRADING.md
Normal file
399
UPGRADING.md
Normal file
@@ -0,0 +1,399 @@
|
||||
# Upgrading Kimai
|
||||
|
||||
_Make sure to create a backup before you start!_
|
||||
|
||||
Read the [updates documentation](https://www.kimai.org/documentation/updates.html) to find out how
|
||||
you can upgrade your Kimai installation to the latest stable release.
|
||||
|
||||
Check below if there are more version specific steps required, which need to be executed after the normal update process.
|
||||
Perform EACH version specific task between your version and the new one, otherwise you risk data inconsistency or a broken installation.
|
||||
|
||||
## [2.0](https://github.com/kimai/kimai/releases/tag/2.0)
|
||||
|
||||
**!! This release requires minimum PHP version to 8.1 !!**
|
||||
|
||||
Developer read the full documentation at [https://www.kimai.org/documentation/migration-v2.html](https://www.kimai.org/documentation/migration-v2.html).
|
||||
|
||||
- **All plugins need to be updated**: delete all previous version from your installation (`rm -r var/plugins/*`) before updating!
|
||||
- Invoice renderer and templates for XML, JSON and TEXT were moved to the [Extended invoicing plugin](https://www.kimai.org/store/invoice-bundle.html) (install if you use one of those)
|
||||
- Moved `company.docx` to [external repo](https://github.com/kimai/invoice-templates/tree/main/docx-company) (needs to be re-uploaded if you want to keep on using it!)
|
||||
- Role names are forced to be uppercase
|
||||
- Removed unused `public/avatars/` directory
|
||||
- `local.yaml` is not compatible with old version, remove it before the update and then re-create it after everything works
|
||||
- dashboard default config
|
||||
- removed: theme.branding.translation
|
||||
- removed: kimai.plugin_dir
|
||||
- Time-tracking mode `duration_only` was removed, existing installations will be switched to `duration_fixed_begin`
|
||||
- Removed Twig filters. You might have to replace them in your custom export/invoice templates:
|
||||
- `date_full` => `date_time`
|
||||
- `duration_decimal` => `duration(true)`
|
||||
- `currency` => `currency_name`
|
||||
- `country` => `country_name`
|
||||
- `language` => `language_name`
|
||||
- Removed support for custom translation files (use [TranslationBundle](https://www.kimai.org/store/translation-bundle.html) instead or write your own plugin)
|
||||
- Removed all 3rd party mailer packages, you need to install them manually (ONLY if you used a short syntax to configure the `MAILER_URL` in `.env`):
|
||||
- `composer require symfony/amazon-mailer`
|
||||
- `composer require symfony/google-mailer`
|
||||
- `composer require symfony/mailchimp-mailer`
|
||||
- `composer require symfony/mailgun-mailer`
|
||||
- `composer require symfony/postmark-mailer`
|
||||
- `composer require symfony/sendgrid-mailer`
|
||||
|
||||
## [1.16](https://github.com/kimai/kimai/releases/tag/1.16)
|
||||
|
||||
If you are using MariaDB, it must be at least version 10.1, older versions are not supported any longer.
|
||||
|
||||
**DEVELOPER**
|
||||
|
||||
- Removed `formDateTime` field from API model `I18nConfig`
|
||||
- Upgraded to Doctrine DBAL 3, see [docs](https://github.com/doctrine/dbal/blob/3.1.x/UPGRADE.md) - you might have to update your bundle
|
||||
|
||||
## [1.15](https://github.com/kimai/kimai/releases/tag/1.15)
|
||||
|
||||
**Many database changes: don't forget to [run the updater](https://www.kimai.org/documentation/updates.html).**
|
||||
|
||||
Updating the database might take quite a while, depending on the amount of timesheet entries and speed of your database server (~1 minute per 100k records).
|
||||
|
||||
**ATTENTION**
|
||||
|
||||
- This release bumps the minimum required [PHP version to 7.3](https://www.kimai.org/blog/2021/php8-support-php72-dropped/)
|
||||
- Self-registration is disabled by default
|
||||
- Self-registration now always requires email confirmation
|
||||
- All plugins that use own databases need to be updated as well
|
||||
- Removed the YearChart widget and the related configs named `userRecapThisYear`, `userRecapLastYear`, `userRecapTwoYears`, `userRecapThreeYears`
|
||||
|
||||
**LDAP & SAML**
|
||||
|
||||
Please verify your config with the [LDAP](https://www.kimai.org/documentation/ldap.html) and [SAML](https://www.kimai.org/documentation/saml.html) documentation, especially:
|
||||
|
||||
- SAML users: activate it by setting the `kimai.saml.activate: true` config key
|
||||
- LDAP users: activate it by setting the `kimai.ldap.activate: true` config key
|
||||
- LDAP and SAML users need to remove the complete `security` section from their `local.yaml`
|
||||
|
||||
**DEVELOPER**
|
||||
|
||||
PHP 8 compatibility forced to upgrade MANY libraries, including but not limited to:
|
||||
|
||||
- Removed FOSUserBundle and hslavich/oneloginsaml
|
||||
- Doctrine Migrations, whose new major version forces plugin updates
|
||||
- Gedmo v3 (which include BC breaks in definitions)
|
||||
- Doctrine DBAL and others, which required PHP 7.3 as well
|
||||
|
||||
**API BC break**: Due to team structure changes, it was impossible to keep the (writing) API structure. Please adjust your code accordingly!
|
||||
|
||||
## [1.14](https://github.com/kimai/kimai/releases/tag/1.14)
|
||||
|
||||
**CRITICAL BC break**: SQLite support was removed. If you are using SQLite, you have to [read this blog post](https://www.kimai.org/blog/2021/sqlite-and-ftp-support-removed/) and migrate to MySQL/MariaDB first!
|
||||
|
||||
**New database tables and fields: don't forget to [run the updater](https://www.kimai.org/documentation/updates.html).**
|
||||
|
||||
Permission changes:
|
||||
- `history_invoice` - removed permission entirely
|
||||
|
||||
## [1.13](https://github.com/kimai/kimai/releases/tag/1.13)
|
||||
|
||||
- Deprecated `now` variable in export templates: create it yourself with `{% set now = create_date('now', app.user) %}`
|
||||
- Changed invoice filename generation (check if you use cronjob for invoices)
|
||||
- **BC break**: duration entered as plain numbers will now be treated as decimal duration in hours instead of seconds
|
||||
|
||||
## [1.12](https://github.com/kimai/kimai/releases/tag/1.12)
|
||||
|
||||
- Export templates can now include items from plugins (eg. Expenses).
|
||||
|
||||
## [1.10](https://github.com/kimai/kimai/releases/tag/1.10)
|
||||
|
||||
**New database tables and fields were created, don't forget to [run the updater](https://www.kimai.org/documentation/updates.html).**
|
||||
|
||||
- Invoice renderer `CSV` was removed
|
||||
- Sessions are now stored in the database (all users have to re-login after upgrade)
|
||||
- New permissions: `lockdown_grace_timesheet`, `lockdown_override_timesheet`, `view_all_data`
|
||||
- Fixed team permissions on user queries: depending on your previous team & permission setup your users might see less data (SUPER_ADMINS see all data, but new: ADMINS only see all data if they own the `view_all_data` permission)
|
||||
- Markdown does not support headings anymore, text like `# foo` is not converted to `<h1 id="foo">foo</h1>` anymore
|
||||
|
||||
### Developer
|
||||
|
||||
- **BC break**: removed registration of `.env` with `putenv()` - do not rely on `getenv()` as it is not thread-safe
|
||||
- **BC break**: interface method signature `HtmlToPdfConverter::convertToPdf()` changed
|
||||
- **BC break**: the macros `badge` and `label` do not apply the `|trans` filter any more
|
||||
- **BC Break**: removed `getVisible()` (deprecated since 1.4) method on Customer, Project and Activity (use `isVisible()` instead, templates are still working)
|
||||
- **BC Break**: API changes
|
||||
- some representation names changed (eg. from `ActivityMetaField` to `ActivityMeta`, `TimesheetSubCollection` vs `TimesheetCollectionExpanded`), you could use `class_alias()` if you use auto-generated code from Swagger-Gen or alike
|
||||
- new result types were introduced
|
||||
- result data changed in some areas to smooth out inconsistencies (eg. TeamEntity fields changed in nested results)
|
||||
|
||||
## [1.9](https://github.com/kimai/kimai/releases/tag/1.9)
|
||||
|
||||
**New database tables and fields were created, don't forget to [run the updater](https://www.kimai.org/documentation/updates.html).**
|
||||
|
||||
- The directory `var/data/invoices/` will be used to store archived invoice files (check file permissions)
|
||||
- The default invoice number format changed. If you want to use the old one: configure `{date}` as format - see [invoice documentation](https://www.kimai.org/documentation/invoices.html)
|
||||
- HTML invoice templates are now treated like other files and offered as download. If you are using relative URLs for including assets (CSS, images) you need to either inline them (see the default templates) or use absolute URLs
|
||||
- Invoice templates that use the templates variables `${activity.X}` or `${project.X}` should be checked and possibly adapted, as multi-select is now possible for filtering
|
||||
- Invoice templates have access to all meta-fields as variables, not only the ones marked as visible
|
||||
- Rates configuration/structure changed for customer, project and activity
|
||||
- **Invoice templates**: rates variables were removed
|
||||
|
||||
Permission changes:
|
||||
- `history_invoice` - NEW: grants all features for the new invoice archive (by default for all admins)
|
||||
|
||||
### Developer
|
||||
|
||||
- **BC break**: `InvoiceItemInterface` has new methods `getType()` and `getCategory()`
|
||||
- **BC break**: API fields changed - see new `/rates` endpoints
|
||||
|
||||
## [1.8](https://github.com/kimai/kimai/releases/tag/1.8)
|
||||
|
||||
**New database tables and fields were created, don't forget to [run the updater](https://www.kimai.org/documentation/updates.html).**
|
||||
|
||||
- New PHP requirement: `ext-xsl` - which should be pre-installed in most environments when `ext-xml` is loaded
|
||||
- New mailer library: check if emails are still working (eg. by using the "password forgotten" function) or if you need to adjust your configuration, [see docs at symfony.com](https://symfony.com/doc/current/components/mailer.html#transport)
|
||||
- Support for line breaks in multiline invoice fields for spreadsheets (check your invoice templates after the update)
|
||||
|
||||
Permission changes:
|
||||
|
||||
- `comments_create_customer` - NEW: permission that allows to add new comments for customers
|
||||
- `comments_create_team_customer` - NEW: permission that allows to add new comments for team members of the current customer
|
||||
- `comments_create_teamlead_customer` - NEW: permission that allows to add new comments for a teamlead of the current customer
|
||||
- `comments_create_project` - NEW: permission that allows to add new comments for project
|
||||
- `comments_create_team_project` - NEW: permission that allows to add new comments for team members of the current project
|
||||
- `comments_create_teamlead_project` - NEW: permission that allows to add new comments for a teamlead of the current project
|
||||
- `edit_teamlead_project` - removed default permission from ROLE_TEAMLEAD (if you use it: change it in the Role & Permission UI)
|
||||
- `edit_teamlead_customer` - removed default permission from ROLE_TEAMLEAD (if you use it: change it in the Role & Permission UI)
|
||||
- `upload_invoice_template` - NEW: permission that allows to upload invoice documents from the UI
|
||||
|
||||
## [1.7](https://github.com/kimai/kimai/releases/tag/1.7)
|
||||
|
||||
**New database tables and fields were created, don't forget to [run the updater](https://www.kimai.org/documentation/updates.html).**
|
||||
|
||||
New permissions:
|
||||
|
||||
- `comments_customer` - show comment list on customer detail page (new feature)
|
||||
- `details_customer` - show detail information for customers (customer number, vat, rates, meta-fields, assigned teams ...)
|
||||
- `comments_project` - show comment list on project detail page (new feature)
|
||||
- `details_project` - show detail information for projects (rates, meta-fields, assigned teams ...)
|
||||
|
||||
If you are using teams, please read on: The following list of permissions are now also available in the UI and they (can) replace the `X_project` and `X_customer` permissions.
|
||||
They are more strict, as they allow only access to team specific items, the older permissions without `_teamlead_`/`_team_` work on a global level instead.
|
||||
|
||||
- `view_teamlead_customer`, `edit_teamlead_customer`, `budget_teamlead_customer`, `permissions_teamlead_customer`, `comments_teamlead_customer`, `details_teamlead_customer` - allows access to customer data when user is teamlead of a team assigned to the customer (replaces more global permission like `view_customer` for teamleads)
|
||||
- `view_team_customer`, `edit_team_customer`, `budget_team_customer`, `comments_team_customer`, `details_team_customer` - allows access to customer data when user is member of a team assigned to the customer (replaces more global permission like `view_customer` for users)
|
||||
- `view_teamlead_project`, `edit_teamlead_project`, `budget_teamlead_project`, `permissions_teamlead_project`, `comments_teamlead_project`, `details_teamlead_project` - allows access to customer data when user is teamlead of a team assigned to the project (replaces more global permission like `view_project` for teamleads)
|
||||
- `view_team_project`, `edit_team_project`, `budget_team_project`, `comments_team_project`, `details_team_project` - allows access to customer data when user is member of a team assigned to the project (replaces more global permission like `view_project` for users)
|
||||
|
||||
### ExpenseBundle
|
||||
|
||||
**ATTENTION** due to incompatibilities in the underlying frameworks users of the ExpenseBundle need to do one more step:
|
||||
You need to delete the bundle before updating: `rm -r var/plugins/ExpenseBundle`, otherwise you will run into errors during the update.
|
||||
After the Kimai update was successful, you have to re-install the latest bundle version, which is compatible with Kimai 1.7 only.
|
||||
|
||||
### Developer
|
||||
|
||||
- Projects now have a start and end date and the API will only return those, which are either unconfigured or currently active, you might want to reload the list of projects once the user entered begin and end datetime OR use the new `ignoreDates` parameter.
|
||||
- Doctrine bundle was updated to v2, check your code for [the usage of RegistryInterface and ObjectManager](https://github.com/doctrine/DoctrineBundle/blob/master/UPGRADE-2.0.md)
|
||||
- Removed the webserver bundle and the command `server:run` - see [docs](https://www.kimai.org/documentation/developers.html)
|
||||
|
||||
## [1.6](https://github.com/kimai/kimai/releases/tag/1.6), [1.6.1](https://github.com/kimai/kimai/releases/tag/1.6.1), [1.6.2](https://github.com/kimai/kimai/releases/tag/1.6.2)
|
||||
|
||||
**New database tables and fields were created, don't forget to [run the updater](https://www.kimai.org/documentation/updates.html).**
|
||||
|
||||
- Invoice changes:
|
||||
- Moved CSV, ODS and XSLX invoice templates to [another repository](https://github.com/Keleo/kimai2-invoice-templates). Using them? Install them manually (see [invoice documentation](https://www.kimai.org/documentation/invoices.html)).
|
||||
- Added new invoice fields (VAT, contact, payment details) and customer field (VAT). Used the twig settings before? Move them to the respective invoice template settings.
|
||||
- Permissions can be managed via Admin UI. Please move your permission settings from [local.yaml to your database](https://www.kimai.org/documentation/permissions.html).
|
||||
- Important permission change: regular users with the `view_other_timesheet` permission could see all timesheets. This was a legacy from the time before team permissions were introduced. If you rely on this behavior, you need to create a team with all users and the teamlead being the user who needs access to all timesheets.
|
||||
|
||||
### Developer
|
||||
|
||||
Please add default permissions to your [plugin](https://www.kimai.org/documentation/plugins.html).
|
||||
|
||||
## [1.5](https://github.com/kimai/kimai/releases/tag/1.5)
|
||||
|
||||
[Update as usual](https://www.kimai.org/documentation/updates.html)
|
||||
|
||||
## [1.4](https://github.com/kimai/kimai/releases/tag/1.4)
|
||||
|
||||
**There is a new directory, which needs to be writable by the webserver: `public/avatars/`.**
|
||||
|
||||
New permission (used in new dashboard widget):
|
||||
- `view_team_member` - display team assignments (names, teamleads and members) for the current user
|
||||
|
||||
Activated Javascript select component by default (check mobile devices).
|
||||
|
||||
### Developer: BC breaks
|
||||
|
||||
- Dashboard widgets and rows need to define their `type` by FQCN
|
||||
- Switched to Symfony 4.3 event types, this could fail in plugins, but only if they didn't use the official constants for event names
|
||||
|
||||
## [1.3](https://github.com/kimai/kimai/releases/tag/1.3)
|
||||
|
||||
Added `manage_tag` permission for new tag features
|
||||
|
||||
### Developer: BC breaks
|
||||
|
||||
- Refactored toolbars and search, plugins needs to be checked
|
||||
- Invoices now supports multiple repositories, some method signatures had to be changed (eg. `calculateSumIdentifier()`)
|
||||
|
||||
## [1.2](https://github.com/kimai/kimai/releases/tag/1.2)
|
||||
|
||||
**If you are still using 0.7 or below, you need to upgrade to 1.1 before upgrading to this version.**
|
||||
|
||||
- Deleted timezone conversion command.
|
||||
- Minimum password length raised from 5 to 8 character (applies only for password changes and new users)
|
||||
- Maximum customer name length lowered to 150 character
|
||||
- Maximum project name length lowered to 150 character
|
||||
- Maximum activity name length lowered to 150 character
|
||||
- Added new permission: `manage_invoice_template`
|
||||
- Removed permissions: `view_invoice_template`, `create_invoice_template`, `edit_invoice_template`, `delete_invoice_template`
|
||||
- Removed permission: `view_export` (using `create_export` only)
|
||||
|
||||
### Developer: BC breaks
|
||||
|
||||
- Custom export renderer need to check for usage of `Timesheet::getEnd()` as running entries can now be exported as well
|
||||
|
||||
## [1.1](https://github.com/kimai/kimai/releases/tag/1.1)
|
||||
|
||||
[Update as usual](https://www.kimai.org/documentation/updates.html), nothing special for this release if you upgrade from 1.0 / 1.0.1.
|
||||
|
||||
## [1.0](https://github.com/kimai/kimai/releases/tag/1.0)
|
||||
|
||||
This release contains several changes, as I still have the goal to stabilize the code base to prevent
|
||||
such "challenges" after 1.0 for a while.
|
||||
|
||||
### Changes for your local.yaml
|
||||
|
||||
New permissions are available. You have to add them to your `local.yaml` ONLY if you use a custom permission structure,
|
||||
otherwise you can't use the new features:
|
||||
- `view_tag` - view all tags
|
||||
- `delete_tag` - delete tags
|
||||
- `edit_exported_timesheet` - allows to edit records which were exported
|
||||
- `role_permissions` - view calculated permissions for user roles
|
||||
- `budget_activity` - view and edit budgets for activities
|
||||
- `budget_project` - view and edit budgets for projects
|
||||
- `budget_customer` - view and edit budgets for customers
|
||||
|
||||
Removed permission:
|
||||
- `system_actions` - removed experimental feature to flush app cache from the about screen
|
||||
|
||||
### BC BREAKS
|
||||
|
||||
- API: Format for queries including a datetime object fixed to use HTML5 format (previously `2019-03-02 14:23` - now `2019-03-02T14:23:00`)
|
||||
- **Permission config**: the `permissions` definition in your `local.yaml` needs to be verified/changed, as the internal structure was highly optimized to simplify the definition.
|
||||
Thanks to the new structure, you should be able to remove almost everything from your `local.yaml` (tip: start over from scratch!). Please read [the updated permission docu](https://www.kimai.org/documentation/permissions.html).
|
||||
- default widgets were removed from `kimai.yaml`, that shouldn't cause any issues ... but if something is odd: [look here for help](https://www.kimai.org/documentation/dashboard.html)
|
||||
|
||||
## [0.9](https://github.com/kimai/kimai/releases/tag/0.9)
|
||||
|
||||
Remember to execute the necessary timezone conversion script, if you haven't updated to 0.8 before (see below)!
|
||||
|
||||
### BC BREAKS
|
||||
|
||||
This release contains some BC breaks which were necessary before 1.0 will be released (_now or never_), to prevent those BC breaks after 1.0.
|
||||
|
||||
- **Kimai requires PHP 7.2 now => [PHP 7.1 expired 4 month ago](https://www.php.net/supported-versions.php)**
|
||||
- The `.env` variable `DATABASE_PREFIX` was removed and the table prefix is now hardcoded to `kimai2_`. If you used another prefix,
|
||||
you have to rename your tables manually before starting the update process. You can delete the row `DATABASE_PREFIX` from your `.env` file.
|
||||
- API: Format for DateTime objects changed, now including timezone identifier (previously `2019-03-02 14:23` - now `2019-03-02T14:23:00+00:00`), see [#718](https://github.com/kimai/kimai/pull/718)
|
||||
- API: changed from snake_case to camelCase (affected fields: hourlyRate vs hourly_rate / fixedRate vs fixed_rate / orderNumber vs order_number / i18n config object)
|
||||
- Plugin mechanism changed: existing Plugins have to be deleted or updated
|
||||
|
||||
### Apply necessary changes to your `local.yaml`:
|
||||
|
||||
New permissions are available:
|
||||
- `system_configuration` - for accessing the new system configuration screen
|
||||
- `system_actions` - for the experimental feature to flush your cache from the about screen
|
||||
- `plugins` - for accessing the new plugins screen
|
||||
|
||||
The setting `kimai.timesheet.mode` replaces the setting `kimai.timesheet.duration_only`. If you used the duration_only mode, you need to change your config:
|
||||
```yaml
|
||||
# Before
|
||||
kimai:
|
||||
timesheet:
|
||||
duration_only: true
|
||||
|
||||
# After
|
||||
kimai:
|
||||
timesheet:
|
||||
mode: duration_only
|
||||
```
|
||||
Or switch the mode directly in the new System configuration screen within Kimai.
|
||||
|
||||
## [0.8.1](https://github.com/kimai/kimai/releases/tag/0.8.1)
|
||||
|
||||
A bug fixing release. Remember to execute the necessary timezone conversion script, if you haven't updated to 0.8 before (see below)!
|
||||
|
||||
## [0.8](https://github.com/kimai/kimai/releases/tag/0.8)
|
||||
|
||||
After you followed the normal update and database migration process (see above), you need to execute a bash command to convert your timesheet data for timezone support:
|
||||
|
||||
- Read this [pull request](https://github.com/kimai/kimai/pull/372) BEFORE you follow the instructions to convert the
|
||||
timezones in your existing time records with `bin/console kimai:convert-timezone`. Without that, you will end up with wrong times in your database.
|
||||
|
||||
### Apply necessary changes to your `local.yaml`:
|
||||
|
||||
- A new boolean setting `kimai.timesheet.rules.allow_future_times` was introduced
|
||||
- New permissions are available:
|
||||
- `view_export` - for the new export feature
|
||||
- `create_export` - for the new export feature
|
||||
- `edit_export_own_timesheet` - for the new export feature
|
||||
- `edit_export_other_timesheet` - for the new export feature
|
||||
- `system_information` - to see the new about screen
|
||||
|
||||
## [0.7](https://github.com/kimai/kimai/releases/tag/0.7)
|
||||
|
||||
The configuration `kimai.theme.active_warning` was deprecated and should be replaced in your local.yaml,
|
||||
[read config docs for more information](https://www.kimai.org/documentation/timesheet.html#limit-active-entries).
|
||||
|
||||
## [0.6.1](https://github.com/kimai/kimai/releases/tag/0.6.1)
|
||||
|
||||
A bugfix release to address database compatibility issues with older MySQL/MariaDB versions.
|
||||
|
||||
## [0.6](https://github.com/kimai/kimai/releases/tag/0.6)
|
||||
|
||||
The API has some minor BC breaks: some fields were renamed and entities have a larger attribute set than collections.
|
||||
Be aware that the API is still is development mode and shouldn't be considered stable for now.
|
||||
|
||||
## [0.5](https://github.com/kimai/kimai/releases/tag/0.5)
|
||||
|
||||
Some configuration nodes were removed, if you have one of them in your `local.yaml` you need to delete them before you start the update:
|
||||
- `kimai.invoice.calculator`
|
||||
- `kimai.invoice.renderer`
|
||||
- `kimai.invoice.number_generator`
|
||||
|
||||
The new config `kimai.invoice.documents` was introduced, holding a list of directories ([read more](https://www.kimai.org/documentation/invoices.html)).
|
||||
|
||||
**BC break:** InvoiceTemplate name was changed from 255 characters to 60. If you used longer invoice-template names, they will be truncated when upgrading the database.
|
||||
Please make sure that they are unique in the first 60 character before you upgrade your database with `doctrine:migrations:migrate`.
|
||||
|
||||
## [0.4](https://github.com/kimai/kimai/releases/tag/0.4)
|
||||
|
||||
In the time between 0.3 and 0.4 there was a release of composer that introduced a BC break,
|
||||
which leads to problems between Composer and Symfony Flex, resulting in an error like this when running it:
|
||||
|
||||
```
|
||||
[ErrorException]
|
||||
Declaration of Symfony\Flex\ParallelDownloader::getRemoteContents($originUrl, $fileUrl, $context) should be compatible with Composer\Util\RemoteFilesystem::getRemoteContents($originUrl, $fileUrl, $context, ?array &$responseHeaders = NULL)
|
||||
```
|
||||
|
||||
This can be fixed by updating Composer and Flex before executing the Kimai update:
|
||||
```
|
||||
sudo composer self-update
|
||||
sudo -u www-data composer update symfony/flex --no-plugins --no-scripts
|
||||
```
|
||||
|
||||
## [0.3](https://github.com/kimai/kimai/releases/tag/0.3)
|
||||
|
||||
You need to adjust your `.env` file and add your `from` address for [all emails](https://www.kimai.org/documentation/emails.html) generated by Kimai 2:
|
||||
```
|
||||
MAILER_FROM=kimai@example.com
|
||||
```
|
||||
|
||||
Create a file and database backup before executing the following steps:
|
||||
|
||||
```bash
|
||||
git pull origin master
|
||||
sudo -u www-data composer install --no-dev --optimize-autoloader
|
||||
sudo -u www-data bin/console cache:clear --env=prod
|
||||
sudo -u www-data bin/console cache:warmup --env=prod
|
||||
bin/console doctrine:migrations:version --add 20180701120000
|
||||
bin/console doctrine:migrations:migrate
|
||||
```
|
||||
26
app.json
26
app.json
@@ -1,26 +0,0 @@
|
||||
{
|
||||
"name": "Kimai v2",
|
||||
"description": "The reloaded Kimai Time-tracking application",
|
||||
"keywords": [
|
||||
"php",
|
||||
"kimai"
|
||||
],
|
||||
"website": "https://www.kimai.org.com/",
|
||||
"repository": "https://github.com/kevinpapst/kimai2",
|
||||
"logo": "",
|
||||
"success_url": "/",
|
||||
"scripts": {
|
||||
"postdeploy": "php bin/console doctrine:schema:create && php bin/console doctrine:fixtures:load -n"
|
||||
},
|
||||
"env": {
|
||||
"SYMFONY_ENV": "prod",
|
||||
"SYMFONY_SECRET": {
|
||||
"description": "Extra entropy for %kernel.secret%; used for CSRF tokens, cookies and signed URLs.",
|
||||
"generator": "secret"
|
||||
}
|
||||
},
|
||||
"addons": [
|
||||
"heroku-postgresql"
|
||||
],
|
||||
"image": "heroku/php"
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
<IfModule mod_authz_core.c>
|
||||
Require all denied
|
||||
</IfModule>
|
||||
<IfModule !mod_authz_core.c>
|
||||
Order deny,allow
|
||||
Deny from all
|
||||
</IfModule>
|
||||
@@ -1,21 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Kimai package.
|
||||
*
|
||||
* (c) Kevin Papst <kevin@kevinpapst.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\HttpCache\HttpCache;
|
||||
|
||||
/**
|
||||
* Class AppCache
|
||||
*
|
||||
* @author Kevin Papst <kevin@kevinpapst.de>
|
||||
*/
|
||||
class AppCache extends HttpCache
|
||||
{
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Kimai package.
|
||||
*
|
||||
* (c) Kevin Papst <kevin@kevinpapst.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use Symfony\Component\HttpKernel\Kernel;
|
||||
use Symfony\Component\Config\Loader\LoaderInterface;
|
||||
|
||||
/**
|
||||
* Class AppKernel
|
||||
*
|
||||
* @author Kevin Papst <kevin@kevinpapst.de>
|
||||
*/
|
||||
class AppKernel extends Kernel
|
||||
{
|
||||
public function registerBundles()
|
||||
{
|
||||
$bundles = [
|
||||
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
|
||||
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
|
||||
new Symfony\Bundle\TwigBundle\TwigBundle(),
|
||||
new Symfony\Bundle\MonologBundle\MonologBundle(),
|
||||
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
|
||||
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
|
||||
new WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle(),
|
||||
new Avanzu\AdminThemeBundle\AvanzuAdminThemeBundle(),
|
||||
new AppBundle\AppBundle(),
|
||||
new TimesheetBundle\TimesheetBundle(),
|
||||
];
|
||||
|
||||
// Bundles only used for development or unit and functional tests
|
||||
if (in_array($this->getEnvironment(), ['dev', 'test'])) {
|
||||
//$bundles[] = new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle();
|
||||
$bundles[] = new Symfony\Bundle\AsseticBundle\AsseticBundle();
|
||||
$bundles[] = new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle();
|
||||
$bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
|
||||
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
|
||||
$bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
|
||||
$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
|
||||
$bundles[] = new Symfony\Bundle\WebServerBundle\WebServerBundle();
|
||||
}
|
||||
|
||||
return $bundles;
|
||||
}
|
||||
|
||||
public function getRootDir()
|
||||
{
|
||||
return __DIR__;
|
||||
}
|
||||
|
||||
public function getCacheDir()
|
||||
{
|
||||
return dirname(__DIR__).'/var/cache/'.$this->getEnvironment();
|
||||
}
|
||||
|
||||
public function getLogDir()
|
||||
{
|
||||
return dirname(__DIR__).'/var/logs';
|
||||
}
|
||||
|
||||
public function registerContainerConfiguration(LoaderInterface $loader)
|
||||
{
|
||||
$loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
|
||||
}
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
{# User Account: style can be found in dropdown.less #}
|
||||
{% import "AvanzuAdminThemeBundle:layout:macros.html.twig" as macro %}
|
||||
<li class="dropdown user user-menu">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
||||
{{ macro.avatar(user.avatar, user.username, 'user-image') }}
|
||||
<span class="hidden-xs">{{ user.name }}</span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<!-- User image -->
|
||||
<li class="user-header">
|
||||
{{ macro.avatar(user.avatar, user.username) }}
|
||||
<p>
|
||||
{{user.name}}
|
||||
<small>{{user.title}}</small>
|
||||
</p>
|
||||
</li>
|
||||
{#
|
||||
<!-- Menu Body -->
|
||||
<li class="user-body">
|
||||
<div class="col-xs-4 text-center">
|
||||
</div>
|
||||
<div class="col-xs-4 text-center">
|
||||
</div>
|
||||
<div class="col-xs-4 text-center">
|
||||
</div>
|
||||
</li>
|
||||
#}
|
||||
<!-- Menu Footer-->
|
||||
<li class="user-footer">
|
||||
<div class="pull-left">
|
||||
<a href="{{ path('user_profile', {'username' : user.username}) }}" class="btn btn-default btn-flat">{{ 'label.user_profile'|trans }}</a>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<a href="{{ logout_path() }}" class="btn btn-default btn-flat">{{ 'label.logout'|trans }}</a>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -1,12 +0,0 @@
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
|
||||
<link rel="stylesheet" href="{{ asset('theme/bootstrap/css/bootstrap.min.css') }}">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||
{#<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css">#}
|
||||
<link rel="stylesheet" href="{{ asset('theme/dist/css/AdminLTE.min.css') }}">
|
||||
<link rel="stylesheet" href="{{ asset("theme/dist/css/skins/" ~ avanzu_admin_context.skin|default('skin-blue-light') ~ ".min.css") }}">
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
@@ -1,28 +0,0 @@
|
||||
{#
|
||||
This template is used to render any error different from 403, 404 and 500.
|
||||
|
||||
This is the simplest way to customize error pages in Symfony applications.
|
||||
In case you need it, you can also hook into the internal exception handling
|
||||
made by Symfony. This allows you to perform advanced tasks and even recover
|
||||
your application from some errors.
|
||||
See http://symfony.com/doc/current/cookbook/controller/error_pages.html
|
||||
#}
|
||||
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body_id 'error' %}
|
||||
|
||||
{% block main %}
|
||||
<h1 class="text-danger">{{ 'http_error.name'|trans({ '%status_code%': status_code }) }}</h1>
|
||||
|
||||
<p class="lead">
|
||||
{{ 'http_error.description'|trans({ '%status_code%': status_code }) }}
|
||||
</p>
|
||||
<p>
|
||||
{{ 'http_error.suggestion'|trans({ '%url%': path('homepage') })|raw }}
|
||||
</p>
|
||||
{% endblock %}
|
||||
|
||||
{% block sidebar %}
|
||||
{{ parent() }}
|
||||
{% endblock %}
|
||||
@@ -1,28 +0,0 @@
|
||||
{#
|
||||
This template is used to render errors of type HTTP 403 (Forbidden)
|
||||
|
||||
This is the simplest way to customize error pages in Symfony applications.
|
||||
In case you need it, you can also hook into the internal exception handling
|
||||
made by Symfony. This allows you to perform advanced tasks and even recover
|
||||
your application from some errors.
|
||||
See http://symfony.com/doc/current/cookbook/controller/error_pages.html
|
||||
#}
|
||||
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body_id 'error' %}
|
||||
|
||||
{% block main %}
|
||||
<h1 class="text-danger"><i class="fa fa-unlock-alt"></i> {{ 'http_error.name'|trans({ '%status_code%': 403 }) }}</h1>
|
||||
|
||||
<p class="lead">
|
||||
{{ 'http_error_403.description'|trans }}
|
||||
</p>
|
||||
<p>
|
||||
{{ 'http_error_403.suggestion'|trans }}
|
||||
</p>
|
||||
{% endblock %}
|
||||
|
||||
{% block sidebar %}
|
||||
{{ parent() }}
|
||||
{% endblock %}
|
||||
@@ -1,28 +0,0 @@
|
||||
{#
|
||||
This template is used to render errors of type HTTP 404 (Not Found)
|
||||
|
||||
This is the simplest way to customize error pages in Symfony applications.
|
||||
In case you need it, you can also hook into the internal exception handling
|
||||
made by Symfony. This allows you to perform advanced tasks and even recover
|
||||
your application from some errors.
|
||||
See http://symfony.com/doc/current/cookbook/controller/error_pages.html
|
||||
#}
|
||||
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body_id 'error' %}
|
||||
|
||||
{% block main %}
|
||||
<h1 class="text-danger">{{ 'http_error.name'|trans({ '%status_code%': 404 }) }}</h1>
|
||||
|
||||
<p class="lead">
|
||||
{{ 'http_error_404.description'|trans }}
|
||||
</p>
|
||||
<p>
|
||||
{{ 'http_error_404.suggestion'|trans({ '%url%': path('homepage') })|raw }}
|
||||
</p>
|
||||
{% endblock %}
|
||||
|
||||
{% block sidebar %}
|
||||
{{ parent() }}
|
||||
{% endblock %}
|
||||
@@ -1,28 +0,0 @@
|
||||
{#
|
||||
This template is used to render errors of type HTTP 500 (Internal Server Error)
|
||||
|
||||
This is the simplest way to customize error pages in Symfony applications.
|
||||
In case you need it, you can also hook into the internal exception handling
|
||||
made by Symfony. This allows you to perform advanced tasks and even recover
|
||||
your application from some errors.
|
||||
See http://symfony.com/doc/current/cookbook/controller/error_pages.html
|
||||
#}
|
||||
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body_id 'error' %}
|
||||
|
||||
{% block main %}
|
||||
<h1 class="text-danger">{{ 'http_error.name'|trans({ '%status_code%': 500 }) }}</h1>
|
||||
|
||||
<p class="lead">
|
||||
{{ 'http_error_500.description'|trans }}
|
||||
</p>
|
||||
<p>
|
||||
{{ 'http_error_500.suggestion'|trans({ '%url%': path('homepage') })|raw }}
|
||||
</p>
|
||||
{% endblock %}
|
||||
|
||||
{% block sidebar %}
|
||||
{{ parent() }}
|
||||
{% endblock %}
|
||||
@@ -1,14 +0,0 @@
|
||||
# Users
|
||||
|
||||
There are multiple pre-defined roles in Kimai, which define the ACLs. A user can only inherit one role, where the roles extend each user.
|
||||
|
||||
## Roles
|
||||
|
||||
| Role name | extends | Gives permission for |
|
||||
|---|---|---|
|
||||
| ROLE_CUSTOMER | - | Currently has no permissions, but was reserved for future functionality |
|
||||
| ROLE_USER | ROLE_CUSTOMER | Time-tracking |
|
||||
| ROLE_TEAMLEAD | ROLE_USER | All of the above, plus: editing other users timesheets |
|
||||
| ROLE_ADMIN | ROLE_TEAMLEAD | All of the above, plus: editing customers, editing projects, editing activities |
|
||||
| ROLE_SUPER_ADMIN | ROLE_ADMIN | All of the above, plus: editing users |
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<file date="2016-10-19T21:46:45Z" source-language="en" target-language="de" datatype="plaintext" original="not.available">
|
||||
<body>
|
||||
|
||||
<trans-unit id="Toggle navigation">
|
||||
<source>Toggle navigation</source>
|
||||
<target>Ansicht der Seitenleiste umschalten</target>
|
||||
</trans-unit>
|
||||
|
||||
</body>
|
||||
</file>
|
||||
</xliff>
|
||||
@@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<file date="2016-10-19T21:46:45Z" source-language="en" target-language="de" datatype="plaintext" original="not.available">
|
||||
<body>
|
||||
|
||||
<trans-unit id="access.denied">
|
||||
<source>access.denied</source>
|
||||
<target>Der Zugriff wurde verweigert</target>
|
||||
</trans-unit>
|
||||
|
||||
</body>
|
||||
</file>
|
||||
</xliff>
|
||||
@@ -1,33 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<file date="2016-10-19T21:46:45Z" source-language="en" target-language="de" datatype="plaintext" original="not.available">
|
||||
<body>
|
||||
|
||||
<trans-unit id="timesheet.stop.success">
|
||||
<source>timesheet.stop.success</source>
|
||||
<target>Zeitmessung wurde gestoppt</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="timesheet.stop.error">
|
||||
<source>timesheet.stop.error</source>
|
||||
<target>Zeitmessung konnte nicht gestoppt werden: %reason%</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="timesheet.start.success">
|
||||
<source>timesheet.start.success</source>
|
||||
<target>Zeitmessung wurde gestartet</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="timesheet.start.error">
|
||||
<source>timesheet.start.error</source>
|
||||
<target>Zeitmessung konnte nicht gestartet werden: %reason%</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="action.updated_successfully">
|
||||
<source>action.updated_successfully</source>
|
||||
<target>Änderungen erfolgreich gespeichert</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="action.deleted_successfully">
|
||||
<source>action.deleted_successfully</source>
|
||||
<target>Eintrag wurde erfolgreich gelöscht</target>
|
||||
</trans-unit>
|
||||
|
||||
</body>
|
||||
</file>
|
||||
</xliff>
|
||||
@@ -1,712 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<file date="2016-10-19T21:46:45Z" source-language="en" target-language="de" datatype="plaintext" original="not.available">
|
||||
<body>
|
||||
|
||||
<!--
|
||||
Global template keys
|
||||
-->
|
||||
<trans-unit id="browser.title">
|
||||
<source>browser.title</source>
|
||||
<target>Kimai - Time Tracking</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="yes">
|
||||
<source>yes</source>
|
||||
<target>Ja</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="no">
|
||||
<source>no</source>
|
||||
<target>Nein</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="subtitle.amount">
|
||||
<source>subtitle.amount</source>
|
||||
<target> (insgesamt %count%)</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="This is a mandatory field">
|
||||
<source>This is a mandatory field</source>
|
||||
<target>Pflichtfeld</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="create">
|
||||
<source>create</source>
|
||||
<target>Erstellen</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="confirm.delete">
|
||||
<source>confirm.delete</source>
|
||||
<target>Wollen Sie das wirklich löschen?</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="confirm.delete_message">
|
||||
<source>confirm.delete_message</source>
|
||||
<target>Sie müssen das Löschen erneut bestätigen, da verknüpfte Objekte existieren welche ebenfalls mit gelöscht werden.</target>
|
||||
</trans-unit>
|
||||
|
||||
<!--
|
||||
Login / Security
|
||||
-->
|
||||
<trans-unit id="security.title.login">
|
||||
<source>security.title.login</source>
|
||||
<target>Anmelden</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="security.label.username">
|
||||
<source>security.label.username</source>
|
||||
<target>Benutzername</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="security.label.password">
|
||||
<source>security.label.password</source>
|
||||
<target>Passwort</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="security.label.password_repeat">
|
||||
<source>security.label.password_repeat</source>
|
||||
<target>Passwort wiederholen</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="security.action.sign_in">
|
||||
<source>security.action.sign_in</source>
|
||||
<target>Los geht's</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="label.logout">
|
||||
<source>label.logout</source>
|
||||
<target>Abmelden</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="label.user_profile">
|
||||
<source>label.user_profile</source>
|
||||
<target>Mein Profil</target>
|
||||
</trans-unit>
|
||||
|
||||
<!--
|
||||
Menu / Navbar items
|
||||
-->
|
||||
<trans-unit id="menu.homepage">
|
||||
<source>menu.homepage</source>
|
||||
<target>Dashboard</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="menu.admin">
|
||||
<source>menu.admin</source>
|
||||
<target>Administration</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="menu.logout">
|
||||
<source>menu.logout</source>
|
||||
<target>Abmelden</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="menu.timesheet">
|
||||
<source>menu.timesheet</source>
|
||||
<target>Zeiterfassung</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="menu.admin_timesheet">
|
||||
<source>menu.admin_timesheet</source>
|
||||
<target>Mitarbeiter Zeiten</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="menu.admin_customer">
|
||||
<source>menu.admin_customer</source>
|
||||
<target>Kunden</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="menu.admin_project">
|
||||
<source>menu.admin_project</source>
|
||||
<target>Projekte</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="menu.admin_activity">
|
||||
<source>menu.admin_activity</source>
|
||||
<target>Aktivitäten</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="menu.admin_user">
|
||||
<source>menu.admin_user</source>
|
||||
<target>Benutzer</target>
|
||||
</trans-unit>
|
||||
|
||||
<!--
|
||||
Footer
|
||||
-->
|
||||
<trans-unit id="footer.license">
|
||||
<source>footer.license</source>
|
||||
<target>Alle Rechte vorbehalten.</target>
|
||||
</trans-unit>
|
||||
|
||||
<!--
|
||||
Error templates
|
||||
-->
|
||||
<trans-unit id="http_error.name">
|
||||
<source>http_error.name</source>
|
||||
<target>Error</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="http_error.description">
|
||||
<source>http_error.description</source>
|
||||
<target>Error</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="http_error.suggestion">
|
||||
<source>http_error.suggestion</source>
|
||||
<target>Error</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="http_error_403.description">
|
||||
<source>http_error_403.description</source>
|
||||
<target>Error</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="http_error_403.suggestion">
|
||||
<source>http_error_403.suggestion</source>
|
||||
<target>Error</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="http_error_404.description">
|
||||
<source>http_error_404.description</source>
|
||||
<target>Error</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="http_error_404.suggestion">
|
||||
<source>http_error_404.suggestion</source>
|
||||
<target>Error</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="http_error_405.description">
|
||||
<source>http_error_405.description</source>
|
||||
<target>Error</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="http_error_405.suggestion">
|
||||
<source>http_error_405.suggestion</source>
|
||||
<target>Error</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="error.no_entries_found">
|
||||
<source>error.no_entries_found</source>
|
||||
<target>Keine Einträge vorhanden</target>
|
||||
</trans-unit>
|
||||
|
||||
<!--
|
||||
General labels
|
||||
-->
|
||||
<trans-unit id="label.date">
|
||||
<source>label.date</source>
|
||||
<target>Datum</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="label.starttime">
|
||||
<source>label.starttime</source>
|
||||
<target>Begin</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="label.endtime">
|
||||
<source>label.endtime</source>
|
||||
<target>Ende</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="label.duration">
|
||||
<source>label.duration</source>
|
||||
<target>Dauer</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="label.username">
|
||||
<source>label.username</source>
|
||||
<target>Benutzer</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="label.description">
|
||||
<source>label.description</source>
|
||||
<target>Beschreibung</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="label.name">
|
||||
<source>label.name</source>
|
||||
<target>Name</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="label.comment">
|
||||
<source>label.comment</source>
|
||||
<target>Kommentar</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="label.id">
|
||||
<source>label.id</source>
|
||||
<target>ID</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="label.visible">
|
||||
<source>label.visible</source>
|
||||
<target>Sichtbar</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="label.budget">
|
||||
<source>label.budget</source>
|
||||
<target>Budget</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="label.activity">
|
||||
<source>label.activity</source>
|
||||
<target>Aktivität</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="label.project">
|
||||
<source>label.project</source>
|
||||
<target>Projekt</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="label.hourly_rate">
|
||||
<source>label.hourly_rate</source>
|
||||
<target>Stundenlohn</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="label.hours">
|
||||
<source>label.hours</source>
|
||||
<target>Stunden</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="label.rate">
|
||||
<source>label.rate</source>
|
||||
<target>Lohn</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="label.language">
|
||||
<source>label.language</source>
|
||||
<target>Sprache</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="label.customer">
|
||||
<source>label.customer</source>
|
||||
<target>Kunde</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="label.email">
|
||||
<source>label.email</source>
|
||||
<target>Email</target>
|
||||
</trans-unit>
|
||||
|
||||
<!--
|
||||
Buttons & Actions
|
||||
-->
|
||||
<trans-unit id="label.actions">
|
||||
<source>label.actions</source>
|
||||
<target>Aktionen</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="action.edit">
|
||||
<source>action.edit</source>
|
||||
<target>Bearbeiten</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="action.delete">
|
||||
<source>action.delete</source>
|
||||
<target>Löschen</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="action.save">
|
||||
<source>action.save</source>
|
||||
<target>Speichern</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="action.back">
|
||||
<source>action.back</source>
|
||||
<target>Zurück</target>
|
||||
</trans-unit>
|
||||
|
||||
<!--
|
||||
Dashboard
|
||||
-->
|
||||
<trans-unit id="dashboard.title">
|
||||
<source>dashboard.title</source>
|
||||
<target>Dashboard</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="dashboard.subtitle">
|
||||
<source>dashboard.subtitle</source>
|
||||
<target>Willkommen!</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="dashboard.you">
|
||||
<source>dashboard.you</source>
|
||||
<target>Deine Statistiken</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="dashboard.all">
|
||||
<source>dashboard.all</source>
|
||||
<target>Alle Benutzer</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="dashboard.admin">
|
||||
<source>dashboard.admin</source>
|
||||
<target>Administrator</target>
|
||||
</trans-unit>
|
||||
|
||||
<!--
|
||||
Widgets
|
||||
-->
|
||||
<trans-unit id="more.info.link">
|
||||
<source>more.info.link</source>
|
||||
<target>Mehr Infos</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="badge.visible">
|
||||
<source>badge.visible</source>
|
||||
<target>Ja</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="badge.invisible">
|
||||
<source>badge.invisible</source>
|
||||
<target>Nein</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="label.toggle_dropdown">
|
||||
<source>label.toggle_dropdown</source>
|
||||
<target>Menü anzeigen</target>
|
||||
</trans-unit>
|
||||
|
||||
<!--
|
||||
Timesheet
|
||||
-->
|
||||
<trans-unit id="timesheet.title">
|
||||
<source>timesheet.title</source>
|
||||
<target>Zeiterfassung</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="timesheet.subtitle">
|
||||
<source>timesheet.subtitle</source>
|
||||
<target>Verwalten Sie Ihre Zeiteinträge</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="timesheet.edit">
|
||||
<source>timesheet.edit</source>
|
||||
<target>Eintrag bearbeiten</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="label.begin">
|
||||
<source>label.begin</source>
|
||||
<target>Von</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="label.end">
|
||||
<source>label.end</source>
|
||||
<target>Bis</target>
|
||||
</trans-unit>
|
||||
|
||||
<!--
|
||||
User profile
|
||||
-->
|
||||
<trans-unit id="profile.title">
|
||||
<source>profile.title</source>
|
||||
<target>Benutzerprofil</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="profile.subtitle">
|
||||
<source>profile.subtitle</source>
|
||||
<target>Verwalte Deine Einstellungen</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="profile.about_me">
|
||||
<source>profile.about_me</source>
|
||||
<target>Über mich</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="profile.first_entry">
|
||||
<source>profile.first_entry</source>
|
||||
<target>Arbeitet seit</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="profile.tab_monthly">
|
||||
<source>profile.tab_monthly</source>
|
||||
<target>Jahresstatistik</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="profile.settings">
|
||||
<source>profile.settings</source>
|
||||
<target>Einstellungen</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="profile.password">
|
||||
<source>profile.password</source>
|
||||
<target>Passwort</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="profile.roles">
|
||||
<source>profile.roles</source>
|
||||
<target>Rollen</target>
|
||||
</trans-unit>
|
||||
|
||||
<!--
|
||||
Admin: Timesheet
|
||||
-->
|
||||
<trans-unit id="admin_timesheet.title">
|
||||
<source>admin_timesheet.title</source>
|
||||
<target>Mitarbeiter Zeiterfassung</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="admin_timesheet.subtitle">
|
||||
<source>admin_timesheet.subtitle</source>
|
||||
<target>Zeiten aller Benutzer</target>
|
||||
</trans-unit>
|
||||
|
||||
<!--
|
||||
Admin: Projects
|
||||
-->
|
||||
<trans-unit id="admin_project.title">
|
||||
<source>admin_project.title</source>
|
||||
<target>Projekte</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="admin_project.subtitle">
|
||||
<source>admin_project.subtitle</source>
|
||||
<target>Ein Projekt fasst Tätigkeiten für jeweils einen Kunden in einer Gruppe zusammen</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="admin_project.delete_confirm">
|
||||
<source>admin_project.delete_confirm</source>
|
||||
<target>Momentan existieren für das Projekt %project% des Kunden %customer% insgesamt %activities% Aktivitäten und %records% Zeiteinträge, welche sich auf eine Gesamtdauer von %duration% belaufen. Diese Aktivitäten und Zeiteinträge werden ebenfalls mit gelöscht!</target>
|
||||
</trans-unit>
|
||||
|
||||
<!--
|
||||
Admin: Activity
|
||||
-->
|
||||
<trans-unit id="admin_activity.title">
|
||||
<source>admin_activity.title</source>
|
||||
<target>Aktivitäten</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="admin_activity.subtitle">
|
||||
<source>admin_activity.subtitle</source>
|
||||
<target>Aufgaben die zur Zeiterfassung genutzt werden können</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="admin_activity.delete_confirm">
|
||||
<source>admin_activity.delete_confirm</source>
|
||||
<target>Momentan existieren für die Aktivität %activity% im Projekt %project% für den Kunden %customer% insgesamt %records% Zeiteinträge, welche sich auf eine Gesamtdauer von %duration% belaufen. Diese Zeiteinträge werden ebenfalls mit gelöscht!</target>
|
||||
</trans-unit>
|
||||
|
||||
<!--
|
||||
Admin: Customer
|
||||
-->
|
||||
<trans-unit id="admin_customer.title">
|
||||
<source>admin_customer.title</source>
|
||||
<target>Kunden</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="admin_customer.subtitle">
|
||||
<source>admin_customer.subtitle</source>
|
||||
<target>Ihre Kunden stellen die Basis dar, auf der Sie Projekte und Tätigkeiten anlegen können</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="label.company">
|
||||
<source>label.company</source>
|
||||
<target>Unternehmensbezeichnung</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="label.vat">
|
||||
<source>label.vat</source>
|
||||
<target>Umsatzsteuer</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="label.contact">
|
||||
<source>label.contact</source>
|
||||
<target>Kontakt</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="label.address">
|
||||
<source>label.address</source>
|
||||
<target>Adresse</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="label.country">
|
||||
<source>label.country</source>
|
||||
<target>Land</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="label.phone">
|
||||
<source>label.phone</source>
|
||||
<target>Telefon</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="label.fax">
|
||||
<source>label.fax</source>
|
||||
<target>Fax</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="label.mobile">
|
||||
<source>label.mobile</source>
|
||||
<target>Handy</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="label.homepage">
|
||||
<source>label.homepage</source>
|
||||
<target>Homepage</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="label.timezone">
|
||||
<source>label.timezone</source>
|
||||
<target>Zeitzone</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="label.currency">
|
||||
<source>label.currency</source>
|
||||
<target>Währung</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="admin_customer.delete_confirm">
|
||||
<source>admin_customer.delete_confirm</source>
|
||||
<target>Momentan existieren für den Kunden %customer% insgesamt %project% Projekte mit %activity% Aktivitäten, die sich in %records% Zeiteinträgen auf eine Gesamtdauer von %duration% belaufen. Diese Projekte, Aktivitäten und Zeiteinträge werden ebenfalls mit gelöscht!</target>
|
||||
</trans-unit>
|
||||
|
||||
<!--
|
||||
Admin: User
|
||||
-->
|
||||
<trans-unit id="admin_user.title">
|
||||
<source>admin_user.title</source>
|
||||
<target>Benutzer</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="admin_user.subtitle">
|
||||
<source>admin_user.subtitle</source>
|
||||
<target>Alle registrierten Benutzer der Zeitverwaltung</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="label.alias">
|
||||
<source>label.alias</source>
|
||||
<target>Name</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="label.title">
|
||||
<source>label.title</source>
|
||||
<target>Titel</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="label.avatar">
|
||||
<source>label.avatar</source>
|
||||
<target>Profilbild</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="label.active">
|
||||
<source>label.active</source>
|
||||
<target>Aktiv</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="label.roles">
|
||||
<source>label.roles</source>
|
||||
<target>Rolle</target>
|
||||
</trans-unit>
|
||||
|
||||
<!--
|
||||
ROLES
|
||||
-->
|
||||
<trans-unit id="ROLE_SUPER_ADMIN">
|
||||
<source>ROLE_SUPER_ADMIN</source>
|
||||
<target>System-Admin</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="ROLE_ADMIN">
|
||||
<source>ROLE_ADMIN</source>
|
||||
<target>Administrator</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="ROLE_TEAMLEAD">
|
||||
<source>ROLE_TEAMLEAD</source>
|
||||
<target>Teamleiter</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="ROLE_USER">
|
||||
<source>ROLE_USER</source>
|
||||
<target>Benutzer</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="ROLE_CUSTOMER">
|
||||
<source>ROLE_CUSTOMER</source>
|
||||
<target>Kunde</target>
|
||||
</trans-unit>
|
||||
|
||||
<!--
|
||||
Statistics
|
||||
-->
|
||||
<trans-unit id="stats.durationThisMonth">
|
||||
<source>stats.durationThisMonth</source>
|
||||
<target>Arbeitszeit diesen Monat</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="stats.amountThisMonth">
|
||||
<source>stats.amountThisMonth</source>
|
||||
<target>Umsatz diesen Monat</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="stats.durationTotal">
|
||||
<source>stats.durationTotal</source>
|
||||
<target>Arbeitszeit total</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="stats.amountTotal">
|
||||
<source>stats.amountTotal</source>
|
||||
<target>Umsatz total</target>
|
||||
</trans-unit>
|
||||
|
||||
<!--
|
||||
Dashboard
|
||||
-->
|
||||
<trans-unit id="stats.userTotal">
|
||||
<source>stats.userTotal</source>
|
||||
<target>Anzahl Benutzer</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="stats.userActiveThisMoth">
|
||||
<source>stats.userActiveThisMoth</source>
|
||||
<target>Aktive Benutzer diesen Monat</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="stats.userActiveEver">
|
||||
<source>stats.userActiveEver</source>
|
||||
<target>Aktive Benutzer jemals</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="stats.activeRecordings">
|
||||
<source>stats.activeRecordings</source>
|
||||
<target>Momentan aktive Zeitmessungen</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="stats.activitiesTotal">
|
||||
<source>stats.activitiesTotal</source>
|
||||
<target>Anzahl Aktivitäten</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="stats.projectsTotal">
|
||||
<source>stats.projectsTotal</source>
|
||||
<target>Anzahl Projekte</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="stats.customerTotal">
|
||||
<source>stats.customerTotal</source>
|
||||
<target>Anzahl Kunden</target>
|
||||
</trans-unit>
|
||||
|
||||
<!--
|
||||
Month names
|
||||
-->
|
||||
<trans-unit id="month.1">
|
||||
<source>month.1</source>
|
||||
<target>Januar</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="month.2">
|
||||
<source>month.2</source>
|
||||
<target>Februar</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="month.3">
|
||||
<source>month.3</source>
|
||||
<target>März</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="month.4">
|
||||
<source>month.4</source>
|
||||
<target>April</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="month.5">
|
||||
<source>month.5</source>
|
||||
<target>Mai</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="month.6">
|
||||
<source>month.6</source>
|
||||
<target>Juni</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="month.7">
|
||||
<source>month.7</source>
|
||||
<target>Juli</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="month.8">
|
||||
<source>month.8</source>
|
||||
<target>August</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="month.9">
|
||||
<source>month.9</source>
|
||||
<target>September</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="month.10">
|
||||
<source>month.10</source>
|
||||
<target>Oktober</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="month.11">
|
||||
<source>month.11</source>
|
||||
<target>November</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="month.12">
|
||||
<source>month.12</source>
|
||||
<target>Dezember</target>
|
||||
</trans-unit>
|
||||
|
||||
<!--
|
||||
Navbar - recent entries and activities
|
||||
-->
|
||||
<trans-unit id="active.entries">
|
||||
<source>active.entries</source>
|
||||
<target>Sie haben %count% aktiven Eintrag|Sie haben %count% aktive Einträge</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="timesheet.all">
|
||||
<source>timesheet.all</source>
|
||||
<target>Alle Einträge anzeigen</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="recent.activities">
|
||||
<source>recent.activities</source>
|
||||
<target>Ihr %count% zuletzt bearbeitete Aktivität|Eine ihrer %count% letzten Aktivitäten neustarten</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="recent.activities.format">
|
||||
<source>recent.activities.format</source>
|
||||
<target>%activity% in %project% für %customer%</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="timesheet.start">
|
||||
<source>timesheet.start</source>
|
||||
<target>Neue Zeitmessung starten</target>
|
||||
</trans-unit>
|
||||
|
||||
<!--
|
||||
TOOLBARS
|
||||
-->
|
||||
<trans-unit id="label.pageSize">
|
||||
<source>label.pageSize</source>
|
||||
<target>Anzahl Einträge</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="label.entryState">
|
||||
<source>label.entryState</source>
|
||||
<target>Zeiten</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="entryState.all">
|
||||
<source>entryState.all</source>
|
||||
<target>Alle</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="entryState.running">
|
||||
<source>entryState.running</source>
|
||||
<target>Laufende</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="entryState.stopped">
|
||||
<source>entryState.stopped</source>
|
||||
<target>Beendete</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="0">
|
||||
<source>0</source>
|
||||
<target>0</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="10">
|
||||
<source>10</source>
|
||||
<target>10</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="25">
|
||||
<source>25</source>
|
||||
<target>25</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="50">
|
||||
<source>50</source>
|
||||
<target>50</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="75">
|
||||
<source>75</source>
|
||||
<target>75</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="100">
|
||||
<source>100</source>
|
||||
<target>100</target>
|
||||
</trans-unit>
|
||||
|
||||
</body>
|
||||
</file>
|
||||
</xliff>
|
||||
@@ -1,17 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<file date="2016-10-19T21:46:45Z" source-language="en" target-language="de" datatype="plaintext" original="not.available">
|
||||
<body>
|
||||
|
||||
<trans-unit id="previous">
|
||||
<source>previous</source>
|
||||
<target>Vorherige</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="next">
|
||||
<source>next</source>
|
||||
<target>Nächste</target>
|
||||
</trans-unit>
|
||||
|
||||
</body>
|
||||
</file>
|
||||
</xliff>
|
||||
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<file source-language="en" target-language="de" datatype="plaintext" original="not.available">
|
||||
<body>
|
||||
<trans-unit id="This value is not a valid role.">
|
||||
<source>This value is not a valid role.</source>
|
||||
<target>Dieser Wert ist keine gültige Rolle.</target>
|
||||
</trans-unit>
|
||||
|
||||
</body>
|
||||
</file>
|
||||
</xliff>
|
||||
@@ -1,52 +0,0 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
{% import "macros/datatables.html.twig" as tables %}
|
||||
{% import "macros/widgets.html.twig" as widgets %}
|
||||
|
||||
{% block page_title %}{{ 'admin_user.title'|trans }}{% endblock %}
|
||||
{% block page_subtitle %}{{ 'admin_user.subtitle'|trans }} {{ 'subtitle.amount'|trans({'%count%': entries.count}) }}{% endblock %}
|
||||
{% block javascript_imports %}<script src="{{ asset('js/toolbar.js') }}"></script>{% endblock %}
|
||||
|
||||
{% block main %}
|
||||
{% if entries.count == 0 %}
|
||||
{{ widgets.callout('warning', 'error.no_entries_found') }}
|
||||
{% endif %}
|
||||
|
||||
{{ tables.data_table_header({
|
||||
'label.id': 'hidden-xs',
|
||||
'label.alias': '',
|
||||
'label.username': 'hidden-xs',
|
||||
'label.email': 'hidden-xs hidden-sm',
|
||||
'label.title': 'hidden-xs',
|
||||
'label.active': '',
|
||||
'label.roles': '',
|
||||
'label.actions': '',
|
||||
}, toolbarForm, {'plus-square': path('admin_user_create')}) }}
|
||||
|
||||
{% for entry in entries %}
|
||||
<tr>
|
||||
<td class="hidden-xs">{{ entry.id }}</td>
|
||||
<td>{{ widgets.username(entry) }}</td>
|
||||
<td class="hidden-xs">{{ entry.username }}</td>
|
||||
<td class="hidden-xs hidden-sm">{{ entry.email }}</td>
|
||||
<td class="hidden-xs">{{ entry.title }}</td>
|
||||
<td>{{ widgets.label_visible(entry.active) }}</td>
|
||||
<td>
|
||||
{% for role in entry.roles %}
|
||||
{{ widgets.label_role(role) }}
|
||||
{% endfor %}
|
||||
</td>
|
||||
<td>
|
||||
{% set actionButtons = {} %}
|
||||
{% if is_granted('edit', entry) %}
|
||||
{% set actionButtons = {'edit': path('user_profile', {'username' : entry.username})}|merge(actionButtons) %}
|
||||
{% endif %}
|
||||
{% if is_granted('delete', entry) %}
|
||||
{% set actionButtons = actionButtons|merge({'trash': '#'}) %}
|
||||
{% endif %}
|
||||
{{ widgets.button_group(actionButtons) }}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
{{ tables.data_table_footer(entries, 'admin_user_paginated') }}
|
||||
{% endblock %}
|
||||
@@ -1,12 +0,0 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block page_title %}{{ 'admin_user.title'|trans }}{% endblock %}
|
||||
{% block page_subtitle %}{{ 'admin_user.subtitle'|trans }}{% endblock %}
|
||||
|
||||
{% block main %}
|
||||
{{ include('default/_form.html.twig', {
|
||||
'title': 'create'|trans,
|
||||
'form': form,
|
||||
'back': path('admin_user')
|
||||
}) }}
|
||||
{% endblock %}
|
||||
@@ -1,100 +0,0 @@
|
||||
{% extends 'AvanzuAdminThemeBundle:layout:default-layout.html.twig' %}
|
||||
|
||||
{% block avanzu_page_content %}
|
||||
{{ include('default/_flash_messages.html.twig') }}
|
||||
{% block main %}{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
{% block avanzu_document_title %}
|
||||
{% block title %}{{ 'browser.title'|trans }}{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
{% block avanzu_page_title %}
|
||||
{% block page_title %}{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
{% block avanzu_page_subtitle %}
|
||||
{% block page_subtitle %}{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
{% block avanzu_logo_path %}
|
||||
{{ path('dashboard') }}
|
||||
{% endblock %}
|
||||
|
||||
{% block avanzu_logo_mini %}
|
||||
<b>K</b>TT
|
||||
{% endblock %}
|
||||
|
||||
{% block avanzu_logo_lg %}
|
||||
<b>Kimai</b> - Time Tracking
|
||||
{% endblock %}
|
||||
|
||||
{% block avanzu_head %}
|
||||
<link rel="stylesheet" href="{{ asset('css/kimai.css') }}">
|
||||
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
|
||||
{% endblock %}
|
||||
|
||||
{% block avanzu_footer %}
|
||||
{% block footer %}
|
||||
<footer class="main-footer">
|
||||
<div class="pull-right hidden-xs">
|
||||
<b>Version</b> 2.0
|
||||
</div>
|
||||
<strong>Copyright © {{ 'now'|date('Y') }} - <a href="http://www.kevinpapst.de">Kevin Papst</a></strong>.
|
||||
{{ 'footer.license'|trans }}
|
||||
</footer>
|
||||
<!-- Page rendered on {{ 'now'|localizeddate('long', 'long', null, 'UTC') }} -->
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
{% block avanzu_navbar_messages %}
|
||||
{% if app.user is not null and is_granted('IS_AUTHENTICATED_FULLY') %}
|
||||
{{ render(controller('TimesheetBundle:Timesheet:activeEntries')) }}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block avanzu_navbar_notifications %}
|
||||
{% if app.user is not null and is_granted('IS_AUTHENTICATED_FULLY') %}
|
||||
{{ render(controller('TimesheetBundle:Activity:recentActivities')) }}
|
||||
{% endif %}
|
||||
{#
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-globe"></i> <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu locales" role="menu">
|
||||
{% for locale in locales() %}
|
||||
<li {% if app.request.locale == locale.code %}class="active"{% endif %}><a href="{{ path(app.request.get('_route', 'homepage'), app.request.get('_route_params', [])|merge({ _locale: locale.code })) }}">{{ locale.name|capitalize }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</li>
|
||||
#}
|
||||
{% endblock %}
|
||||
|
||||
{% block avanzu_navbar_toggle %}{{ parent() }}{% endblock %}
|
||||
{% block avanzu_navbar_tasks %}{{ parent() }}{% endblock %}
|
||||
{% block avanzu_navbar_user %}{{ parent() }}{% endblock %}
|
||||
{% block avanzu_navbar_control_sidebar_toggle %}{{ parent() }}{% endblock %}
|
||||
|
||||
{% block avanzu_sidebar_user %}{# right now we simply deactivate that box #}{% endblock %}
|
||||
{% block avanzu_sidebar_search %}{# right now we simply deactivate that box #}{% endblock %}
|
||||
{% block avanzu_sidebar_nav %}{{ parent() }}{% endblock %}
|
||||
|
||||
{% block avanzu_breadcrumb %}{{ parent() }}{% endblock %}
|
||||
{% block avanzu_control_sidebar %}{{ parent() }}{% endblock %}
|
||||
|
||||
{% block avanzu_javascripts %}
|
||||
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script>
|
||||
<script src="{{ asset('theme/bootstrap/js/bootstrap.min.js') }}"></script>
|
||||
<script src="{{ asset('js/kimai.js') }}"></script>
|
||||
<script src="{{ asset('js/Chart.min.js') }}"></script>
|
||||
{% block javascript_imports %}{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
{% block avanzu_javascripts_inline %}
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
$('.dropdown-toggle').dropdown();
|
||||
$(document).kimai({imagePath: '{{ asset('images') }}', confirmDelete: '{{ 'confirm.delete'|trans }}'});
|
||||
//$(document).kimai('pauseRecord', 'li.messages-menu ul.menu li');
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -1,27 +0,0 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
{% import "macros/widgets.html.twig" as widgets %}
|
||||
|
||||
{% block page_title %}{{ 'dashboard.title'|trans }}{% endblock %}
|
||||
{% block page_subtitle %}{{ 'dashboard.subtitle'|trans }}{% endblock %}
|
||||
|
||||
{% block main %}
|
||||
|
||||
{% for settings in dashboard_widgets %}
|
||||
{% if settings.header %}
|
||||
{{ widgets.page_header(settings.header) }}
|
||||
{% endif %}
|
||||
|
||||
{% set width = settings.widgets|length %}
|
||||
{% set rawWidth = 12 / width %}
|
||||
{% set columnWidth = rawWidth|round(0, 'floor') %}
|
||||
<div class="row">
|
||||
{% for widgetTemplate in settings.widgets %}
|
||||
<div class="col-md-{{ columnWidth }} col-sm-{{ columnWidth * 2 }} col-xs-{{ columnWidth * 4 }}">
|
||||
{% set widgetString = '{% import "macros/widgets.html.twig" as widgets %}' ~ widgetTemplate %}
|
||||
{{ include(template_from_string(widgetString)) }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
{% endblock %}
|
||||
@@ -1,9 +0,0 @@
|
||||
{% import "AvanzuAdminThemeBundle:layout:macros.html.twig" as macro %}
|
||||
|
||||
{% if app.session.started and app.session.flashbag.peekAll|length > 0 %}
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
{{ macro.session_flash(avanzu_adminlte_close_alert|default(true), false, '', 'flashmessages') }}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
@@ -1,16 +0,0 @@
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{{ title }}</h3>
|
||||
</div>
|
||||
{{ form_start(form) }}
|
||||
<div class="box-body">
|
||||
{{ form_widget(form) }}
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<input type="submit" value="{{ 'action.save'|trans }}" class="btn btn-primary" />
|
||||
{% if back %}
|
||||
<a href="{{ back }}" class="btn btn-warning">{{ 'action.back'|trans }}</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{{ form_end(form) }}
|
||||
</div>
|
||||
@@ -1,20 +0,0 @@
|
||||
<div class="box box-solid box-danger">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">{{ title|default('confirm.delete'|trans) }}</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
{{ message|default('confirm.delete_message'|trans)|raw }}
|
||||
</div>
|
||||
{{ form_start(form) }}
|
||||
<div class="box-body">
|
||||
{{ form_widget(form) }}
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<input type="submit" value="{{ 'action.delete'|trans }}" class="btn btn-danger" />
|
||||
{% if back %}
|
||||
<a href="{{ back }}" class="btn btn-primary">{{ 'action.back'|trans }}</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{{ form_end(form) }}
|
||||
</div>
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
{#
|
||||
Each field type is rendered by a template fragment, which is determined
|
||||
by the name of your form type class (DateTimePickerType -> date_time_picker)
|
||||
and the suffix "_widget". This can be controlled by overriding getBlockPrefix()
|
||||
in DateTimePickerType.
|
||||
|
||||
See http://symfony.com/doc/current/cookbook/form/create_custom_field_type.html#creating-a-template-for-the-field
|
||||
#}
|
||||
|
||||
{% block date_time_picker_widget %}
|
||||
{% spaceless %}
|
||||
<div class="input-group date" data-toggle="datetimepicker">
|
||||
{{ block('datetime_widget') }}
|
||||
<span class="input-group-addon">
|
||||
<span class="fa fa-calendar"></span>
|
||||
</span>
|
||||
</div>
|
||||
{% endspaceless %}
|
||||
{% endblock %}
|
||||
@@ -1,78 +0,0 @@
|
||||
|
||||
{% macro data_table_header(entries, form, tools, toolsRight) %}
|
||||
<div class="box data_table">
|
||||
{% if form or tools or toolsRight %}
|
||||
<div class="box-header with-border">
|
||||
{% if tools %}
|
||||
<div class="btn-group tools-left">
|
||||
{% for icon,url in tools %}
|
||||
<a class="btn btn-default" href="{{ url }}"><i class="fa fa-{{ icon }}"></i></a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if form %}
|
||||
<div class="box-title toolbar">
|
||||
{{ form_start(form) }}
|
||||
{{ form_widget(form) }}
|
||||
{{ form_end(form) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if toolsRight %}
|
||||
<div class="box-tools">
|
||||
<div class="btn-group">
|
||||
{% for icon,url in tools %}
|
||||
<a class="btn btn-default" href="{{ url }}"><i class="fa fa-{{ icon }}"></i></a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="box-body no-padding">
|
||||
<div class="dataTables_wrapper form-inline dt-bootstrap">
|
||||
<div class="row">
|
||||
<div class="col-sm-6"></div>
|
||||
<div class="col-sm-6"></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<table class="table table-striped table-hover dataTable" role="grid">
|
||||
<thead>
|
||||
<tr>
|
||||
{% for title, class in entries %}
|
||||
<th{% if class %} class="{{ class }}"{% endif %}>
|
||||
{{ title|trans }}
|
||||
</th>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro data_table_footer(entries, route) %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{#<div class="row">
|
||||
<div class="col-sm-5">
|
||||
{#<div class="dataTables_info" id="example2_info" role="status" aria-live="polite">
|
||||
{{ 'datatables.entry_counter'|trans({'%from%': '1', '%to%': '10', '%total%': entries.count}) }}
|
||||
</div># }
|
||||
</div>
|
||||
<div class="col-sm-7">
|
||||
<div class="dataTables_paginate paging_simple_numbers">
|
||||
{{ pagerfanta(entries, 'twitter_bootstrap3_translated', { routeName: route }) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>#}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="navigation text-center">
|
||||
{{ pagerfanta(entries, 'twitter_bootstrap3_translated', { routeName: route }) }}
|
||||
</div>
|
||||
{% endmacro %}
|
||||
@@ -1,173 +0,0 @@
|
||||
|
||||
{% macro page_header(title) %}
|
||||
<h2 class="page-header">{{ title|trans }}</h2>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro label_visible(visible) %}
|
||||
{% import _self as macro %}
|
||||
{% if visible %}
|
||||
{{ macro.label('badge.visible', 'success') }}
|
||||
{% else %}
|
||||
{{ macro.label('badge.invisible', 'warning') }}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro label_role(role) %}
|
||||
{% import _self as macro %}
|
||||
{% if role == 'ROLE_SUPER_ADMIN' %}
|
||||
{{ macro.label(role, 'danger') }}
|
||||
{% else %}
|
||||
{{ macro.label(role, 'primary') }}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro username(user) %}
|
||||
{{ user.alias|default(user.username) }}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro label_user(user) %}
|
||||
{% import _self as macro %}
|
||||
{{ macro.label(macro.username(user), 'primary') }}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro label_activity(activity) %}
|
||||
{% import _self as macro %}
|
||||
{% if activity.visible and activity.project.visible and activity.project.customer.visible %}
|
||||
{{ macro.label(activity.name, 'primary', activity.project.customer.name ~ ': ' ~ activity.project.name) }}
|
||||
{% else %}
|
||||
{{ macro.label(activity.name, 'warning', activity.project.customer.name ~ ': ' ~ activity.project.name) }}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro label_project(project) %}
|
||||
{% import _self as macro %}
|
||||
{% if project.visible and project.customer.visible %}
|
||||
{{ macro.label(project.name, 'primary', project.customer.name) }}
|
||||
{% else %}
|
||||
{{ macro.label(project.name, 'warning', project.customer.name) }}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro label_customer(customer) %}
|
||||
{% import _self as macro %}
|
||||
{% if customer.visible %}
|
||||
{{ macro.label(customer.name, 'primary') }}
|
||||
{% else %}
|
||||
{{ macro.label(customer.name, 'warning') }}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro badge_counter(count, url) %}
|
||||
{% if url %}
|
||||
<a href="{{ url }}"><span class="badge bg-blue">{{ count }}</span></a>
|
||||
{% else %}
|
||||
<span class="badge bg-blue">{{ count }}</span>
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro label(title, type, tooltip) %}
|
||||
{# success, warning, danger, primary #}
|
||||
<span {% if tooltip %}title="{{ tooltip }}" {% endif %}class="label label-{{ type|default('success') }}">{{ title|trans }}</span>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro badge(title, color) %}
|
||||
{# black, green, blue, yellow #}
|
||||
<span class="badge bg-{{ color|default('red') }}">{{ title|trans }}</span>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro alert(type, description, title, icon) %}
|
||||
<div class="alert alert-{{ type|default('danger') }} alert-dismissible">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
{% if title %}<h4><i class="icon fa fa-{{ icon|default('ban') }}"></i> {{ title|trans }}</h4>{% endif %}
|
||||
{{ description|trans }}
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro callout(type, description, title) %}
|
||||
<div class="callout callout-{{ type|default('danger') }} lead">
|
||||
{% if title %}<h4>{{ title|trans }}</h4>{% endif %}
|
||||
<p>{{ description|trans }}</p>
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro info_box_counter(title, amount, icon, color, url) %}
|
||||
<div class="info-box">
|
||||
<span class="info-box-icon bg-{{ color|default(kimai_context.box_color) }}"><i class="fa fa-{{ icon|default('flag-o') }}"></i></span>
|
||||
|
||||
<div class="info-box-content">
|
||||
{# this is a ugly hack, make me look nicely (dashboard widget with link) #}
|
||||
{% if url %}
|
||||
<a href="{{ url }}" class="small-box-footer">
|
||||
{% endif %}
|
||||
<span class="info-box-text">{{ title|trans }}</span>
|
||||
<span class="info-box-number">{{ amount }}</span>
|
||||
{% if url %}
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro info_box_progress(title, description, amount, percentage, icon, color) %}
|
||||
<div class="info-box bg-{{ color|default(kimai_context.box_color) }}">
|
||||
<span class="info-box-icon"><i class="fa fa-{{ icon|default('thumbs-o-up') }}"></i></span>
|
||||
|
||||
<div class="info-box-content">
|
||||
<span class="info-box-text">{{ title|trans }}</span>
|
||||
<span class="info-box-number">{{ amount }}</span>
|
||||
|
||||
<div class="progress">
|
||||
<div class="progress-bar" style="width: {{ percentage }}%"></div>
|
||||
</div>
|
||||
<span class="progress-description">
|
||||
{{ description }}
|
||||
</span>
|
||||
</div>
|
||||
<!-- /.info-box-content -->
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro info_box_more(title, amount, unit, url, icon, color) %}
|
||||
<div class="small-box bg-{{ color|default(kimai_context.box_color) }}">
|
||||
<div class="inner">
|
||||
<h3>{{ amount }}<sup style="font-size: 20px">{{ unit|default('') }}</sup></h3>
|
||||
<p>{{ title|trans }}</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="fa fa-{{ icon|default('bar-chart') }}"></i>
|
||||
</div>
|
||||
<a href="{{ url }}" class="small-box-footer">
|
||||
{{ 'more.info.link'|trans }} <i class="fa fa-arrow-circle-right"></i>
|
||||
</a>
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro button_group_dropdown(title, actions) %}
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default">{{ title|trans }}</button>
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
|
||||
<span class="caret"></span>
|
||||
<span class="sr-only">{{ 'label.toggle_dropdown'|trans }}</span>
|
||||
</button>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
{% for url, entry in actions %}
|
||||
<li><a href="{{ url }}">{{ entry|trans }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro button_group(actions) %}
|
||||
{% import _self as macro %}
|
||||
<div class="btn-group">
|
||||
{% for icon, url in actions %}
|
||||
{{ macro.button_action(icon, url) }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro button_action(icon, url) %}
|
||||
<a href="{{ url }}" class="btn btn-default btn-{{ icon }}">
|
||||
<i class="fa fa-{{ icon }}"></i>
|
||||
</a>
|
||||
{% endmacro %}
|
||||
@@ -1,40 +0,0 @@
|
||||
{% extends 'AvanzuAdminThemeBundle:layout:login-layout.html.twig' %}
|
||||
|
||||
{% block avanzu_login_title %}{{ 'browser.title'|trans }}{% endblock %}
|
||||
{% block avanzu_logo_login %}<b>Kimai</b><br>TimeTracking{% endblock %}
|
||||
{% block avanzu_login_box_msg %}
|
||||
{{ 'security.title.login'|trans }}
|
||||
|
||||
{% if error|default(false) %}
|
||||
<div class="alert alert-danger">{{ error.messageKey|trans(error.messageData, 'security') }}</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% block avanzu_login_form %}
|
||||
<form action="{{ path('security_login') }}" method="post">
|
||||
<div class="form-group has-feedback">
|
||||
<input type="text" name="_username" class="form-control" placeholder="{{ 'security.label.username'|trans }}" value="{{ last_username }}">
|
||||
<span class="glyphicon glyphicon-envelope form-control-feedback"></span>
|
||||
</div>
|
||||
<div class="form-group has-feedback">
|
||||
<input name="_password" type="password" class="form-control" placeholder="{{ 'security.label.password'|trans }}">
|
||||
<span class="glyphicon glyphicon-lock form-control-feedback"></span>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-8">
|
||||
{#
|
||||
<div class="checkbox icheck">
|
||||
<label>
|
||||
<input type="checkbox"> {{ 'Remember Me'|trans({}, 'AvanzuAdminTheme') }}
|
||||
</label>
|
||||
</div>
|
||||
#}
|
||||
</div>
|
||||
<div class="col-xs-4">
|
||||
<button type="submit" class="btn btn-primary btn-block btn-flat">{{ 'security.action.sign_in'|trans }}</button>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}"/>
|
||||
</form>
|
||||
{% endblock %}
|
||||
{% block avanzu_login_social_auth %}{% endblock %}
|
||||
{% block avanzu_login_actions %}{% endblock %}
|
||||
@@ -1,254 +0,0 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block page_title %}{{ 'profile.title'|trans }}{% endblock %}
|
||||
{% block page_subtitle %}{{ 'profile.subtitle'|trans }}{% endblock %}
|
||||
|
||||
{% block main %}
|
||||
{% import _self as macro %}
|
||||
{% import "macros/widgets.html.twig" as widgets %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
{{ macro.profile_box(user, stats) }}
|
||||
{{ macro.profile_infos(user, stats) }}
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
|
||||
<div class="nav-tabs-custom">
|
||||
<ul class="nav nav-tabs">
|
||||
<li {% if tab == "charts" %}class="active"{% endif %}><a href="#charts" data-toggle="tab" aria-expanded="true">{{ 'profile.tab_monthly'|trans }}</a></li>
|
||||
{% if form %}
|
||||
<li {% if tab == "profile" %}class="active"{% endif %}><a href="#profile" data-toggle="tab" aria-expanded="false">{{ 'profile.settings'|trans }}</a></li>
|
||||
{% endif %}
|
||||
{% if form_password %}
|
||||
<li {% if tab == "password" %}class="active"{% endif %}><a href="#password" data-toggle="tab" aria-expanded="false">{{ 'profile.password'|trans }}</a></li>
|
||||
{% endif %}
|
||||
{% if form_roles %}
|
||||
<li {% if tab == "roles" %}class="active"{% endif %}><a href="#roles" data-toggle="tab" aria-expanded="false">{{ 'profile.roles'|trans }}</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane {% if tab == "charts" %}active{% endif %}" id="charts">
|
||||
{% if years is empty %}
|
||||
{{ widgets.callout('warning', 'error.no_entries_found') }}
|
||||
{% endif %}
|
||||
|
||||
<script type="text/javascript">
|
||||
var barChartOptions = {
|
||||
scaleBeginAtZero: true,
|
||||
scaleShowGridLines: true,
|
||||
scaleGridLineColor: "rgba(0,0,0,.05)",
|
||||
scaleGridLineWidth: 1,
|
||||
scaleShowHorizontalLines: true,
|
||||
scaleShowVerticalLines: true,
|
||||
barShowStroke: true,
|
||||
barStrokeWidth: 2,
|
||||
barValueSpacing: 5,
|
||||
barDatasetSpacing: 1,
|
||||
responsive: true,
|
||||
maintainAspectRatio: true,
|
||||
tooltipTemplate: "<%= value %> {{ 'label.hours'|trans }}",
|
||||
};
|
||||
var barChartLabels = [
|
||||
{% for i in 1..11 %}
|
||||
"{{ ('month.' ~i)|trans }}",
|
||||
{% endfor %}
|
||||
"{{ 'month.12'|trans }}"
|
||||
];
|
||||
</script>
|
||||
|
||||
{% for year,yearStat in years %}
|
||||
<h2>{{ year }}</h2>
|
||||
<div class="chart">
|
||||
<canvas id="barChart{{ year }}" style="height: 230px;"></canvas>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var barChartData{{ year }} = {
|
||||
labels: barChartLabels,
|
||||
datasets: [
|
||||
{
|
||||
{# label: '# hours',#}
|
||||
fillColor: "#00a65a",
|
||||
strokeColor: "#00a65a",
|
||||
pointColor: "#00a65a",
|
||||
pointStrokeColor: "#c1c7d1",
|
||||
pointHighlightFill: "#fff",
|
||||
pointHighlightStroke: "rgba(220,220,220,1)",
|
||||
data: [
|
||||
{% for i in 1..11 %}
|
||||
{{ (yearStat.month(i).totalDuration / 3600)|round }},
|
||||
{% endfor %}
|
||||
{{ (yearStat.month(12).totalDuration / 3600)|round }}
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
{% if tab == "charts" %}
|
||||
$(function () {
|
||||
var barChartCanvas{{ year }} = $("#barChart{{ year }}").get(0).getContext("2d");
|
||||
var barChart = new Chart(barChartCanvas{{ year }});
|
||||
barChart.Bar(barChartData{{ year }}, barChartOptions);
|
||||
});
|
||||
{% endif %}
|
||||
$('a[href="#charts"]').on('shown.bs.tab', function(e){
|
||||
var barChartCanvas{{ year }} = $("#barChart{{ year }}").get(0).getContext("2d");
|
||||
var barChart = new Chart(barChartCanvas{{ year }});
|
||||
barChart.Bar(barChartData{{ year }}, barChartOptions);
|
||||
});
|
||||
</script>
|
||||
{% endfor %}
|
||||
|
||||
</div>
|
||||
{% if form %}
|
||||
<div class="tab-pane {% if tab == "profile" %}active{% endif %}" id="profile">
|
||||
{{ form_start(form) }}
|
||||
{{ form_widget(form) }}
|
||||
<input type="submit" value="{{ 'action.save'|trans }}" class="btn btn-primary" />
|
||||
{{ form_end(form) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if form_password %}
|
||||
<div class="tab-pane {% if tab == "password" %}active{% endif %}" id="password">
|
||||
{{ form_start(form_password) }}
|
||||
{{ form_widget(form_password) }}
|
||||
<input type="submit" value="{{ 'action.save'|trans }}" class="btn btn-primary" />
|
||||
{{ form_end(form_password) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if form_roles %}
|
||||
<div class="tab-pane {% if tab == "roles" %}active{% endif %}" id="roles">
|
||||
{{ form_start(form_roles) }}
|
||||
{{ form_widget(form_roles) }}
|
||||
<input type="submit" value="{{ 'action.save'|trans }}" class="btn btn-primary" />
|
||||
{{ form_end(form_roles) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% macro profile_infos(user, stats) %}
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{{ 'profile.about_me'|trans }}</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<ul class="nav nav-stacked">
|
||||
{# colors = purple, blue, aqua, red, green #}
|
||||
{# FIXME hourly rate must be dynamic <li><a href="#">{{ 'label.hourly_rate'|trans }} <span class="pull-right badge bg-blue">70</span></a></li> #}
|
||||
<li><a href="#">{{ 'label.id'|trans }} <span class="pull-right badge bg-aqua">{{ user.id }}</span></a></li>
|
||||
<li><a href="#">{{ 'label.username'|trans }} <span class="pull-right badge bg-blue">{{ user.username }}</span></a></li>
|
||||
<li><a href="#">{{ 'label.language'|trans }} <span class="pull-right badge bg-green">{{ user.language }}</span></a></li>
|
||||
<li><a href="#">{{ 'profile.first_entry'|trans }} <span class="pull-right badge bg-purple">{{ stats.firstEntry|date }}</span></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro profile_box(user, stats) %}
|
||||
{% import "AvanzuAdminThemeBundle:layout:macros.html.twig" as macro %}
|
||||
{% import "macros/widgets.html.twig" as widgets %}
|
||||
|
||||
<div class="box box-primary">
|
||||
<div class="box-body box-profile">
|
||||
{{ macro.avatar(user.avatar, user.username, 'profile-user-img img-responsive img-circle') }}
|
||||
<h3 class="profile-username text-center">{{ widgets.username(user) }}</h3>
|
||||
|
||||
<p class="text-muted text-center">{{ user.title }}</p>
|
||||
|
||||
<ul class="list-group list-group-unbordered">
|
||||
|
||||
<li class="list-group-item">
|
||||
<b>{{ 'stats.durationThisMonth'|trans }}</b> <a class="pull-right">{{ stats.durationThisMonth|duration }}</a>
|
||||
</li>
|
||||
|
||||
<li class="list-group-item">
|
||||
<b>{{ 'stats.amountThisMonth'|trans }}</b> <a class="pull-right">{{ stats.amountThisMonth|money }}</a>
|
||||
</li>
|
||||
|
||||
<li class="list-group-item">
|
||||
<b>{{ 'stats.durationTotal'|trans }}</b> <a class="pull-right">{{ stats.durationTotal|duration }}</a>
|
||||
</li>
|
||||
|
||||
<li class="list-group-item">
|
||||
<b>{{ 'stats.amountTotal'|trans }}</b> <a class="pull-right">{{ stats.amountTotal|money }}</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
{# <a href="#" class="btn btn-primary btn-block"><b>Follow</b></a> #}
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{# -------------------------------- UNUSED FOR NOW -------------------------------- #}
|
||||
{% macro profile_list_unused(user, items, color) %}
|
||||
{% import "AvanzuAdminThemeBundle:layout:macros.html.twig" as macro %}
|
||||
{% import "macros/widgets.html.twig" as widgets %}
|
||||
|
||||
<div class="box box-widget widget-user-2">
|
||||
<!-- Add the bg color to the header using any of the bg-* classes -->
|
||||
<div class="widget-user-header bg-{{ color|default(kimai_context.box_color) }}">
|
||||
<div class="widget-user-image">
|
||||
{{ macro.avatar(user.avatar, user.username) }}
|
||||
</div>
|
||||
<!-- /.widget-user-image -->
|
||||
<h3 class="widget-user-username">{{ widgets.username(user) }}</h3>
|
||||
<h5 class="widget-user-desc">{{ user.title }}</h5>
|
||||
</div>
|
||||
<div class="box-footer no-padding">
|
||||
<ul class="nav nav-stacked">
|
||||
{% for entry in items %}
|
||||
<li><a href="{{ entry.url }}">{{ entry.title|trans }} <span class="pull-right badge bg-{{ entry.color }}">{{ entry.value }}</span></a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{# -------------------------------- UNUSED FOR NOW -------------------------------- #}
|
||||
{% macro profile_box_unused(user, stats, color) %}
|
||||
{% import "AvanzuAdminThemeBundle:layout:macros.html.twig" as macro %}
|
||||
{% import "macros/widgets.html.twig" as widgets %}
|
||||
|
||||
<div class="box box-widget widget-user">
|
||||
<div class="widget-user-header bg-{{ color|default(kimai_context.box_color) }}">
|
||||
<h3 class="widget-user-username">{{ widgets.username(user) }}</h3>
|
||||
<h5 class="widget-user-desc">{{ user.title }}</h5>
|
||||
</div>
|
||||
<div class="widget-user-image">
|
||||
{{ macro.avatar(user.avatar, user.username) }}
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<div class="row">
|
||||
<div class="col-sm-3 border-right">
|
||||
<div class="description-block">
|
||||
<h5 class="description-header">{{ stats.durationTotal|duration }}</h5>
|
||||
<span class="description-text">{{ 'stats.durationTotal'|trans }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-3 border-right">
|
||||
<div class="description-block">
|
||||
<h5 class="description-header">{{ stats.amountTotal|money }}</h5>
|
||||
<span class="description-text">{{ 'stats.amountTotal'|trans }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-3 border-right">
|
||||
<div class="description-block">
|
||||
<h5 class="description-header">{{ stats.durationThisMonth|duration }}</h5>
|
||||
<span class="description-text">{{ 'stats.durationThisMonth'|trans }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-3 border-right">
|
||||
<div class="description-block">
|
||||
<h5 class="description-header">{{ stats.amountThisMonth|money }}</h5>
|
||||
<span class="description-text">{{ 'stats.amountThisMonth'|trans }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endmacro %}
|
||||
@@ -1,13 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Doctrine\Common\Annotations\AnnotationRegistry;
|
||||
use Composer\Autoload\ClassLoader;
|
||||
|
||||
/**
|
||||
* @var ClassLoader $loader
|
||||
*/
|
||||
$loader = require __DIR__.'/../vendor/autoload.php';
|
||||
|
||||
AnnotationRegistry::registerLoader([$loader, 'loadClass']);
|
||||
|
||||
return $loader;
|
||||
@@ -1,105 +0,0 @@
|
||||
# This is the main configuration file of your application. It stores all the
|
||||
# common options for every execution environment ('prod', 'dev', 'test').
|
||||
|
||||
# To avoid creating configuration files that are too long, we first import some
|
||||
# files that define the values for important parts of the application,
|
||||
# such as the security component and the dependency injection services
|
||||
imports:
|
||||
- { resource: parameters.yml }
|
||||
- { resource: security.yml }
|
||||
- { resource: services.yml }
|
||||
|
||||
# These are the configuration parameters that define the application's behavior
|
||||
# and which are independent from the underlying technical infrastructure
|
||||
# See http://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
|
||||
parameters:
|
||||
# This parameter defines the codes of the locales (languages) enabled in the application
|
||||
app_locales: en|de
|
||||
app.notifications.email_sender: "%mailer_from%"
|
||||
|
||||
# Basic configuration for the Symfony framework features
|
||||
framework:
|
||||
# Uncomment the 'ide' option to turn all of the file paths in an exception
|
||||
# page into clickable links that open the given file using your favorite IDE.
|
||||
# Supported values are 'textmate', 'macvim', 'emacs' and 'sublime' shortcuts
|
||||
# and any custom configuration string, such as: "phpstorm://open?file=%%f&line=%%l"
|
||||
# See http://symfony.com/doc/current/reference/configuration/framework.html#ide
|
||||
#ide: sublime
|
||||
|
||||
# When using the HTTP Cache, ESI allows to render page fragments separately
|
||||
# and with different cache configurations for each fragment
|
||||
# http://symfony.com/doc/current/book/http_cache.html#edge-side-includes
|
||||
esi: { enabled: true }
|
||||
translator: { fallback: "%locale%" }
|
||||
secret: "%secret%"
|
||||
router:
|
||||
resource: "%kernel.root_dir%/config/routing.yml"
|
||||
strict_requirements: ~
|
||||
form: ~
|
||||
csrf_protection: ~
|
||||
validation: { enable_annotations: true }
|
||||
templating:
|
||||
engines: ['twig']
|
||||
default_locale: "%locale%"
|
||||
trusted_hosts: ~
|
||||
session:
|
||||
handler_id: session.handler.native_file
|
||||
save_path: "%kernel.root_dir%/../var/sessions/%kernel.environment%"
|
||||
fragments: ~
|
||||
http_method_override: true
|
||||
assets: ~
|
||||
|
||||
# Twig Configuration (used for rendering application templates)
|
||||
twig:
|
||||
debug: "%kernel.debug%"
|
||||
strict_variables: "%kernel.debug%"
|
||||
# form_themes:
|
||||
# - "bootstrap_3_layout.html.twig"
|
||||
# - "form/fields.html.twig"
|
||||
globals:
|
||||
kimai_context:
|
||||
date_1: "d.m.Y" # used for display in timesheets
|
||||
box_color: "green" # a color for ???
|
||||
active_warning: 3 # display a warning color if the user has at least X active recordings
|
||||
|
||||
# Assetic Configuration (used for managing web assets: CSS, JavaScript, Sass, etc.)
|
||||
#assetic:
|
||||
# debug: "%kernel.debug%"
|
||||
# use_controller: false
|
||||
# bundles: [ ]
|
||||
# filters:
|
||||
# cssrewrite: ~
|
||||
# jsqueeze: ~
|
||||
# scssphp:
|
||||
# # the formatter must be the FQCN (don't use the 'compressed' value)
|
||||
# formatter: "Leafo\\ScssPhp\\Formatter\\Compressed"
|
||||
|
||||
# Doctrine Configuration (used to access databases and manipulate their information)
|
||||
doctrine:
|
||||
dbal:
|
||||
url: "%database_url%"
|
||||
|
||||
orm:
|
||||
auto_generate_proxy_classes: "%kernel.debug%"
|
||||
auto_mapping: true
|
||||
|
||||
# Swiftmailer Configuration (used to send emails)
|
||||
#swiftmailer:
|
||||
# transport: "%mailer_transport%"
|
||||
# host: "%mailer_host%"
|
||||
# username: "%mailer_user%"
|
||||
# password: "%mailer_password%"
|
||||
# spool: { type: memory }
|
||||
|
||||
avanzu_admin_theme:
|
||||
use_twig: true
|
||||
use_assetic: true
|
||||
bower_bin: "/usr/local/bin/bower"
|
||||
options:
|
||||
default_avatar: avatars/default.png
|
||||
skin: skin-green-light
|
||||
fixed_layout: false
|
||||
boxed_layout: false
|
||||
collapsed_sidebar: true
|
||||
mini_sidebar: true
|
||||
control_sidebar: false
|
||||
@@ -1,47 +0,0 @@
|
||||
imports:
|
||||
- { resource: config.yml }
|
||||
- { resource: services_dev.yml }
|
||||
|
||||
framework:
|
||||
router:
|
||||
resource: "%kernel.root_dir%/config/routing_dev.yml"
|
||||
strict_requirements: true
|
||||
profiler: { only_exceptions: false }
|
||||
|
||||
monolog:
|
||||
handlers:
|
||||
main:
|
||||
type: stream
|
||||
path: "%kernel.logs_dir%/%kernel.environment%.log"
|
||||
level: info
|
||||
console:
|
||||
type: console
|
||||
bubble: false
|
||||
# uncomment to get logging in your browser
|
||||
# you may have to allow bigger header sizes in your Web server configuration
|
||||
#firephp:
|
||||
# type: firephp
|
||||
# level: info
|
||||
#chromephp:
|
||||
# type: chromephp
|
||||
# level: info
|
||||
|
||||
#assetic:
|
||||
# use_controller: true
|
||||
|
||||
#swiftmailer:
|
||||
# delivery_address: me@example.com
|
||||
|
||||
services:
|
||||
twig.text_extension:
|
||||
class: Twig_Extensions_Extension_Text
|
||||
tags:
|
||||
- name: twig.extension
|
||||
|
||||
web_profiler:
|
||||
toolbar: '%kernel.debug%'
|
||||
intercept_redirects: false
|
||||
|
||||
# See routing_dev.yml
|
||||
#avanzu_admin_theme:
|
||||
# enable_demo: false
|
||||
@@ -1,25 +0,0 @@
|
||||
imports:
|
||||
- { resource: config.yml }
|
||||
|
||||
#framework:
|
||||
# cache:
|
||||
# system: cache.adapter.apcu
|
||||
|
||||
#doctrine:
|
||||
# orm:
|
||||
# metadata_cache_driver: apc
|
||||
# result_cache_driver: apc
|
||||
# query_cache_driver: apc
|
||||
|
||||
monolog:
|
||||
handlers:
|
||||
main:
|
||||
type: fingers_crossed
|
||||
action_level: error
|
||||
handler: nested
|
||||
nested:
|
||||
type: stream
|
||||
path: "%kernel.logs_dir%/%kernel.environment%.log"
|
||||
level: debug
|
||||
console:
|
||||
type: console
|
||||
@@ -1,31 +0,0 @@
|
||||
imports:
|
||||
- { resource: config_dev.yml }
|
||||
|
||||
framework:
|
||||
test: ~
|
||||
session:
|
||||
storage_id: session.storage.mock_file
|
||||
profiler:
|
||||
collect: false
|
||||
|
||||
web_profiler:
|
||||
toolbar: false
|
||||
intercept_redirects: false
|
||||
|
||||
swiftmailer:
|
||||
disable_delivery: true
|
||||
|
||||
# It's recommended to use a separate database for tests. This allows to have a
|
||||
# fixed and known set of data fixtures, it simplifies the code of tests and it
|
||||
# makes them more robust.
|
||||
# In this case we just need to define a different path for the application database.
|
||||
doctrine:
|
||||
dbal:
|
||||
database_url: 'sqlite:///%kernel.root_dir%/data/timesheet_test.sqlite'
|
||||
|
||||
# this configuration simplifies testing URLs protected by the security mechanism
|
||||
# See http://symfony.com/doc/current/cookbook/testing/http_authentication.html
|
||||
security:
|
||||
firewalls:
|
||||
secured_area:
|
||||
http_basic: ~
|
||||
@@ -1,86 +0,0 @@
|
||||
doctrine:
|
||||
orm:
|
||||
dql:
|
||||
datetime_functions:
|
||||
convert_tz: DoctrineExtensions\Query\Mysql\ConvertTz
|
||||
date: DoctrineExtensions\Query\Mysql\Date
|
||||
date_format: DoctrineExtensions\Query\Mysql\DateFormat
|
||||
dateadd: DoctrineExtensions\Query\Mysql\DateAdd
|
||||
datesub: DoctrineExtensions\Query\Mysql\DateSub
|
||||
datediff: DoctrineExtensions\Query\Mysql\DateDiff
|
||||
day: DoctrineExtensions\Query\Mysql\Day
|
||||
dayname: DoctrineExtensions\Query\Mysql\DayName
|
||||
dayofweek: DoctrineExtensions\Query\Mysql\DayOfWeek
|
||||
dayofyear: DoctrineExtensions\Query\Mysql\DayOfYear
|
||||
div: DoctrineExtensions\Query\Mysql\Div
|
||||
from_unixtime: DoctrineExtensions\Query\Mysql\FromUnixtime
|
||||
last_day: DoctrineExtensions\Query\Mysql\LastDay
|
||||
minute: DoctrineExtensions\Query\Mysql\Minute
|
||||
now: DoctrineExtensions\Query\Mysql\Now
|
||||
month: DoctrineExtensions\Query\Mysql\Month
|
||||
monthname: DoctrineExtensions\Query\Mysql\MonthName
|
||||
second: DoctrineExtensions\Query\Mysql\Second
|
||||
strtodate: DoctrineExtensions\Query\Mysql\StrToDate
|
||||
time: DoctrineExtensions\Query\Mysql\Time
|
||||
timediff: DoctrineExtensions\Query\Mysql\TimeDiff
|
||||
timestampadd: DoctrineExtensions\Query\Mysql\TimestampAdd
|
||||
timestampdiff: DoctrineExtensions\Query\Mysql\TimestampDiff
|
||||
timetosec: DoctrineExtensions\Query\Mysql\TimeToSec
|
||||
week: DoctrineExtensions\Query\Mysql\Week
|
||||
weekday: DoctrineExtensions\Query\Mysql\WeekDay
|
||||
year: DoctrineExtensions\Query\Mysql\Year
|
||||
yearweek: DoctrineExtensions\Query\Mysql\YearWeek
|
||||
unix_timestamp: DoctrineExtensions\Query\Mysql\UnixTimestamp
|
||||
|
||||
numeric_functions:
|
||||
acos: DoctrineExtensions\Query\Mysql\Acos
|
||||
asin: DoctrineExtensions\Query\Mysql\Asin
|
||||
atan2: DoctrineExtensions\Query\Mysql\Atan2
|
||||
atan: DoctrineExtensions\Query\Mysql\Atan
|
||||
bit_count: DoctrineExtensions\Query\Mysql\BitCount
|
||||
bit_xor: DoctrineExtensions\Query\Mysql\BitXor
|
||||
ceil: DoctrineExtensions\Query\Mysql\Ceil
|
||||
cos: DoctrineExtensions\Query\Mysql\Cos
|
||||
cot: DoctrineExtensions\Query\Mysql\Cot
|
||||
floor: DoctrineExtensions\Query\Mysql\Floor
|
||||
hour: DoctrineExtensions\Query\Mysql\Hour
|
||||
pi: DoctrineExtensions\Query\Mysql\Pi
|
||||
power: DoctrineExtensions\Query\Mysql\Power
|
||||
quarter: DoctrineExtensions\Query\Mysql\Quarter
|
||||
rand: DoctrineExtensions\Query\Mysql\Rand
|
||||
round: DoctrineExtensions\Query\Mysql\Round
|
||||
stddev: DoctrineExtensions\Query\Mysql\StdDev
|
||||
sin: DoctrineExtensions\Query\Mysql\Sin
|
||||
std: DoctrineExtensions\Query\Mysql\Std
|
||||
tan: DoctrineExtensions\Query\Mysql\Tan
|
||||
|
||||
string_functions:
|
||||
ascii: DoctrineExtensions\Query\Mysql\Ascii
|
||||
binary: DoctrineExtensions\Query\Mysql\Binary
|
||||
char_length: DoctrineExtensions\Query\Mysql\CharLength
|
||||
concat_ws: DoctrineExtensions\Query\Mysql\ConcatWs
|
||||
countif: DoctrineExtensions\Query\Mysql\CountIf
|
||||
crc32: DoctrineExtensions\Query\Mysql\Crc32
|
||||
degrees: DoctrineExtensions\Query\Mysql\Degrees
|
||||
field: DoctrineExtensions\Query\Mysql\Field
|
||||
find_in_set: DoctrineExtensions\Query\Mysql\FindInSet
|
||||
greatest: DoctrineExtensions\Query\Mysql\Greatest
|
||||
group_concat: DoctrineExtensions\Query\Mysql\GroupConcat
|
||||
ifelse: DoctrineExtensions\Query\Mysql\IfElse
|
||||
ifnull: DoctrineExtensions\Query\Mysql\IfNull
|
||||
least: DoctrineExtensions\Query\Mysql\Least
|
||||
lpad: DoctrineExtensions\Query\Mysql\Lpad
|
||||
match_against: DoctrineExtensions\Query\Mysql\MatchAgainst
|
||||
md5: DoctrineExtensions\Query\Mysql\Md5
|
||||
nullif: DoctrineExtensions\Query\Mysql\NullIf
|
||||
radians: DoctrineExtensions\Query\Mysql\Radians
|
||||
regexp: DoctrineExtensions\Query\Mysql\Regexp
|
||||
replace: DoctrineExtensions\Query\Mysql\Replace
|
||||
rpad: DoctrineExtensions\Query\Mysql\Rpad
|
||||
sha1: DoctrineExtensions\Query\Mysql\Sha1
|
||||
sha2: DoctrineExtensions\Query\Mysql\Sha2
|
||||
soundex: DoctrineExtensions\Query\Mysql\Soundex
|
||||
substring_index: DoctrineExtensions\Query\Mysql\SubstringIndex
|
||||
uuid_short: DoctrineExtensions\Query\Mysql\UuidShort
|
||||
hex: DoctrineExtensions\Query\Mysql\Hex
|
||||
unhex: DoctrineExtensions\Query\Mysql\Unhex
|
||||
@@ -1,37 +0,0 @@
|
||||
# This file defines the canonical configuration parameters of the application.
|
||||
# Symfony uses this file as a template to generate the real app/config/parameters.yml used by the application.
|
||||
# See http://symfony.com/doc/current/best_practices/configuration.html#canonical-parameters
|
||||
parameters:
|
||||
|
||||
# used to load additional doctrine functions (possible values: mysql, sqlite)
|
||||
database_engine: sqlite
|
||||
|
||||
# Define the database connection string
|
||||
database_url: 'sqlite:///%kernel.root_dir%/data/timesheet.sqlite'
|
||||
# database_url: 'mysql://root:pass@127.0.0.1:3306/timesheet'
|
||||
|
||||
# You can prefix all your tables to pevent collision with other software
|
||||
database_prefix: kimai2_
|
||||
|
||||
# You can create the database and load the sample data from the command line:
|
||||
#
|
||||
# php bin/console doctrine:database:create
|
||||
# php bin/console doctrine:schema:create
|
||||
# php bin/console doctrine:fixtures:load
|
||||
|
||||
# If you don't use a real mail server, you can send emails via your Gmail account.
|
||||
# see http://symfony.com/doc/current/cookbook/email/gmail.html
|
||||
mailer_transport: smtp
|
||||
mailer_host: 127.0.0.1
|
||||
mailer_user: ~
|
||||
mailer_password: ~
|
||||
mailer_from: anonymous@example.com
|
||||
|
||||
# The code of the default language used by the application ('en' = English, 'de' = German)
|
||||
locale: de
|
||||
|
||||
# The 'secret' value is a random string of characters, numbers and symbols
|
||||
# used internally by Symfony in several places (CSRF tokens, URI signing,
|
||||
# 'Remember Me' functionality, etc.)
|
||||
# see: http://symfony.com/doc/current/reference/configuration/framework.html#secret
|
||||
secret: 'please_change_this_secret_to_something_unique'
|
||||
@@ -1,39 +0,0 @@
|
||||
# These first lines load the all routes defined as @Route() annotations in any
|
||||
# controller defined inside the src/AppBundle/Controller/ directory. Controllers
|
||||
# are loaded recursively, so you can separate them into subdirectories.
|
||||
# If you don't like to add annotations in your applications, you can also define
|
||||
# the routes in YAML, XML or PHP files.
|
||||
# See http://symfony.com/doc/current/book/routing.html
|
||||
app:
|
||||
resource: '@AppBundle/Controller/'
|
||||
type: annotation
|
||||
prefix: /{_locale}
|
||||
requirements:
|
||||
_locale: '%app_locales%'
|
||||
defaults:
|
||||
_locale: '%locale%'
|
||||
|
||||
timesheet:
|
||||
resource: '@TimesheetBundle/Controller/'
|
||||
type: annotation
|
||||
prefix: /{_locale}
|
||||
requirements:
|
||||
_locale: '%app_locales%'
|
||||
defaults:
|
||||
_locale: '%locale%'
|
||||
|
||||
# These lines define a route using YAML configuration. The controller used by
|
||||
# the route (FrameworkBundle:Template:template) is a convenient shortcut when
|
||||
# the template can be rendered without executing any logic in your own controller.
|
||||
# See http://symfony.com/doc/current/cookbook/templating/render_without_controller.html
|
||||
homepage:
|
||||
path: /{_locale}
|
||||
defaults:
|
||||
_controller: FrameworkBundle:Redirect:redirect
|
||||
route: timesheet
|
||||
permanent: true
|
||||
|
||||
avanzu_admin_profile:
|
||||
path: /{_locale}/profile/{username}
|
||||
options:
|
||||
avanzu_admin_route: profile
|
||||
@@ -1,35 +0,0 @@
|
||||
# this imports the routes used to display the web debug toolbar at the bottom of each page
|
||||
_wdt:
|
||||
resource: "@WebProfilerBundle/Resources/config/routing/wdt.xml"
|
||||
prefix: /_wdt
|
||||
|
||||
# this imports the routes needed to display the Symfony Profiler information
|
||||
_profiler:
|
||||
resource: "@WebProfilerBundle/Resources/config/routing/profiler.xml"
|
||||
prefix: /_profiler
|
||||
|
||||
# this imports the route used to test error pages. Just browse the following URL:
|
||||
# /{_locale}/_error/{status_code}.{format}
|
||||
# (e.g. /en/_error/404, /en/_error/403.json, /fr/_error/500.xml)
|
||||
# See http://symfony.com/doc/current/cookbook/controller/error_pages.html#testing-error-pages-during-development
|
||||
|
||||
_errors:
|
||||
resource: "@TwigBundle/Resources/config/routing/errors.xml"
|
||||
prefix: /{_locale}/_error
|
||||
requirements:
|
||||
_locale: '%app_locales%'
|
||||
defaults:
|
||||
_locale: '%locale%'
|
||||
|
||||
# this loads the main routing file, which usually defines the routes available
|
||||
# in any environment (production, development, etc.)
|
||||
_main:
|
||||
resource: routing.yml
|
||||
|
||||
# ========================================================================
|
||||
# Demo routes, only work with "avanzu_admin_theme/enable_demo: true"
|
||||
# ========================================================================
|
||||
|
||||
#avanzu_admin:
|
||||
# prefix: /admin
|
||||
# resource: "@AvanzuAdminThemeBundle/Resources/config/routes.yml"
|
||||
@@ -1,55 +0,0 @@
|
||||
security:
|
||||
encoders:
|
||||
# Our user class and the algorithm we'll use to encode passwords
|
||||
# http://symfony.com/doc/current/book/security.html#encoding-the-user-s-password
|
||||
AppBundle\Entity\User: bcrypt
|
||||
|
||||
providers:
|
||||
# in this example, users are stored via Doctrine in the database
|
||||
# demo users can be found at src/AppBundle/DataFixtures/ORM/LoadFixtures.php
|
||||
database_users:
|
||||
entity: { class: AppBundle:User, property: username }
|
||||
|
||||
# http://symfony.com/doc/current/book/security.html#firewalls-authentication
|
||||
firewalls:
|
||||
secured_area:
|
||||
# does what it says
|
||||
logout_on_user_change: true
|
||||
|
||||
# this firewall applies to all URLs
|
||||
pattern: ^/
|
||||
|
||||
# but the firewall does not require login on every page
|
||||
# denying access is done in access_control or in your controllers
|
||||
anonymous: ~
|
||||
|
||||
# This allows the user to login by submitting a username and password
|
||||
# Reference: http://symfony.com/doc/current/cookbook/security/form_login_setup.html
|
||||
form_login:
|
||||
# The route name that the login form submits to
|
||||
check_path: security_login
|
||||
# The name of the route where the login form lives
|
||||
# When the user tries to access a protected page, they are redirected here
|
||||
login_path: security_login
|
||||
# Secure the login form against CSRF
|
||||
# Reference: http://symfony.com/doc/current/cookbook/security/csrf_in_login_form.html
|
||||
csrf_token_generator: security.csrf.token_manager
|
||||
|
||||
logout:
|
||||
# The route name the user can go to in order to logout
|
||||
path: security_logout
|
||||
# The name of the route to redirect to after logging out
|
||||
target: homepage
|
||||
|
||||
role_hierarchy:
|
||||
ROLE_USER: ROLE_CUSTOMER
|
||||
ROLE_TEAMLEAD: ROLE_USER
|
||||
ROLE_ADMIN: ROLE_TEAMLEAD
|
||||
ROLE_SUPER_ADMIN: ROLE_ADMIN
|
||||
|
||||
access_control:
|
||||
# this is a catch-all for the admin area
|
||||
# additional security lives in the controllers
|
||||
- { path: '^/(%app_locales%)$', role: IS_AUTHENTICATED_FULLY }
|
||||
- { path: '^/(%app_locales%)/login', role: IS_AUTHENTICATED_ANONYMOUSLY }
|
||||
- { path: '^/(%app_locales%)/admin', roles: ROLE_ADMIN }
|
||||
@@ -1,177 +0,0 @@
|
||||
services:
|
||||
|
||||
# ================================================================================
|
||||
# TWIG
|
||||
# ================================================================================
|
||||
|
||||
markdown:
|
||||
class: AppBundle\Utils\Markdown
|
||||
|
||||
app.twig.app_extension:
|
||||
public: false
|
||||
class: AppBundle\Twig\Extensions
|
||||
arguments: ['@markdown', '%app_locales%']
|
||||
tags:
|
||||
- { name: twig.extension }
|
||||
|
||||
# twig function: template_from_string()
|
||||
app.twig.loader_extension:
|
||||
class: Twig_Extension_StringLoader
|
||||
tags:
|
||||
- { name: 'twig.extension' }
|
||||
|
||||
app.twig.intl_extension:
|
||||
public: false
|
||||
class: Twig_Extensions_Extension_Intl
|
||||
tags:
|
||||
- { name: twig.extension }
|
||||
|
||||
# ================================================================================
|
||||
# SECURITY
|
||||
# ================================================================================
|
||||
|
||||
# security voter to check user-profile access
|
||||
app.voter.user:
|
||||
class: AppBundle\Voter\UserVoter
|
||||
arguments: ["@security.access.decision_manager"]
|
||||
tags:
|
||||
- { name: security.voter }
|
||||
|
||||
# security voter to check customer access
|
||||
timesheet.voter.customer:
|
||||
class: TimesheetBundle\Voter\CustomerVoter
|
||||
arguments: ["@security.access.decision_manager"]
|
||||
tags:
|
||||
- { name: security.voter }
|
||||
|
||||
# security voter to check project access
|
||||
timesheet.voter.project:
|
||||
class: TimesheetBundle\Voter\ProjectVoter
|
||||
arguments: ["@security.access.decision_manager"]
|
||||
tags:
|
||||
- { name: security.voter }
|
||||
|
||||
# security voter to check activity access
|
||||
timesheet.voter.activity:
|
||||
class: TimesheetBundle\Voter\ActivityVoter
|
||||
arguments: ["@security.access.decision_manager"]
|
||||
tags:
|
||||
- { name: security.voter }
|
||||
|
||||
# security voter to check activity access
|
||||
timesheet.voter.timesheet:
|
||||
class: TimesheetBundle\Voter\TimesheetVoter
|
||||
arguments: ["@security.access.decision_manager"]
|
||||
tags:
|
||||
- { name: security.voter }
|
||||
|
||||
# ================================================================================
|
||||
# FORMS
|
||||
# ================================================================================
|
||||
|
||||
# form to edit user roles
|
||||
app.admin.user_role:
|
||||
class: AppBundle\Form\Type\UserRoleType
|
||||
arguments: ["%security.role_hierarchy.roles%"]
|
||||
tags:
|
||||
- { name: form.type }
|
||||
|
||||
# event-listener to populate the navigation
|
||||
app.menu_builder:
|
||||
class: AppBundle\EventListener\MenuBuilder
|
||||
arguments: ["@event_dispatcher", "@security.authorization_checker"]
|
||||
tags:
|
||||
- { name: kernel.event_listener, event: theme.sidebar_setup_menu, method: onSetupNavbar }
|
||||
|
||||
# ================================================================================
|
||||
# DATABASE
|
||||
# ================================================================================
|
||||
|
||||
# service that prefixes every database table
|
||||
app.tableprefix_subscriber:
|
||||
class: AppBundle\Doctrine\TablePrefixSubscriber
|
||||
arguments: ["%database_prefix%"]
|
||||
tags:
|
||||
- { name: doctrine.event_subscriber }
|
||||
|
||||
app.database_listener.timesheet:
|
||||
class: TimesheetBundle\EventListener\TimesheetListener
|
||||
tags:
|
||||
- { name: doctrine.event_listener, event: prePersist, lazy: true }
|
||||
- { name: doctrine.event_listener, event: preUpdate, lazy: true }
|
||||
|
||||
# Uncomment the following lines to define a service for the Post Doctrine repository.
|
||||
# It's not mandatory to create these services, but if you use repositories a lot,
|
||||
# these services simplify your code:
|
||||
#
|
||||
# app.post_repository:
|
||||
# class: Doctrine\ORM\EntityRepository
|
||||
# factory: ['@doctrine.orm.entity_manager', getRepository]
|
||||
# arguments: [AppBundle\Entity\User]
|
||||
#
|
||||
# // traditional code inside a controller
|
||||
# $entityManager = $this->getDoctrine()->getManager();
|
||||
# $posts = $entityManager->getRepository('AppBundle:User')->findAll();
|
||||
#
|
||||
# // same code using repository services
|
||||
# $posts = $this->get('app.user_repository')->findAll();
|
||||
|
||||
# ================================================================================
|
||||
# THEME
|
||||
# ================================================================================
|
||||
|
||||
avanzu_admin_theme.navbar_user_listener:
|
||||
class: AppBundle\EventListener\NavbarShowUserListener
|
||||
arguments: ["@security.token_storage"]
|
||||
tags:
|
||||
- { name: kernel.event_listener, event: theme.navbar_user, method: onShowUser }
|
||||
- { name: kernel.event_listener, event: theme.sidebar_user, method: onShowUser }
|
||||
|
||||
# avanzu_admin_theme.navbar_task_listener:
|
||||
# class: "%avanzu_admin_theme.navbar_task_listener.class%"
|
||||
# tags:
|
||||
# - { name: kernel.event_listener, event: theme.tasks, method: onListTasks }
|
||||
#
|
||||
# avanzu_admin_theme.navbar_notify_listener:
|
||||
# class: "%avanzu_admin_theme.navbar_notify_listener.class%"
|
||||
# tags:
|
||||
# - { name: kernel.event_listener, event: theme.notifications, method: onListNotifications }
|
||||
#
|
||||
# avanzu_admin_theme.navbar_msg_listener:
|
||||
# class: "%avanzu_admin_theme.navbar_msg_listener.class%"
|
||||
# tags:
|
||||
# - { name: kernel.event_listener, event: theme.messages, method: onListMessages }
|
||||
#
|
||||
# avanzu_admin_theme.setup_menu_listener:
|
||||
# class: "%avanzu_admin_theme.setup_menu_listener.class%"
|
||||
# tags:
|
||||
# - { name: kernel.event_listener, event: theme.sidebar_setup_menu, method: onSetupMenu }
|
||||
# - { name: kernel.event_listener, event: theme.breadcrumb, method: onSetupMenu }
|
||||
|
||||
# ================================================================================
|
||||
# APPLICATION CORE
|
||||
# ================================================================================
|
||||
|
||||
# a route listener, that injects the locale through a URL directory
|
||||
app.redirect_to_preferred_locale_listener:
|
||||
class: AppBundle\EventListener\RedirectToPreferredLocaleListener
|
||||
arguments: ['@router', '%app_locales%', '%locale%']
|
||||
tags:
|
||||
- { name: kernel.event_listener, event: kernel.request, method: onKernelRequest }
|
||||
|
||||
# additional menu entries for the timesheet bundle
|
||||
timesheet.configure_menu_listener:
|
||||
class: TimesheetBundle\EventListener\Menu
|
||||
tags:
|
||||
- { name: kernel.event_listener, event: app.main_menu_configure, method: onMainMenuConfigure }
|
||||
- { name: kernel.event_listener, event: app.admin_menu_configure, method: onAdminMenuConfigure }
|
||||
|
||||
# ================================================================================
|
||||
# CONSOLE COMMANDS
|
||||
# ================================================================================
|
||||
|
||||
app.command.create_user:
|
||||
class: AppBundle\Command\CreateUserCommand
|
||||
arguments: ["@security.password_encoder", "@doctrine", "@validator"]
|
||||
tags:
|
||||
- { name: console.command, command: kimai:create-user }
|
||||
@@ -1,32 +0,0 @@
|
||||
imports:
|
||||
- { resource: services.yml }
|
||||
|
||||
services:
|
||||
|
||||
# ================================================================================
|
||||
# CONSOLE COMMANDS
|
||||
# ================================================================================
|
||||
|
||||
app.command.run_phpcs:
|
||||
class: AppBundle\Command\RunCodeSnifferCommand
|
||||
arguments: ["%kernel.root_dir%"]
|
||||
tags:
|
||||
- { name: console.command, command: kimai:dev:phpcs }
|
||||
|
||||
app.command.run_unit_tests:
|
||||
class: AppBundle\Command\RunUnitTestsCommand
|
||||
arguments: ["%kernel.root_dir%"]
|
||||
tags:
|
||||
- { name: console.command, command: kimai:dev:test-unit }
|
||||
|
||||
app.command.run_integration_tests:
|
||||
class: AppBundle\Command\RunIntegrationTestsCommand
|
||||
arguments: ["%kernel.root_dir%"]
|
||||
tags:
|
||||
- { name: console.command, command: kimai:dev:test-integration }
|
||||
|
||||
app.command.dev_reset:
|
||||
class: AppBundle\Command\DevResetCommand
|
||||
arguments: ["%kernel.root_dir%"]
|
||||
tags:
|
||||
- { name: console.command, command: kimai:dev:reset }
|
||||
@@ -1,50 +0,0 @@
|
||||
doctrine:
|
||||
orm:
|
||||
dql:
|
||||
datetime_functions:
|
||||
date: DoctrineExtensions\Query\Sqlite\Date
|
||||
date_format: DoctrineExtensions\Query\Sqlite\DateFormat
|
||||
#dateadd: DoctrineExtensions\Query\Sqlite\DateAdd
|
||||
#datediff: DoctrineExtensions\Query\Sqlite\DateDiff
|
||||
day: DoctrineExtensions\Query\Sqlite\Day
|
||||
dayname: DoctrineExtensions\Query\Sqlite\DayName
|
||||
minute: DoctrineExtensions\Query\Sqlite\Minute
|
||||
#month: DoctrineExtensions\Query\Sqlite\Month
|
||||
#monthname: DoctrineExtensions\Query\Sqlite\MonthName
|
||||
second: DoctrineExtensions\Query\Sqlite\Second
|
||||
month: DoctrineExtensions\Query\Sqlite\Month
|
||||
strftime: DoctrineExtensions\Query\Sqlite\StrfTime
|
||||
#strtodate: DoctrineExtensions\Query\Sqlite\StrToDate
|
||||
#time: DoctrineExtensions\Query\Sqlite\Time
|
||||
#timestampadd: DoctrineExtensions\Query\Sqlite\TimestampAdd
|
||||
#timestampdiff: DoctrineExtensions\Query\Sqlite\TimestampDiff
|
||||
week: DoctrineExtensions\Query\Sqlite\Week
|
||||
weekday: DoctrineExtensions\Query\Sqlite\WeekDay
|
||||
year: DoctrineExtensions\Query\Sqlite\Year
|
||||
|
||||
|
||||
string_functions:
|
||||
# binary: DoctrineExtensions\Query\Sqlite\Binary
|
||||
# char_length: DoctrineExtensions\Query\Sqlite\CharLength
|
||||
concat_ws: DoctrineExtensions\Query\Sqlite\ConcatWs
|
||||
# countif: DoctrineExtensions\Query\Sqlite\CountIf
|
||||
# crc32: DoctrineExtensions\Query\Sqlite\Crc32
|
||||
# degrees: DoctrineExtensions\Query\Sqlite\Degrees
|
||||
# field: DoctrineExtensions\Query\Sqlite\Field
|
||||
# find_in_set: DoctrineExtensions\Query\Sqlite\FindInSet
|
||||
# group_concat: DoctrineExtensions\Query\Sqlite\GroupConcat
|
||||
# ifelse: DoctrineExtensions\Query\Sqlite\IfElse
|
||||
ifnull: DoctrineExtensions\Query\Sqlite\IfNull
|
||||
# match_against: DoctrineExtensions\Query\Sqlite\MatchAgainst
|
||||
# md5: DoctrineExtensions\Query\Sqlite\Md5
|
||||
# nullif: DoctrineExtensions\Query\Sqlite\NullIf
|
||||
# radians: DoctrineExtensions\Query\Sqlite\Radians
|
||||
# regexp: DoctrineExtensions\Query\Sqlite\Regexp
|
||||
replace: DoctrineExtensions\Query\Sqlite\Replace
|
||||
# sha1: DoctrineExtensions\Query\Sqlite\Sha1
|
||||
# sha2: DoctrineExtensions\Query\Sqlite\Sha2
|
||||
# soundex: DoctrineExtensions\Query\Sqlite\Soundex
|
||||
# uuid_short: DoctrineExtensions\Query\Sqlite\UuidShort
|
||||
|
||||
numeric_functions:
|
||||
round: DoctrineExtensions\Query\Sqlite\Round
|
||||
0
app/data/.gitkeep → assets/.gitignore
vendored
0
app/data/.gitkeep → assets/.gitignore
vendored
9
assets/app.js
Normal file
9
assets/app.js
Normal file
@@ -0,0 +1,9 @@
|
||||
|
||||
require('./sass/app.scss');
|
||||
|
||||
// ------ Kimai itself ------
|
||||
require('./js/KimaiWebLoader.js');
|
||||
global.KimaiPaginatedBoxWidget = require('./js/widgets/KimaiPaginatedBoxWidget').default;
|
||||
global.KimaiReloadPageWidget = require('./js/widgets/KimaiReloadPageWidget').default;
|
||||
global.KimaiColor = require('./js/widgets/KimaiColor').default;
|
||||
global.KimaiStorage = require('./js/widgets/KimaiStorage').default;
|
||||
2
assets/calendar.js
Normal file
2
assets/calendar.js
Normal file
@@ -0,0 +1,2 @@
|
||||
|
||||
global.KimaiCalendar = require('./js/widgets/KimaiCalendar').default;
|
||||
56
assets/chart.js
Normal file
56
assets/chart.js
Normal file
@@ -0,0 +1,56 @@
|
||||
import {
|
||||
Chart,
|
||||
ArcElement,
|
||||
LineElement,
|
||||
BarElement,
|
||||
PointElement,
|
||||
BarController,
|
||||
// BubbleController,
|
||||
DoughnutController,
|
||||
LineController,
|
||||
PieController,
|
||||
// PolarAreaController,
|
||||
// RadarController,
|
||||
// ScatterController,
|
||||
CategoryScale,
|
||||
LinearScale,
|
||||
// LogarithmicScale,
|
||||
// RadialLinearScale,
|
||||
// TimeScale,
|
||||
// TimeSeriesScale,
|
||||
// Decimation,
|
||||
// Filler,
|
||||
Legend,
|
||||
Title,
|
||||
Tooltip,
|
||||
// SubTitle
|
||||
} from 'chart.js';
|
||||
|
||||
Chart.register(
|
||||
ArcElement,
|
||||
LineElement,
|
||||
BarElement,
|
||||
PointElement,
|
||||
BarController,
|
||||
// BubbleController,
|
||||
DoughnutController,
|
||||
LineController,
|
||||
PieController,
|
||||
// PolarAreaController,
|
||||
// RadarController,
|
||||
// ScatterController,
|
||||
CategoryScale,
|
||||
LinearScale,
|
||||
// LogarithmicScale,
|
||||
// RadialLinearScale,
|
||||
// TimeScale,
|
||||
// TimeSeriesScale,
|
||||
// Decimation,
|
||||
// Filler,
|
||||
Legend,
|
||||
Title,
|
||||
Tooltip,
|
||||
// SubTitle
|
||||
);
|
||||
|
||||
global.Chart = Chart;
|
||||
1348
assets/css/emails.css
Normal file
1348
assets/css/emails.css
Normal file
File diff suppressed because it is too large
Load Diff
8
assets/dashboard.js
Normal file
8
assets/dashboard.js
Normal file
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* https://gridstackjs.com
|
||||
* https://github.com/gridstack/gridstack.js/tree/master/doc
|
||||
*/
|
||||
require('gridstack/dist/gridstack.min.css');
|
||||
require('gridstack/dist/gridstack-extra.min.css');
|
||||
import { GridStack } from 'gridstack';
|
||||
global.GridStack = GridStack;
|
||||
2
assets/export-pdf.js
Normal file
2
assets/export-pdf.js
Normal file
@@ -0,0 +1,2 @@
|
||||
|
||||
require('./sass/export-pdf.scss');
|
||||
2
assets/invoice-pdf.js
Normal file
2
assets/invoice-pdf.js
Normal file
@@ -0,0 +1,2 @@
|
||||
|
||||
require('./sass/invoice-pdf.scss');
|
||||
2
assets/invoice.js
Normal file
2
assets/invoice.js
Normal file
@@ -0,0 +1,2 @@
|
||||
|
||||
require('./sass/invoice.scss');
|
||||
53
assets/js/KimaiConfiguration.js
Normal file
53
assets/js/KimaiConfiguration.js
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*!
|
||||
* [KIMAI] KimaiConfiguration: handling all configuration and runtime settings
|
||||
*/
|
||||
|
||||
export default class KimaiConfiguration {
|
||||
|
||||
constructor(configurations) {
|
||||
this._configurations = configurations;
|
||||
}
|
||||
|
||||
get(name) {
|
||||
return this._configurations[name];
|
||||
}
|
||||
|
||||
has(name) {
|
||||
return name in this._configurations;
|
||||
}
|
||||
|
||||
isRTL() {
|
||||
return this.get('direction') === 'rtl';
|
||||
}
|
||||
|
||||
getLanguage() {
|
||||
return this.get('locale').replace('_', '-');
|
||||
}
|
||||
|
||||
is24Hours() {
|
||||
return !!this.get('twentyFourHours');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {boolean} iso
|
||||
* @return {number}
|
||||
*/
|
||||
getFirstDayOfWeek(iso = true) {
|
||||
if (iso === undefined) {
|
||||
iso = true;
|
||||
}
|
||||
let config = this.get('first_dow_iso');
|
||||
if (!iso) {
|
||||
config = config % 7;
|
||||
}
|
||||
return config;
|
||||
}
|
||||
|
||||
}
|
||||
91
assets/js/KimaiContainer.js
Normal file
91
assets/js/KimaiContainer.js
Normal file
@@ -0,0 +1,91 @@
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*!
|
||||
* [KIMAI] KimaiContainer
|
||||
*
|
||||
* ServiceContainer for Kimai
|
||||
*/
|
||||
|
||||
import KimaiConfiguration from './KimaiConfiguration';
|
||||
import KimaiTranslation from './KimaiTranslation';
|
||||
import KimaiPlugin from './KimaiPlugin';
|
||||
|
||||
export default class KimaiContainer {
|
||||
|
||||
/**
|
||||
* Create a new Container with the given configurations and translations.
|
||||
*
|
||||
* @param {KimaiConfiguration} configuration
|
||||
* @param {KimaiTranslation} translation
|
||||
*/
|
||||
constructor(configuration, translation) {
|
||||
if (!(configuration instanceof KimaiConfiguration)) {
|
||||
throw new Error('Configuration needs to a KimaiConfiguration instance');
|
||||
}
|
||||
this._configuration = configuration;
|
||||
|
||||
if (!(translation instanceof KimaiTranslation)) {
|
||||
throw new Error('Configuration needs to a KimaiTranslation instance');
|
||||
}
|
||||
this._translation = translation;
|
||||
this._plugins = [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a new Plugin.
|
||||
*
|
||||
* @param {KimaiPlugin} plugin
|
||||
* @returns {KimaiPlugin}
|
||||
*/
|
||||
registerPlugin(plugin) {
|
||||
if (!(plugin instanceof KimaiPlugin)) {
|
||||
throw new Error('Invalid plugin given, needs to be a KimaiPlugin instance');
|
||||
}
|
||||
|
||||
plugin.setContainer(this);
|
||||
|
||||
this._plugins.push(plugin);
|
||||
|
||||
return plugin;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} name
|
||||
* @returns {KimaiPlugin}
|
||||
*/
|
||||
getPlugin(name) {
|
||||
for (let plugin of this._plugins) {
|
||||
if (plugin.getId() !== null && plugin.getId() === name) {
|
||||
return plugin;
|
||||
}
|
||||
}
|
||||
throw new Error('Unknown plugin: ' + name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {Array<KimaiPlugin>}
|
||||
*/
|
||||
getPlugins() {
|
||||
return this._plugins;
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {KimaiTranslation}
|
||||
*/
|
||||
getTranslation() {
|
||||
return this._translation;
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {KimaiConfiguration}
|
||||
*/
|
||||
getConfiguration() {
|
||||
return this._configuration;
|
||||
}
|
||||
|
||||
}
|
||||
107
assets/js/KimaiLoader.js
Normal file
107
assets/js/KimaiLoader.js
Normal file
@@ -0,0 +1,107 @@
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*!
|
||||
* [KIMAI] KimaiLoader: bootstrap the application and all plugins
|
||||
*/
|
||||
|
||||
import { Settings } from 'luxon';
|
||||
import KimaiTranslation from "./KimaiTranslation";
|
||||
import KimaiConfiguration from "./KimaiConfiguration";
|
||||
import KimaiContainer from "./KimaiContainer";
|
||||
import KimaiDatatableColumnView from './plugins/KimaiDatatableColumnView.js';
|
||||
import KimaiThemeInitializer from "./plugins/KimaiThemeInitializer";
|
||||
import KimaiDateRangePicker from "./forms/KimaiDateRangePicker";
|
||||
import KimaiDatatable from "./plugins/KimaiDatatable";
|
||||
import KimaiToolbar from "./plugins/KimaiToolbar";
|
||||
import KimaiAPI from "./plugins/KimaiAPI";
|
||||
import KimaiAlternativeLinks from "./plugins/KimaiAlternativeLinks";
|
||||
import KimaiAjaxModalForm from "./plugins/KimaiAjaxModalForm";
|
||||
import KimaiActiveRecords from "./plugins/KimaiActiveRecords";
|
||||
import KimaiEvent from "./plugins/KimaiEvent";
|
||||
import KimaiAPILink from "./plugins/KimaiAPILink";
|
||||
import KimaiAlert from "./plugins/KimaiAlert";
|
||||
import KimaiAutocomplete from "./forms/KimaiAutocomplete";
|
||||
import KimaiFormSelect from "./forms/KimaiFormSelect";
|
||||
import KimaiForm from "./plugins/KimaiForm";
|
||||
import KimaiDatePicker from "./forms/KimaiDatePicker";
|
||||
import KimaiConfirmationLink from "./plugins/KimaiConfirmationLink";
|
||||
import KimaiMultiUpdateTable from "./plugins/KimaiMultiUpdateTable";
|
||||
import KimaiDateUtils from "./plugins/KimaiDateUtils";
|
||||
import KimaiEscape from "./plugins/KimaiEscape";
|
||||
import KimaiFetch from "./plugins/KimaiFetch";
|
||||
import KimaiTimesheetForm from "./forms/KimaiTimesheetForm";
|
||||
import KimaiTeamForm from "./forms/KimaiTeamForm";
|
||||
import KimaiCopyDataForm from "./forms/KimaiCopyDataForm";
|
||||
import KimaiDateNowForm from "./forms/KimaiDateNowForm";
|
||||
import KimaiNotification from "./plugins/KimaiNotification";
|
||||
import KimaiHotkeys from "./plugins/KimaiHotkeys";
|
||||
import KimaiRemoteModal from "./plugins/KimaiRemoteModal";
|
||||
|
||||
export default class KimaiLoader {
|
||||
|
||||
constructor(configurations, translations) {
|
||||
// set the current locale for all javascript components
|
||||
Settings.defaultLocale = configurations['locale'].replace('_', '-').toLowerCase();
|
||||
Settings.defaultZone = configurations['timezone'];
|
||||
|
||||
const kimai = new KimaiContainer(
|
||||
new KimaiConfiguration(configurations),
|
||||
new KimaiTranslation(translations)
|
||||
);
|
||||
|
||||
// GLOBAL HELPER PLUGINS
|
||||
kimai.registerPlugin(new KimaiEscape());
|
||||
kimai.registerPlugin(new KimaiEvent());
|
||||
kimai.registerPlugin(new KimaiAPI());
|
||||
kimai.registerPlugin(new KimaiAlert());
|
||||
kimai.registerPlugin(new KimaiFetch());
|
||||
kimai.registerPlugin(new KimaiDateUtils());
|
||||
kimai.registerPlugin(new KimaiNotification());
|
||||
|
||||
// FORM PLUGINS
|
||||
kimai.registerPlugin(new KimaiFormSelect('.selectpicker', 'select[data-related-select]'));
|
||||
kimai.registerPlugin(new KimaiDateRangePicker('input[data-daterangepicker="on"]'));
|
||||
kimai.registerPlugin(new KimaiDatePicker('input[data-datepicker="on"]'));
|
||||
kimai.registerPlugin(new KimaiAutocomplete());
|
||||
kimai.registerPlugin(new KimaiTimesheetForm());
|
||||
kimai.registerPlugin(new KimaiTeamForm());
|
||||
kimai.registerPlugin(new KimaiCopyDataForm());
|
||||
kimai.registerPlugin(new KimaiDateNowForm());
|
||||
kimai.registerPlugin(new KimaiForm());
|
||||
kimai.registerPlugin(new KimaiHotkeys());
|
||||
|
||||
// SPECIAL FEATURES
|
||||
kimai.registerPlugin(new KimaiConfirmationLink('confirmation-link'));
|
||||
kimai.registerPlugin(new KimaiDatatableColumnView('data-column-visibility'));
|
||||
kimai.registerPlugin(new KimaiDatatable('section.content', 'table.dataTable'));
|
||||
kimai.registerPlugin(new KimaiToolbar('form.searchform', 'toolbar-action'));
|
||||
kimai.registerPlugin(new KimaiAlternativeLinks('.alternative-link'));
|
||||
kimai.registerPlugin(new KimaiAjaxModalForm('.modal-ajax-form'));
|
||||
kimai.registerPlugin(new KimaiRemoteModal());
|
||||
kimai.registerPlugin(new KimaiActiveRecords());
|
||||
kimai.registerPlugin(new KimaiAPILink('api-link'));
|
||||
kimai.registerPlugin(new KimaiMultiUpdateTable());
|
||||
kimai.registerPlugin(new KimaiThemeInitializer());
|
||||
|
||||
// notify all listeners that Kimai plugins can now be registered
|
||||
document.dispatchEvent(new CustomEvent('kimai.pluginRegister', {detail: {'kimai': kimai}}));
|
||||
|
||||
// initialize all plugins
|
||||
kimai.getPlugins().map(plugin => { plugin.init(); });
|
||||
|
||||
// notify all listeners that Kimai is now ready to be used
|
||||
document.dispatchEvent(new CustomEvent('kimai.initialized', {detail: {'kimai': kimai}}));
|
||||
|
||||
this.kimai = kimai;
|
||||
}
|
||||
|
||||
getKimai() {
|
||||
return this.kimai;
|
||||
}
|
||||
|
||||
}
|
||||
161
assets/js/KimaiPlugin.js
Normal file
161
assets/js/KimaiPlugin.js
Normal file
@@ -0,0 +1,161 @@
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*!
|
||||
* [KIMAI] KimaiPlugin: base class for all plugins
|
||||
*/
|
||||
|
||||
import KimaiContainer from "./KimaiContainer";
|
||||
|
||||
export default class KimaiPlugin {
|
||||
|
||||
/**
|
||||
* Overwrite this method to initialize your plugin.
|
||||
*
|
||||
* It is called AFTER setContainer() and AFTER DOMContentLoaded was fired.
|
||||
* You don't have access to the container before this method!
|
||||
*/
|
||||
init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* If you return an ID, you indicate that your plugin can be used by other plugins.
|
||||
*
|
||||
* @returns {string|null}
|
||||
*/
|
||||
getId() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {KimaiContainer} core
|
||||
*/
|
||||
setContainer(core) {
|
||||
if (!(core instanceof KimaiContainer)) {
|
||||
throw new Error('Plugin was given an invalid KimaiContainer');
|
||||
}
|
||||
this._core = core;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function returns null, if you call it BEFORE init().
|
||||
*
|
||||
* @returns {KimaiContainer}
|
||||
*/
|
||||
getContainer() {
|
||||
return this._core;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} name
|
||||
* @returns {(string|number|boolean)}
|
||||
*/
|
||||
getConfiguration(name) {
|
||||
return this.getContainer().getConfiguration().get(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {KimaiConfiguration}
|
||||
*/
|
||||
getConfigurations() {
|
||||
return this.getContainer().getConfiguration();
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {KimaiDateUtils}
|
||||
*/
|
||||
getDateUtils() {
|
||||
return this.getPlugin('date');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} name
|
||||
* @returns {KimaiPlugin}
|
||||
*/
|
||||
getPlugin(name) {
|
||||
return this.getContainer().getPlugin(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {KimaiTranslation}
|
||||
*/
|
||||
getTranslation() {
|
||||
return this.getContainer().getTranslation();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} name
|
||||
* @returns {string}
|
||||
*/
|
||||
translate(name) {
|
||||
return this.getTranslation().get(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} title
|
||||
* @returns {string}
|
||||
*/
|
||||
escape(title) {
|
||||
return this.getPlugin('escape').escapeForHtml(title);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} name
|
||||
* @param {string|null} details
|
||||
*/
|
||||
trigger(name, details = null) {
|
||||
this.getPlugin('event').trigger(name, details);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} url
|
||||
* @param {object} options
|
||||
* @returns {Promise<Response>}
|
||||
*/
|
||||
fetch(url, options = {}) {
|
||||
return this.getPlugin('fetch').fetch(url, options);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {HTMLFormElement} form
|
||||
* @param {object} options
|
||||
* @param {string|null} url
|
||||
* @returns {Promise<Response>}
|
||||
*/
|
||||
fetchForm(form, options = {}, url = null) {
|
||||
url = url || form.getAttribute('action');
|
||||
const method = form.getAttribute('method').toUpperCase();
|
||||
|
||||
if (method === 'GET') {
|
||||
const data = this.getPlugin('form').convertFormDataToQueryString(form, {}, true);
|
||||
// TODO const data = new URLSearchParams(new FormData(form)).toString();
|
||||
url = url + (url.includes('?') ? '&' : '?') + data;
|
||||
options = {...{method: 'GET'}, ...options};
|
||||
} else if (method === 'POST') {
|
||||
options = {...{
|
||||
method: 'POST',
|
||||
body: new FormData(form)
|
||||
}, ...options};
|
||||
}
|
||||
|
||||
return this.fetch(url, options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the current device is a mobile device (targeting the bootstrip xs breakpoint size).
|
||||
*
|
||||
* @returns {boolean}
|
||||
*/
|
||||
isMobile() {
|
||||
const width = Math.max(
|
||||
document.documentElement.clientWidth,
|
||||
window.innerWidth || 0
|
||||
)
|
||||
|
||||
return width < 576;
|
||||
}
|
||||
}
|
||||
37
assets/js/KimaiTranslation.js
Normal file
37
assets/js/KimaiTranslation.js
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*!
|
||||
* [KIMAI] KimaiTranslation: handling translation strings
|
||||
*/
|
||||
|
||||
export default class KimaiTranslation {
|
||||
|
||||
/**
|
||||
* @param {Array<string, string>} translations
|
||||
*/
|
||||
constructor(translations) {
|
||||
this._translations = translations;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} name
|
||||
* @returns {string}
|
||||
*/
|
||||
get(name) {
|
||||
return this._translations[name];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} name
|
||||
* @returns {boolean}
|
||||
*/
|
||||
has(name) {
|
||||
return name in this._translations;
|
||||
}
|
||||
|
||||
}
|
||||
33
assets/js/KimaiWebLoader.js
Normal file
33
assets/js/KimaiWebLoader.js
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* Main JS application file for Kimai 2. This file should be included in all pages.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*!
|
||||
* [KIMAI] Wrapper class for loading Kimai app in browser script scope
|
||||
*/
|
||||
|
||||
import KimaiLoader from "./KimaiLoader";
|
||||
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define([], function () {
|
||||
return (root.KimaiWebLoader = factory());
|
||||
});
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
module.exports = factory();
|
||||
} else {
|
||||
root.KimaiWebLoader = factory();
|
||||
}
|
||||
}(typeof self !== 'undefined' ? self : this, function () {
|
||||
|
||||
class KimaiWebLoader extends KimaiLoader {
|
||||
}
|
||||
|
||||
return KimaiWebLoader;
|
||||
|
||||
}));
|
||||
97
assets/js/forms/KimaiAutocomplete.js
Normal file
97
assets/js/forms/KimaiAutocomplete.js
Normal file
@@ -0,0 +1,97 @@
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
import TomSelect from 'tom-select';
|
||||
import KimaiFormPlugin from "./KimaiFormPlugin";
|
||||
|
||||
/**
|
||||
* Supporting auto-complete fields via API.
|
||||
* Used for timesheet tagging in toolbar and edit dialogs.
|
||||
*/
|
||||
export default class KimaiAutocomplete extends KimaiFormPlugin {
|
||||
|
||||
init()
|
||||
{
|
||||
this.selector = '[data-form-widget="autocomplete"]';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {HTMLFormElement} form
|
||||
* @return boolean
|
||||
*/
|
||||
supportsForm(form) // eslint-disable-line no-unused-vars
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
activateForm(form)
|
||||
{
|
||||
/** @type {KimaiAPI} API */
|
||||
const API = this.getContainer().getPlugin('api');
|
||||
|
||||
[].slice.call(form.querySelectorAll(this.selector)).map((node) => {
|
||||
const apiUrl = node.dataset['autocompleteUrl'];
|
||||
let minChars = 3;
|
||||
if (node.dataset['minimumCharacter'] !== undefined) {
|
||||
minChars = parseInt(node.dataset['minimumCharacter']);
|
||||
}
|
||||
|
||||
new TomSelect(node, {
|
||||
// if there are more than 500, they need to be found by "typing"
|
||||
maxOptions: 500,
|
||||
// the autocomplete is ONLY used, when the user can create tags
|
||||
create: node.dataset['create'] !== undefined,
|
||||
onOptionAdd: (value) => {
|
||||
node.dispatchEvent(new CustomEvent('create', {detail: {'value': value}}));
|
||||
},
|
||||
plugins: ['remove_button'],
|
||||
shouldLoad: function(query) {
|
||||
return query.length >= minChars;
|
||||
},
|
||||
load: (query, callback) => {
|
||||
API.get(apiUrl, {'name': query}, (data) => {
|
||||
const results = [].slice.call(data).map((result) => {
|
||||
return {text: result, value: result};
|
||||
});
|
||||
callback(results);
|
||||
}, () => {
|
||||
callback();
|
||||
});
|
||||
},
|
||||
render: {
|
||||
// eslint-disable-next-line
|
||||
not_loading: (data, escape) => {
|
||||
// no default content
|
||||
},
|
||||
option_create: (data, escape) => {
|
||||
const name = escape(data.input);
|
||||
if (name.length < 3) {
|
||||
return null;
|
||||
}
|
||||
const tpl = this.translate('select.search.create');
|
||||
const tplReplaced = tpl.replace('%input%', '<strong>' + name + '</strong>')
|
||||
return '<div class="create">' + tplReplaced + '</div>';
|
||||
},
|
||||
no_results: (data, escape) => {
|
||||
const tpl = this.translate('select.search.notfound');
|
||||
const tplReplaced = tpl.replace('%input%', '<strong>' + escape(data.input) + '</strong>')
|
||||
return '<div class="no-results">' + tplReplaced + '</div>';
|
||||
},
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
destroyForm(form) {
|
||||
[].slice.call(form.querySelectorAll(this.selector)).map((node) => {
|
||||
if (node.tomselect) {
|
||||
node.tomselect.destroy();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
71
assets/js/forms/KimaiCopyDataForm.js
Normal file
71
assets/js/forms/KimaiCopyDataForm.js
Normal file
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*!
|
||||
* [KIMAI] KimaiEditTimesheetForm: responsible for the most important form in the application
|
||||
*/
|
||||
|
||||
import KimaiFormPlugin from "./KimaiFormPlugin";
|
||||
|
||||
/**
|
||||
* Used for simple copy from link to input action, e.g. the time and duration dropdowns
|
||||
* copy the selected values into their corresponding input.
|
||||
*/
|
||||
export default class KimaiCopyDataForm extends KimaiFormPlugin {
|
||||
|
||||
/**
|
||||
* @param {HTMLFormElement} form
|
||||
* @return boolean
|
||||
*/
|
||||
supportsForm(form) // eslint-disable-line no-unused-vars
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {HTMLFormElement} form
|
||||
*/
|
||||
activateForm(form) // eslint-disable-line no-unused-vars
|
||||
{
|
||||
if (this._eventHandler === undefined) {
|
||||
this._eventHandler = (event) => {
|
||||
let element = event.target;
|
||||
if (!element.matches('a[data-form-widget="copy-data"]')) {
|
||||
element = element.parentNode; // mostly for icons
|
||||
}
|
||||
if (!element.matches('a[data-form-widget="copy-data"]') || element.dataset.target === undefined) {
|
||||
return;
|
||||
}
|
||||
const target = document.querySelector(element.dataset.target);
|
||||
if (target === null) {
|
||||
return;
|
||||
}
|
||||
target.value = element.dataset.value;
|
||||
if (element.dataset.event !== undefined) {
|
||||
for (const event of element.dataset.event.split(' ')) {
|
||||
target.dispatchEvent(new Event(event));
|
||||
}
|
||||
} else if (element.dataset.eventBubbles !== undefined) {
|
||||
for (const event of element.dataset.eventBubbles.split(' ')) {
|
||||
target.dispatchEvent(new Event(event, {bubbles: true}));
|
||||
}
|
||||
}
|
||||
event.preventDefault();
|
||||
};
|
||||
}
|
||||
form.addEventListener('click', this._eventHandler);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {HTMLFormElement} form
|
||||
*/
|
||||
destroyForm(form) // eslint-disable-line no-unused-vars
|
||||
{
|
||||
form.removeEventListener('click', this._eventHandler);
|
||||
}
|
||||
|
||||
}
|
||||
70
assets/js/forms/KimaiDateNowForm.js
Normal file
70
assets/js/forms/KimaiDateNowForm.js
Normal file
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*!
|
||||
* [KIMAI] KimaiEditTimesheetForm: responsible for the most important form in the application
|
||||
*/
|
||||
|
||||
import KimaiFormPlugin from "./KimaiFormPlugin";
|
||||
|
||||
/**
|
||||
*/
|
||||
export default class KimaiDateNowForm extends KimaiFormPlugin {
|
||||
|
||||
init()
|
||||
{
|
||||
this.selector = 'a[data-form-widget="date-now"]';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {HTMLFormElement} form
|
||||
* @return boolean
|
||||
*/
|
||||
supportsForm(form) // eslint-disable-line no-unused-vars
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {HTMLFormElement} form
|
||||
*/
|
||||
activateForm(form)
|
||||
{
|
||||
[].slice.call(form.querySelectorAll(this.selector)).map((element) => {
|
||||
if (element.dataset.format !== undefined && element.dataset.target !== undefined) {
|
||||
if (this._eventHandler === undefined) {
|
||||
this._eventHandler = (event) => {
|
||||
const linkTarget = event.currentTarget;
|
||||
|
||||
const formElement = document.getElementById(linkTarget.dataset.target);
|
||||
if (!formElement.disabled) {
|
||||
formElement.value = this.getDateUtils().format(linkTarget.dataset.format, null);
|
||||
formElement.dispatchEvent(new Event('change', {bubbles: true}));
|
||||
}
|
||||
|
||||
event.preventDefault();
|
||||
};
|
||||
}
|
||||
element.addEventListener('click', this._eventHandler);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {HTMLFormElement} form
|
||||
*/
|
||||
destroyForm(form)
|
||||
{
|
||||
[].slice.call(form.querySelectorAll(this.selector)).map((element) => {
|
||||
if (element.dataset.format !== undefined && element.dataset.target !== undefined) {
|
||||
element.removeEventListener('click', this._eventHandler);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
113
assets/js/forms/KimaiDatePicker.js
Normal file
113
assets/js/forms/KimaiDatePicker.js
Normal file
@@ -0,0 +1,113 @@
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*!
|
||||
* [KIMAI] KimaiDatePicker: single date selects (currently unused)
|
||||
*/
|
||||
|
||||
import { Litepicker } from 'litepicker';
|
||||
import 'litepicker/dist/plugins/mobilefriendly';
|
||||
import KimaiFormPlugin from "./KimaiFormPlugin";
|
||||
|
||||
export default class KimaiDatePicker extends KimaiFormPlugin {
|
||||
|
||||
constructor(selector)
|
||||
{
|
||||
super();
|
||||
this._selector = selector;
|
||||
}
|
||||
|
||||
init()
|
||||
{
|
||||
window.disableLitepickerStyles = true;
|
||||
this._pickers = [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {HTMLFormElement} form
|
||||
* @return boolean
|
||||
*/
|
||||
supportsForm(form) // eslint-disable-line no-unused-vars
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {HTMLFormElement} form
|
||||
*/
|
||||
activateForm(form)
|
||||
{
|
||||
const FIRST_DOW = this.getConfigurations().getFirstDayOfWeek(false);
|
||||
const LANGUAGE = this.getConfigurations().getLanguage();
|
||||
|
||||
let options = {
|
||||
buttonText: {
|
||||
previousMonth: `<i class="fas fa-chevron-left"></i>`,
|
||||
nextMonth: `<i class="fas fa-chevron-right"></i>`,
|
||||
apply: this.translate('confirm'),
|
||||
cancel: this.translate('cancel'),
|
||||
},
|
||||
};
|
||||
|
||||
const newPickers = [].slice.call(form.querySelectorAll(this._selector)).map((element) => {
|
||||
if (element.dataset.format === undefined) {
|
||||
console.log('Trying to bind litepicker to an element without data-format attribute');
|
||||
}
|
||||
options = {...options, ...{
|
||||
format: element.dataset.format,
|
||||
showTooltip: false,
|
||||
element: element,
|
||||
lang: LANGUAGE,
|
||||
autoRefresh: true,
|
||||
firstDay: FIRST_DOW, // Litepicker: 0 = Sunday, 1 = Monday
|
||||
setup: (picker) => {
|
||||
// nasty hack, because litepicker does not trigger change event on the input and the available
|
||||
// event "selected" is triggered why to often, even when moving the cursor inside the input
|
||||
// element (not even typing is necessary) and so we have to make sure that the manual "click" event
|
||||
// (works for touch as well) happened before we actually dispatch the change event manually ...
|
||||
// what? report forms would be submitted upon cursor move without the "preselect” check
|
||||
picker.on('preselect', (date1, date2) => { // eslint-disable-line no-unused-vars
|
||||
picker._wasPreselected = true;
|
||||
});
|
||||
picker.on('selected', (date1, date2) => { // eslint-disable-line no-unused-vars
|
||||
if (picker._wasPreselected !== undefined) {
|
||||
element.dispatchEvent(new Event('change', {bubbles: true}));
|
||||
delete picker._wasPreselected;
|
||||
}
|
||||
});
|
||||
},
|
||||
}};
|
||||
|
||||
return [element, new Litepicker(this.prepareOptions(options))];
|
||||
});
|
||||
|
||||
this._pickers = this._pickers.concat(newPickers);
|
||||
}
|
||||
|
||||
prepareOptions(options)
|
||||
{
|
||||
return {...options, ...{
|
||||
plugins: ['mobilefriendly'],
|
||||
}};
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {HTMLFormElement} form
|
||||
*/
|
||||
destroyForm(form)
|
||||
{
|
||||
[].slice.call(form.querySelectorAll(this._selector)).map((element) => {
|
||||
for (let i = 0; i < this._pickers.length; i++) {
|
||||
if (this._pickers[i][0] === element) {
|
||||
this._pickers[i][1].destroy();
|
||||
this._pickers.splice(i, 1);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
25
assets/js/forms/KimaiDateRangePicker.js
Normal file
25
assets/js/forms/KimaiDateRangePicker.js
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*!
|
||||
* [KIMAI] KimaiDateRangePicker: activate the (daterange picker) compound field in toolbar
|
||||
*/
|
||||
|
||||
import KimaiDatePicker from "./KimaiDatePicker";
|
||||
|
||||
export default class KimaiDateRangePicker extends KimaiDatePicker {
|
||||
|
||||
prepareOptions(options)
|
||||
{
|
||||
return {...options, ...{
|
||||
plugins: ['mobilefriendly'],
|
||||
singleMode: false,
|
||||
autoRefresh: true,
|
||||
}};
|
||||
}
|
||||
|
||||
}
|
||||
39
assets/js/forms/KimaiFormPlugin.js
Normal file
39
assets/js/forms/KimaiFormPlugin.js
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*!
|
||||
* [KIMAI] KimaiFormPlugin: base class for all none ID plugin that handle forms
|
||||
*/
|
||||
|
||||
import KimaiPlugin from '../KimaiPlugin';
|
||||
|
||||
export default class KimaiFormPlugin extends KimaiPlugin {
|
||||
|
||||
/**
|
||||
* @param {HTMLFormElement} form
|
||||
* @return boolean
|
||||
*/
|
||||
supportsForm(form) // eslint-disable-line no-unused-vars
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {HTMLFormElement} form
|
||||
*/
|
||||
activateForm(form) // eslint-disable-line no-unused-vars
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {HTMLFormElement} form
|
||||
*/
|
||||
destroyForm(form) // eslint-disable-line no-unused-vars
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
574
assets/js/forms/KimaiFormSelect.js
Normal file
574
assets/js/forms/KimaiFormSelect.js
Normal file
@@ -0,0 +1,574 @@
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*!
|
||||
* [KIMAI] KimaiFormSelect: enhanced functionality for HTMLSelectElement
|
||||
*/
|
||||
|
||||
import TomSelect from 'tom-select';
|
||||
import KimaiFormPlugin from "./KimaiFormPlugin";
|
||||
|
||||
export default class KimaiFormSelect extends KimaiFormPlugin {
|
||||
|
||||
constructor(selector, apiSelects)
|
||||
{
|
||||
super();
|
||||
this._selector = selector;
|
||||
this._apiSelects = apiSelects;
|
||||
}
|
||||
|
||||
getId()
|
||||
{
|
||||
return 'form-select';
|
||||
}
|
||||
|
||||
init()
|
||||
{
|
||||
// selects the original value inside dropdowns, as the "reset" event (the updated option)
|
||||
// is not automatically propagated to the JS element
|
||||
document.addEventListener('reset', (event) => {
|
||||
if (event.target.tagName.toUpperCase() === 'FORM') {
|
||||
setTimeout(() => {
|
||||
const fields = event.target.querySelectorAll(this._selector);
|
||||
for (let field of fields) {
|
||||
if (field.tagName.toUpperCase() === 'SELECT') {
|
||||
field.dispatchEvent(new Event('data-reloaded'));
|
||||
}
|
||||
}
|
||||
}, 10);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {HTMLFormElement} node
|
||||
*/
|
||||
activateSelectPickerByElement(node)
|
||||
{
|
||||
let plugins = ['change_listener'];
|
||||
|
||||
const isMultiple = node.multiple !== undefined && node.multiple === true;
|
||||
|
||||
/*
|
||||
const isOrdering = false;
|
||||
if (isOrdering) {
|
||||
plugins.push('caret_position');
|
||||
plugins.push('drag_drop');
|
||||
}
|
||||
*/
|
||||
|
||||
if (isMultiple) {
|
||||
plugins.push('remove_button');
|
||||
}
|
||||
|
||||
let options = {
|
||||
lockOptgroupOrder: true,
|
||||
allowEmptyOption: true,
|
||||
plugins: plugins,
|
||||
// if there are more than X entries, the other ones are hidden and can only be found
|
||||
// by typing some characters to trigger the internal option search
|
||||
maxOptions: 500,
|
||||
};
|
||||
|
||||
let render = {
|
||||
option_create: (data, escape) => {
|
||||
const name = escape(data.input);
|
||||
if (name.length < 3) {
|
||||
return null;
|
||||
}
|
||||
const tpl = this.translate('select.search.create');
|
||||
const tplReplaced = tpl.replace('%input%', '<strong>' + name + '</strong>');
|
||||
return '<div class="create">' + tplReplaced + '</div>';
|
||||
},
|
||||
no_results: (data, escape) => {
|
||||
const tpl = this.translate('select.search.notfound');
|
||||
const tplReplaced = tpl.replace('%input%', '<strong>' + escape(data.input) + '</strong>');
|
||||
return '<div class="no-results">' + tplReplaced + '</div>';
|
||||
},
|
||||
onOptionAdd: (value) => {
|
||||
node.dispatchEvent(new CustomEvent('create', {detail: {'value': value}}));
|
||||
},
|
||||
};
|
||||
|
||||
if (node.dataset['create'] !== undefined) {
|
||||
options = {...options, ...{
|
||||
persist: true,
|
||||
create: true,
|
||||
}};
|
||||
} else {
|
||||
options = {...options, ...{
|
||||
persist: false,
|
||||
create: false,
|
||||
}};
|
||||
}
|
||||
|
||||
if (node.dataset.disableSearch !== undefined) {
|
||||
options = {...options, ...{
|
||||
controlInput: null,
|
||||
}};
|
||||
}
|
||||
|
||||
if (node.dataset['renderer'] !== undefined && node.dataset['renderer'] === 'color') {
|
||||
options.render = {...render, ...{
|
||||
option: function(data, escape) {
|
||||
let color = data.value;
|
||||
if (data.color !== undefined) {
|
||||
color = data.color;
|
||||
}
|
||||
return '<div class="list-group-item border-0 p-1 ps-2 text-nowrap"><span style="background-color:' + color + '" class="color-choice-item"> </span>' + escape(data.text) + '</div>';
|
||||
},
|
||||
item: function(data, escape) {
|
||||
let color = data.value;
|
||||
if (data.color !== undefined) {
|
||||
color = data.color;
|
||||
}
|
||||
return '<div class="text-nowrap"><span style="background-color:' + color + '" class="color-choice-item"> </span>' + escape(data.text) + '</div>';
|
||||
}
|
||||
}};
|
||||
} else {
|
||||
options.render = {...render, ...{
|
||||
// the empty entry would collapse and only show as a tiny 5px line if there is no content inside
|
||||
option: function(data, escape) {
|
||||
let text = data.text;
|
||||
if (text === null || text.trim() === '') {
|
||||
text = ' ';
|
||||
} else {
|
||||
text = escape(text);
|
||||
}
|
||||
return '<div>' + text + '</div>';
|
||||
}
|
||||
}};
|
||||
}
|
||||
|
||||
const select = new TomSelect(node, options);
|
||||
node.addEventListener('data-reloaded', (event) => {
|
||||
select.clear(true);
|
||||
select.clearOptionGroups();
|
||||
select.clearOptions();
|
||||
select.sync();
|
||||
select.setValue(event.detail);
|
||||
select.refreshItems();
|
||||
select.refreshOptions(false);
|
||||
});
|
||||
|
||||
// support reloading the list upon external event
|
||||
if (node.dataset['reload'] !== undefined) {
|
||||
node.addEventListener('reload', () => {
|
||||
select.disable();
|
||||
node.disabled = true;
|
||||
|
||||
/** @type {KimaiAPI} API */
|
||||
const API = this.getContainer().getPlugin('api');
|
||||
|
||||
API.get(node.dataset['reload'], {}, (data) => {
|
||||
this._updateSelect(node, data);
|
||||
select.enable();
|
||||
node.disabled = false;
|
||||
});
|
||||
|
||||
node.dispatchEvent(new Event('change'));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {HTMLFormElement} form
|
||||
* @return boolean
|
||||
*/
|
||||
supportsForm(form) // eslint-disable-line no-unused-vars
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {HTMLFormElement} form
|
||||
*/
|
||||
activateForm(form)
|
||||
{
|
||||
[].slice.call(form.querySelectorAll(this._selector)).map((node) => {
|
||||
this.activateSelectPickerByElement(node);
|
||||
});
|
||||
|
||||
this._activateApiSelects(this._apiSelects);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {HTMLFormElement} form
|
||||
*/
|
||||
destroyForm(form)
|
||||
{
|
||||
[].slice.call(form.querySelectorAll(this._selector)).map((node) => {
|
||||
if (node.tomselect) {
|
||||
node.tomselect.destroy();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string|Element} selectIdentifier
|
||||
* @param {object} data
|
||||
* @private
|
||||
*/
|
||||
_updateOptions(selectIdentifier, data)
|
||||
{
|
||||
let emptyOption = null;
|
||||
let node = null;
|
||||
if (selectIdentifier instanceof Element) {
|
||||
node = selectIdentifier;
|
||||
} else {
|
||||
node = document.querySelector(selectIdentifier);
|
||||
}
|
||||
if (node === null) {
|
||||
console.log('Missing select: ' + selectIdentifier);
|
||||
return;
|
||||
}
|
||||
const selectedValue = node.value;
|
||||
|
||||
for (let i = 0; i < node.options.length; i++) {
|
||||
if (node.options[i].value === '') {
|
||||
emptyOption = node.options[i];
|
||||
}
|
||||
}
|
||||
|
||||
node.options.length = 0;
|
||||
|
||||
if (emptyOption !== null) {
|
||||
node.appendChild(this._createOption(emptyOption.text, ''));
|
||||
}
|
||||
|
||||
let emptyOpts = [];
|
||||
let options = [];
|
||||
/** @type {string|null} titlePattern */
|
||||
let titlePattern = null;
|
||||
if (node.dataset !== undefined && node.dataset['optionPattern'] !== undefined) {
|
||||
titlePattern = node.dataset['optionPattern'];
|
||||
}
|
||||
if (titlePattern === null || titlePattern === '') {
|
||||
titlePattern = '{name}';
|
||||
}
|
||||
|
||||
for (const [key, value] of Object.entries(data)) {
|
||||
if (key === '__empty__') {
|
||||
for (const entity of value) {
|
||||
emptyOpts.push(this._createOption(this._getTitleFromPattern(titlePattern, entity), entity.id));
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
let optGroup = this._createOptgroup(key);
|
||||
for (const entity of value) {
|
||||
optGroup.appendChild(this._createOption(this._getTitleFromPattern(titlePattern, entity), entity.id));
|
||||
}
|
||||
options.push(optGroup);
|
||||
}
|
||||
|
||||
options.forEach(child => node.appendChild(child));
|
||||
emptyOpts.forEach(child => node.appendChild(child));
|
||||
|
||||
// if available, re-select the previous selected option (mostly usable for global activities)
|
||||
node.value = selectedValue;
|
||||
|
||||
// pre-select an option if it is the only available one
|
||||
if (node.value === '' || node.value === null) {
|
||||
const allOptions = node.options;
|
||||
const optionLength = allOptions.length;
|
||||
let selectOption = '';
|
||||
|
||||
if (optionLength === 1) {
|
||||
selectOption = allOptions[0].value;
|
||||
} else if (optionLength === 2 && emptyOption !== null) {
|
||||
selectOption = allOptions[1].value;
|
||||
}
|
||||
|
||||
if (selectOption !== '') {
|
||||
node.value = selectOption;
|
||||
}
|
||||
}
|
||||
|
||||
// this will update the attached javascript component
|
||||
node.dispatchEvent(new CustomEvent('data-reloaded', {detail: node.value}));
|
||||
// if we don't trigger the change, the other selects won't reset
|
||||
node.dispatchEvent(new Event('change'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} pattern
|
||||
* @param {array} entity
|
||||
* @private
|
||||
*/
|
||||
_getTitleFromPattern(pattern, entity)
|
||||
{
|
||||
const DATE_UTILS = this.getDateUtils();
|
||||
const regexp = new RegExp('{[^}]*?}','g');
|
||||
let title = pattern;
|
||||
let match = null;
|
||||
|
||||
while ((match = regexp.exec(pattern)) !== null) {
|
||||
// cutting a string like "{name}" into "name"
|
||||
const field = match[0].slice(1, -1);
|
||||
let value = entity[field] === undefined ? null : entity[field];
|
||||
if ((field === 'start' || field === 'end')) {
|
||||
if (value === null) {
|
||||
value = '?';
|
||||
} else {
|
||||
value = DATE_UTILS.getFormattedDate(value);
|
||||
}
|
||||
}
|
||||
|
||||
title = title.replace(new RegExp('{' + field + '}', 'g'), value ?? '');
|
||||
}
|
||||
title = title.replace(/- \?-\?/, '');
|
||||
title = title.replace(/\r\n|\r|\n/g, ' ');
|
||||
title = title.substring(0, 110);
|
||||
|
||||
const chars = '- ';
|
||||
let start = 0, end = title.length;
|
||||
|
||||
while (start < end && chars.indexOf(title[start]) >= 0) {
|
||||
++start;
|
||||
}
|
||||
|
||||
while (end > start && chars.indexOf(title[end - 1]) >= 0) {
|
||||
--end;
|
||||
}
|
||||
|
||||
return (start > 0 || end < title.length) ? title.substring(start, end) : title;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {HTMLSelectElement} select
|
||||
* @param {string} label
|
||||
* @param {string} value
|
||||
* @param {object} dataset
|
||||
*/
|
||||
addOption(select, label, value, dataset)
|
||||
{
|
||||
const option = this._createOption(label, value);
|
||||
for (const key in dataset) {
|
||||
option.dataset[key] = dataset[key];
|
||||
}
|
||||
|
||||
select.options.add(option);
|
||||
if (select.tomselect !== undefined) {
|
||||
select.tomselect.sync();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {HTMLSelectElement} select
|
||||
* @param {HTMLOptionElement} option
|
||||
*/
|
||||
removeOption(select, option)
|
||||
{
|
||||
option.remove();
|
||||
if (select.tomselect !== undefined) {
|
||||
select.tomselect.removeOption(option.value, true);
|
||||
select.tomselect.clear(true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} label
|
||||
* @param {string} value
|
||||
* @returns {HTMLElement}
|
||||
* @private
|
||||
*/
|
||||
_createOption(label, value)
|
||||
{
|
||||
let option = document.createElement('option');
|
||||
option.innerText = label;
|
||||
option.value = value;
|
||||
return option;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} label
|
||||
* @returns {HTMLElement}
|
||||
* @private
|
||||
*/
|
||||
_createOptgroup(label)
|
||||
{
|
||||
let optGroup = document.createElement('optgroup');
|
||||
optGroup.label = label;
|
||||
return optGroup;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} selector
|
||||
* @private
|
||||
*/
|
||||
_activateApiSelects(selector)
|
||||
{
|
||||
if (this._eventHandlerApiSelects === undefined) {
|
||||
this._eventHandlerApiSelects = (event) => {
|
||||
if (event.target === null || !event.target.matches(selector)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const apiSelect = event.target;
|
||||
const targetSelectId = '#' + apiSelect.dataset['relatedSelect'];
|
||||
/** @type {HTMLSelectElement} targetSelect */
|
||||
const targetSelect = document.getElementById(apiSelect.dataset['relatedSelect']);
|
||||
|
||||
// if the related target select does not exist, we do not need to load the related data
|
||||
if (targetSelect === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (targetSelect.tomselect !== undefined) {
|
||||
targetSelect.tomselect.disable();
|
||||
}
|
||||
targetSelect.disabled = true;
|
||||
|
||||
let formPrefix = apiSelect.dataset['formPrefix'];
|
||||
if (formPrefix === undefined || formPrefix === null) {
|
||||
formPrefix = '';
|
||||
} else if (formPrefix.length > 0) {
|
||||
formPrefix += '_';
|
||||
}
|
||||
|
||||
let newApiUrl = this._buildUrlWithFormFields(apiSelect.dataset['apiUrl'], formPrefix);
|
||||
|
||||
const selectValue = apiSelect.value;
|
||||
|
||||
// Problem: select a project with activities and then select a customer that has no project
|
||||
// results in a wrong URL, it triggers "activities?project=" instead of using the "emptyUrl"
|
||||
if (selectValue === undefined || selectValue === null || selectValue === '' || (Array.isArray(selectValue) && selectValue.length === 0)) {
|
||||
if (apiSelect.dataset['emptyUrl'] === undefined) {
|
||||
this._updateSelect(targetSelectId, {});
|
||||
return;
|
||||
}
|
||||
newApiUrl = this._buildUrlWithFormFields(apiSelect.dataset['emptyUrl'], formPrefix);
|
||||
}
|
||||
|
||||
/** @type {KimaiAPI} API */
|
||||
const API = this.getContainer().getPlugin('api');
|
||||
|
||||
API.get(newApiUrl, {}, (data) => {
|
||||
this._updateSelect(targetSelectId, data);
|
||||
if (targetSelect.tomselect !== undefined) {
|
||||
targetSelect.tomselect.enable();
|
||||
}
|
||||
targetSelect.disabled = false;
|
||||
});
|
||||
}
|
||||
|
||||
document.addEventListener('change', this._eventHandlerApiSelects);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} apiUrl
|
||||
* @param {string} formPrefix
|
||||
* @return {string}
|
||||
* @private
|
||||
*/
|
||||
_buildUrlWithFormFields(apiUrl, formPrefix)
|
||||
{
|
||||
let newApiUrl = apiUrl;
|
||||
|
||||
apiUrl.split('?')[1].split('&').forEach(item => {
|
||||
const [key, value] = item.split('='); // eslint-disable-line no-unused-vars
|
||||
const decoded = decodeURIComponent(value);
|
||||
const test = decoded.match(/%(.*)%/);
|
||||
if (test !== null) {
|
||||
const originalFieldName = test[1];
|
||||
const targetFieldName = (formPrefix + originalFieldName).replace(/\[/, '').replace(/]/, '');
|
||||
const targetField = document.getElementById(targetFieldName);
|
||||
let newValue = '';
|
||||
if (targetField === null) {
|
||||
// happens for example:
|
||||
// - in duration only mode, when the end field is not found
|
||||
// console.log('ERROR: Cannot find field with name "' + test[1] + '" by selector: #' + formPrefix + test[1]);
|
||||
} else {
|
||||
if (targetField.value !== null) {
|
||||
newValue = targetField.value;
|
||||
if (targetField.tagName === 'SELECT' && targetField.multiple) {
|
||||
newValue = [...targetField.selectedOptions].map(o => o.value);
|
||||
} else if (newValue !== '') {
|
||||
if (targetField.type === 'date') {
|
||||
const timeId = targetField.id.replace('_date', '_time')
|
||||
const timeElement = document.getElementById(timeId);
|
||||
const time = timeElement === null ? '12:00:00' : timeElement.value;
|
||||
// using 12:00 as fallback, because timezone handling might change the date if we use 00:00
|
||||
const newDate = this.getDateUtils().fromHtml5Input(newValue, time);
|
||||
newValue = this.getDateUtils().formatForAPI(newDate, false);
|
||||
} else if (targetField.type === 'text' && targetField.name.includes('date')) {
|
||||
const timeId = targetField.id.replace('_date', '_time')
|
||||
const timeElement = document.getElementById(timeId);
|
||||
// using 12:00 as fallback, because timezone handling might change the date if we use 00:00
|
||||
let time = '12:00:00';
|
||||
let timeFormat = 'HH:mm';
|
||||
if (timeElement !== null) {
|
||||
time = timeElement.value;
|
||||
timeFormat = timeElement.dataset['format'];
|
||||
}
|
||||
const newDate = this.getDateUtils().fromFormat(newValue.trim() + ' ' + time.trim(), targetField.dataset['format'] + ' ' + timeFormat);
|
||||
newValue = this.getDateUtils().formatForAPI(newDate, false);
|
||||
} else if (targetField.dataset['format'] !== undefined) {
|
||||
// find out when this else branch is triggered and document!
|
||||
|
||||
if (this.getDateUtils().isValidDateTime(newValue, targetField.dataset['format'])) {
|
||||
newValue = this.getDateUtils().format(targetField.dataset['format'], newValue);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// happens for example:
|
||||
// - when the end date is not set on a timesheet record and the project list is loaded (as the URL contains the %end% replacer)
|
||||
// console.log('Empty value found for field with name "' + test[1] + '" by selector: #' + formPrefix + test[1]);
|
||||
}
|
||||
} else {
|
||||
// happens for example:
|
||||
// - when a customer without projects is selected
|
||||
// console.log('ERROR: Empty field with name "' + test[1] + '" by selector: #' + formPrefix + test[1]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (Array.isArray(newValue)) {
|
||||
let urlParams = [];
|
||||
for (let tmpValue of newValue) {
|
||||
urlParams.push(originalFieldName + '=' + tmpValue);
|
||||
}
|
||||
newApiUrl = newApiUrl.replace(item, urlParams.join('&'));
|
||||
} else {
|
||||
newApiUrl = newApiUrl.replace(value, newValue);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return newApiUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string|Element} select
|
||||
* @param {object} data
|
||||
* @private
|
||||
*/
|
||||
_updateSelect(select, data)
|
||||
{
|
||||
const options = {};
|
||||
for (const apiData of data) {
|
||||
let title = '__empty__';
|
||||
if (apiData['parentTitle'] !== undefined && apiData['parentTitle'] !== null) {
|
||||
title = apiData['parentTitle'];
|
||||
}
|
||||
if (options[title] === undefined) {
|
||||
options[title] = [];
|
||||
}
|
||||
options[title].push(apiData);
|
||||
}
|
||||
|
||||
const ordered = {};
|
||||
Object.keys(options).sort().forEach(function(key) {
|
||||
ordered[key] = options[key];
|
||||
});
|
||||
|
||||
this._updateOptions(select, ordered);
|
||||
}
|
||||
}
|
||||
145
assets/js/forms/KimaiTeamForm.js
Normal file
145
assets/js/forms/KimaiTeamForm.js
Normal file
@@ -0,0 +1,145 @@
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*!
|
||||
* [KIMAI] KimaiEditTimesheetForm: responsible for the most important form in the application
|
||||
*/
|
||||
|
||||
import KimaiFormPlugin from "./KimaiFormPlugin";
|
||||
import KimaiColor from "../widgets/KimaiColor";
|
||||
|
||||
export default class KimaiTeamForm extends KimaiFormPlugin {
|
||||
|
||||
init()
|
||||
{
|
||||
this.usersId = 'team_edit_form_users';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {HTMLFormElement} form
|
||||
* @return boolean
|
||||
*/
|
||||
supportsForm(form)
|
||||
{
|
||||
return form.name === 'team_edit_form';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {HTMLElement}
|
||||
* @private
|
||||
*/
|
||||
_getPrototype()
|
||||
{
|
||||
return document.getElementById('team_edit_form_members');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {HTMLFormElement} form
|
||||
*/
|
||||
activateForm(form)
|
||||
{
|
||||
if (!this.supportsForm(form)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// must be attached to the form, because the button is added dynamically
|
||||
form.addEventListener('click', event => this._removeMember(event));
|
||||
|
||||
document.getElementById(this.usersId).addEventListener('change', event => {
|
||||
const select = event.target;
|
||||
const option = select.options[select.selectedIndex];
|
||||
const member = this._createMember(option);
|
||||
this._getPrototype().append(member);
|
||||
this.getPlugin('form-select').removeOption(select, option);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {HTMLOptionElement} option
|
||||
* @returns {Element}
|
||||
* @private
|
||||
*/
|
||||
_createMember(option)
|
||||
{
|
||||
const prototype = this._getPrototype();
|
||||
let counter = prototype.dataset['widgetCounter'] || prototype.childNodes.length;
|
||||
let newWidget = prototype.dataset['prototype'];
|
||||
|
||||
newWidget = newWidget.replace(/__name__/g, counter);
|
||||
|
||||
newWidget = newWidget.replace(/#000000/g, KimaiColor.calculateContrastColor(option.dataset.color));
|
||||
newWidget = newWidget.replace(/__DISPLAY__/g, option.dataset.display);
|
||||
newWidget = newWidget.replace(/__COLOR__/g, option.dataset.color);
|
||||
newWidget = newWidget.replace(/__INITIALS__/g, option.dataset.initials);
|
||||
newWidget = newWidget.replace(/__TITLE__/g, option.dataset.title);
|
||||
newWidget = newWidget.replace(/__USERNAME__/g, option.text);
|
||||
|
||||
prototype.dataset['widgetCounter'] = (++counter).toString();
|
||||
|
||||
const temp = document.createElement('div');
|
||||
temp.innerHTML = newWidget;
|
||||
temp.querySelector('input[type=hidden]').value = option.value;
|
||||
|
||||
const newNode = temp.firstElementChild;
|
||||
|
||||
// copy over all initial settings, so we are able to rebuild the original option if the
|
||||
// member is removed from the list later on
|
||||
for (const key in option.dataset) {
|
||||
newNode.dataset[key] = option.dataset[key];
|
||||
}
|
||||
|
||||
return newNode;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Event} event
|
||||
* @private
|
||||
*/
|
||||
_removeMember(event)
|
||||
{
|
||||
let button = event.target;
|
||||
|
||||
if (button.parentNode.matches('.remove-member')) {
|
||||
button = button.parentNode;
|
||||
}
|
||||
|
||||
if (button.matches('.remove-member')) {
|
||||
// see blocks.html.twig => block team_member_widget
|
||||
const element = button.parentNode.parentNode.parentNode.parentNode.parentNode;
|
||||
|
||||
// re-adding the option to the select makes up for form validation errors
|
||||
// because the list would have to be re-ordered and indices need to be changed ...
|
||||
/*
|
||||
this.getPlugin('form-select').addOption(
|
||||
document.getElementById(this.usersId),
|
||||
element.dataset['display'],
|
||||
element.dataset['id'],
|
||||
element.dataset
|
||||
);
|
||||
const prototype = this._getPrototype();
|
||||
prototype.dataset['widgetCounter'] = (prototype.dataset['widgetCounter'] - 1).toString();
|
||||
*/
|
||||
|
||||
element.remove();
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {HTMLFormElement} form
|
||||
*/
|
||||
destroyForm(form)
|
||||
{
|
||||
if (!this.supportsForm(form)) {
|
||||
return;
|
||||
}
|
||||
|
||||
form.removeEventListener('click', this._removeMember);
|
||||
}
|
||||
|
||||
}
|
||||
368
assets/js/forms/KimaiTimesheetForm.js
Normal file
368
assets/js/forms/KimaiTimesheetForm.js
Normal file
@@ -0,0 +1,368 @@
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*!
|
||||
* [KIMAI] KimaiEditTimesheetForm: responsible for the most important form in the application
|
||||
*/
|
||||
|
||||
import { DateTime } from 'luxon';
|
||||
import KimaiFormPlugin from "./KimaiFormPlugin";
|
||||
|
||||
export default class KimaiTimesheetForm extends KimaiFormPlugin {
|
||||
|
||||
/**
|
||||
* @param {HTMLFormElement} form
|
||||
* @return boolean
|
||||
*/
|
||||
supportsForm(form)
|
||||
{
|
||||
return (form.name === 'timesheet_edit_form' || form.name ==='timesheet_admin_edit_form' || form.name ==='timesheet_multi_user_edit_form');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {HTMLFormElement} form
|
||||
*/
|
||||
destroyForm(form)
|
||||
{
|
||||
if (!this.supportsForm(form)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this._beginDate !== undefined) {
|
||||
this._beginDate.removeEventListener('change', this._beginListener);
|
||||
delete this._beginListener;
|
||||
delete this._beginDate;
|
||||
}
|
||||
|
||||
if (this._beginTime !== undefined) {
|
||||
this._beginTime.removeEventListener('change', this._beginListener);
|
||||
delete this._beginTime;
|
||||
}
|
||||
|
||||
if (this._endTime !== undefined) {
|
||||
this._endTime.removeEventListener('change', this._endListener);
|
||||
delete this._endTime;
|
||||
}
|
||||
|
||||
if (this._duration !== undefined) {
|
||||
this._duration.removeEventListener('change', this._durationListener);
|
||||
delete this._durationListener;
|
||||
delete this._duration;
|
||||
}
|
||||
|
||||
if (this._durationToggle !== undefined && this._durationToggle !== null) {
|
||||
this._durationToggle.removeEventListener('change', this._durationToggleListener);
|
||||
delete this._durationToggleListener;
|
||||
delete this._durationToggle;
|
||||
}
|
||||
|
||||
if (this._activity !== undefined) {
|
||||
this._activity.removeEventListener('create', this._activityListener);
|
||||
delete this._activityListener;
|
||||
delete this._activity;
|
||||
}
|
||||
|
||||
if (this._project !== undefined) {
|
||||
delete this._project;
|
||||
}
|
||||
}
|
||||
|
||||
activateForm(form)
|
||||
{
|
||||
if (!this.supportsForm(form)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const formPrefix = form.name;
|
||||
|
||||
this._activity = document.getElementById(formPrefix + '_activity');
|
||||
this._project = document.getElementById(formPrefix + '_project');
|
||||
|
||||
/** @param {CustomEvent} event */
|
||||
this._activityListener = (event) => {
|
||||
const project = this._project.value;
|
||||
/** @type {KimaiAPI} API */
|
||||
const API = this.getContainer().getPlugin('api');
|
||||
API.post(this._activity.dataset['create'], {
|
||||
name: event.detail.value,
|
||||
project: (project === '' ? null : project),
|
||||
visible: true,
|
||||
}, () => {
|
||||
this._project.dispatchEvent(new Event('change'));
|
||||
});
|
||||
};
|
||||
this._activity.addEventListener('create', this._activityListener);
|
||||
|
||||
this._beginDate = document.getElementById(formPrefix + '_begin_date');
|
||||
this._beginTime = document.getElementById(formPrefix + '_begin_time');
|
||||
this._endTime = document.getElementById(formPrefix + '_end_time');
|
||||
this._duration = document.getElementById(formPrefix + '_duration');
|
||||
this._durationToggle = document.getElementById(formPrefix + '_duration_toggle');
|
||||
|
||||
if (this._beginDate === null || this._beginTime === null || this._endTime === null || this._duration === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._beginListener = () => this._changedBegin();
|
||||
this._endListener = () => this._changedEnd();
|
||||
this._durationListener = () => this._changedDuration();
|
||||
|
||||
this._beginDate.addEventListener('change', this._beginListener);
|
||||
this._beginTime.addEventListener('change', this._beginListener);
|
||||
this._endTime.addEventListener('change', this._endListener);
|
||||
this._duration.addEventListener('change', this._durationListener);
|
||||
|
||||
if (this._duration !== null && this._durationToggle !== null) {
|
||||
this._durationToggleListener = () => {
|
||||
this._durationToggle.classList.toggle('text-success');
|
||||
};
|
||||
this._durationToggle.addEventListener('click', this._durationToggleListener);
|
||||
}
|
||||
}
|
||||
|
||||
_isDurationConnected()
|
||||
{
|
||||
if (this._duration === null && this._durationToggle === null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this._durationToggle === null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return this._durationToggle.classList.contains('text-success');
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {DateTime|null}
|
||||
* @private
|
||||
*/
|
||||
_getBegin()
|
||||
{
|
||||
if (this._beginDate.value === '' || this._beginTime.value === '') {
|
||||
return null;
|
||||
}
|
||||
|
||||
const date = this.getDateUtils().fromFormat(
|
||||
this._beginDate.value + ' ' + this._beginTime.value,
|
||||
this._beginDate.dataset['format'] + ' ' + this._beginTime.dataset['format'],
|
||||
);
|
||||
|
||||
if (date.invalid) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return date;
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {DateTime|null}
|
||||
* @private
|
||||
*/
|
||||
_getEnd()
|
||||
{
|
||||
if (this._endTime.value === '') {
|
||||
return null;
|
||||
}
|
||||
|
||||
let date = this.getDateUtils().fromFormat(
|
||||
DateTime.now().toFormat('yyyy-LL-dd') + ' ' + this._endTime.value,
|
||||
'yyyy-LL-dd ' + this._endTime.dataset['format'],
|
||||
);
|
||||
|
||||
const begin = this._getBegin();
|
||||
if (begin !== null) {
|
||||
date = this.getDateUtils().fromFormat(
|
||||
begin.toFormat('yyyy-LL-dd') + ' ' + this._endTime.value,
|
||||
'yyyy-LL-dd ' + this._endTime.dataset['format'],
|
||||
);
|
||||
|
||||
if (date < begin) {
|
||||
date = date.plus({days: 1});
|
||||
}
|
||||
}
|
||||
|
||||
if (date.invalid) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ruleset:
|
||||
* - invalid begin => skip
|
||||
* - empty end => set end to begin (only if duration > 0 = running record)
|
||||
* - invalid end => skip
|
||||
* - calculate duration
|
||||
*/
|
||||
_changedBegin()
|
||||
{
|
||||
const begin = this._getBegin();
|
||||
if (begin === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
const duration = this._getParsedDuration();
|
||||
const hasDuration = duration.as('seconds') > 0;
|
||||
const end = this._getEnd();
|
||||
|
||||
if (end === null && hasDuration) {
|
||||
this._applyDateToField(begin.plus(duration), null, this._endTime);
|
||||
} else {
|
||||
this._updateDuration();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Ruleset:
|
||||
* - invalid end => skip
|
||||
* - empty begin => set begin to end
|
||||
* - invalid begin => skip
|
||||
* - calculate duration
|
||||
*/
|
||||
_changedEnd()
|
||||
{
|
||||
const end = this._getEnd();
|
||||
// empty or invalid date => reset duration and stop progress
|
||||
if (end === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
const duration = this._getParsedDuration();
|
||||
const hasDuration = duration.as('seconds') > 0;
|
||||
const begin = this._getBegin();
|
||||
|
||||
if (begin === null && hasDuration) {
|
||||
this._applyDateToField(end.minus(duration), this._beginDate, this._beginTime);
|
||||
} else {
|
||||
this._updateDuration();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
_updateDuration()
|
||||
{
|
||||
const begin = this._getBegin();
|
||||
const end = this._getEnd();
|
||||
let newDuration = null;
|
||||
|
||||
if (begin !== null && end !== null) {
|
||||
newDuration = end.diff(begin);
|
||||
}
|
||||
|
||||
this._setDurationAsString(newDuration);
|
||||
}
|
||||
|
||||
/**
|
||||
* Ruleset:
|
||||
* - invalid duration => skip
|
||||
* - if begin and end are empty: set begin to now and end to duration
|
||||
* - if begin is empty and end is not empty: set begin to end minus duration
|
||||
* - if begin is not empty and end is empty and duration is > 0 (running records = 0): set end to begin plus duration
|
||||
*/
|
||||
_changedDuration()
|
||||
{
|
||||
if (!this._isDurationConnected()) {
|
||||
return;
|
||||
}
|
||||
|
||||
const duration = this._getParsedDuration();
|
||||
if (!duration.isValid) {
|
||||
this._setDurationAsString(null);
|
||||
return;
|
||||
}
|
||||
|
||||
const begin = this._getBegin();
|
||||
let end = this._getEnd();
|
||||
const seconds = duration.as('seconds');
|
||||
|
||||
if (seconds < 0) {
|
||||
end = null;
|
||||
}
|
||||
|
||||
if (begin === null && end === null) {
|
||||
const newBegin = DateTime.now();
|
||||
this._applyDateToField(newBegin, this._beginDate, this._beginTime);
|
||||
this._applyDateToField(newBegin.plus({seconds: seconds}), null, this._endTime);
|
||||
} else if (begin === null && end !== null) {
|
||||
this._applyDateToField(end.minus({seconds: seconds}), this._beginDate, this._beginTime);
|
||||
} else if (begin !== null && seconds > 0) {
|
||||
this._applyDateToField(begin.plus({seconds: seconds}), null, this._endTime);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the value of a duration object as human-readable string into the duration field
|
||||
*
|
||||
* @param {Duration|null} duration
|
||||
*/
|
||||
_setDurationAsString(duration)
|
||||
{
|
||||
if (!this._isDurationConnected()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (duration === null) {
|
||||
this._duration.value = '';
|
||||
return;
|
||||
}
|
||||
|
||||
if (!duration.isValid) {
|
||||
return;
|
||||
}
|
||||
|
||||
const seconds = duration.as('seconds');
|
||||
if (seconds < 0) {
|
||||
this._duration.value = '';
|
||||
return;
|
||||
}
|
||||
|
||||
const hours = Math.floor(seconds / 3600);
|
||||
let minutes = Math.floor((seconds - (hours * 3600)) / 60);
|
||||
|
||||
if (minutes < 10) {
|
||||
minutes = '0' + minutes;
|
||||
}
|
||||
|
||||
this._duration.value = hours + ':' + minutes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a duration object from the duration input field.
|
||||
*
|
||||
* @private
|
||||
* @return {Duration}
|
||||
*/
|
||||
_getParsedDuration()
|
||||
{
|
||||
return this.getDateUtils().parseDuration(this._duration.value.toUpperCase());
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {DateTime|null} dateTime
|
||||
* @param {HTMLElement|null} dateField
|
||||
* @param {HTMLElement} timeField
|
||||
* @private
|
||||
*/
|
||||
_applyDateToField(dateTime, dateField, timeField)
|
||||
{
|
||||
if (dateTime === null || dateTime.invalid) {
|
||||
dateField.value = '';
|
||||
timeField.value = '';
|
||||
return;
|
||||
}
|
||||
|
||||
if (dateField !== null) {
|
||||
dateField.value = this.getDateUtils().format(dateField.dataset['format'], dateTime);
|
||||
}
|
||||
timeField.value = this.getDateUtils().format(timeField.dataset['format'], dateTime);
|
||||
}
|
||||
|
||||
}
|
||||
178
assets/js/plugins/KimaiAPI.js
Normal file
178
assets/js/plugins/KimaiAPI.js
Normal file
@@ -0,0 +1,178 @@
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*!
|
||||
* [KIMAI] KimaiAPI: easy access to API methods
|
||||
*/
|
||||
|
||||
import KimaiPlugin from "../KimaiPlugin";
|
||||
|
||||
export default class KimaiAPI extends KimaiPlugin {
|
||||
|
||||
getId() {
|
||||
return 'api';
|
||||
}
|
||||
|
||||
_headers() {
|
||||
const headers = new Headers();
|
||||
headers.append('X-AUTH-SESSION', '1');
|
||||
headers.append('Content-Type', 'application/json');
|
||||
|
||||
return headers;
|
||||
}
|
||||
|
||||
get(url, data, callbackSuccess, callbackError) {
|
||||
if (data !== undefined) {
|
||||
const params = (new URLSearchParams(data)).toString();
|
||||
if (params !== '') {
|
||||
url = url + (url.includes('?') ? '&' : '?') + params;
|
||||
}
|
||||
}
|
||||
|
||||
if (callbackError === undefined) {
|
||||
callbackError = (error) => {
|
||||
this.handleError('An error occurred', error);
|
||||
};
|
||||
}
|
||||
|
||||
this.fetch(url, {
|
||||
method: 'GET',
|
||||
headers: this._headers()
|
||||
}).then((response) => {
|
||||
response.json().then((json) => {
|
||||
callbackSuccess(json);
|
||||
});
|
||||
}).catch((error) => {
|
||||
callbackError(error);
|
||||
});
|
||||
}
|
||||
|
||||
post(url, data, callbackSuccess, callbackError) {
|
||||
if (callbackError === undefined) {
|
||||
callbackError = (error) => {
|
||||
this.handleError('action.update.error', error);
|
||||
};
|
||||
}
|
||||
|
||||
this.fetch(url, {
|
||||
method: 'POST',
|
||||
body: this._parseData(data),
|
||||
headers: this._headers()
|
||||
}).then((response) => {
|
||||
response.json().then((json) => {
|
||||
callbackSuccess(json);
|
||||
});
|
||||
}).catch((error) => {
|
||||
callbackError(error);
|
||||
});
|
||||
}
|
||||
|
||||
patch(url, data, callbackSuccess, callbackError) {
|
||||
if (callbackError === undefined) {
|
||||
callbackError = (error) => {
|
||||
this.handleError('action.update.error', error);
|
||||
};
|
||||
}
|
||||
|
||||
this.fetch(url, {
|
||||
method: 'PATCH',
|
||||
body: this._parseData(data),
|
||||
headers: this._headers()
|
||||
}).then((response) => {
|
||||
if (response.statusCode === 204) {
|
||||
callbackSuccess();
|
||||
} else {
|
||||
response.json().then((json) => {
|
||||
callbackSuccess(json);
|
||||
});
|
||||
}
|
||||
}).catch((error) => {
|
||||
callbackError(error);
|
||||
});
|
||||
}
|
||||
|
||||
delete(url, callbackSuccess, callbackError) {
|
||||
if (callbackError === undefined) {
|
||||
callbackError = (error) => {
|
||||
this.handleError('action.delete.error', error);
|
||||
};
|
||||
}
|
||||
|
||||
this.fetch(url, {
|
||||
method: 'DELETE',
|
||||
headers: this._headers()
|
||||
}).then(() => {
|
||||
callbackSuccess();
|
||||
}).catch((error) => {
|
||||
callbackError(error);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string|object} data
|
||||
* @returns {string}
|
||||
* @private
|
||||
*/
|
||||
_parseData(data) {
|
||||
if (typeof data === 'object') {
|
||||
return JSON.stringify(data);
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} message
|
||||
* @param {Response} response
|
||||
*/
|
||||
handleError(message, response) {
|
||||
if (response.headers === undefined) {
|
||||
// this can happen if someone clicks to fast and auto running
|
||||
// requests (e.g. active records) are aborted
|
||||
return;
|
||||
}
|
||||
|
||||
const contentType = response.headers.get("content-type");
|
||||
if (contentType && contentType.indexOf("application/json") !== -1) {
|
||||
response.json().then(data => {
|
||||
let resultError = data.message;
|
||||
// find validation errors
|
||||
if (response.status === 400 && data.errors) {
|
||||
let collected = ['<u>' + resultError + '</u>'];
|
||||
// form errors that are not attached to a field (like extra fields)
|
||||
if (data.errors.errors) {
|
||||
for (let error of data.errors.errors) {
|
||||
collected.push(error);
|
||||
}
|
||||
}
|
||||
if (data.errors.children) {
|
||||
for (let field in data.errors.children) {
|
||||
let tmpField = data.errors.children[field];
|
||||
if (tmpField.errors !== undefined && tmpField.errors.length > 0) {
|
||||
for (let error of tmpField.errors) {
|
||||
collected.push(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (collected.length > 0) {
|
||||
resultError = collected;
|
||||
}
|
||||
}
|
||||
|
||||
this.getPlugin('alert').error(message, resultError);
|
||||
|
||||
});
|
||||
} else {
|
||||
response.text().then(() => {
|
||||
const resultError = '[' + response.statusCode + '] ' + response.statusText;
|
||||
this.getPlugin('alert').error(message, resultError);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
105
assets/js/plugins/KimaiAPILink.js
Normal file
105
assets/js/plugins/KimaiAPILink.js
Normal file
@@ -0,0 +1,105 @@
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
import KimaiPlugin from "../KimaiPlugin";
|
||||
|
||||
/**
|
||||
* Needs to be initialized with a class name.
|
||||
*
|
||||
* A link like <a href=# class=remoteLink> can be activated with:
|
||||
* new KimaiAPILink('remoteLink')
|
||||
*
|
||||
* Allows to assign the given selector to any element, which then is used as click-handler
|
||||
* calling an API method and trigger the event from data-event attribute afterwards.
|
||||
*
|
||||
* @param selector
|
||||
*/
|
||||
export default class KimaiAPILink extends KimaiPlugin {
|
||||
|
||||
constructor(selector) {
|
||||
super();
|
||||
this._selector = selector;
|
||||
}
|
||||
|
||||
init() {
|
||||
document.addEventListener('click', (event) => {
|
||||
let target = event.target;
|
||||
while (target !== null && typeof target.matches === "function" && !target.matches('body')) {
|
||||
if (target.classList.contains(this._selector)) {
|
||||
const attributes = target.dataset;
|
||||
|
||||
let url = attributes['href'];
|
||||
if (!url) {
|
||||
url = target.getAttribute('href');
|
||||
}
|
||||
|
||||
if (attributes.question !== undefined) {
|
||||
this.getContainer().getPlugin('alert').question(attributes.question, (value) => {
|
||||
if (value) {
|
||||
this._callApi(url, attributes);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this._callApi(url, attributes);
|
||||
}
|
||||
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}
|
||||
|
||||
target = target.parentNode;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} url
|
||||
* @param {DOMStringMap} attributes
|
||||
* @private
|
||||
*/
|
||||
_callApi(url, attributes)
|
||||
{
|
||||
const method = attributes['method'];
|
||||
const eventName = attributes['event'];
|
||||
/** @type {KimaiAPI} API */
|
||||
const API = this.getContainer().getPlugin('api');
|
||||
/** @type {KimaiEvent} EVENTS */
|
||||
const EVENTS = this.getContainer().getPlugin('event');
|
||||
/** @type {KimaiAlert} ALERT */
|
||||
const ALERT = this.getContainer().getPlugin('alert');
|
||||
const successHandle = () => {
|
||||
EVENTS.trigger(eventName);
|
||||
if (attributes['msgSuccess'] !== undefined) {
|
||||
ALERT.success(attributes['msgSuccess']);
|
||||
}
|
||||
};
|
||||
const errorHandle = (error) => {
|
||||
let message = 'action.update.error';
|
||||
if (attributes['msgError'] !== undefined) {
|
||||
message = attributes['msgError'];
|
||||
}
|
||||
API.handleError(message, error);
|
||||
};
|
||||
|
||||
if (method === 'PATCH') {
|
||||
let data = {};
|
||||
if (attributes['payload'] !== undefined) {
|
||||
data = attributes['payload'];
|
||||
}
|
||||
API.patch(url, data, successHandle, errorHandle);
|
||||
} else if (method === 'POST') {
|
||||
let data = {};
|
||||
if (attributes['payload'] !== undefined) {
|
||||
data = attributes['payload'];
|
||||
}
|
||||
API.post(url, data, successHandle, errorHandle);
|
||||
} else if (method === 'DELETE') {
|
||||
API.delete(url, successHandle, errorHandle);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
198
assets/js/plugins/KimaiActiveRecords.js
Normal file
198
assets/js/plugins/KimaiActiveRecords.js
Normal file
@@ -0,0 +1,198 @@
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*!
|
||||
* [KIMAI] KimaiActiveRecords: responsible to display the users active records
|
||||
*/
|
||||
|
||||
import KimaiPlugin from '../KimaiPlugin';
|
||||
|
||||
export default class KimaiActiveRecords extends KimaiPlugin {
|
||||
|
||||
constructor()
|
||||
{
|
||||
super();
|
||||
this._selector = '.ticktac-menu';
|
||||
this._selectorEmpty = '.ticktac-menu-empty';
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {string}
|
||||
*/
|
||||
getId()
|
||||
{
|
||||
return 'active-records';
|
||||
}
|
||||
|
||||
init()
|
||||
{
|
||||
// the menu can be hidden if user has no permissions to see it
|
||||
if (document.querySelector(this._selector) === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
const handleUpdate = () => {
|
||||
this.reloadActiveRecords();
|
||||
};
|
||||
|
||||
document.addEventListener('kimai.timesheetUpdate', handleUpdate);
|
||||
document.addEventListener('kimai.timesheetDelete', handleUpdate);
|
||||
document.addEventListener('kimai.activityUpdate', handleUpdate);
|
||||
document.addEventListener('kimai.activityDelete', handleUpdate);
|
||||
document.addEventListener('kimai.projectUpdate', handleUpdate);
|
||||
document.addEventListener('kimai.projectDelete', handleUpdate);
|
||||
document.addEventListener('kimai.customerUpdate', handleUpdate);
|
||||
document.addEventListener('kimai.customerDelete', handleUpdate);
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// handle duration in the visible UI
|
||||
this._updateBrowserTitle = !!this.getConfiguration('updateBrowserTitle');
|
||||
|
||||
// deactivated direct duration update, becuase it is unclear
|
||||
// this._updateDuration();
|
||||
const handle = () => {
|
||||
this._updateDuration();
|
||||
};
|
||||
this._updatesHandler = setInterval(handle, 10000);
|
||||
document.addEventListener('kimai.timesheetUpdate', handle);
|
||||
document.addEventListener('kimai.reloadedContent', handle);
|
||||
}
|
||||
|
||||
// TODO we could unregister all handler and listener
|
||||
// _unregisterHandler() {
|
||||
// clearInterval(this._updatesHandler);
|
||||
// }
|
||||
|
||||
/**
|
||||
* Updates the duration of all running entries, both in the ticktac menus and in the listing pages.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
_updateDuration()
|
||||
{
|
||||
// needs to search in document, to find all running entries, both in "ticktac" and listing pages
|
||||
const activeRecords = document.querySelectorAll('[data-since]:not([data-since=""])');
|
||||
|
||||
if (activeRecords.length === 0) {
|
||||
if (this._updateBrowserTitle) {
|
||||
if (document.body.dataset['title'] === undefined) {
|
||||
this._updateBrowserTitle = false;
|
||||
} else {
|
||||
document.title = document.body.dataset['title'];
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
const DATE = this.getDateUtils();
|
||||
let durations = [];
|
||||
|
||||
for (const record of activeRecords) {
|
||||
const duration = DATE.formatDuration(record.dataset['since']);
|
||||
// only use the ones from the menu for the title
|
||||
if (record.dataset['replacer'] !== undefined && record.dataset['title'] !== null && duration !== '?') {
|
||||
durations.push(duration);
|
||||
}
|
||||
// but update all on the page (running entries in list pages)
|
||||
record.textContent = duration;
|
||||
}
|
||||
|
||||
if (durations.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this._updateBrowserTitle) {
|
||||
// only show the first found record, even if we have more
|
||||
document.title = durations.shift();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adapts the ticktac menus accordingg to the given entries (amount and duration).
|
||||
* Does not influence listing pages, as those refresh themselves.
|
||||
*
|
||||
* @param {array} entries
|
||||
* @private
|
||||
*/
|
||||
_setEntries(entries)
|
||||
{
|
||||
const hasEntries = entries.length > 0;
|
||||
|
||||
// these contain the "start" button
|
||||
for (let menuEmpty of document.querySelectorAll(this._selectorEmpty)) {
|
||||
menuEmpty.style.display = !hasEntries ? 'inline-block' : 'none';
|
||||
}
|
||||
|
||||
// and they contain the "stop" button
|
||||
for (let menu of document.querySelectorAll(this._selector)) {
|
||||
menu.style.display = hasEntries ? 'inline-block' : 'none';
|
||||
if (!hasEntries) {
|
||||
// make sure that template entries in the menu are removed, otherwise they
|
||||
// might still be shown in the browsers title
|
||||
for (let record of menu.querySelectorAll('[data-since]')) {
|
||||
record.dataset['since'] = '';
|
||||
}
|
||||
}
|
||||
|
||||
const stop = menu.querySelector('.ticktac-stop');
|
||||
|
||||
if (!hasEntries) {
|
||||
if (stop) {
|
||||
stop.accesskey = null;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (stop) {
|
||||
stop.accesskey = 's';
|
||||
}
|
||||
this._replaceInNode(menu, entries[0]);
|
||||
}
|
||||
|
||||
this._updateDuration();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {HTMLElement} node
|
||||
* @param {object} timesheet
|
||||
* @private
|
||||
*/
|
||||
_replaceInNode(node, timesheet)
|
||||
{
|
||||
const date = this.getDateUtils();
|
||||
const allReplacer = node.querySelectorAll('[data-replacer]');
|
||||
for (let link of allReplacer) {
|
||||
const replacerName = link.dataset['replacer'];
|
||||
if (replacerName === 'url') {
|
||||
link.href = node.dataset['href'].replace('000', timesheet.id);
|
||||
} else if (replacerName === 'activity') {
|
||||
link.innerText = timesheet.activity.name;
|
||||
} else if (replacerName === 'project') {
|
||||
link.innerText = timesheet.project.name;
|
||||
} else if (replacerName === 'customer') {
|
||||
link.innerText = timesheet.project.customer.name;
|
||||
} else if (replacerName === 'duration') {
|
||||
link.dataset['since'] = timesheet.begin;
|
||||
link.innerText = date.formatDuration(timesheet.duration);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
reloadActiveRecords()
|
||||
{
|
||||
/** @type {KimaiAPI} API */
|
||||
const API = this.getContainer().getPlugin('api');
|
||||
|
||||
// TODO using the first found "ticktac" menu is working, but can be done better
|
||||
const apiUrl = document.querySelector(this._selector).dataset['api'];
|
||||
|
||||
API.get(apiUrl, {}, (result) => {
|
||||
this._setEntries(result);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
294
assets/js/plugins/KimaiAjaxModalForm.js
Normal file
294
assets/js/plugins/KimaiAjaxModalForm.js
Normal file
@@ -0,0 +1,294 @@
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*!
|
||||
* [KIMAI] KimaiAjaxModalForm
|
||||
*
|
||||
* allows to assign the given selector to any element, which then is used as click-handler:
|
||||
* opening a modal with the content from the URL given in the elements 'data-href' or 'href' attribute
|
||||
*/
|
||||
|
||||
import KimaiReducedClickHandler from "./KimaiReducedClickHandler";
|
||||
import { Modal } from 'bootstrap';
|
||||
|
||||
export default class KimaiAjaxModalForm extends KimaiReducedClickHandler {
|
||||
|
||||
constructor(selector) {
|
||||
super();
|
||||
this._selector = selector;
|
||||
}
|
||||
|
||||
getId()
|
||||
{
|
||||
return 'modal';
|
||||
}
|
||||
|
||||
init()
|
||||
{
|
||||
this._isDirty = false;
|
||||
|
||||
const modalElement = this._getModalElement();
|
||||
if (modalElement === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
modalElement.addEventListener('hide.bs.modal', (event) => {
|
||||
if (this._isDirty) {
|
||||
if (modalElement.querySelector('.modal-body .remote_modal_is_dirty_warning') === null) {
|
||||
const msg = this.translate('modal.dirty');
|
||||
const temp = document.createElement('div');
|
||||
temp.innerHTML = '<p class="text-danger small remote_modal_is_dirty_warning">' + msg + '</p>';
|
||||
modalElement.querySelector('.modal-body').prepend(temp.firstElementChild);
|
||||
}
|
||||
event.preventDefault();
|
||||
return;
|
||||
}
|
||||
this._isDirty = false;
|
||||
document.dispatchEvent(new Event('modal-hide'));
|
||||
});
|
||||
|
||||
modalElement.addEventListener('hidden.bs.modal', () => {
|
||||
// kill all references, so GC can kick in
|
||||
this.getContainer().getPlugin('form').destroyForm(this._getFormIdentifier());
|
||||
modalElement.querySelector('.modal-body').replaceWith('');
|
||||
});
|
||||
|
||||
modalElement.addEventListener('show.bs.modal', () => {
|
||||
document.dispatchEvent(new Event('modal-show'));
|
||||
});
|
||||
|
||||
this.addClickHandler(this._selector, (href) => {
|
||||
this.openUrlInModal(href);
|
||||
});
|
||||
}
|
||||
|
||||
_getModal()
|
||||
{
|
||||
return Modal.getOrCreateInstance(this._getModalElement())
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} url
|
||||
* @param {function(Response)} error the callback to execute if the fetch failed
|
||||
*/
|
||||
openUrlInModal(url, error)
|
||||
{
|
||||
const headers = new Headers();
|
||||
headers.append('X-Requested-With', 'Kimai-Modal');
|
||||
|
||||
this.fetch(url, {
|
||||
method: 'GET',
|
||||
redirect: 'follow',
|
||||
headers: headers
|
||||
})
|
||||
.then(response => {
|
||||
if (!response.ok) {
|
||||
window.location = url;
|
||||
return;
|
||||
}
|
||||
|
||||
return response.text().then(html => {
|
||||
this._openFormInModal(html);
|
||||
});
|
||||
})
|
||||
.catch((reason) => {
|
||||
if (error === undefined || error === null) {
|
||||
window.location = url;
|
||||
} else {
|
||||
error(reason);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the CSS selector for the modal form.
|
||||
*
|
||||
* @returns {string}
|
||||
* @private
|
||||
*/
|
||||
_getFormIdentifier()
|
||||
{
|
||||
return '#remote_form_modal .modal-content form';
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {HTMLElement|null}
|
||||
* @private
|
||||
*/
|
||||
_getModalElement()
|
||||
{
|
||||
return document.getElementById('remote_form_modal');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Element|ChildNode} node
|
||||
* @returns {Element}
|
||||
* @private
|
||||
*/
|
||||
_makeScriptExecutable(node) {
|
||||
if (node.tagName !== undefined && node.tagName === 'SCRIPT') {
|
||||
const script = document.createElement('script');
|
||||
script.text = node.innerHTML;
|
||||
node.parentNode.replaceChild(script, node);
|
||||
} else {
|
||||
for (const child of node.childNodes) {
|
||||
this._makeScriptExecutable(child);
|
||||
}
|
||||
}
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
_openFormInModal(html)
|
||||
{
|
||||
const formIdentifier = this._getFormIdentifier();
|
||||
let remoteModal = this._getModalElement();
|
||||
const newFormHtml = document.createElement('div');
|
||||
newFormHtml.innerHTML = html;
|
||||
const newModalContent = this._makeScriptExecutable(newFormHtml.querySelector('#form_modal .modal-content'));
|
||||
|
||||
// load new form from given content
|
||||
if (newModalContent !== null) {
|
||||
// Support changing modal sizes
|
||||
let modalDialog = remoteModal.querySelector('.modal-dialog');
|
||||
let largeModal = newFormHtml.querySelector('.modal-dialog').classList.contains('modal-lg');
|
||||
|
||||
if (largeModal && !modalDialog.classList.contains('modal-lg')) {
|
||||
modalDialog.classList.toggle('modal-lg');
|
||||
}
|
||||
|
||||
if (!largeModal && modalDialog.classList.contains('modal-lg')) {
|
||||
modalDialog.classList.toggle('modal-lg');
|
||||
}
|
||||
|
||||
remoteModal.querySelector('.modal-content').replaceWith(newModalContent);
|
||||
[].slice.call(remoteModal.querySelectorAll('[data-bs-dismiss="modal"]')).map((element) => {
|
||||
element.addEventListener('click', () => {
|
||||
this._isDirty = false;
|
||||
this._getModal().hide();
|
||||
});
|
||||
});
|
||||
|
||||
// activate new loaded widgets
|
||||
this.getContainer().getPlugin('form').activateForm(formIdentifier);
|
||||
}
|
||||
|
||||
// show error flash messages
|
||||
let flashMessages = newFormHtml.querySelector('div.alert');
|
||||
if (flashMessages !== null) {
|
||||
remoteModal.querySelector('.modal-body').prepend(flashMessages);
|
||||
}
|
||||
|
||||
// the new form that was loaded via ajax
|
||||
const form = document.querySelector(formIdentifier);
|
||||
|
||||
form.addEventListener('change', () => {
|
||||
this._isDirty = true;
|
||||
});
|
||||
|
||||
// click handler for modal save button, to send forms via ajax
|
||||
form.addEventListener('submit', this._getEventHandler());
|
||||
|
||||
this._getModal().show();
|
||||
}
|
||||
|
||||
_getEventHandler()
|
||||
{
|
||||
if (this.eventHandler === undefined) {
|
||||
this.eventHandler = (event) => {
|
||||
const form = event.target;
|
||||
|
||||
// if the form has a target, we let the normal HTML flow happen
|
||||
if (form.target !== undefined && form.target !== '') {
|
||||
return true;
|
||||
}
|
||||
|
||||
// otherwise we do some AJAX magic to process the form in the background
|
||||
/** @type {HTMLButtonElement} btn */
|
||||
const btn = document.querySelector(this._getFormIdentifier() + ' button[type=submit]');
|
||||
btn.textContent = btn.textContent + ' …';
|
||||
btn.disabled = true;
|
||||
|
||||
const eventName = form.dataset['formEvent'];
|
||||
/** @type {KimaiEvent} alert */
|
||||
const events = this.getContainer().getPlugin('event');
|
||||
/** @type {KimaiAlert} alert */
|
||||
const alert = this.getContainer().getPlugin('alert');
|
||||
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
const headers = new Headers();
|
||||
headers.append('X-Requested-With', 'Kimai-Modal');
|
||||
const options = {headers: headers};
|
||||
|
||||
this.fetchForm(form, options)
|
||||
.then(response => {
|
||||
response.text().then((html) => {
|
||||
/** @type {HTMLDivElement} responseHtml */
|
||||
const responseHtml = document.createElement('div');
|
||||
responseHtml.innerHTML = html;
|
||||
let hasFieldError = false;
|
||||
let hasFormError = false;
|
||||
let hasFlashError = false;
|
||||
|
||||
// button must be re-enabled anyway
|
||||
btn.textContent = btn.textContent.replace(' …', '');
|
||||
btn.disabled = false;
|
||||
|
||||
// if the request was successful, there will be no form
|
||||
/** @type {Element} modalContent */
|
||||
const modalContent = responseHtml.querySelector('#form_modal .modal-content');
|
||||
if (modalContent !== null) {
|
||||
hasFieldError = modalContent.querySelector('.is-invalid') !== null;
|
||||
if (!hasFieldError) {
|
||||
// happens when an error occurs for a "hidden or non-classical" form element e.g. creating team without users
|
||||
hasFieldError = modalContent.querySelector('.invalid-feedback') !== null;
|
||||
}
|
||||
hasFormError = modalContent.querySelector('ul.list-unstyled li.text-danger') !== null;
|
||||
hasFlashError = responseHtml.querySelector('div.alert-danger') !== null;
|
||||
}
|
||||
|
||||
if (hasFieldError || hasFormError || hasFlashError) {
|
||||
this._openFormInModal(html);
|
||||
} else {
|
||||
events.trigger(eventName);
|
||||
|
||||
// try to find form defined message first, but
|
||||
let msg = form.dataset['msgSuccess'];
|
||||
// if that is not available: use a generic fallback message
|
||||
if (msg === null || msg === undefined || msg === '') {
|
||||
msg = 'action.update.success';
|
||||
}
|
||||
this._isDirty = false;
|
||||
this._getModal().hide();
|
||||
alert.success(msg);
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(error => {
|
||||
let message = form.dataset['msgError'];
|
||||
if (message === null || message === undefined || message === '') {
|
||||
message = 'action.update.error';
|
||||
}
|
||||
|
||||
alert.error(message, error.message);
|
||||
|
||||
// this is useful for changing form fields and retrying to save (and in development to test form changes)
|
||||
setTimeout(() =>{
|
||||
// critical error, allow to re-submit?
|
||||
btn.textContent = btn.textContent.replace(' …', '');
|
||||
btn.disabled = false;
|
||||
}, 1500);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
return this.eventHandler;
|
||||
}
|
||||
|
||||
}
|
||||
269
assets/js/plugins/KimaiAlert.js
Normal file
269
assets/js/plugins/KimaiAlert.js
Normal file
@@ -0,0 +1,269 @@
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*!
|
||||
* [KIMAI] KimaiAlert: notifications for Kimai
|
||||
*/
|
||||
|
||||
import KimaiPlugin from "../KimaiPlugin";
|
||||
import {Modal, Toast} from "bootstrap";
|
||||
|
||||
export default class KimaiAlert extends KimaiPlugin {
|
||||
|
||||
/**
|
||||
* @return {string}
|
||||
*/
|
||||
getId() {
|
||||
return 'alert';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} title
|
||||
* @param {string|array|undefined} message
|
||||
*/
|
||||
error(title, message) {
|
||||
const translation = this.getTranslation();
|
||||
if (translation.has(title)) {
|
||||
title = translation.get(title);
|
||||
}
|
||||
title = title.replace('%reason%', '');
|
||||
|
||||
if (message === undefined) {
|
||||
message = null;
|
||||
}
|
||||
|
||||
if (message !== null) {
|
||||
if (translation.has(message)) {
|
||||
message = translation.get(message);
|
||||
}
|
||||
if (Array.isArray(message)) {
|
||||
message = message.join('<br>');
|
||||
}
|
||||
}
|
||||
|
||||
const id = 'alert_global_error';
|
||||
const oldModalElement = document.getElementById(id);
|
||||
if (oldModalElement !== null) {
|
||||
Modal.getOrCreateInstance(oldModalElement).hide();
|
||||
}
|
||||
|
||||
const html = `
|
||||
<div class="modal modal-blur fade" id="` + id + `" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog modal-sm modal-dialog-centered" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-status bg-` + this._mapClass('danger') + `"></div>
|
||||
<div class="modal-body text-center py-4">
|
||||
<i class="fas fa-exclamation-circle fa-3x mb-3 text-danger"></i>
|
||||
<h2>` + title + `</h2>
|
||||
` + (message !== null ? '<div class="text-muted">' + message + '</div>' : '') + `
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<div class="w-100">
|
||||
<div class="row">
|
||||
<div class="col text-center"><a href="#" class="btn btn-primary" data-bs-dismiss="modal">` + translation.get('close') + `</a></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
this._showModal(html);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} message
|
||||
*/
|
||||
warning(message) {
|
||||
this._show('warning', message);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} message
|
||||
*/
|
||||
success(message) {
|
||||
this._toast('success', message);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} message
|
||||
*/
|
||||
info(message) {
|
||||
this._show('info', message);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} html
|
||||
* @private
|
||||
*/
|
||||
_showModal(html) {
|
||||
const container = document.body;
|
||||
const template = document.createElement('template');
|
||||
template.innerHTML = html.trim();
|
||||
const element = template.content.firstChild;
|
||||
container.appendChild(element);
|
||||
|
||||
const modal = new Modal(element);
|
||||
element.addEventListener('hidden.bs.modal', function () {
|
||||
container.removeChild(element);
|
||||
});
|
||||
modal.show();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} type
|
||||
* @param {string} message
|
||||
* @private
|
||||
*/
|
||||
_show(type, message) {
|
||||
const translation = this.getTranslation();
|
||||
|
||||
if (translation.has(message)) {
|
||||
message = translation.get(message);
|
||||
}
|
||||
|
||||
const html = `
|
||||
<div class="modal modal-blur fade" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog modal-sm modal-dialog-centered" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-status bg-` + this._mapClass(type) + `"></div>
|
||||
<div class="modal-body text-center py-4">
|
||||
<i class="fas fa-exclamation-circle fa-3x mb-3 text-` + this._mapClass(type) + `"></i>
|
||||
<h2>` + message + `</h2>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<div class="w-100">
|
||||
<div class="row">
|
||||
<div class="col text-center"><a href="#" class="btn btn-primary" data-bs-dismiss="modal">` + translation.get('close') + `</a></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
this._showModal(html);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} type
|
||||
* @return {string}
|
||||
* @private
|
||||
*/
|
||||
_mapClass(type) {
|
||||
if (type === 'info' || type === 'success' || type === 'warning' || type === 'danger') {
|
||||
return type;
|
||||
} else if (type === 'error') {
|
||||
return 'danger';
|
||||
}
|
||||
|
||||
return 'primary';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param type
|
||||
* @param message
|
||||
* @private
|
||||
*/
|
||||
_toast(type, message) {
|
||||
const translation = this.getTranslation();
|
||||
|
||||
if (translation.has(message)) {
|
||||
message = translation.get(message);
|
||||
}
|
||||
|
||||
let icon = '<i class="fas fa-info me-2"></i>';
|
||||
|
||||
if (type === 'success') {
|
||||
icon = '<i class="fas fa-check me-2"></i>';
|
||||
} else if (type === 'warning') {
|
||||
icon = '<i class="fas fa-exclamation me-2"></i>';
|
||||
} else if (type === 'danger' || type === 'error') {
|
||||
icon = '<i class="fas fa-exclamation-circle me-2"></i>';
|
||||
}
|
||||
|
||||
const html =
|
||||
`<div class="toast align-items-center text-white bg-` + this._mapClass(type) + ` border-0" data-bs-delay="2000" role="alert" aria-live="assertive" aria-atomic="true">
|
||||
<div class="d-flex">
|
||||
<div class="toast-body">
|
||||
` + icon + ' ' + message + `
|
||||
</div>
|
||||
<button type="button" class="btn-close btn-close-white me-2 m-auto" data-bs-dismiss="toast" aria-label="` + translation.get('close') + `"></button>
|
||||
</div>
|
||||
</div>`;
|
||||
|
||||
const container = document.getElementById('toast-container');
|
||||
const template = document.createElement('template');
|
||||
|
||||
template.innerHTML = html.trim();
|
||||
const element = template.content.firstChild;
|
||||
container.appendChild(element);
|
||||
|
||||
const toast = new Toast(element);
|
||||
element.addEventListener('hidden.bs.toast', function () {
|
||||
container.removeChild(element);
|
||||
})
|
||||
toast.show();
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback receives a bool value (true = confirm, false = cancel / close without action).
|
||||
*
|
||||
* @param message
|
||||
* @param callback
|
||||
*/
|
||||
question(message, callback) {
|
||||
const translation = this.getTranslation();
|
||||
|
||||
if (translation.has(message)) {
|
||||
message = translation.get(message);
|
||||
}
|
||||
|
||||
const css = this._mapClass('info');
|
||||
const html = `
|
||||
<div class="modal modal-blur fade" tabindex="-1" role="dialog" data-bs-backdrop="static">
|
||||
<div class="modal-dialog modal-sm modal-dialog-centered" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-status bg-` + css + `"></div>
|
||||
<div class="modal-body text-center py-4">
|
||||
<i class="fas fa-question fa-3x mb-3 text-` + css + `"></i>
|
||||
<h2>` + message + `</h2>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<div class="w-100">
|
||||
<div class="row">
|
||||
<div class="col"><a href="#" class="question-confirm btn btn-primary w-100" data-bs-dismiss="modal">` + translation.get('confirm') + `</a></div>
|
||||
<div class="col"><a href="#" class="question-cancel btn w-100" data-bs-dismiss="modal">` + translation.get('cancel') + `</a></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
const container = document.body;
|
||||
const template = document.createElement('template');
|
||||
template.innerHTML = html.trim();
|
||||
const element = template.content.firstChild;
|
||||
container.appendChild(element);
|
||||
element.querySelector('.question-confirm').addEventListener('click', () => {
|
||||
callback(true);
|
||||
});
|
||||
element.querySelector('.question-cancel').addEventListener('click', () => {
|
||||
callback(false);
|
||||
});
|
||||
|
||||
const modal = new Modal(element);
|
||||
element.addEventListener('hidden.bs.modal', () => {
|
||||
container.removeChild(element);
|
||||
});
|
||||
modal.show();
|
||||
}
|
||||
}
|
||||
30
assets/js/plugins/KimaiAlternativeLinks.js
Normal file
30
assets/js/plugins/KimaiAlternativeLinks.js
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*!
|
||||
* [KIMAI] KimaiAlternativeLinks
|
||||
*
|
||||
* allows to assign the given selector to any element, which then is used as click-handler
|
||||
* redirecting to the URL given in the elements 'data-href' or 'href' attribute
|
||||
*/
|
||||
|
||||
import KimaiReducedClickHandler from "./KimaiReducedClickHandler";
|
||||
|
||||
export default class KimaiAlternativeLinks extends KimaiReducedClickHandler {
|
||||
|
||||
constructor(selector) {
|
||||
super();
|
||||
this._selector = selector;
|
||||
}
|
||||
|
||||
init() {
|
||||
this.addClickHandler(this._selector, function(href) {
|
||||
window.location = href;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
69
assets/js/plugins/KimaiConfirmationLink.js
Normal file
69
assets/js/plugins/KimaiConfirmationLink.js
Normal file
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
import KimaiPlugin from "../KimaiPlugin";
|
||||
|
||||
/**
|
||||
* Needs to be initialized with a class name.
|
||||
*
|
||||
* Allows to assign the given selector to any element, which then is used as click-handler
|
||||
* calling an API method and trigger the event from data-event attribute afterwards.
|
||||
*
|
||||
* @param selector
|
||||
*/
|
||||
export default class KimaiConfirmationLink extends KimaiPlugin {
|
||||
|
||||
constructor(selector) {
|
||||
super();
|
||||
this._selector = selector;
|
||||
}
|
||||
|
||||
init() {
|
||||
document.addEventListener('click', (event) => {
|
||||
let target = event.target;
|
||||
while (target !== null && typeof target.matches === "function" && !target.matches('body')) {
|
||||
if (target.classList.contains(this._selector)) {
|
||||
const attributes = target.dataset;
|
||||
|
||||
// is this a link?
|
||||
let url = attributes['href'];
|
||||
// or another HTML element with a custom href
|
||||
if (!url) {
|
||||
url = target.getAttribute('href');
|
||||
}
|
||||
|
||||
// or is this a button?
|
||||
let form = null;
|
||||
if (target.type === 'submit' && target.form !== undefined) {
|
||||
form = target.form;
|
||||
}
|
||||
|
||||
if (attributes.question !== undefined) {
|
||||
this.getContainer().getPlugin('alert').question(attributes.question, function(value) {
|
||||
if (value) {
|
||||
if (form === null) {
|
||||
document.location = url;
|
||||
} else {
|
||||
if (url !== null) {
|
||||
form.action = url;
|
||||
}
|
||||
form.submit();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}
|
||||
|
||||
target = target.parentNode;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
97
assets/js/plugins/KimaiDatatable.js
Normal file
97
assets/js/plugins/KimaiDatatable.js
Normal file
@@ -0,0 +1,97 @@
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*!
|
||||
* [KIMAI] KimaiDatatable: handles functionality for the datatable
|
||||
*/
|
||||
|
||||
import KimaiPlugin from "../KimaiPlugin";
|
||||
import KimaiContextMenu from "../widgets/KimaiContextMenu";
|
||||
|
||||
export default class KimaiDatatable extends KimaiPlugin {
|
||||
|
||||
constructor(contentAreaSelector, tableSelector) {
|
||||
super();
|
||||
this._contentArea = contentAreaSelector;
|
||||
this._selector = tableSelector;
|
||||
}
|
||||
|
||||
getId() {
|
||||
return 'datatable';
|
||||
}
|
||||
|
||||
init() {
|
||||
const dataTable = document.querySelector(this._selector);
|
||||
|
||||
// not every page contains a dataTable
|
||||
if (dataTable === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.registerContextMenu(this._selector);
|
||||
|
||||
const events = dataTable.dataset['reloadEvent'];
|
||||
if (events === undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
const handle = () => { this.reloadDatatable(); };
|
||||
|
||||
for (let eventName of events.split(' ')) {
|
||||
document.addEventListener(eventName, handle);
|
||||
}
|
||||
|
||||
document.addEventListener('pagination-change', handle);
|
||||
document.addEventListener('filter-change', handle);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} selector
|
||||
* @private
|
||||
*/
|
||||
registerContextMenu(selector)
|
||||
{
|
||||
KimaiContextMenu.createForDataTable(selector);
|
||||
}
|
||||
|
||||
reloadDatatable()
|
||||
{
|
||||
const toolbarSelector = this.getContainer().getPlugin('toolbar').getSelector();
|
||||
|
||||
/** @type {HTMLFormElement} form */
|
||||
const form = document.querySelector(toolbarSelector);
|
||||
const callback = (text) => {
|
||||
const temp = document.createElement('div');
|
||||
temp.innerHTML = text;
|
||||
const newContent = temp.querySelector(this._contentArea);
|
||||
document.querySelector(this._contentArea).replaceWith(newContent);
|
||||
this.registerContextMenu(this._selector);
|
||||
document.dispatchEvent(new Event('kimai.reloadedContent'));
|
||||
};
|
||||
|
||||
document.dispatchEvent(new CustomEvent('kimai.reloadContent', {detail: this._contentArea}));
|
||||
|
||||
if (form === null) {
|
||||
this.fetch(document.location)
|
||||
.then(response => {
|
||||
response.text().then(callback);
|
||||
})
|
||||
.catch(() => {
|
||||
document.location.reload();
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
this.fetchForm(form)
|
||||
.then(response => {
|
||||
response.text().then(callback);
|
||||
})
|
||||
.catch(() => {
|
||||
form.submit();
|
||||
});
|
||||
}
|
||||
}
|
||||
138
assets/js/plugins/KimaiDatatableColumnView.js
Normal file
138
assets/js/plugins/KimaiDatatableColumnView.js
Normal file
@@ -0,0 +1,138 @@
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*!
|
||||
* [KIMAI] KimaiDatatableColumnView: manages the visibility of data-table columns in cookies
|
||||
*/
|
||||
|
||||
import KimaiPlugin from "../KimaiPlugin";
|
||||
|
||||
export default class KimaiDatatableColumnView extends KimaiPlugin {
|
||||
|
||||
constructor(dataAttribute) {
|
||||
super();
|
||||
this.dataAttribute = dataAttribute;
|
||||
}
|
||||
|
||||
getId() {
|
||||
return 'datatable-column-visibility';
|
||||
}
|
||||
|
||||
init() {
|
||||
let dataTable = document.querySelector('[' + this.dataAttribute + ']');
|
||||
if (dataTable === null) {
|
||||
return;
|
||||
}
|
||||
this._id = dataTable.getAttribute(this.dataAttribute);
|
||||
this._modal = document.getElementById('modal_' + this._id);
|
||||
this._modal.addEventListener('show.bs.modal', () => {
|
||||
this._evaluateCheckboxes();
|
||||
});
|
||||
this._modal.querySelector('button[data-type=save]').addEventListener('click', () => {
|
||||
this._saveVisibility();
|
||||
});
|
||||
this._modal.querySelector('button[data-type=reset]').addEventListener('click', (event) => {
|
||||
this._resetVisibility(event.currentTarget);
|
||||
});
|
||||
this._modal.querySelectorAll('input[name=datatable_profile]').forEach(element => {
|
||||
element.addEventListener('change', () => {
|
||||
const form = this._modal.getElementsByTagName('form')[0];
|
||||
this.fetchForm(form, {}, element.getAttribute('data-href'))
|
||||
.then(() => {
|
||||
// the local storage is read in the login screen to set a cookie,
|
||||
// which triggers the session switch in ProfileSubscriber
|
||||
localStorage.setItem('kimai_profile', element.getAttribute('value'));
|
||||
document.location.reload();
|
||||
})
|
||||
.catch(() => {
|
||||
form.setAttribute('action', element.getAttribute('data-href'));
|
||||
form.submit();
|
||||
});
|
||||
});
|
||||
});
|
||||
for (let checkbox of this._modal.querySelectorAll('form input[type=checkbox]')) {
|
||||
checkbox.addEventListener('change', () => {
|
||||
this._changeVisibility(checkbox.getAttribute('name'), checkbox.checked);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
_evaluateCheckboxes() {
|
||||
const form = this._modal.getElementsByTagName('form')[0];
|
||||
const table = document.getElementsByClassName('datatable_' + this._id)[0];
|
||||
for (let columnElement of table.getElementsByTagName('th')) {
|
||||
const fieldName = columnElement.getAttribute('data-field');
|
||||
if (fieldName === null) {
|
||||
continue;
|
||||
}
|
||||
const checkbox = form.querySelector('input[name=' + fieldName + ']');
|
||||
if (checkbox === null) {
|
||||
continue;
|
||||
}
|
||||
checkbox.checked = window.getComputedStyle(columnElement).display !== 'none';
|
||||
}
|
||||
}
|
||||
|
||||
_saveVisibility() {
|
||||
const form = this._modal.getElementsByTagName('form')[0];
|
||||
|
||||
this.fetchForm(form)
|
||||
.then(() => {
|
||||
document.location.reload();
|
||||
})
|
||||
.catch(() => {
|
||||
form.submit();
|
||||
});
|
||||
}
|
||||
|
||||
_resetVisibility(button) {
|
||||
const form = this._modal.getElementsByTagName('form')[0];
|
||||
|
||||
this.fetchForm(form, {}, button.getAttribute('formaction'))
|
||||
.then(() => {
|
||||
document.location.reload();
|
||||
})
|
||||
.catch(() => {
|
||||
form.setAttribute('action', button.getAttribute('formaction'));
|
||||
form.submit();
|
||||
});
|
||||
}
|
||||
|
||||
_changeVisibility(columnName, checked) {
|
||||
for (const tableBox of document.getElementsByClassName('datatable_' + this._id)) {
|
||||
let targetClasses = null;
|
||||
for (let element of tableBox.getElementsByClassName('col_' + columnName)) {
|
||||
// only calculate that once and re-use the cached class list
|
||||
if (targetClasses === null) {
|
||||
let removeClass = '-none';
|
||||
let addClass = 'd-table-cell';
|
||||
|
||||
if (!checked) {
|
||||
removeClass = '-table-cell';
|
||||
addClass = 'd-none';
|
||||
}
|
||||
|
||||
targetClasses = '';
|
||||
element.classList.forEach(
|
||||
function (name, index, listObj) { // eslint-disable-line no-unused-vars
|
||||
if (name.indexOf(removeClass) === -1) {
|
||||
targetClasses += ' ' + name;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
if (targetClasses.indexOf(addClass) === -1) {
|
||||
targetClasses += ' ' + addClass;
|
||||
}
|
||||
}
|
||||
|
||||
element.className = targetClasses;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user