Compare commits

...

101 Commits
2.0.2 ... 2.3.0

Author SHA1 Message Date
Kevin Papst
6a828cc9bd Release 2.3.0 (#4412)
- move user-preferences to edit submenu
- unify user preferences with other forms
- use light fieldset for all user-edit-forms
- support offcanvas elements
- allow to dynamically inject toolbar buttons (via plugins)
- use interface for formatting dates
- improve docker issue template
- bump version and composer packages
2023-11-08 22:30:22 +01:00
Weblate (bot)
7034066de9 Translated using Weblate (#4346)
Co-authored-by: Allan Nordhøy <epost@anotheragency.no>
Co-authored-by: Benjamin Alan Jamie <benjamin@weblate.org>
Co-authored-by: ButterflyOfFire <boffire@users.noreply.hosted.weblate.org>
Co-authored-by: Den SE <dense800@gmail.com>
Co-authored-by: EngageIndo <engageindo@gmail.com>
Co-authored-by: Kevin Papst <kevin@kevinpapst.de>
Co-authored-by: Liam Azofra <liamazofra@gmail.com>
Co-authored-by: Milo Ivir <mail@milotype.de>
Co-authored-by: Prefill add-on <noreply-addon-prefill@weblate.org>
Co-authored-by: Serhii Horichenko <m@sgg.im>
Co-authored-by: Singh <spamio@protonmail.com>
Co-authored-by: Wellington Terumi Uemura <wellingtonuemura@gmail.com>
Co-authored-by: Yaron Shahrabani <sh.yaron@gmail.com>
Co-authored-by: albanobattistella <albano_battistella@hotmail.com>
Co-authored-by: gallegonovato <fran-carro@hotmail.es>
Co-authored-by: yangyangdaji <1504305527@qq.com>
Co-authored-by: مهدی امیری راد <mahdiamererad@gmail.com>
2023-11-07 12:41:57 +01:00
Kevin Papst
2a9bdb7982 fix locale definitions starting with AM/PM (#4408)
* adapt locale script to fix locales starting with AM/PM
* fix korean locales that start with AM / PM
* added missing uk and zh_Hant locales
2023-11-07 12:27:11 +01:00
Kevin Papst
a1d9874c13 added role cards to permission screen (#4401)
* simplify creating new roles by auto-replacing input
2023-11-04 20:17:05 +01:00
Kevin Papst
0b1625175b remove link to external docker repo 2023-11-03 00:06:19 +01:00
Kevin Papst
0f6a6e7561 Update docker.yml (#4395) 2023-11-03 00:05:21 +01:00
Kevin Papst
7bbd497ef1 change URL to support landing page 2023-11-02 23:55:42 +01:00
Kevin Papst
0b3f645bda added docker bug report template 2023-11-02 23:54:29 +01:00
Kevin Papst
c840fee911 Release 2.2.1 (#4389)
* added missing functions to invoice security policy
2023-11-01 01:16:17 +01:00
Simon Schaufelberger
e06acc95c5 add parameter types and fix a phpstan issue (#4384) 2023-10-31 17:03:26 +01:00
Kevin Papst
95f15e6c88 Release 2.2.0 (#4359)
* deactivate deprecation logging in prod for now
* fix several deprecations
* enable CSRF for logout
* allow more twig methods and functions in InvoiceSecurity policy
2023-10-31 16:41:09 +01:00
Kevin Papst
114617a052 clarify EOL of Kimai 1 2023-10-20 16:30:20 +02:00
Kevin Papst
38e37f1c2e Release 2.1.0 (#4321)
* fix deprecations
* remove unused config
* replace invalid annotation type with attribute
* use AsDoctrineListener to fix deprecation
* new ModifiedSubscriber to support custom logic and fix deprecation
* removed inheritdoc comment
* new ModifiedSubscriber to support custom logic and fix deprecation
* cleanup event dispatcher interface
* re-order annotation params
* one more doctrine based deprecation
* fix query to count active timesheets
* link to "all times" to identify active timesheets
* link icon instead of text
* fix "skin" translation in wizard
* use duration filter to show duration
* added login link command and controller
* bump tabler theme to 1.0
* added wizard to force password reset by user
* allow to configure that new accounts need to reset their password
* prevent uploading twig templates by default
* bump composer packages
* enable sandbox and basic security measures for custom twig templates for invoice and export
* bump to symfony 6.3.5
* allow to export single user reports to excel
* removed broken method to reload twig cache
* added api parameter to fetch user collection fully serialized
* allow to replace or append description via timesheet batch update
* show api username above form
2023-10-19 11:21:50 +02:00
Kevin Papst
7a5b12762a Release 2.0.35 (#4302) 2023-09-23 18:15:22 +02:00
Kevin Papst
de419350b2 Release 2.0.34 (#4281) 2023-09-17 22:32:01 +02:00
Weblate (bot)
a6b237936e Translated using Weblate (#4282)
Co-authored-by: Kieran W <alarmcuddly@outlook.com>
Co-authored-by: Massimo Pissarello <mapi68@gmail.com>
Co-authored-by: Mykola Skira <mykola.skira@icloud.com>
Co-authored-by: No Pasaran <damiengourdin@gmail.com>
Co-authored-by: Wellington Terumi Uemura <wellingtonuemura@gmail.com>
Co-authored-by: Yaron Shahrabani <sh.yaron@gmail.com>
Co-authored-by: yangyangdaji <1504305527@qq.com>
Co-authored-by: Łukasz Kosiński <lukikosin@gmail.com>
2023-09-11 23:18:07 +02:00
Kevin Papst
6e1207578e Release 2.0.33 (#4273)
* added function to check if meta-field is defined by a plugin
* hide un-defined meta-fields in details view
* fix default charset = utf8mb4
* remove broken DATABASE_VERSION fallback
* split off upgrade infos for version 1.x
* fix page out of range #4279
2023-09-07 22:24:08 +02:00
Kevin Papst
31348da4c0 Release 2.0.32 (#4256) 2023-08-31 15:33:53 +02:00
Bruno Paré-Simard
452de88e18 change isWeekend() handling to use work-hour configuration (#4261) 2023-08-31 13:38:58 +02:00
Weblate (bot)
18d953e79b Translated using Weblate (#4267)
Co-authored-by: Ali Evcil <evcil@proton.me>
Co-authored-by: Massimo Pissarello <mapi68@gmail.com>
Co-authored-by: Milo Ivir <mail@milotype.de>
2023-08-31 12:51:37 +02:00
Kevin Papst
636422e342 show global form errors - fixes #4233 2023-08-21 20:38:32 +02:00
Weblate (bot)
20149ae765 Translated using Weblate (#4252)
Co-authored-by: Wellington Terumi Uemura <wellingtonuemura@gmail.com>
Co-authored-by: Yaron Shahrabani <sh.yaron@gmail.com>
2023-08-21 20:31:38 +02:00
Kevin Papst
a392f61d61 Release 2.0.31 (#4245)
* replace strings by class references
* allow 64 chars for username
* fix time can be optional and null
* fix timezone is not respected
* bump version
* fix br in attribute
* support different visible duration from booked duration
* fix image URL
2023-08-21 20:24:24 +02:00
Kevin Papst
3e61e0dce6 added supervisor setting for user (#4251) 2023-08-20 13:18:35 +02:00
Kevin Papst
9baa477bed fix payload 2023-08-17 22:58:28 +02:00
Kevin Papst
4d182ad1a7 validate version 2023-08-17 22:54:35 +02:00
Kevin Papst
e77056c4b7 fix payload and validate version 2023-08-17 22:22:53 +02:00
Johannes Przymusinski
d7f1df2987 update website version automatically (#4248) 2023-08-17 21:16:36 +02:00
Kevin Papst
8c1a793b0a added workflow to update website version 2023-08-16 22:33:25 +02:00
Kevin Papst
adc0779912 Release 2.0.30 (#4225) 2023-08-16 18:20:14 +02:00
Weblate (bot)
c7bc8fae73 Translated using Weblate (#4210)
Co-authored-by: Evgeniy Khramov <thejenjagamertjg@gmail.com>
Co-authored-by: Joaquim Homrighausen <joho@boojam.se>
Co-authored-by: John Aleksander Jazbec <johnny@xhorizont.com>
Co-authored-by: Kevin Papst <kevin@kevinpapst.de>
Co-authored-by: Massimo Pissarello <mapi68@gmail.com>
Co-authored-by: Matthew Durajka <logrcz@gmail.com>
Co-authored-by: Milo Ivir <mail@milotype.de>
Co-authored-by: PatoGordo <icariusv@gmail.com>
Co-authored-by: SC <lalocas@protonmail.com>
Co-authored-by: Serhii Horichenko <m@sgg.im>
Co-authored-by: Tobs Hart <tobias@2bproduction.net>
Co-authored-by: Wellington Terumi Uemura <wellingtonuemura@gmail.com>
Co-authored-by: Yaron Shahrabani <sh.yaron@gmail.com>
Co-authored-by: Yaroslaw <bruce.levitangens@gmail.com>
Co-authored-by: beq <beqbdean@gmail.com>
Co-authored-by: full name <iaeqgz09gu6d@opayq.com>
Co-authored-by: jhtm <jhtm@users.noreply.hosted.weblate.org>
Co-authored-by: yangyangdaji <1504305527@qq.com>
2023-08-16 15:08:22 +02:00
Kevin Papst
0a0ffb4ac9 remove text from tag choice after selection - fixes #4076 2023-08-04 13:03:11 +02:00
Kevin Papst
b831532323 Release 2.0.29 (#4178)
- show button title if delete is used in page actions
- fix invoice due date depends on invoice date, replace DateTime with DateTimeI… 
- lowercase all font names in PDFs, otherwise they fail loading
- hide empty fieldset (work-contract page)
- activate contract_other_profile by default for admin and super-admin
- deactivate rule to check "maximum duration of entries" by default
- allow to deactivate presets in DateRange Picker (for Devs)
2023-07-26 15:16:59 +02:00
Kevin Papst
385753fbc3 Release 2.0.28 (#4172)
See https://github.com/kimai/kimai/pull/4172
2023-07-09 15:27:27 +02:00
Kevin Papst
651f812da8 Release 2.0.27 (#4107) 2023-07-04 17:01:29 +02:00
Weblate (bot)
6a99ad41ca Translated using Weblate (#4109)
Co-authored-by: Eryk Michalak <gnu.ewm@protonmail.com>
Co-authored-by: Kevin Papst <kevin@kevinpapst.de>
Co-authored-by: Massimo Pissarello <mapi68@gmail.com>
Co-authored-by: Matthew Durajka <logrcz@gmail.com>
Co-authored-by: Matúš Bulla <matbull12345@gmail.com>
Co-authored-by: Milo Ivir <mail@milotype.de>
Co-authored-by: SC <lalocas@protonmail.com>
Co-authored-by: Sergii Horichenko <m@sgg.im>
Co-authored-by: Wellington Terumi Uemura <wellingtonuemura@gmail.com>
Co-authored-by: Yaron Shahrabani <sh.yaron@gmail.com>
Co-authored-by: Yonggen <vizualizer@gmail.com>
Co-authored-by: bigvictorio <bigvictorio12345@gmail.com>
Co-authored-by: yangyangdaji <1504305527@qq.com>
2023-07-04 00:17:38 +02:00
Kevin Papst
dd89363c72 Improve UX for invoice template management (#4121)
change translations and to explain that calculator actually group items by fields
2023-06-21 08:17:54 +02:00
Weblate (bot)
983bf2c88b Translated using Weblate (#4099)
Co-authored-by: Arjan Houben <arjan@houben.es>
Co-authored-by: Jiri Nakola <github@nakola.fi>
Co-authored-by: Milo Ivir <mail@milotype.de>
Co-authored-by: Sebastiaan <djsebas@home.nl>
Co-authored-by: Tomas Koutek <spam@hug0.cz>
Co-authored-by: Wellington Terumi Uemura <wellingtonuemura@gmail.com>
Co-authored-by: Yaron Shahrabani <sh.yaron@gmail.com>
Co-authored-by: akawshi <zenranoakawshi@gmail.com>
Co-authored-by: yangyangdaji <1504305527@qq.com>
2023-06-13 14:17:37 +02:00
Kevin Papst
ce7fe67fcc use modern flat form styles with more icons (#4098) 2023-06-09 19:16:36 +02:00
Kevin Papst
053a1d9017 use collapsible element instead of collapsible card (#4096) 2023-06-09 18:17:32 +02:00
Kevin Papst
2e2bf986a4 Support visibility for tags (#4086) 2023-06-09 17:07:49 +02:00
Kevin Papst
6e781b59e2 Release 2.0.26 (#4087)
- setting "rounding days" not required
- developer: added user pref for public holiday group (to be used by plugins)
- developer: added WorkingTimeYearEvent (to be used by plugins)
- user pref: cleanup work contract form and support more fields (to be used by plugins)
- code cleanup
- bump theme and composer packages
2023-06-09 16:29:19 +02:00
Kevin Papst
0663995d06 Release 2.0.25 (#4066)
* added support for hourly rate column in detail table
* allow to register icon in extension
* allow to show QR code secret
* new translations
* bump theme and packages
* fix validation for invoice-document-filenames with uppercase character
* max upload size 1MB
* fix last month in daterange-picker in certain situations, more years in quick-select
* remove unused package-versions-deprecated
* link preferences from contract warning message
* added page_setup page layout
* prevent DROP TABLE in addSQL() and replace drop table with schema call
* added azuyalabs/yasumi
2023-06-06 23:05:20 +02:00
Kevin Papst
2ba9cff281 bump theme to get navigation id specific classes (#4065) 2023-05-26 22:39:07 +02:00
Kevin Papst
9c1150c50e added JS api to access current user in frontend (#4064) 2023-05-26 18:40:54 +02:00
Kevin Papst
b4a4d81ca8 Fix nullable parameter in work-contract API (#4063) 2023-05-26 18:39:44 +02:00
Kevin Papst
2681b81990 calendar: update popover content when shown (#4045) 2023-05-22 18:41:30 +02:00
Kevin Papst
97092acae9 fix single dropdown became two lines (#4041) 2023-05-21 17:49:44 +02:00
Kevin Papst
fdb6cf5cf8 allow to remove date from non-required field (#4040) 2023-05-21 17:13:41 +02:00
Kevin Papst
7ab0a8cea1 dynamic favicon that indicates if an entry is running (#4038) 2023-05-21 15:40:45 +02:00
Kevin Papst
2664d6117f show available github release only if newer version exists (#4037) 2023-05-20 13:49:31 +02:00
Kevin Papst
6bdf27fc9b change parameter name 2023-05-20 12:46:16 +02:00
Weblate (bot)
f0298335ee Translated using Weblate (#4036)
Co-authored-by: J. Lavoie <j.lavoie@net-c.ca>
Co-authored-by: Massimo Pissarello <mapi68@gmail.com>
Co-authored-by: Oğuz Ersen <oguz@ersen.moe>
Co-authored-by: Sabri Ünal <libreajans@gmail.com>
Co-authored-by: Sebastiaan <djsebas@home.nl>
Co-authored-by: Wellington Terumi Uemura <wellingtonuemura@gmail.com>
Co-authored-by: Yaron Shahrabani <sh.yaron@gmail.com>
2023-05-20 12:08:36 +02:00
Kevin Papst
a58a33fc7d Release 2.0.22 (#4032)
* fix version string in migration
* disable search in order and order_by
* reduce divider spacing for context menu and select with optgroup
2023-05-20 12:08:01 +02:00
Kevin Papst
9bd5965ecd Release 2.0.21 (#4030)
* increase padding in wizard
* fix theme chooser in wizard
* improve dynamic export columns in PDFs
* added label for total column
* bump theme bundle
* improve avatar list spacing
* be more flexible parsing times - fixes #4031
2023-05-17 15:02:10 +02:00
Kevin Papst
29624354a2 Release 2.0.20 (#4028)
* max duration per entry increased from 8 to 10 hours
* fixes #3981 - clickable area in dropdown too small
* fixes #4008 - duplicate activities in project-details report
* headers and summary styling in project-details report
* show billable stats in project-details report
* added new invoice variable for entry.duration_format
2023-05-15 22:30:37 +02:00
Kevin Papst
04422f3530 frontend update to tabler beta 19 (#4029) 2023-05-15 19:10:00 +02:00
Kevin Papst
43bd7bf1ab added API for handling work contract times (#4016) 2023-05-13 01:24:15 +02:00
Kevin Papst
4b2a3669e6 Release 2.0.19 (#4022)
* prevent invoices with exceeding filename
* fixed invalid LDAP log level
* support locale switching in action events
2023-05-12 14:45:51 +02:00
Kevin Papst
1099e76244 Release 2.0.18 (#4003)
* prevent too long values for user preferences
* add chart value 0 to y-axis if last value > 0, to always display the zero line (project details)
* add user-preferences to invoice hydrator
* DateTime vs DateTimeInterface
* simplify permission config
* fix query for teamleads limiting to only selected teams not possible
2023-05-08 17:11:55 +02:00
Weblate (bot)
d8f72b8b88 Translated using Weblate (#4010)
Co-authored-by: Eryk Michalak <gnu.ewm@protonmail.com>
Co-authored-by: Hama Czech <hamaczech13@gmail.com>
Co-authored-by: J. Lavoie <j.lavoie@net-c.ca>
Co-authored-by: Milo Ivir <mail@milotype.de>
Co-authored-by: Mæve Rey <martin.rey@mailbox.org>
Co-authored-by: Oğuz Ersen <oguz@ersen.moe>
Co-authored-by: Sanji Finsmok <khldeilamil@gmail.com>
Co-authored-by: Wellington Terumi Uemura <wellingtonuemura@gmail.com>
Co-authored-by: Yaron Shahrabani <sh.yaron@gmail.com>
Co-authored-by: yangyangdaji <1504305527@qq.com>
2023-05-08 13:07:59 +02:00
Weblate (bot)
b2314de315 Translated using Weblate (#4002)
Co-authored-by: Massimo Pissarello <mapi68@gmail.com>
2023-05-02 00:44:49 +02:00
Kevin Papst
66413d789c Release 2.0.17 (#3992)
* prevent empty title for select options
* removed css for unused sweetalert
* fix isWeekend() check with DateTimeInterface
* reset timesheet rates on "create copy"
* wrap long names in multi-selects - fix #4001
* rename profile menus
* show all possible links in user profile dropdown
* check if plugin is compatible before displaying the buy link
2023-05-02 00:40:43 +02:00
Kevin Papst
7112e932a2 Allow 2FA for SAML and LDAP users (#4000)
* inline totp image as data uri to prevent caching issues
* allow 2fa for ldap and saml users
* allow 2FA access for super admin to all profiles
2023-05-01 08:28:35 +02:00
Kevin Papst
01e26dca9e Release 2.0.16 (#3990)
https://github.com/kimai/kimai/pull/3990
2023-04-27 18:48:31 +02:00
Weblate (bot)
844062b90e Translated using Weblate (#3991)
Co-authored-by: Anders Johansson <johansson@aljmedia.se>
Co-authored-by: ButterflyOfFire <boffire@users.noreply.hosted.weblate.org>
Co-authored-by: Eryk Michalak <gnu.ewm@protonmail.com>
Co-authored-by: Petr Daniel Ambrož <paces@paces.cz>
2023-04-27 18:22:01 +02:00
Kevin Papst
f60065d089 split timesheet validator to simplify imports (#3974) 2023-04-27 13:56:07 +02:00
Kevin Papst
046ed313c9 Release 2.0.15 (#3970) 2023-04-16 00:44:00 +02:00
Weblate (bot)
ecd8ee85f3 Translated using Weblate (#3968)
Co-authored-by: Kevin Papst <kevin@kevinpapst.de>
Co-authored-by: Kyotaro Iijima <kyotaro.eyes@gmail.com>
Co-authored-by: Massimo Pissarello <mapi68@gmail.com>
Co-authored-by: Milo Ivir <mail@milotype.de>
Co-authored-by: Simona Iacob <s@zp1.net>
Co-authored-by: Wellington Terumi Uemura <wellingtonuemura@gmail.com>
Co-authored-by: gallegonovato <fran-carro@hotmail.es>
Co-authored-by: gnu-ewm <gnu.ewm@protonmail.com>
Co-authored-by: ssantos <ssantos@web.de>
Co-authored-by: tachyglossues <tachyglossues@gmail.com>
Co-authored-by: yangyangdaji <1504305527@qq.com>
2023-04-06 22:03:33 +02:00
Kevin Papst
0c397e5080 Release 2.0.14 (#3963)
- show customer totals in single-user reports
- support custom fonts in export / invoice templates
- require daterange for export and invoice searches
- improve help label for user locale
- show decimal formats in help controller
- cache tag amount per request
- composer updates
- improved code styles
- added default label to date picker
- new macros & use own macro
2023-04-05 19:14:49 +02:00
Kevin Papst
01226a1243 Release 2.0.13 (#3955)
- added missing escape to prevent HTML injection
- added missing color attribute
- upgrade theme
  - use dropdown submenu if title is set, otherwise dropdown tends to get too long
  - allow to use card-table instead of card-body
  - added `required` attribute to username and password field
- fix pagination back to page 1
- prevent tag name too long
- re-add missing user preferences link
2023-03-30 01:08:15 +02:00
Weblate (bot)
7164ec126f Translated using Weblate (#3945)
Co-authored-by: Kevin Papst <kevin@kevinpapst.de>
Co-authored-by: Milo Ivir <mail@milotype.de>
Co-authored-by: Wellington Terumi Uemura <wellingtonuemura@gmail.com>
Co-authored-by: gallegonovato <fran-carro@hotmail.es>
Co-authored-by: gnu-ewm <gnu.ewm@protonmail.com>
Co-authored-by: tachyglossues <tachyglossues@gmail.com>
Co-authored-by: yangyangdaji <1504305527@qq.com>
2023-03-30 01:06:24 +02:00
Kevin Papst
04b5eb4c38 Release 2.0.12 (#3947)
- added submenus in action drodowns, to shorten them
- show all user-edit-screens in action dropdown
- fix cascade delete teams through customer
- fix cascade delete customer/project/activity through teams
- fix responsive classes for "internal rate" column
- clarify error message if invoice number generator or calculator is missing
2023-03-24 00:47:36 +01:00
Kevin Papst
3a5d7a62de Release 2.0.11 (#3932)
- added "today" as selector in date-range dropdown
- added feature to prevent auto-select of dropdowns with only one entry
- added hint that no changes were detected in batch update
- added negative invoice sums are possible (e.g. for credit notes)
- fix project list is expanded after submission
- fix invalid date parsing causes 500
- fix: prevent auto-select of activities in export and invoice form (in case only one global activity exists)
- fix team assignments for customer and project were not saved (using API now)
- fix form fieldset with legend styling (e.g. team project assignment)
- fix required meta-field were forced to have a value in batch update
- fix tomselect meta-field was not disabled in batch update
- fix unset internal rate is shown as 0
- fix one minute rounding problem in duration-only mode  with "now" being default time
- fix column width and label for duration-only mode
- tech debt: cleanup invoice template (remove invoice layout)
- tech debt: reorder for simpler comparison with invoice form
- possible BC for devs: remove unused methods from form trait
- bump composer packages (includes new translations for auth screens)
2023-03-21 12:42:18 +01:00
Weblate (bot)
252652082d Translated using Weblate (#3937)
Co-authored-by: Allan Nordhøy <epost@anotheragency.no>
Co-authored-by: Blueberry <igory.ygr200@gmail.com>
Co-authored-by: ButterflyOfFire <boffire@users.noreply.hosted.weblate.org>
Co-authored-by: Felipe Nogueira <contato.fnog@gmail.com>
Co-authored-by: Jeffrey <kjw5608kjw@gmail.com>
Co-authored-by: Kevin Papst <kevin@kevinpapst.de>
Co-authored-by: Lars Vogdt <lars.vogdt@suse.com>
Co-authored-by: Ondřej Mach <machondra2003@gmail.com>
Co-authored-by: Oğuz Ersen <oguz@ersen.moe>
Co-authored-by: Simona Iacob <s@zp1.net>
Co-authored-by: Tang Yin <bingyuanshiye@126.com>
Co-authored-by: Viktor Kryvda <ivic4u@gmail.com>
Co-authored-by: Wellington Terumi Uemura <wellingtonuemura@gmail.com>
Co-authored-by: Yaron Shahrabani <sh.yaron@gmail.com>
Co-authored-by: gallegonovato <fran-carro@hotmail.es>
Co-authored-by: ssantos <ssantos@web.de>
Co-authored-by: tygyh <jonis9898@hotmail.com>
2023-03-18 22:06:36 +01:00
Kevin Papst
f007697a73 Release 2.0.10 (#3927)
* allow API calls via GET
* allow to stop timesheet via GET
* improve form handling and validation
* improve stop button handling
* bump version
2023-03-15 23:02:28 +01:00
Kevin Papst
1a8c78944a Release 2.0.9 (#3922)
* fix api definition
* include customer number in validation message
* fix doctrine deprecation, prepare for DBAL 4
* added DataSubscriberInterface to identify certain doctrine subscribers
2023-03-14 23:51:49 +01:00
Kevin Papst
8449eafcb6 Release 2.0.8 (#3914)
* support parsing negative durations in JS
* bump luxon dependency
* make sure that 2FA is not required for session based API calls
* show name of items to delete
* fix permission issue for recent activity items
2023-03-13 01:48:53 +01:00
Kevin Papst
1310285133 bump version 2023-03-08 23:30:45 +01:00
Weblate (bot)
588e85d48f Translated using Weblate (#3905) 2023-03-08 21:05:19 +01:00
Kevin Papst
aebd57e311 added translation domain for dashboard widgets (#3909) 2023-03-08 19:01:49 +01:00
Kevin Papst
9d503300f6 Release 2.0.6 (#3900)
* cleanup invoice templates
* cleanup invoice translations
* fix invoice datetime for now
* support invoice archive order by number and status
* bump version
* allow meta-field sub-classing
* removed unused translation task.delete
* prevent null in str_replace
2023-03-08 00:38:10 +01:00
Weblate (bot)
80f8f70695 Translated using Weblate (#3902)
Co-authored-by: Allan Nordhøy <epost@anotheragency.no>
Co-authored-by: ButterflyOfFire <boffire@users.noreply.hosted.weblate.org>
Co-authored-by: Felipe Nogueira <contato.fnog@gmail.com>
Co-authored-by: Jeffrey <kjw5608kjw@gmail.com>
Co-authored-by: Kevin Papst <kevin@kevinpapst.de>
Co-authored-by: Ondřej Mach <machondra2003@gmail.com>
Co-authored-by: Oğuz Ersen <oguz@ersen.moe>
Co-authored-by: Wellington Terumi Uemura <wellingtonuemura@gmail.com>
Co-authored-by: Yaron Shahrabani <sh.yaron@gmail.com>
Co-authored-by: gallegonovato <fran-carro@hotmail.es>
2023-03-07 21:39:42 +01:00
Weblate (bot)
c6fc06222f Unify language files (#3899)
Co-authored-by: Felipe Nogueira <contato.fnog@gmail.com>
Co-authored-by: Yaron Shahrabani <sh.yaron@gmail.com>
Co-authored-by: Kevin Papst <kpapst@gmx.net>
2023-03-05 15:23:18 +01:00
Weblate (bot)
8926f7677e Update translation files (#3898) 2023-03-05 04:40:00 +01:00
Weblate (bot)
517e7eae89 Update translation files (#3897) 2023-03-05 04:38:12 +01:00
Weblate (bot)
8b53980ce7 Update translation files (#3896) 2023-03-05 04:36:34 +01:00
Weblate (bot)
d13083fc6f Cleanup translation files (#3895) 2023-03-05 04:34:54 +01:00
Weblate (bot)
34a79b1e3a Translated using Weblate (#3894)
Co-authored-by: Oğuz Ersen <oguz@ersen.moe>
2023-03-05 03:52:28 +01:00
Weblate (bot)
ea8bf6d1fa Cleanup translation files (#3893) 2023-03-05 03:48:04 +01:00
Weblate (bot)
cc39f25d37 Update translation files (#3887)
Co-authored-by: ButterflyOfFire <boffire@users.noreply.hosted.weblate.org>
Co-authored-by: Dan <denqwerta@gmail.com>
Co-authored-by: Felipe Nogueira <contato.fnog@gmail.com>
Co-authored-by: J. Lavoie <j.lavoie@net-c.ca>
Co-authored-by: Luna Jernberg <droidbittin@gmail.com>
Co-authored-by: Massimo Pissarello <mapi68@gmail.com>
Co-authored-by: Milo Ivir <mail@milotype.de>
Co-authored-by: Ondřej Mach <machondra2003@gmail.com>
Co-authored-by: Oğuz Ersen <oguz@ersen.moe>
Co-authored-by: Simona Iacob <s@zp1.net>
Co-authored-by: Yaron Shahrabani <sh.yaron@gmail.com>
Co-authored-by: gallegonovato <fran-carro@hotmail.es>
Co-authored-by: i3sey <deniskedrovsky@mail.ru>
Co-authored-by: tygyh <jonis9898@hotmail.com>
Co-authored-by: yangyangdaji <1504305527@qq.com>
2023-03-05 03:44:28 +01:00
Kevin Papst
0cbf0053d2 Release 2.0.5 (#3888)
- Fixed: mandatory fields / form validation for invoice template
- Added: Duration as calendar title replacer (open: running records)
- Fixed: HTML injection in Calendar
- Fixed: Doctrine Proxies are not initialized (leads to empty customer/project)
- Fixed: tag creation
- Fixed: validation errors do not need to be logged in prod
- Removed: Customer VCard download, as used library is outdated and not maintained
- Added: supporting translations domains in many new places (menu, help_text, page_setup, report, exporter, calendar)
2023-03-05 03:08:43 +01:00
Kevin Papst
3b93afabc8 Revert "bump packages"
This reverts commit d03fbf0ef9.
2023-03-02 15:15:01 +01:00
Kevin Papst
d03fbf0ef9 bump packages 2023-03-02 15:10:23 +01:00
Weblate (bot)
5c473ad39b Translated using Weblate (#3882)
Co-authored-by: ButterflyOfFire <boffire@users.noreply.hosted.weblate.org>
Co-authored-by: Felipe Nogueira <contato.fnog@gmail.com>
Co-authored-by: J. Lavoie <j.lavoie@net-c.ca>
Co-authored-by: Luna Jernberg <droidbittin@gmail.com>
Co-authored-by: Massimo Pissarello <mapi68@gmail.com>
Co-authored-by: Milo Ivir <mail@milotype.de>
Co-authored-by: Ondřej Mach <machondra2003@gmail.com>
Co-authored-by: Simona Iacob <s@zp1.net>
Co-authored-by: tygyh <jonis9898@hotmail.com>
2023-03-02 14:22:19 +01:00
Kevin Papst
3f09a2674b Release 2.0.4 (#3883)
* fix column data truncated
* calculate internal rate from user
* show internal rate in timesheet listing
* Fixed: responsivenss and size of report start page icons
* fix: name display in dropdowns (and added tests)
* translate reload button
* fix invoice date might be in the past
* fail safe customer name handling
* translate invoice_date and invoice_date help
* prevent URLs like start=null
* prevent to reload select twice
2023-03-02 14:04:06 +01:00
Kevin Papst
a8b972f8a5 added permission caching (#3877) 2023-02-25 20:57:48 +01:00
Weblate (bot)
3c28288cac Translated using Weblate (#3867)
Co-authored-by: ButterflyOfFire <boffire@users.noreply.hosted.weblate.org>
Co-authored-by: Kevin Papst <kevin@kevinpapst.de>
Co-authored-by: Noemi <mikrometer-gearbeitet-0v@icloud.com>
Co-authored-by: Oğuz Ersen <oguz@ersen.moe>
Co-authored-by: Sergii Horichenko <m@sgg.im>
Co-authored-by: Simona Iacob <s@zp1.net>
Co-authored-by: Wellington Terumi Uemura <wellingtonuemura@gmail.com>
Co-authored-by: Yaron Shahrabani <sh.yaron@gmail.com>
Co-authored-by: gallegonovato <fran-carro@hotmail.es>
2023-02-25 20:49:01 +01:00
Kevin Papst
2cb29bfef5 Release 2.0.3 (#3879) 2023-02-25 20:37:52 +01:00
Kevin Papst
068e9425eb added action to download invoice document (#3878) 2023-02-25 19:23:45 +01:00
Kevin Papst
a9849fc6cf added action to reload twig invoice template (#3876) 2023-02-25 19:10:29 +01:00
1146 changed files with 26821 additions and 16615 deletions

View File

@@ -7,19 +7,19 @@
# 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 version "5.7" (the database server version, examples for MySQL and MariaDB below)
# - the database username "user"
# - the database password "password"
# - the database schema name "database"
# - the password "password" for "user"
# - the database schema "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
# DATABASE_URL=mysql://user:password@127.0.0.1:3306/database?charset=utf8mb4&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
# For MariaDB it would be "serverVersion=10.5.8-MariaDB":
# DATABASE_URL=mysql://user:password@127.0.0.1:3306/database?charset=utf8mb4&serverVersion=10.5.8-MariaDB
#
DATABASE_URL=mysql://user:password@127.0.0.1:3306/database?charset=utf8&serverVersion=5.7
DATABASE_URL=mysql://user:password@127.0.0.1:3306/database?charset=utf8mb4&serverVersion=10.5.8-MariaDB
#================================================================================
# The full documentation can be found at https://www.kimai.org/documentation/emails.html

View File

@@ -3,12 +3,9 @@ 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
url: https://www.kimai.org/en/support.html
about: As a customer, you will always receive fast and helpful replies from the developer.

42
.github/ISSUE_TEMPLATE/docker.yml vendored Normal file
View File

@@ -0,0 +1,42 @@
name: Docker issue
description: Experiencing an issue with your Docker Setup?
labels: [ "docker" ]
body:
- type: markdown
attributes:
value: |
Thank you for reporting an issue with your docker setup! This form will guide you to create a useful issue report.
- type: textarea
id: describe
attributes:
label: Describe the problem
description: >
Please provide a clear and concise description of what the issue is and the steps to reproduce the behaviour:
1. Start the container '...'
2. Click on '....'
3. See error xyz
validations:
required: true
- type: textarea
id: environment
attributes:
label: Describe your setup and add your Docker compose file (redact your credentials)
description: >
Your working environment:
- OS: [e.g. Linux, Windows, Mac]
- Docker version: [e.g. 19.03.2]
- Docker compose version: [e.g. 1.21.0]
Docker compose file:
```yaml
version: '3.5'
services:
image: ...
```
validations:
required: true
- type: input
id: command
attributes:
label: Command used to run the container
description: e.g. docker run -v ....

View File

@@ -13,4 +13,4 @@ jobs:
with:
token: ${{ secrets.DOCKER_ACCESS_TOKEN }}
repository: tobybatch/kimai2
event_type: kimai_release
event-type: kimai_release

42
.github/workflows/website.yaml vendored Normal file
View File

@@ -0,0 +1,42 @@
name: 'Website update'
on:
workflow_dispatch:
inputs:
kimai_version:
description: 'Kimai version for the website'
required: true
release:
types: [released]
jobs:
build:
name: Trigger version update for website
runs-on: ubuntu-latest
steps:
- name: "Determine Version"
run: |
input="${{ github.event.inputs.kimai_version }}"
# Determine between manual trigger and release event
if [ -z "$input" ]; then
echo "No input provided, using release tag"
version="${{ github.event.release.tag_name }}"
else
echo "Using input provided: $input"
version="$input"
fi
echo "kimai_version=$version" >> $GITHUB_ENV
if [[ ! $version =~ ^2\.(0|[1-9]*)(0?)\.(0|[0-9]*)(0?)$ ]]; then
echo "Invalid version number: $version"
exit 1
fi
- name: Emit repository_dispatch
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.WEBSITE_ACCESS_TOKEN }}
repository: kimai/www.kimai.org
event-type: kimai_release
client-payload: '{"kimai_version": "${{ env.kimai_version }}"}'

39
.gitignore vendored
View File

@@ -1,41 +1,34 @@
# some hosters require a htaccess to change the PHP version
.htaccess
.env-*
.idea/
.DS_Store
rector.php
phpstan.sh
/public/.htaccess
/.env-*
/.idea/
/.DS_Store
/phpstan.sh
# custom apache rules e.g. to deactivate ioncube loader
/public/.user.ini
# for symfony local webserver
php.ini
.php-version
/php.ini
/.php-version
# YARN 2
.yarnrc.yml
.yarn
/.yarnrc.yml
/.yarn
# for keeping empty directories
!.gitkeep
/bin/*
!/bin/console
*local.yaml
/config/packages/local.yaml
/config/bundles-local.php
/templates/invoice/renderer/.~lock*
/translations/branding.*.xlf
/var/data/*
/var/coverage/
/var/cache/*
/var/invoices/*
/var/invoices*
/var/export/*
/var/log/*
/var/sessions/*
/var/packages/*
/var/plugins/*
*.disabled
/var/plugins_old/
/var/plugins/*/*.disabled
###> symfony/framework-bundle ###
/.env.local

View File

@@ -14,7 +14,11 @@ $fixer
'encoding' => true,
'full_opening_tag' => true,
'blank_line_after_namespace' => true,
'braces' => true,
'control_structure_braces' => true,
'control_structure_continuation_position' => ['position' => 'same_line'],
'declare_parentheses' => true,
'no_multiple_statements_per_line' => true,
'statement_indentation' => true,
'class_definition' => true,
'elseif' => true,
'function_declaration' => true,
@@ -29,7 +33,7 @@ $fixer
'no_break_comment' => true,
'no_closing_tag' => true,
'no_spaces_after_function_name' => true,
'no_spaces_inside_parenthesis' => true,
'spaces_inside_parentheses' => ['space' => 'none'],
'no_trailing_whitespace' => true,
'no_trailing_whitespace_in_comment' => true,
'single_blank_line_at_eof' => true,
@@ -50,7 +54,7 @@ $fixer
'class_attributes_separation' => ['elements' => ['method' => 'one']],
'concat_space' => ['spacing' => 'one'],
'declare_equal_normalize' => true,
'function_typehint_space' => true,
'type_declaration_spaces' => ['elements' => ['function', 'property']],
'include' => true,
'lowercase_cast' => true,
'lowercase_static_reference' => true,
@@ -119,7 +123,7 @@ $fixer
'return_type_declaration' => true,
'semicolon_after_instruction' => true,
'short_scalar_cast' => true,
'single_blank_line_before_namespace' => true,
'blank_lines_before_namespace' => ['min_line_breaks' => 2, 'max_line_breaks' => 2],
'single_line_comment_style' => [
'comment_types' => ['hash'],
],

View File

@@ -3,7 +3,7 @@
</p>
<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://github.com/kimai/kimai/actions"><img alt="CI Status" src="https://github.com/kimai/kimai/actions/workflows/testing.yaml/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>
@@ -23,10 +23,12 @@ and so much more.
### Versions
There are two versions of Kimai existing:
There are two [versions](https://www.kimai.org/documentation/versions.html) of Kimai existing:
- [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)
- [Version 2](https://github.com/kimai/kimai) — the current stable release (PHP 8.1+)
- [Version 1](https://github.com/kimai/kimai/tree/1.x) — EOL since mid of 2023 (PHP 7.4)
Do **NOT** use Version 1, it won't get any more updates!
### Links
@@ -72,8 +74,6 @@ It is open for changes and input from the community, your [ideas and questions](
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.
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.
## Contributing
You want to contribute to this repository? This is so great!

View File

@@ -13,7 +13,8 @@ As announced in the [README](README.md) I only support the latest available rele
## 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.
You can report any security related vulnerability in the [advisory section at GitHub](https://github.com/kimai/kimai/security/advisories)
or via email to [support@kimai.org](mailto:support@kimai.org).
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.
@@ -22,3 +23,5 @@ 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!
Please note: if you are asking for money, I will not reply. I receive these scam messages every day...

368
UPGRADING-1.md Normal file
View File

@@ -0,0 +1,368 @@
# Upgrading Kimai - Version 1.x
_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.
## [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
```

View File

@@ -1,4 +1,4 @@
# Upgrading Kimai
# Upgrading Kimai - Version2.x
_Make sure to create a backup before you start!_
@@ -8,21 +8,31 @@ 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.30](https://github.com/kimai/kimai/releases/tag/2.0.30)
The `DATABASE_URL` in your environment settings ([.env](https://github.com/kimai/kimai/issues/4246) or in your [Docker](https://github.com/tobybatch/kimai2/issues/531) or webserver config)
now requires the `charset` and `serverVersion` params, e.g.: `DATABASE_URL=mysql://user:password@127.0.0.1:3306/database?charset=utf8mb4&serverVersion=10.5.8-MariaDB` (examples in `.env`).
## [2.0](https://github.com/kimai/kimai/releases/tag/2.0)
**!! This release requires minimum PHP version to 8.1 !!**
### Breaking changes
- All plugins need to be updated: delete all previous version from your installation (`rm -r var/plugins/*`) before updating!
- The `local.yaml` is not compatible with old version, remove it before the update and then re-create it after everything works
- removed: configuring the `dashboard` is not supported any longer
- removed: custom translation files via `theme.branding.translation`
- removed: changing the plugin directory via `kimai.plugin_dir`
### Developer
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`
@@ -38,362 +48,3 @@ Developer read the full documentation at [https://www.kimai.org/documentation/mi
- `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
```

View File

@@ -1,5 +1,5 @@
require('./sass/app.scss');
require('./sass/_app.scss');
// ------ Kimai itself ------
require('./js/KimaiWebLoader.js');

View File

@@ -1,2 +1,2 @@
require('./sass/export-pdf.scss');
require('./sass/_export-pdf.scss');

View File

@@ -1,2 +1,2 @@
require('./sass/invoice-pdf.scss');
require('./sass/_invoice-pdf.scss');

View File

@@ -1,2 +1,2 @@
require('./sass/invoice.scss');
require('./sass/_invoice.scss');

View File

@@ -88,4 +88,11 @@ export default class KimaiContainer {
return this._configuration;
}
/**
* @returns {KimaiUser}
*/
getUser() {
return this.getPlugin('user');
}
}

View File

@@ -41,6 +41,7 @@ import KimaiDateNowForm from "./forms/KimaiDateNowForm";
import KimaiNotification from "./plugins/KimaiNotification";
import KimaiHotkeys from "./plugins/KimaiHotkeys";
import KimaiRemoteModal from "./plugins/KimaiRemoteModal";
import KimaiUser from "./plugins/KimaiUser";
export default class KimaiLoader {
@@ -55,6 +56,7 @@ export default class KimaiLoader {
);
// GLOBAL HELPER PLUGINS
kimai.registerPlugin(new KimaiUser());
kimai.registerPlugin(new KimaiEscape());
kimai.registerPlugin(new KimaiEvent());
kimai.registerPlugin(new KimaiAPI());

View File

@@ -41,6 +41,11 @@ export default class KimaiAutocomplete extends KimaiFormPlugin {
}
new TomSelect(node, {
// see https://github.com/orchidjs/tom-select/issues/543#issuecomment-1664342257
onItemAdd: function(){
// remove remaining characters from input after selecting an item
this.setTextboxValue('');
},
// 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

View File

@@ -79,6 +79,12 @@ export default class KimaiDatePicker extends KimaiFormPlugin {
delete picker._wasPreselected;
}
});
// only if mobile.friendly plugin is activated
if (picker.backdrop !== undefined) {
// the node needs to be moved, so the flat form layout works properly (e.g. for date types)
document.body.appendChild(picker.backdrop);
}
},
}};

View File

@@ -52,6 +52,15 @@ export default class KimaiFormSelect extends KimaiFormPlugin {
let plugins = ['change_listener'];
const isMultiple = node.multiple !== undefined && node.multiple === true;
const isRequired = node.required !== undefined && node.required === true;
if (isRequired) {
plugins.push('no_backspace_delete');
}
if (isMultiple) {
plugins.push('remove_button');
}
/*
const isOrdering = false;
@@ -61,13 +70,15 @@ export default class KimaiFormSelect extends KimaiFormPlugin {
}
*/
if (isMultiple) {
plugins.push('remove_button');
}
let options = {
// see https://github.com/orchidjs/tom-select/issues/543#issuecomment-1664342257
onItemAdd: function(){
// remove remaining characters from input after selecting an item
this.setTextboxValue('');
},
lockOptgroupOrder: true,
allowEmptyOption: true,
allowEmptyOption: !isRequired,
hidePlaceholder: false,
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
@@ -115,18 +126,24 @@ export default class KimaiFormSelect extends KimaiFormPlugin {
if (node.dataset['renderer'] !== undefined && node.dataset['renderer'] === 'color') {
options.render = {...render, ...{
option: function(data, escape) {
let color = data.value;
let item = '<div class="list-group-item border-0 p-1 ps-2 text-nowrap">';
if (data.color !== undefined) {
color = data.color;
item += '<span style="background-color:' + data.color + '" class="color-choice-item">&nbsp;</span>';
} else {
item += '<span class="color-choice-item">&nbsp;</span>';
}
return '<div class="list-group-item border-0 p-1 ps-2 text-nowrap"><span style="background-color:' + color + '" class="color-choice-item">&nbsp;</span>' + escape(data.text) + '</div>';
item += escape(data.text) + '</div>';
return item;
},
item: function(data, escape) {
let color = data.value;
let item = '<div class="text-nowrap">';
if (data.color !== undefined) {
color = data.color;
item += '<span style="background-color:' + data.color + '" class="color-choice-item">&nbsp;</span>';
} else {
item += '<span class="color-choice-item">&nbsp;</span>';
}
return '<div class="text-nowrap"><span style="background-color:' + color + '" class="color-choice-item">&nbsp;</span>' + escape(data.text) + '</div>';
item += escape(data.text) + '</div>';
return item;
}
}};
} else {
@@ -278,7 +295,7 @@ export default class KimaiFormSelect extends KimaiFormPlugin {
const optionLength = allOptions.length;
let selectOption = '';
if (optionLength === 1) {
if (optionLength === 1 && node.dataset['autoselect'] === undefined) {
selectOption = allOptions[0].value;
} else if (optionLength === 2 && emptyOption !== null) {
selectOption = allOptions[1].value;
@@ -336,7 +353,13 @@ export default class KimaiFormSelect extends KimaiFormPlugin {
--end;
}
return (start > 0 || end < title.length) ? title.substring(start, end) : title;
let result = (start > 0 || end < title.length) ? title.substring(start, end) : title;
if (result === '' && entity['name'] !== undefined) {
return entity['name'];
}
return result;
}
/**
@@ -416,9 +439,10 @@ export default class KimaiFormSelect extends KimaiFormPlugin {
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) {
if (targetSelect === null || targetSelect.dataset['reloading'] === '1') {
return;
}
targetSelect.dataset['reloading'] = '1';
if (targetSelect.tomselect !== undefined) {
targetSelect.tomselect.disable();
@@ -441,6 +465,7 @@ export default class KimaiFormSelect extends KimaiFormPlugin {
if (selectValue === undefined || selectValue === null || selectValue === '' || (Array.isArray(selectValue) && selectValue.length === 0)) {
if (apiSelect.dataset['emptyUrl'] === undefined) {
this._updateSelect(targetSelectId, {});
targetSelect.dataset['reloading'] = '0';
return;
}
newApiUrl = this._buildUrlWithFormFields(apiSelect.dataset['emptyUrl'], formPrefix);
@@ -454,6 +479,7 @@ export default class KimaiFormSelect extends KimaiFormPlugin {
if (targetSelect.tomselect !== undefined) {
targetSelect.tomselect.enable();
}
targetSelect.dataset['reloading'] = '0';
targetSelect.disabled = false;
});
}
@@ -533,10 +559,16 @@ export default class KimaiFormSelect extends KimaiFormPlugin {
if (Array.isArray(newValue)) {
let urlParams = [];
for (let tmpValue of newValue) {
if (tmpValue === null) {
tmpValue = '';
}
urlParams.push(originalFieldName + '=' + tmpValue);
}
newApiUrl = newApiUrl.replace(item, urlParams.join('&'));
} else {
if (newValue === null) {
newValue = '';
}
newApiUrl = newApiUrl.replace(value, newValue);
}
}

View File

@@ -65,6 +65,8 @@ export default class KimaiTeamForm extends KimaiFormPlugin {
*/
_createMember(option)
{
/** @type {KimaiEscape} ESCAPER */
const ESCAPER = this.getPlugin('escape');
const prototype = this._getPrototype();
let counter = prototype.dataset['widgetCounter'] || prototype.childNodes.length;
let newWidget = prototype.dataset['prototype'];
@@ -72,11 +74,11 @@ export default class KimaiTeamForm extends KimaiFormPlugin {
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(/__DISPLAY__/g, ESCAPER.escapeForHtml(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);
newWidget = newWidget.replace(/__INITIALS__/g, ESCAPER.escapeForHtml(option.dataset.initials));
newWidget = newWidget.replace(/__TITLE__/g, ESCAPER.escapeForHtml(option.dataset.title));
newWidget = newWidget.replace(/__USERNAME__/g, ESCAPER.escapeForHtml(option.text));
prototype.dataset['widgetCounter'] = (++counter).toString();

View File

@@ -147,18 +147,49 @@ export default class KimaiTimesheetForm extends KimaiFormPlugin {
return null;
}
const date = this.getDateUtils().fromFormat(
this._beginDate.value + ' ' + this._beginTime.value,
this._beginDate.dataset['format'] + ' ' + this._beginTime.dataset['format'],
);
let date = this._parseBegin(this._beginTime.dataset['format']);
if (date.invalid) {
return null;
date = this._parseBegin(this._fixTimeFormat(this._beginTime.dataset['format']));
if (date.invalid) {
return null;
}
}
return date;
}
_parseBegin(timeFormat)
{
return this.getDateUtils().fromFormat(
this._beginDate.value + ' ' + this._beginTime.value,
this._beginDate.dataset['format'] + ' ' + timeFormat,
);
}
_parseEnd(endDate, timeFormat)
{
let date = this.getDateUtils().fromFormat(
endDate.toFormat('yyyy-LL-dd') + ' ' + this._endTime.value,
'yyyy-LL-dd ' + timeFormat,
);
if (date.invalid) {
date = this.getDateUtils().fromFormat(
endDate.toFormat('yyyy-LL-dd') + ' ' + this._endTime.value,
'yyyy-LL-dd ' + this._fixTimeFormat(timeFormat),
);
}
return date;
}
_fixTimeFormat(format)
{
return format.replace('HH', 'H').replace('hh', 'h');
}
/**
* @returns {DateTime|null}
* @private
@@ -169,17 +200,11 @@ export default class KimaiTimesheetForm extends KimaiFormPlugin {
return null;
}
let date = this.getDateUtils().fromFormat(
DateTime.now().toFormat('yyyy-LL-dd') + ' ' + this._endTime.value,
'yyyy-LL-dd ' + this._endTime.dataset['format'],
);
let date = this._parseEnd(DateTime.now(), 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'],
);
date = this._parseEnd(begin, this._endTime.dataset['format']);
if (date < begin) {
date = date.plus({days: 1});
@@ -293,7 +318,7 @@ export default class KimaiTimesheetForm extends KimaiFormPlugin {
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) {
} else if (begin !== null && seconds >= 0) {
this._applyDateToField(begin.plus({seconds: seconds}), null, this._endTime);
}
}

View File

@@ -85,20 +85,20 @@ export default class KimaiAPILink extends KimaiPlugin {
API.handleError(message, error);
};
let data = {};
if (attributes['payload'] !== undefined) {
data = attributes['payload'];
}
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);
} else if (method === 'GET') {
API.get(url, data, successHandle, errorHandle);
}
}

View File

@@ -18,6 +18,7 @@ export default class KimaiActiveRecords extends KimaiPlugin {
super();
this._selector = '.ticktac-menu';
this._selectorEmpty = '.ticktac-menu-empty';
this._favIconUrl = null;
}
/**
@@ -52,8 +53,6 @@ export default class KimaiActiveRecords extends KimaiPlugin {
// 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();
};
@@ -77,6 +76,10 @@ export default class KimaiActiveRecords extends KimaiPlugin {
// 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 (this._updateBrowserTitle) {
this._changeFavicon(activeRecords.length > 0);
}
if (activeRecords.length === 0) {
if (this._updateBrowserTitle) {
if (document.body.dataset['title'] === undefined) {
@@ -112,7 +115,7 @@ export default class KimaiActiveRecords extends KimaiPlugin {
}
/**
* Adapts the ticktac menus accordingg to the given entries (amount and duration).
* Adapts the ticktac menus according to the given entries (amount and duration).
* Does not influence listing pages, as those refresh themselves.
*
* @param {array} entries
@@ -168,7 +171,7 @@ export default class KimaiActiveRecords extends KimaiPlugin {
for (let link of allReplacer) {
const replacerName = link.dataset['replacer'];
if (replacerName === 'url') {
link.href = node.dataset['href'].replace('000', timesheet.id);
link.dataset['href'] = node.dataset['href'].replace('000', timesheet.id);
} else if (replacerName === 'activity') {
link.innerText = timesheet.activity.name;
} else if (replacerName === 'project') {
@@ -195,4 +198,36 @@ export default class KimaiActiveRecords extends KimaiPlugin {
});
}
/**
* @param {boolean} running
* @private
*/
_changeFavicon(running)
{
const canvas = document.createElement('canvas');
const orig = document.getElementById('favicon');
if (this._favIconUrl === null) {
this._favIconUrl = orig.href;
}
const link = orig.cloneNode(true);
if (canvas.getContext && link) {
const ratio = window.devicePixelRatio;
const img = document.createElement('img');
canvas.height = canvas.width = 16 * ratio;
img.onload = function () {
const ctx = canvas.getContext('2d');
ctx.drawImage(this, 0, 0, canvas.width, canvas.height);
if (running) {
const width = 5.5 * ratio;
ctx.fillStyle = 'rgb(182,57,57)';
ctx.fillRect((canvas.width / 2) - (width / 2), (canvas.height / 2) - (width / 2), width, width);
}
link.href = canvas.toDataURL('image/png');
orig.remove();
document.head.appendChild(link);
};
img.src = this._favIconUrl;
}
}
}

View File

@@ -194,7 +194,7 @@ export default class KimaiAlert extends KimaiPlugin {
<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>
<button type="button" class="btn-close me-2 m-auto" data-bs-dismiss="toast" aria-label="` + translation.get('close') + `"></button>
</div>
</div>`;

View File

@@ -227,8 +227,6 @@ export default class KimaiDateUtils extends KimaiPlugin {
}
/**
* TODO remove seconds
*
* @param {int} hours
* @param {int} minutes
* @return {string}
@@ -297,6 +295,11 @@ export default class KimaiDateUtils extends KimaiPlugin {
return new Duration({seconds: 0});
}
// actually, the parsing above should be improved, but that works as well
if (duration[0] === '-' && luxonDuration.valueOf() > 0) {
return luxonDuration.negate();
}
return luxonDuration;
}

View File

@@ -9,7 +9,7 @@
* [KIMAI] KimaiThemeInitializer: initialize theme functionality
*/
import { Tooltip } from 'bootstrap';
import { Tooltip, Offcanvas } from 'bootstrap';
import KimaiPlugin from '../KimaiPlugin';
export default class KimaiThemeInitializer extends KimaiPlugin {
@@ -21,6 +21,10 @@ export default class KimaiThemeInitializer extends KimaiPlugin {
return new Tooltip(tooltipTriggerEl);
});
// support for offcanvas elements
const offcanvasElementList = document.querySelectorAll('.offcanvas');
[...offcanvasElementList].map(offcanvasEl => new Offcanvas(offcanvasEl));
// activate all form plugins
/** @type {KimaiForm} FORMS */
const FORMS = this.getContainer().getPlugin('form');

View File

@@ -163,7 +163,12 @@ export default class KimaiToolbar extends KimaiPlugin {
event.preventDefault();
event.stopPropagation();
let urlParts = target.href.split('/');
pager.value = urlParts[urlParts.length-1];
let pageNumber = urlParts[urlParts.length - 1];
// page number usually is the default value and is therefor missing from the URL
if (!/\d/.test(pageNumber)) {
pageNumber = 1;
}
pager.value = pageNumber;
pager.dispatchEvent(new Event('change'));
document.dispatchEvent(new Event('pagination-change'));
return false;

View File

@@ -0,0 +1,52 @@
/*
* 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] KimaiUser: information about the current user
*/
import KimaiPlugin from "../KimaiPlugin";
export default class KimaiUser extends KimaiPlugin {
getId() {
return 'user';
}
init() {
this.user = this.getConfigurations().get('user');
}
/**
* @returns {string}
*/
getUserId() {
return this.user.id;
}
/**
* @returns {string}
*/
getName() {
return this.user.name;
}
/**
* @returns {boolean}
*/
isAdmin() {
return this.user.admin;
}
/**
* @returns {boolean}
*/
isSuperAdmin() {
return this.user.superAdmin;
}
}

View File

@@ -220,15 +220,23 @@ export default class KimaiCalendar {
}
const element = mouseEnterInfo.el;
let popover = Popover.getInstance(element);
const popoverTitle = DATES.getFormattedDate(event.start) + ' | ' + DATES.formatTime(event.start) + ' - ' + (event.end ? DATES.formatTime(event.end) : '');
const popoverContent = this.renderEventPopoverContent(event);
if (popover === null) {
let popover = Popover.getInstance(element);
if (popover !== null) {
// see https://github.com/kimai/kimai/issues/4043
popover.setContent({
'.popover-header': popoverTitle,
'.popover-body': popoverContent
});
} else {
// https://getbootstrap.com/docs/5.0/components/popovers/#options
popover = new Popover(element, {
title: DATES.getFormattedDate(event.start) + ' | ' + DATES.formatTime(event.start) + ' - ' + (event.end ? DATES.formatTime(event.end) : ''),
title: popoverTitle,
placement: 'top',
html: true,
content: this.renderEventPopoverContent(event),
content: popoverContent,
trigger: 'focus',
});
}
@@ -432,8 +440,14 @@ export default class KimaiCalendar {
calendarSource = {...calendarSource, ...{
id: 'kimai-' + source.id,
events: (fetchInfo, successCallback, failureCallback) => {
let url = source.url.replace('{from}', DATES.formatForAPI(fetchInfo.start));
url = url.replace('{to}', DATES.formatForAPI(fetchInfo.end));
const targetFrom = DATES.formatForAPI(fetchInfo.start);
const targetTo = DATES.formatForAPI(fetchInfo.end);
let url = source.url;
url = url.replace('{from}', targetFrom);
url = url.replace('__FROM__', targetFrom);
url = url.replace('{to}', targetTo);
url = url.replace('__TO__', targetTo);
API.get(url, {}, result => {
let apiEvents = [];
@@ -450,6 +464,29 @@ export default class KimaiCalendar {
name: 'google',
editable: false,
}};
} else if (source.type === 'json') {
calendarSource = {...calendarSource, ...{
id: 'json-' + source.id,
editable: false,
events: (fetchInfo, successCallback, failureCallback) => {
const targetFrom = DATES.formatForAPI(fetchInfo.start);
const targetTo = DATES.formatForAPI(fetchInfo.end);
let url = source.url;
url = url.replace('{from}', targetFrom);
url = url.replace('__FROM__', targetFrom);
url = url.replace('{to}', targetTo);
url = url.replace('__TO__', targetTo);
API.get(url, {}, result => {
let apiEvents = [];
for (const record of result) {
apiEvents.push(record);
}
successCallback(apiEvents);
}, failureCallback);
},
}};
} else if (source.type === 'ical') {
calendarSource = {...calendarSource, ...{
id: 'ical-' + source.id,
@@ -536,12 +573,22 @@ export default class KimaiCalendar {
color = defaultColor;
}
/** @type {KimaiDateUtils} DATES */
const DATES = this.kimai.getPlugin('date');
let title = this.options['patterns']['title'];
title = title.replace('{project}', apiItem.project.name);
title = title.replace('{customer}', apiItem.project.customer.name);
title = title.replace('{description}', apiItem.description ?? '');
title = title.replace('{activity}', apiItem.activity.name ?? '');
if (apiItem.end === null) {
// duration = 0 and end = null => is a running entry
title = title.replace('{duration}', '');
} else {
title = title.replace('{duration}', DATES.formatDuration(apiItem.duration));
}
if (title === '' || title === null) {
title = apiItem.activity.name;
}
@@ -573,6 +620,13 @@ export default class KimaiCalendar {
/** @type {KimaiEscape} escaper */
const escaper = this.kimai.getPlugin('escape');
let tags = '';
if (eventObj.tags !== null && eventObj.tags.length > 0) {
for (let tag of eventObj.tags) {
tags += '<span class="badge bg-green">' + escaper.escapeForHtml(tag) + '</span>';
}
}
return `
<div class="calendar-entry">
<ul>
@@ -581,8 +635,7 @@ export default class KimaiCalendar {
<li>` + this.options['translations']['activity'] + `: ` + escaper.escapeForHtml(eventObj.activity) + `</li>
</ul>` +
(eventObj.description !== null || eventObj.tags.length > 0 ? '<hr>' : '') +
(eventObj.description ? '<p>' + eventObj.description + '</p>' : '') +
(eventObj.tags !== null && eventObj.tags.length > 0 ? '<span class="badge bg-green">' + eventObj.tags.join('</span> <span class="badge bg-green">') + '</span>' : '') + `
(eventObj.description ? '<div>' + escaper.escapeForHtml(eventObj.description) + '</div>' : '') + tags + `
</div>`;
}

View File

@@ -76,7 +76,10 @@ export default class KimaiContextMenu {
dropdownElement.style.top = (event.clientY) + 'px';
dropdownElement.style.left = (event.clientX) + 'px';
const dropdownListener = () => {
const dropdownListener = (event) => {
if (event.target.classList.contains('dropdown-toggle') || event.target.classList.contains('dropdown-divider')) {
return;
}
dropdownElement.classList.remove('d-block');
if (!dropdownElement.classList.contains('d-none')) {
dropdownElement.classList.add('d-none');

37
assets/sass/_app.scss Normal file
View 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.
*/
@import "bootstrap/scss/functions";
@import "@tabler/core/src/scss/variables";
@import "@tabler/core/src/scss/variables-dark";
@import "@tabler/core/src/scss/mixins";
@import "bootstrap/scss/variables";
@import "bootstrap/scss/variables-dark";
@import "bootstrap/scss/maps";
@import "bootstrap/scss/mixins";
@import "bootstrap/scss/utilities";
@import "layout";
@import "error-page";
@import "print";
@import "content";
@import "loading-spinner";
@import "tables";
@import "calendar";
@import "ticktac";
@import "selectpicker";
@import "forms";
@import "modal";
@import "progressbar";
@import "avatar";
@import "theme-dark";
@import "pages";
@import "tabler-fixes";
@import "help";
@import "rtl";

View File

@@ -34,10 +34,10 @@ p {
.text-center {
text-align: center;
}
.text-left {
.text-left, .text-begin {
text-align: left;
}
.text-right {
.text-right, .text-end {
text-align: right;
}
.text-nowrap {

View File

@@ -7,15 +7,17 @@
@import "bootstrap/scss/functions";
@import "bootstrap/scss/variables";
@import "bootstrap/scss/variables-dark";
@import "bootstrap/scss/maps";
@import "bootstrap/scss/mixins";
@import "bootstrap/scss/utilities";
@import "bootstrap/scss/reboot";
@import "bootstrap/scss/type";
@import "bootstrap/scss/grid";
@import "bootstrap/scss/tables";
@import "bootstrap/scss/list-group";
@import "bootstrap/scss/card";
@import "bootstrap/scss/utilities";
body {
font-family: $font-family-sans-serif;
@@ -80,7 +82,6 @@ body {
font-size: 20px;
> small {
color: #666;
display: block;
margin-top: 5px;
}
@@ -107,6 +108,13 @@ body {
text-align: right;
}
.text-left {
text-align: left;
}
.text-right {
text-align: right;
}
.invoice-items {
.table {
thead th {

View File

@@ -1,27 +0,0 @@
/*
* 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 'variables';
@import 'layout';
@import 'error-page';
@import 'print';
@import 'content';
@import 'loading-spinner';
@import 'tables';
@import 'calendar';
@import 'ticktac';
@import 'sweetalert';
@import 'selectpicker';
@import 'forms';
@import 'modal';
@import 'progressbar';
@import 'avatar';
@import 'theme-dark';
@import 'pages';
@import 'tabler-fixes';
@import 'help';
@import 'rtl';

View File

@@ -3,18 +3,18 @@ $avatar-base-size: 30;
.initials {
font-weight: bold;
font-size: ceil($avatar-base-size / 2 - 2)+px;
font-size: ceil(calc($avatar-base-size / 2 - 2))+px;
}
$avatarSizes: "xs" .75, "sm" 1.25, "md" 1.5, "lg" 2;
@each $avatarSizeName, $avatarBaseSize in $avatarSizes {
.avatar-#{$avatarSizeName} {
width: ceil($avatar-base-size * $avatarBaseSize)+px;
height: ceil($avatar-base-size * $avatarBaseSize)+px;
width: ceil(calc($avatar-base-size * $avatarBaseSize))+px;
height: ceil(calc($avatar-base-size * $avatarBaseSize))+px;
.initials {
font-size: ceil($avatar-base-size * $avatarBaseSize / 2 - 2)+px;
font-size: ceil(calc($avatar-base-size * $avatarBaseSize / 2 - 2))+px;
}
}
}
@@ -23,10 +23,10 @@ $avatarSizes: "xs" .75, "sm" 1.25, "md" 1.5, "lg" 2;
border-radius: 50%;
border: 3px solid #fff;
.avatar {
width: ceil($avatar-base-size * 2.75)+px;
height: ceil($avatar-base-size * 2.75)+px;
width: ceil(calc($avatar-base-size * 2.75))+px;
height: ceil(calc($avatar-base-size * 2.75))+px;
.initials {
font-size: ceil($avatar-base-size * 2.75 / 2 - 2)+px;
font-size: ceil(calc($avatar-base-size * 2.75 / 2 - 2))+px;
}
}
}
@@ -39,3 +39,8 @@ table.dataTable.table > tbody > tr > td {
}
}
}
/* decreases the margin between avatars, see https://github.com/tabler/tabler/issues/1567 */
.avatar-list-stacked .avatar {
margin-right: calc(var(--tblr-avatar-size)*-.2)!important;
}

View File

@@ -3,6 +3,9 @@
padding: 0;
list-style-type: none;
}
div {
white-space: pre-line;
}
}
.draggable {
@@ -13,3 +16,5 @@
--bs-gray-400: var(--tblr-border-color);
--bs-gray-200: var(--tblr-gray-200);
}
.fc-day-sat, .fc-day-sun { background-color: var(--tblr-bg-surface-secondary); }

View File

@@ -5,6 +5,11 @@
* file that was distributed with this source code.
*/
/* used in security screens and other full-size pages */
.page-center {
justify-content: center;
}
/* make sure that elements can be hidden without taking space (eg. hidden modals like the search or column visibility) */
.hidden-no-space {
margin: 0;
@@ -33,11 +38,6 @@ td {
}
}
.label-gray {
background-color: $gray-lte;
color: #666;
}
.open-edit {
cursor: pointer;
}
@@ -79,15 +79,6 @@ table.dataTable thead > tr > th.hw-min {
max-height: 340px;
}
.card {
.card-tools {
/* a button that is directly connected with a pagination element inside the box tools (eg. project list on customer detail page) */
.btn-pager {
float: left;
margin-right: 5px;
}
}
}
#customer_details_box,
#project_details_box,
#activity_details_box {

View File

@@ -1,19 +0,0 @@
/*
* 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.
*/
$fa-font-path: "~@fortawesome/fontawesome-free/webfonts/";
@import "@fortawesome/fontawesome-free/scss/fontawesome";
@import "@fortawesome/fontawesome-free/scss/regular";
@import "@fortawesome/fontawesome-free/scss/solid";
@import "@fortawesome/fontawesome-free/scss/brands";
/* all icon-buttons with fontawesome icons */
.btn-icon i.icon {
font-size: 16px;
color: $text-muted;
padding-top: 2px;
}

View File

@@ -35,4 +35,22 @@
display: inline-block;
margin-right: 10px;
border-radius: var(--tblr-border-radius);
}
/* e.g. the work contract settings is user profile render rows with mb-3 and the last row doesn't need that */
fieldset > .mb-3.row:last-child {
margin-bottom: 0!important;
}
.form-fieldset-light {
border-radius: 0;
margin-bottom: 0;
border-top: none;
border-right: none;
border-left: none;
background-color: unset;
}
.form-fieldset-light:last-child {
border:none;
}

View File

@@ -38,3 +38,8 @@ h1.navbar-brand a {
/* bootstrap thead.sticky-top has z-index 1020 and the reporting form dropdowns hide behind that */
z-index: 1021;
}
/* reduce the default font size for the brand header */
.navbar {
--tblr-navbar-brand-font-size: 1rem;
}

View File

@@ -11,7 +11,7 @@
left: 0;
width: 100%;
height: 100%;
z-index: 50;
z-index: 1021;
background: rgba(255, 255, 255, 0.7);
> .fas {
position: absolute;

View File

@@ -1,26 +1,21 @@
@import "tom-select/dist/scss/tom-select.bootstrap5";
/* bootstrap thead.sticky-top has z-index 1020 and tomselect dropdowns often hide behind that */
.ts-dropdown {
z-index: 1021;
}
/* Tabler defines a min-width of 7rem, what makes many input fields become a two-line field
e.g. a 7 rem input does not fit behind a word like "Germany" in a 3 column form inside a modal */
.ts-control {
> input {
min-width: unset;
}
.item {
white-space: nowrap!important;
}
}
.ts-dropdown {
.optgroup-header {
background-color: #eee;
color: #000;
font-weight: 600;
}
[data-selectable].option {
padding-left: 20px;
.optgroup {
[data-selectable].option {
padding-left: 20px;
}
}
}

View File

@@ -1,16 +0,0 @@
.swal2-popup {
font-size: unset;
}
body.swal2-toast-shown .swal2-container {
// never block the top two bars double-bars display (smaller displays)
@media only screen and (max-width: 768px) {
top: 95px !important;
width: 80%;
}
// never block the top bar on single-bar display (larger devices)
@media only screen and (min-width: 768px) {
top: 60px !important;
}
}

View File

@@ -1,6 +1,34 @@
@import "@tabler/core/src/scss/variables";
/* fix for vertical labels in date-time pickers, if they are used in half-column forms, e.g. "create tasks" or "create expenses" */
fieldset legend.col-form-label {
padding-top: 0;
}
/* See project assignment to teams */
fieldset.form-fieldset legend {
font-size: 1rem;
font-weight: bold;
}
/* Fixing the margin between the divider and items in context menu or dropdowns with optgroups */
.ts-dropdown .optgroup:before {
--tblr-spacer: .5rem;
}
.dropdown-divider {
--tblr-dropdown-divider-margin-y: .5rem;
}
/*
fixes translucent scroll border, e.g. in timesheet modal duration dropdown
https://github.com/tabler/tabler/issues/1606
*/
.dropdown-menu {
background-clip: border-box;
}
/*
hide empty fieldset
https://github.com/tabler/tabler/issues/1650
*/
fieldset:empty {
display: none;
}

View File

@@ -4,7 +4,6 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
@import "variables";
table.dataTable {
clear: both;
@@ -93,7 +92,7 @@ table.dataTable {
&.summary td {
font-weight: bold;
border: 0;
background-color: var(--tblr-table-striped-bg);
background-color: var(--tblr-bg-surface-secondary);
}
th.multiCheckbox {
width: 15px;
@@ -118,30 +117,17 @@ table.dataTable {
padding: .3em .6em .3em;
line-height: 24px;
}
span.label-activity,
span.label-project,
span.label-customer {
a {
color: unset;
padding-bottom: 2px;
border-bottom: 1px dotted $gray-lte;
&:hover {
border-bottom: 1px dotted darken($gray-lte, 20);
}
}
}
span.label-invisible {
opacity: 0.8;
opacity: 0.6;
}
}
th.weekend,
td.weekend {
background-color: #f9f9f9;
background-color: var(--tblr-bg-surface-secondary);
}
/* order is important, "today” should overwrite "weekend" therefor later in the file */
th.today,
td.today {
background-color: $highlight-today;
th.today {
background-color: var(--tblr-highlight-bg);
}
th.total,
td.total {

View File

@@ -1,48 +1,7 @@
@include dark-mode {
.form-check-input {
border-color: $input-border-color;
}
/* selectpicker.scss / Tom Select */
.ts-wrapper.form-select .ts-control,
.ts-wrapper.form-select.single.input-active .ts-control {
color: $dark-mode-text;
}
.ts-dropdown {
background-color: $dark-mode-lighten;
color: $dark-mode-text;
}
.ts-control {
> input {
min-width: unset;
color: $dark-mode-text;
}
.item {
background-color: $dark;
color: $dark-mode-text;
}
}
.optgroup-header {
background-color: $dropdown-dark-bg;
color: $dark-mode-text;
}
@include color-mode(dark, true) {
table.dataTable {
th.weekend, td.weekend {
background-color: $dark-mode-weekend;
color: $dark-mode-text;
}
/* must be defined after weekend, to overwrite it */
th.today, td.today {
background-color: $dark-mode-today;
color: $dark-mode-text;
}
tr {
&.summary td {
background-color: $dark-mode-darken;
}
th.today {
color: var(--tblr-muted);
}
}
@@ -50,7 +9,7 @@
background: rgba(0, 0, 0, 0.5);
> .fas {
color: $dark-mode-text;
color: var(--tblr-white);
}
}
}

View File

@@ -37,8 +37,6 @@
@include media-breakpoint-down(lg) {
aside.navbar .btn-outline-white,
header.navbar .btn-outline-white {
background-color: var(--tblr-body-color);
border-color: hsla(0,0%,100%,.2);
color: hsla(0,0%,100%,.7);
}
}

View File

@@ -1,30 +0,0 @@
/*
* 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 "bootstrap/scss/functions";
@import "bootstrap/scss/variables";
@import "bootstrap/scss/mixins";
@import "@tabler/core/src/scss/variables";
@import "@tabler/core/src/scss/mixins";
/* For highlighting rows, fieldsets and so on */
$highlight-bg: #f5f5f5;
$highlight-today: #fcf8e3;
$red: #dd4b39;
$green: #00a65a;
$yellow: #f0ad4e;
$blue: #0073b7;
$gray-lte: #d2d6de;
$kimai-default: $gray-lte;
$box-border-radius: 3px;
$dark-mode-today: var(--tblr-blue);
$dark-mode-weekend: lighten($dark, 5%) !default;

View File

@@ -24,18 +24,18 @@
"ext-xml": "*",
"ext-xsl": "*",
"ext-zip": "*",
"composer/package-versions-deprecated": "^1.8",
"composer-runtime-api": "^2.0",
"azuyalabs/yasumi": "^2.6",
"composer/semver": "^3.3",
"doctrine/doctrine-bundle": "^2.7",
"doctrine/doctrine-migrations-bundle": "^3.0",
"doctrine/orm": "^2.8",
"endroid/qr-code": "^4.4.9",
"endroid/qr-code": "^4.8",
"erusev/parsedown": "^1.6",
"friendsofsymfony/rest-bundle": "^3.0",
"gedmo/doctrine-extensions": "^3.6",
"jeroendesloovere/vcard": "^1.7",
"jms/serializer-bundle": "^5.0",
"kevinpapst/tabler-bundle": "^0.10",
"kevinpapst/tabler-bundle": "^1.0",
"league/csv": "^9.4",
"mpdf/mpdf": "^8.0",
"nelmio/api-doc-bundle": "^4.0",
@@ -44,8 +44,8 @@
"pagerfanta/pagerfanta": "^3.0",
"phpoffice/phpspreadsheet": "^1.16",
"phpoffice/phpword": "^1.0",
"psr/container": "^1.0||^2.0",
"psr/log": "^2.0||^3.0",
"psr/container": "^2.0",
"psr/log": "^3.0",
"scheb/2fa-backup-code": "^6.2",
"scheb/2fa-bundle": "^6.2",
"scheb/2fa-totp": "^6.2",
@@ -68,7 +68,7 @@
"symfony/translation": "^6.0",
"symfony/twig-bundle": "^6.0",
"symfony/validator": "^6.0",
"symfony/webpack-encore-bundle": "^1.16",
"symfony/webpack-encore-bundle": "^2.0",
"symfony/yaml": "^6.0",
"twig/cssinliner-extra": "^3.0",
"twig/extra-bundle": "^3.0",
@@ -105,7 +105,6 @@
],
"config": {
"allow-plugins": {
"composer/package-versions-deprecated": true,
"symfony/flex": true,
"symfony/runtime": true
},
@@ -130,6 +129,7 @@
}
},
"replace": {
"symfony/polyfill-ctype": "*",
"symfony/polyfill-mbstring": "*",
"symfony/polyfill-intl": "*",
"symfony/polyfill-iconv": "*",
@@ -180,7 +180,13 @@
"tests-unit": "vendor/bin/phpunit --exclude-group integration tests/",
"tests-integration": "vendor/bin/phpunit --group integration tests/",
"phpstan": [
"vendor/bin/phpstan analyse -c phpstan.neon",
"@phpstan-src",
"@phpstan-tests"
],
"phpstan-src": [
"vendor/bin/phpstan analyse -c phpstan.neon"
],
"phpstan-tests": [
"vendor/bin/phpstan analyse -c tests/phpstan.neon"
],
"codestyle": "vendor/bin/php-cs-fixer fix --dry-run --verbose --show-progress=none",
@@ -196,7 +202,7 @@
"symfony": {
"id": "01C3FWRDJJEX9K6Y3A4XDFXPBR",
"allow-contrib": true,
"require": "6.2.*"
"require": "6.3.*"
}
}
}

3212
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -199,7 +199,7 @@
],
'en_CH' =>
[
'date' => 'dd/MM/y',
'date' => 'dd.MM.y',
'time' => 'HH:mm',
'rtl' => false,
],
@@ -457,7 +457,7 @@
],
'en_MV' =>
[
'date' => 'M/d/yy',
'date' => 'd-M-yy',
'time' => 'HH:mm',
'rtl' => false,
],
@@ -1316,19 +1316,19 @@
'ko' =>
[
'date' => 'yy. M. d.',
'time' => 'a h:mm',
'time' => 'h:mm a',
'rtl' => false,
],
'ko_KP' =>
[
'date' => 'yy. M. d.',
'time' => 'a h:mm',
'time' => 'h:mm a',
'rtl' => false,
],
'ko_KR' =>
[
'date' => 'yy. M. d.',
'time' => 'a h:mm',
'time' => 'h:mm a',
'rtl' => false,
],
'nb_NO' =>
@@ -1589,6 +1589,12 @@
'time' => 'HH:mm',
'rtl' => false,
],
'uk' =>
[
'date' => 'dd.MM.yy',
'time' => 'HH:mm',
'rtl' => false,
],
'vi' =>
[
'date' => 'dd/MM/y',
@@ -1607,4 +1613,10 @@
'time' => 'HH:mm',
'rtl' => false,
],
'zh_Hant' =>
[
'date' => 'y/M/d',
'time' => 'Bh:mm',
'rtl' => false,
],
];

View File

@@ -4,7 +4,6 @@ parameters:
# environment variables are not available yet.
# You should not need to change this value.
env(DATABASE_URL): ''
env(DATABASE_VERSION): ~
doctrine:
dbal:
@@ -15,14 +14,11 @@ doctrine:
#schema_filter: ~^(?!(bundle_migration_|kimai2_sessions))~
url: '%env(DATABASE_URL)%'
driver: 'pdo_mysql'
# If this is wrong, automatic database detection might fail and find false-negatives when running
# doctrine:migrations:diff on null columns with MariaDB.
# This here is mainly a fallback for times, when users have not configured the database version in the URL
server_version: '%env(string:DATABASE_VERSION)%'
charset: utf8mb4
default_table_options:
charset: utf8mb4
collate: utf8mb4_unicode_ci
schema_manager_factory: doctrine.dbal.default_schema_manager_factory
types:
datetime: App\Doctrine\UTCDateTimeType
@@ -31,6 +27,7 @@ doctrine:
default_entity_manager: default
entity_managers:
default:
report_fields_where_declared: true
connection: default
naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
auto_mapping: true

View File

@@ -1,4 +1,8 @@
framework:
exceptions:
App\Validator\ValidationFailedException:
log_level: debug
secret: '%env(APP_SECRET)%'
default_locale: en
csrf_protection: true
@@ -13,8 +17,6 @@ framework:
cookie_httponly: true
storage_factory_id: session.storage.factory.native
#esi: ~
#fragments: ~
php_errors:
log: true

View File

@@ -75,7 +75,7 @@ kimai:
# PERMISSIONS
# --------------------------------------------------------------------------------
permissions:
# mapping complex rule sets of single permissions to named "sets" ("set name" = [array of "permissions and @SETS"])
# mapping a "set name" to an array of "permission names"
sets:
ACTIVITIES: ['view_activity','create_activity','edit_activity','budget_activity','time_activity','delete_activity','permissions_activity']
ACTIVITIES_ALL_TEAMLEAD: ['view_teamlead_activity','edit_teamlead_activity','budget_teamlead_activity','time_teamlead_activity','permissions_teamlead_activity']
@@ -95,7 +95,7 @@ kimai:
TIMESHEET: ['view_own_timesheet','start_own_timesheet','stop_own_timesheet','create_own_timesheet','edit_own_timesheet','export_own_timesheet','delete_own_timesheet','weekly_own_timesheet']
TIMESHEET_OTHER: ['view_other_timesheet','start_other_timesheet','stop_other_timesheet','create_other_timesheet','edit_other_timesheet','export_other_timesheet','delete_other_timesheet']
PROFILE: ['view_own_profile','edit_own_profile','password_own_profile','preferences_own_profile','api-token_own_profile']
PROFILE_OTHER: ['view_other_profile','edit_other_profile','password_other_profile','roles_other_profile','preferences_other_profile','api-token_other_profile','teams_other_profile']
PROFILE_OTHER: ['view_other_profile','edit_other_profile','password_other_profile','roles_other_profile','preferences_other_profile','api-token_other_profile','teams_other_profile','supervisor_other_profile']
TAGS: ['view_tag','manage_tag','create_tag','delete_tag']
USER: ['view_user','create_user','delete_user','role_permissions']
RATE: ['view_rate_own_timesheet','edit_rate_own_timesheet']
@@ -105,28 +105,21 @@ kimai:
TEAMS: ['view_team','create_team','edit_team','delete_team']
LOCKDOWN: ['lockdown_grace_timesheet','lockdown_override_timesheet']
REPORTING: ['view_reporting','view_other_reporting','project_reporting','customer_reporting']
# some single default definitions for roles
SINGLE_USER: ['view_team_member','time_team_project','create_tag','view_reporting']
SINGLE_TEAMLEAD: ['view_rate_own_timesheet','view_rate_other_timesheet','hourly-rate_own_profile','view_team_member']
SINGLE_ADMIN: ['hourly-rate_own_profile','edit_exported_timesheet','teams_own_profile','view_team_member','view_all_data']
SINGLE_SUPER_ADMIN: ['hourly-rate_own_profile','hourly-rate_other_profile','roles_own_profile','system_information','system_configuration','plugins','edit_exported_timesheet','teams_own_profile','view_team_member','upload_invoice_template','view_all_data']
# link above sets to one complete set for each user role
ROLE_USER: ['@TIMESHEET','@PROFILE','@SINGLE_USER']
ROLE_TEAMLEAD: ['@ACTIVITIES_TEAMLEAD','@PROJECTS_TEAMLEAD','@CUSTOMERS_TEAMLEAD','@TIMESHEET_OTHER','@INVOICE','@TIMESHEET','@PROFILE','@EXPORT','@BILLABLE','@TAGS','@REPORTING','@SINGLE_TEAMLEAD']
ROLE_ADMIN: ['@ACTIVITIES','@PROJECTS','@CUSTOMERS','@INVOICE','@INVOICE_ADMIN','@TIMESHEET','@TIMESHEET_OTHER','@PROFILE','@TEAMS','@RATE','@RATE_OTHER','@EXPORT','@BILLABLE','@TAGS','@LOCKDOWN','@REPORTING','@SINGLE_ADMIN']
ROLE_SUPER_ADMIN: ['@ACTIVITIES','@PROJECTS','@CUSTOMERS','@INVOICE','@INVOICE_ADMIN','@TIMESHEET','@TIMESHEET_OTHER','@PROFILE','@PROFILE_OTHER','@USER','@TEAMS','@RATE','@RATE_OTHER','@EXPORT','@BILLABLE','@TAGS','@LOCKDOWN','@REPORTING','@SINGLE_SUPER_ADMIN']
# mapping "sets" or permissions to user roles ("role name" = [array of "set names"])
# permissions which are deactivated, as these features are hidden for now
# brave users can try to activate them and be surprised what happens
REGISTER_BETA: []
# mapping a "role name" to an array of "set names"
maps:
ROLE_USER: ['ROLE_USER']
ROLE_TEAMLEAD: ['ROLE_TEAMLEAD']
ROLE_ADMIN: ['ROLE_ADMIN']
ROLE_SUPER_ADMIN: ['ROLE_SUPER_ADMIN']
# add or remove single permissions
ROLE_USER: ['TIMESHEET','PROFILE']
ROLE_TEAMLEAD: ['ACTIVITIES_TEAMLEAD','PROJECTS_TEAMLEAD','CUSTOMERS_TEAMLEAD','TIMESHEET_OTHER','INVOICE','TIMESHEET','PROFILE','EXPORT','BILLABLE','TAGS','REPORTING']
ROLE_ADMIN: ['ACTIVITIES','PROJECTS','CUSTOMERS','INVOICE','INVOICE_ADMIN','TIMESHEET','TIMESHEET_OTHER','PROFILE','TEAMS','RATE','RATE_OTHER','EXPORT','BILLABLE','TAGS','LOCKDOWN','REPORTING']
ROLE_SUPER_ADMIN: ['ACTIVITIES','PROJECTS','CUSTOMERS','INVOICE','INVOICE_ADMIN','TIMESHEET','TIMESHEET_OTHER','PROFILE','PROFILE_OTHER','USER','TEAMS','RATE','RATE_OTHER','EXPORT','BILLABLE','TAGS','LOCKDOWN','REPORTING']
# mapping a "role name" to an array of "permission names"
roles:
ROLE_USER: []
ROLE_TEAMLEAD: []
ROLE_ADMIN: []
ROLE_SUPER_ADMIN: []
ROLE_USER: ['view_team_member','time_team_project','create_tag','view_reporting']
ROLE_TEAMLEAD: ['view_rate_own_timesheet','view_rate_other_timesheet','hourly-rate_own_profile','view_team_member']
ROLE_ADMIN: ['hourly-rate_own_profile','edit_exported_timesheet','teams_own_profile','view_team_member','view_all_data','contract_other_profile']
ROLE_SUPER_ADMIN: ['hourly-rate_own_profile','hourly-rate_other_profile','roles_own_profile','supervisor_own_profile','system_information','system_configuration','plugins','edit_exported_timesheet','teams_own_profile','view_team_member','upload_invoice_template','view_all_data','contract_other_profile']
# --------------------------------------------------------------------------------
@@ -158,14 +151,20 @@ kimai:
# --------------------------------------------------------------------------------
# INVOICES
# --------------------------------------------------------------------------------
# invoice:
# # all files in these directories will be used as invoice documents (if supported by a renderer)
# documents:
# - 'var/invoices/'
# - 'templates/invoice/renderer/'
# invoice:
# # all files in these directories will be used as invoice documents (if supported by a renderer)
# documents:
# - 'var/invoices/'
# - 'templates/invoice/renderer/'
# # allow to upload twig templates as invoice documents
# upload_twig: true
# --------------------------------------------------------------------------------
when@test:
kimai:
data_dir: '%kernel.project_dir%/tests/_data'
permissions:
roles:
ROLE_ADMIN: ['contract_other_profile']
ROLE_SUPER_ADMIN: ['contract_other_profile']

View File

@@ -1,6 +1,6 @@
when@prod:
monolog:
channels: ["deprecation"]
# channels: ["deprecation"]
handlers:
main:
type: fingers_crossed
@@ -15,10 +15,11 @@ when@prod:
type: console
process_psr_3_messages: false
channels: ["!event", "!doctrine"]
deprecation:
type: stream
channels: ["deprecation"]
path: "%kernel.logs_dir%/deprecations.log"
# deactivated, because currently there are too many deprecations cause by gedmo and doctrine
# deprecation:
# type: stream
# channels: ["deprecation"]
# path: "%kernel.logs_dir%/deprecations.log"
when@dev:
monolog:

View File

@@ -3,12 +3,14 @@ scheb_two_factor:
security_tokens:
- Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken
- Symfony\Component\Security\Http\Authenticator\Token\PostAuthenticationToken
- App\Saml\SamlToken
totp:
enabled: true
template: security/2fa.html.twig # Overwritten template
window: 1 # How many codes before/after the current one would be accepted as valid
# server_name: Server Name # Server name used in QR code
issuer: Kimai # Issuer name used in QR code
# parameters: # Additional parameters added in the QR code
# image: 'https://my-service/img/logo.png'
two_factor_condition: App\Security\TwoFactorCondition
# FIXME add backup codes - https://symfony.com/bundles/SchebTwoFactorBundle/current/backup_codes.html

View File

@@ -60,11 +60,18 @@ security:
logout:
path: logout
target: homepage
enable_csrf: true
login_throttling:
max_attempts: 5
interval: '5 minutes'
login_link:
check_route: link_login_check
signature_properties: ['id']
lifetime: 300
max_uses: 1
access_decision_manager:
strategy: unanimous
allow_if_all_abstain: false

View File

@@ -55,6 +55,7 @@ tabler:
columns: fas fa-table
comment: far fa-comment
configuration: fas fa-cog
contract: fas fa-balance-scale
copy: far fa-copy
create: fas fa-plus
csv: fas fa-table
@@ -77,6 +78,8 @@ tabler:
filter: fas fa-filter
help: far fa-question-circle
home: fas fa-home
info: fas fa-info-circle
import: fas fa-file-import
invoice: fas fa-file-contract
invoice-template: fas fa-file-signature
left: fas fa-chevron-left
@@ -97,6 +100,7 @@ tabler:
password: fas fa-key
pause: fas fa-pause
pause-small: far fa-pause-circle
pending: fas fa-hourglass-half
pin: fas fa-thumbtack
pdf: fas fa-file-pdf
permissions: fas fa-user-lock
@@ -109,6 +113,8 @@ tabler:
repeat: fas fa-redo-alt
reporting: far fa-chart-bar
report: far fa-chart-bar
review: fas fa-user-check
rejected: fas fa-ban
right: fas fa-chevron-right
right2: fas fa-angle-double-right
roles: fas fa-user-shield
@@ -136,4 +142,5 @@ tabler:
weekly-times: fas fa-th
widget_add: fas fa-folder-plus
widget_remove: fas fa-folder-minus
work_times: fas fa-calculator
xlsx: fas fa-file-excel

View File

@@ -1,6 +1,6 @@
controllers:
resource: ../src/Controller/
type: annotation
type: attribute
prefix: /{_locale}
requirements:
_locale: '%app_locales%'
@@ -19,17 +19,17 @@ api.swagger:
api:
resource: ../src/API/
type: annotation
type: attribute
prefix: /api
auth:
resource: ../src/Controller/Auth/
type: annotation
type: attribute
prefix: /auth
security:
resource: ../src/Controller/Security/
type: annotation
type: attribute
prefix: /{_locale}
requirements:
_locale: '%app_locales%'
@@ -38,7 +38,7 @@ security:
kernel:
resource: ../src/Kernel.php
type: annotation
type: attribute
home:
path: /

View File

@@ -91,16 +91,10 @@ services:
App\Doctrine\TimesheetSubscriber:
class: App\Doctrine\TimesheetSubscriber
arguments: [!tagged timesheet.calculator]
tags:
- { name: doctrine.event_subscriber, priority: 50 }
# updates timestampable columns (higher priority, so the TimesheetSubscriber will be executed later)
Gedmo\Timestampable\TimestampableListener:
class: Gedmo\Timestampable\TimestampableListener
tags:
- { name: doctrine.event_subscriber, priority: 60 }
calls:
- [ setAnnotationReader, [ "@annotation_reader" ] ]
App\Doctrine\ModifiedSubscriber:
class: App\Doctrine\ModifiedSubscriber
# ================================================================================
# TIMESHEET RECORD CALCULATOR
@@ -224,3 +218,8 @@ services:
class: App\Repository\BookmarkRepository
factory: ['@doctrine.orm.entity_manager', getRepository]
arguments: ['App\Entity\Bookmark']
App\Repository\WorkingTimeRepository:
class: App\Repository\WorkingTimeRepository
factory: ['@doctrine.orm.entity_manager', getRepository]
arguments: ['App\Entity\WorkingTime']

View File

@@ -29,20 +29,20 @@ final class Version20190706224211 extends AbstractMigration
public function up(Schema $schema): void
{
$timesheetMeta = $schema->getTable('kimai2_timesheet_meta');
$timesheetMeta->changeColumn('visible', ['notnull' => true, 'default' => false]);
$timesheetMeta->changeColumn('timesheet_id', ['notnull' => true]);
$timesheetMeta->modifyColumn('visible', ['notnull' => true, 'default' => false]);
$timesheetMeta->modifyColumn('timesheet_id', ['notnull' => true]);
$projectMeta = $schema->getTable('kimai2_projects_meta');
$projectMeta->changeColumn('visible', ['notnull' => true, 'default' => false]);
$projectMeta->changeColumn('project_id', ['notnull' => true]);
$projectMeta->modifyColumn('visible', ['notnull' => true, 'default' => false]);
$projectMeta->modifyColumn('project_id', ['notnull' => true]);
$customerMeta = $schema->getTable('kimai2_customers_meta');
$customerMeta->changeColumn('visible', ['notnull' => true, 'default' => false]);
$customerMeta->changeColumn('customer_id', ['notnull' => true]);
$customerMeta->modifyColumn('visible', ['notnull' => true, 'default' => false]);
$customerMeta->modifyColumn('customer_id', ['notnull' => true]);
$activityMeta = $schema->getTable('kimai2_activities_meta');
$activityMeta->changeColumn('visible', ['notnull' => true, 'default' => false]);
$activityMeta->changeColumn('activity_id', ['notnull' => true]);
$activityMeta->modifyColumn('visible', ['notnull' => true, 'default' => false]);
$activityMeta->modifyColumn('activity_id', ['notnull' => true]);
}
public function down(Schema $schema): void

View File

@@ -41,6 +41,6 @@ final class Version20210316224358 extends AbstractMigration
public function down(Schema $schema): void
{
$this->addSql('DROP TABLE kimai2_bookmarks');
$schema->dropTable('kimai2_bookmarks');
}
}

View File

@@ -51,7 +51,7 @@ final class Version20210802152814 extends AbstractMigration
public function down(Schema $schema): void
{
$timesheet = $schema->getTable('kimai2_timesheet');
$timesheet->changeColumn('date_tz', ['notnull' => false]);
$timesheet->modifyColumn('date_tz', ['notnull' => false]);
$this->preventEmptyMigrationWarning();
}

View File

@@ -27,14 +27,14 @@ final class Version20210802160837 extends AbstractMigration
public function up(Schema $schema): void
{
$timesheet = $schema->getTable('kimai2_timesheet');
$timesheet->changeColumn('date_tz', ['notnull' => true]);
$timesheet->modifyColumn('date_tz', ['notnull' => true]);
$timesheet->addIndex(['date_tz', 'user'], 'IDX_4F60C6B1BDF467148D93D649');
}
public function down(Schema $schema): void
{
$timesheet = $schema->getTable('kimai2_timesheet');
$timesheet->changeColumn('date_tz', ['notnull' => false]);
$timesheet->modifyColumn('date_tz', ['notnull' => false]);
$timesheet->dropIndex('IDX_4F60C6B1BDF467148D93D649');
}
}

View File

@@ -0,0 +1,52 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use App\Doctrine\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* @version 2.0.20
*/
final class Version20230327143628 extends AbstractMigration
{
public function getDescription(): string
{
return 'Creates the working times table';
}
public function up(Schema $schema): void
{
$workingTimes = $schema->createTable('kimai2_working_times');
$workingTimes->addColumn('id', 'integer', ['autoincrement' => true, 'notnull' => true]);
$workingTimes->addColumn('user_id', 'integer', ['notnull' => true]);
$workingTimes->addColumn('approved_by', 'integer', ['notnull' => false, 'default' => null]);
$workingTimes->addColumn('date', 'date', ['notnull' => true]);
$workingTimes->addColumn('expected', 'integer', ['notnull' => true]);
$workingTimes->addColumn('actual', 'integer', ['notnull' => true]);
$workingTimes->addColumn('approved_at', 'datetime', ['notnull' => false, 'default' => null]);
$workingTimes->setPrimaryKey(['id']);
$workingTimes->addIndex(['user_id'], 'IDX_F95E4933A76ED395');
$workingTimes->addIndex(['approved_by'], 'IDX_F95E49334EA3CB3D');
$workingTimes->addUniqueIndex(['user_id', 'date'], 'UNIQ_F95E4933A76ED395AA9E377A');
$workingTimes->addForeignKeyConstraint('kimai2_users', ['user_id'], ['id'], ['onDelete' => 'CASCADE'], 'FK_F95E4933A76ED395');
$workingTimes->addForeignKeyConstraint('kimai2_users', ['approved_by'], ['id'], ['onDelete' => 'SET NULL'], 'FK_F95E49334EA3CB3D');
}
public function down(Schema $schema): void
{
$workingTimes = $schema->getTable('kimai2_working_times');
$workingTimes->removeForeignKey('FK_F95E4933A76ED395');
$workingTimes->removeForeignKey('FK_F95E49334EA3CB3D');
$schema->dropTable('kimai2_working_times');
}
public function isTransactional(): bool
{
return false;
}
}

View File

@@ -0,0 +1,36 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use App\Doctrine\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* @version 2.0.26
*/
final class Version20230606125948 extends AbstractMigration
{
public function getDescription(): string
{
return 'Adds the visible column for tags';
}
public function up(Schema $schema): void
{
$tags = $schema->getTable('kimai2_tags');
$tags->addColumn('visible', 'boolean', ['notnull' => false, 'default' => true]);
}
public function down(Schema $schema): void
{
$tags = $schema->getTable('kimai2_tags');
$tags->dropColumn('visible');
}
public function isTransactional(): bool
{
return false;
}
}

View File

@@ -0,0 +1,41 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* @version 2.0.31
*/
final class Version20230819090536 extends AbstractMigration
{
public function getDescription(): string
{
return 'Adds the supervisor columns to the user-table';
}
public function up(Schema $schema): void
{
$table = $schema->getTable('kimai2_users');
$table->addColumn('supervisor_id', 'integer', ['length' => 11, 'notnull' => false, 'default' => null]);
$table->addForeignKeyConstraint('kimai2_users', ['supervisor_id'], ['id'], ['onDelete' => 'SET NULL'], 'FK_B9AC5BCE19E9AC5F');
$table->addIndex(['supervisor_id'], 'IDX_B9AC5BCE19E9AC5F');
}
public function down(Schema $schema): void
{
$table = $schema->getTable('kimai2_users');
$table->removeForeignKey('FK_B9AC5BCE19E9AC5F');
$table->dropIndex('IDX_B9AC5BCE19E9AC5F');
$table->dropColumn('supervisor_id');
}
public function isTransactional(): bool
{
return false;
}
}

View File

@@ -36,17 +36,17 @@
"@fullcalendar/interaction": "^5.11",
"@fullcalendar/timegrid": "^5.11",
"@symfony/webpack-encore": "^4.0",
"@tabler/core": "1.0.0-beta16",
"@tabler/core": "1.0.0-beta18",
"chart.js": "^3.9",
"core-js": "^3.6",
"eslint": "^8.0",
"eslint-webpack-plugin": "^3.0",
"gridstack": "^7.1",
"litepicker": "^2.0",
"luxon": "^3.0",
"node-sass": "^8.0",
"luxon": "^3.3",
"sass": "^1.62.1",
"sass-loader": "^13.2",
"tom-select": "^2.0",
"tom-select": "^2.2",
"webpack": "^5.74.0",
"webpack-cli": "^4.10.0",
"webpack-notifier": "^1.13"

File diff suppressed because it is too large Load Diff

View File

@@ -15,7 +15,7 @@
<env name="APP_ENV" value="test" force="true"/>
<env name="APP_DEBUG" value="0" force="true"/>
<env name="APP_SECRET" value="5a79a1c866efef9ca1800f971d689f3e" force="true"/>
<env name="DATABASE_URL" value="mysql://kimai2_test:kimai2_test@127.0.0.1:3306/kimai2_test"/>
<env name="DATABASE_URL" value="mysql://kimai2_test:kimai2_test@127.0.0.1:3306/kimai2_test?serverVersion=10.5.8-MariaDB"/>
<env name="CORS_ALLOW_ORIGIN" value="^https?://localhost(:[0-9]+)?$"/>
<env name="MAILER_URL" value="null://null"/>
<env name="MAILER_FROM" value="kimai@example.com"/>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,6 @@
/*!
* Bootstrap v5.2.2 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Bootstrap v5.3.0-alpha3 (https://getbootstrap.com/)
* Copyright 2011-2023 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
@@ -160,6 +160,10 @@
* [KIMAI] KimaiTranslation: handling translation strings
*/
/*!
* [KIMAI] KimaiUser: information about the current user
*/
/*!
* [KIMAI] Notification: notifications for Kimai
*/

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,6 @@
/*!
* Bootstrap v5.2.2 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Bootstrap v5.3.0-alpha3 (https://getbootstrap.com/)
* Copyright 2011-2023 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/

View File

@@ -3,16 +3,16 @@
"app": {
"js": [
"/build/runtime.f0079159.js",
"/build/app.46a6055b.js"
"/build/app.63b27bee.js"
],
"css": [
"/build/app.2c6c5920.css"
"/build/app.fc41168c.css"
]
},
"export-pdf": {
"js": [
"/build/runtime.f0079159.js",
"/build/export-pdf.587575e7.js"
"/build/export-pdf.d367a32e.js"
],
"css": [
"/build/export-pdf.d8a6c23b.css"
@@ -21,19 +21,19 @@
"invoice": {
"js": [
"/build/runtime.f0079159.js",
"/build/invoice.c8ae95ad.js"
"/build/invoice.2604495e.js"
],
"css": [
"/build/invoice.3c80ee80.css"
"/build/invoice.5bea118e.css"
]
},
"invoice-pdf": {
"js": [
"/build/runtime.f0079159.js",
"/build/invoice-pdf.d86b82ee.js"
"/build/invoice-pdf.ce9aace0.js"
],
"css": [
"/build/invoice-pdf.c88953bb.css"
"/build/invoice-pdf.2b749265.css"
]
},
"chart": {
@@ -45,7 +45,7 @@
"calendar": {
"js": [
"/build/runtime.f0079159.js",
"/build/calendar.3041e41e.js"
"/build/calendar.a1cbcd7b.js"
],
"css": [
"/build/calendar.bb473428.css"
@@ -63,16 +63,16 @@
},
"integrity": {
"/build/runtime.f0079159.js": "sha384-H22sAW1aTvyIPqvHOvGXWSWTxf0y6mptp+MsVmyXCfjx/WJjBbhX9gbUZ+qIuihV",
"/build/app.46a6055b.js": "sha384-4FR2SCr6YUmX48AWUg8rqFrfHSOTRj6tIqZJK/CjrNx0XV1km7nn2BCEVFNo0UkA",
"/build/app.2c6c5920.css": "sha384-qiubu7JONCsPTbVOb8bSJ4GYxioCwIUvlsI0usMmIUyoTxawn6jsjG7KK64iej5S",
"/build/export-pdf.587575e7.js": "sha384-J50GStmmfVwUTN4dIRQ02eg9hyzGFPSzpTtpPody92j0V6zCqw+s5l8+ZhVTugeW",
"/build/app.63b27bee.js": "sha384-1CV+he7m+KfetJpq/DmRwKfUhKH4L7MImv7rRUz/mr/KNR3VkT0fQJHF7ViPTVYE",
"/build/app.fc41168c.css": "sha384-3Td9W7KogJoBiywzWOgpkPPNHEIT8/a/SkMZM5NgIRmuChj/3PeOKkOHVJQlhP2E",
"/build/export-pdf.d367a32e.js": "sha384-Z5baqnzjI636nYFs4g63ViIKBZKRW4Jhv/7PQmTEQlqhfA7eK0vUMUtiyy0R5A9u",
"/build/export-pdf.d8a6c23b.css": "sha384-ztepocHE4rnGE9eKZ4kL6jTKaePUyiwiB9TjJjstjpf/ckcKg1HedrEOOk/8ElJg",
"/build/invoice.c8ae95ad.js": "sha384-2eVY7MBiMQxo1vhfizU+fYfEZbz9bYUdzqxnpTQhxpYiLaxeSV4WnaObq2G7/Pks",
"/build/invoice.3c80ee80.css": "sha384-xjFM2m/EeN7z42ygpt77ll5zAcHTeOjbZFAw2Qcu3IJutgebiAbrXjnH5aJfF5Z6",
"/build/invoice-pdf.d86b82ee.js": "sha384-A0HJqP+MvEqQr1uG8wViCeEWxBRKyS6l8D+Ao4pFYHUA12gCC1gRYhk9I+SJPvZq",
"/build/invoice-pdf.c88953bb.css": "sha384-ZvSi1e+ZKGzvZJUtAPLjzOSTh13N9zRevq44GKdYdBja/DAplGE55saY2Ur+83yv",
"/build/invoice.2604495e.js": "sha384-D6JvhGSqlx7z72b/qD3nF3QDXPy+XsCSRGtWfs1icjDKOcd2UzuXwuSa/E1Fg2TJ",
"/build/invoice.5bea118e.css": "sha384-KNyGdZSTXnAi8Tn2WqrxJnCP18yRK7BrZTHKCAGAEtl5/4S/XAe4IHKpM5gfsmB7",
"/build/invoice-pdf.ce9aace0.js": "sha384-mtZkXrpsXFMX2YvmmTlCm91QgsTlZLzLJnDAFcTuBDtDZ7TNkqLYkfCeLzFLVfwb",
"/build/invoice-pdf.2b749265.css": "sha384-DXXgkz2WWnrWnfBnXX5fmfPQSPb98upMnWxYKwTGYS04EhrPIWfDCutB2unIrWh7",
"/build/chart.f5becfac.js": "sha384-GSqETm8wULiVXyizvwRompfwu63r/C0Qd/AvrHDE4cqAKiIGCssb3QyBtGu1WN+W",
"/build/calendar.3041e41e.js": "sha384-vdX0khIprtUhM4P8aiSsY5H3YSjHM1OMNdiYIhoKy/fm//5gwaEPkSbZDsTbe5dT",
"/build/calendar.a1cbcd7b.js": "sha384-rDvqiEk91ZGY5lHb7vYIUWM2M550H6JAOLt1c3KO5H+toq7Ico7d/KoEDeG52cVW",
"/build/calendar.bb473428.css": "sha384-900W9o8666Qpw21rLP7hn5Ql8tWd40k0IcE3QpFm7E7V6bKva7xQgGlyzVuuh4GK",
"/build/dashboard.6774a712.js": "sha384-lBwkNqUPv+IBbznagiFakY2BOIueq/Bg89wHO2XeM9YAZ51rPkrvdMd+XmFupHsM",
"/build/dashboard.18f5a8b7.css": "sha384-PBD8ftb2yBoSjRe2sN5Xb4dEz045kOEUfcIufdSis+tWoWdAx5j4Yic+F/6CYbrP"

View File

@@ -1 +1 @@
(self.webpackChunkkimai2=self.webpackChunkkimai2||[]).push([[185],{8810:function(i,n,u){u(8568)},8568:function(i,n,u){"use strict";u.r(n)}},function(i){var n;n=8810,i(i.s=n)}]);
(self.webpackChunkkimai2=self.webpackChunkkimai2||[]).push([[185],{8810:function(i,n,u){u(9508)},9508:function(i,n,u){"use strict";u.r(n)}},function(i){var n;n=8810,i(i.s=n)}]);

View File

@@ -0,0 +1 @@
body{font-family:sans-serif;font-size:10pt;margin:4px;padding:0}h1,h2,h3,h4,h5,p,table,td,th,tr{margin:0;padding:0}th{border:none;text-align:left}td{vertical-align:top}p{margin-bottom:12px}.text-small{font-size:7pt}.padding-left{padding-left:15px}.text-center{text-align:center}.text-begin,.text-left{text-align:left}.text-end,.text-right{text-align:right}.text-nowrap{white-space:nowrap}.date{font-size:80%;padding-top:6px;text-align:right}table{border-spacing:0;width:100%}p,table.addresses{line-height:14pt}table.addresses{margin-bottom:30px}table.header{border-bottom:1px solid #999;padding-bottom:4px}table.header .title{font-size:140%;font-weight:400}table.footer{border-top:1px solid #999;font-size:80%;line-height:14px;padding-top:8px}table.footer td{vertical-align:top}table.items{border-collapse:collapse;margin-bottom:60px;margin-top:50px}table.items tbody td,table.items thead th{border-bottom:1px solid #ccc}table.items tbody td.first,table.items thead th.first{padding-left:0}table.items tbody td.last,table.items tfoot td.last,table.items thead th.last{padding-right:0}table.items td,table.items th{padding:8px 6px}table.items tfoot td,table.items tfoot th{line-height:1px;padding:20px 0 0}table.items tfoot td.last{padding-left:10px}table.items tr.odd{background-color:#f5f5f5}

View File

@@ -1 +0,0 @@
body{font-family:sans-serif;font-size:10pt;margin:4px;padding:0}h1,h2,h3,h4,h5,p,table,td,th,tr{margin:0;padding:0}th{border:none;text-align:left}td{vertical-align:top}p{margin-bottom:12px}.text-small{font-size:7pt}.padding-left{padding-left:15px}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.text-nowrap{white-space:nowrap}.date{font-size:80%;padding-top:6px;text-align:right}table{border-spacing:0;width:100%}p,table.addresses{line-height:14pt}table.addresses{margin-bottom:30px}table.header{border-bottom:1px solid #999;padding-bottom:4px}table.header .title{font-size:140%;font-weight:400}table.footer{border-top:1px solid #999;font-size:80%;line-height:14px;padding-top:8px}table.footer td{vertical-align:top}table.items{border-collapse:collapse;margin-bottom:60px;margin-top:50px}table.items tbody td,table.items thead th{border-bottom:1px solid #ccc}table.items tbody td.first,table.items thead th.first{padding-left:0}table.items tbody td.last,table.items tfoot td.last,table.items thead th.last{padding-right:0}table.items td,table.items th{padding:8px 6px}table.items tfoot td,table.items tfoot th{line-height:1px;padding:20px 0 0}table.items tfoot td.last{padding-left:10px}table.items tr.odd{background-color:#f5f5f5}

View File

@@ -0,0 +1 @@
(self.webpackChunkkimai2=self.webpackChunkkimai2||[]).push([[266],{35:function(i,n,u){u(6197)},6197:function(i,n,u){"use strict";u.r(n)}},function(i){var n;n=35,i(i.s=n)}]);

View File

@@ -1 +0,0 @@
(self.webpackChunkkimai2=self.webpackChunkkimai2||[]).push([[266],{35:function(i,n,u){u(297)},297:function(i,n,u){"use strict";u.r(n)}},function(i){var n;n=35,i(i.s=n)}]);

View File

@@ -1 +1 @@
(self.webpackChunkkimai2=self.webpackChunkkimai2||[]).push([[149],{474:function(i,n,u){u(3648)},3648:function(i,n,u){"use strict";u.r(n)}},function(i){var n;n=474,i(i.s=n)}]);
(self.webpackChunkkimai2=self.webpackChunkkimai2||[]).push([[149],{474:function(i,n,u){u(9822)},9822:function(i,n,u){"use strict";u.r(n)}},function(i){var n;n=474,i(i.s=n)}]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,15 +1,15 @@
{
"build/app.css": "/build/app.2c6c5920.css",
"build/app.js": "/build/app.46a6055b.js",
"build/app.css": "/build/app.fc41168c.css",
"build/app.js": "/build/app.63b27bee.js",
"build/export-pdf.css": "/build/export-pdf.d8a6c23b.css",
"build/export-pdf.js": "/build/export-pdf.587575e7.js",
"build/invoice.css": "/build/invoice.3c80ee80.css",
"build/invoice.js": "/build/invoice.c8ae95ad.js",
"build/invoice-pdf.css": "/build/invoice-pdf.c88953bb.css",
"build/invoice-pdf.js": "/build/invoice-pdf.d86b82ee.js",
"build/export-pdf.js": "/build/export-pdf.d367a32e.js",
"build/invoice.css": "/build/invoice.5bea118e.css",
"build/invoice.js": "/build/invoice.2604495e.js",
"build/invoice-pdf.css": "/build/invoice-pdf.2b749265.css",
"build/invoice-pdf.js": "/build/invoice-pdf.ce9aace0.js",
"build/chart.js": "/build/chart.f5becfac.js",
"build/calendar.css": "/build/calendar.bb473428.css",
"build/calendar.js": "/build/calendar.3041e41e.js",
"build/calendar.js": "/build/calendar.a1cbcd7b.js",
"build/dashboard.css": "/build/dashboard.18f5a8b7.css",
"build/dashboard.js": "/build/dashboard.6774a712.js",
"build/runtime.js": "/build/runtime.f0079159.js"

View File

@@ -21,10 +21,10 @@ use FOS\RestBundle\View\ViewHandlerInterface;
use Nelmio\ApiDocBundle\Annotation\Model;
use Nelmio\ApiDocBundle\Annotation\Security as ApiSecurity;
use OpenApi\Attributes as OA;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
#[Route(path: '/actions')]
@@ -46,6 +46,7 @@ final class ActionsController extends BaseApiController
*/
private function convertEvent(PageActionsEvent $event, string $locale): array
{
$event->setLocale($locale);
$this->dispatcher->dispatch($event, $event->getEventName());
$translator = $this->translator;

View File

@@ -26,8 +26,8 @@ use FOS\RestBundle\View\View;
use FOS\RestBundle\View\ViewHandlerInterface;
use Nelmio\ApiDocBundle\Annotation\Security as ApiSecurity;
use OpenApi\Attributes as OA;
use Psr\EventDispatcher\EventDispatcherInterface;
use Symfony\Bridge\Doctrine\Attribute\MapEntity;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
@@ -112,6 +112,7 @@ final class ActivityController extends BaseApiController
$query->setSearchTerm(new SearchTerm($term));
}
$query->setIsApiCall(true);
$data = $this->repository->getActivitiesForQuery($query);
$view = new View($data, 200);
$view->getContext()->setGroups(self::GROUPS_COLLECTION);

View File

@@ -9,6 +9,7 @@
namespace App\API\Authentication;
use Scheb\TwoFactorBundle\Security\Http\Authenticator\TwoFactorAuthenticator;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
@@ -24,6 +25,19 @@ final class SessionAuthenticator extends AbstractAuthenticator
{
}
public function createToken(Passport $passport, string $firewallName): TokenInterface
{
$token = parent::createToken($passport, $firewallName);
// this should not be necessary, as /api/ is excluded from 2FA process, but just to make sure this
// authenticator never triggers 2FA, we add the attribute to the token
// https://symfony.com/bundles/SchebTwoFactorBundle/6.x/custom_conditions.html
$token->setAttribute(TwoFactorAuthenticator::FLAG_2FA_COMPLETE, true);
return $token;
}
public function supports(Request $request): ?bool
{
if (str_contains($request->getRequestUri(), '/api/')) {

View File

@@ -10,13 +10,14 @@
namespace App\API;
use App\Entity\User;
use App\Repository\Query\BaseQuery;
use App\Timesheet\DateTimeFactory;
use App\Utils\Pagination;
use FOS\RestBundle\View\View;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Form\Extension\Core\Type\DateTimeType;
use Symfony\Component\Form\Extension\Core\Type\FormType;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormTypeInterface;
/**
* @method null|User getUser()
@@ -27,7 +28,15 @@ abstract class BaseApiController extends AbstractController
public const DATE_FORMAT = DateTimeType::HTML5_FORMAT;
public const DATE_FORMAT_PHP = 'Y-m-d\TH:i:s';
protected function createSearchForm(string $type = FormType::class, $data = null, array $options = []): FormInterface
/**
* @template TFormType of FormTypeInterface<TData>
* @template TData of BaseQuery
* @param class-string<TFormType> $type
* @param TData $data
* @param array<mixed> $options
* @return FormInterface<BaseQuery>
*/
protected function createSearchForm(string $type, BaseQuery $data, array $options = []): FormInterface
{
return $this->container
->get('form.factory')

View File

@@ -26,8 +26,8 @@ use FOS\RestBundle\View\View;
use FOS\RestBundle\View\ViewHandlerInterface;
use Nelmio\ApiDocBundle\Annotation\Security as ApiSecurity;
use OpenApi\Attributes as OA;
use Psr\EventDispatcher\EventDispatcherInterface;
use Symfony\Bridge\Doctrine\Attribute\MapEntity;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
@@ -90,6 +90,7 @@ final class CustomerController extends BaseApiController
$query->setSearchTerm(new SearchTerm($term));
}
$query->setIsApiCall(true);
$data = $this->repository->getCustomersForQuery($query);
$view = new View($data, 200);
$view->getContext()->setGroups(self::GROUPS_COLLECTION);

View File

@@ -0,0 +1,93 @@
<?php
/*
* 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.
*/
namespace App\API\Model;
use App\Utils\Color;
use JMS\Serializer\Annotation as Serializer;
#[Serializer\ExclusionPolicy('all')]
final class CalendarEvent
{
/**
* Calendar entry title
*/
#[Serializer\Expose]
#[Serializer\Groups(['Default'])]
#[Serializer\Type(name: 'string')]
private string $title; // @phpstan-ignore-line
/**
* Calendar background color
*/
#[Serializer\Expose]
#[Serializer\Groups(['Default'])]
#[Serializer\Type(name: 'string')]
private ?string $color = null; // @phpstan-ignore-line
/**
* Calendar text color
*/
#[Serializer\Expose]
#[Serializer\Groups(['Default'])]
#[Serializer\Type(name: 'string')]
private ?string $textColor = null;
/**
* If this entry is all-day long
*/
#[Serializer\Expose]
#[Serializer\Groups(['Default'])]
#[Serializer\Type(name: 'boolean')]
private bool $allDay = false; // @phpstan-ignore-line
/**
* Calendar entry start date
*/
#[Serializer\Expose]
#[Serializer\Groups(['Default'])]
#[Serializer\Type(name: 'DateTime')]
private \DateTimeInterface $start; // @phpstan-ignore-line
/**
* Calendar entry end date
*/
#[Serializer\Expose]
#[Serializer\Groups(['Default'])]
#[Serializer\Type(name: 'DateTime')]
private \DateTimeInterface $end; // @phpstan-ignore-line
public function setTitle(string $title): void
{
$this->title = $title;
}
public function setStart(\DateTimeInterface $start): void
{
$this->start = $start;
}
public function setEnd(\DateTimeInterface $end): void
{
$this->end = $end;
}
public function setColor(?string $color): void
{
$this->color = $color;
if ($color !== null && $this->textColor === null) {
$this->textColor = (new Color())->getFontContrastColor($color);
}
}
public function setAllDay(bool $allDay): void
{
$this->allDay = $allDay;
}
public function setTextColor(?string $textColor): void
{
$this->textColor = $textColor;
}
}

View File

@@ -27,8 +27,8 @@ use FOS\RestBundle\View\View;
use FOS\RestBundle\View\ViewHandlerInterface;
use Nelmio\ApiDocBundle\Annotation\Security as ApiSecurity;
use OpenApi\Attributes as OA;
use Psr\EventDispatcher\EventDispatcherInterface;
use Symfony\Bridge\Doctrine\Attribute\MapEntity;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
@@ -115,8 +115,8 @@ final class ProjectController extends BaseApiController
}
$ignoreDates = false;
if (null !== $paramFetcher->get('ignoreDates')) {
$ignoreDates = \intval($paramFetcher->get('ignoreDates')) === 1;
if (null !== ($ign = $paramFetcher->get('ignoreDates'))) {
$ignoreDates = $ign === 1 || $ign === '1';
}
if (!$ignoreDates) {
@@ -144,6 +144,7 @@ final class ProjectController extends BaseApiController
$query->setSearchTerm(new SearchTerm($term));
}
$query->setIsApiCall(true);
$data = $this->repository->getProjectsForQuery($query);
$view = new View($data, 200);
$view->getContext()->setGroups(self::GROUPS_COLLECTION);

View File

@@ -15,6 +15,9 @@ use App\Entity\Project;
use App\Entity\Team;
use App\Entity\User;
use App\Form\API\TeamApiEditForm;
use App\Repository\ActivityRepository;
use App\Repository\CustomerRepository;
use App\Repository\ProjectRepository;
use App\Repository\TeamRepository;
use FOS\RestBundle\Controller\Annotations as Rest;
use FOS\RestBundle\View\View;
@@ -230,15 +233,14 @@ final class TeamController extends BaseApiController
#[Rest\Post(path: '/{id}/customers/{customerId}', name: 'post_team_customer', requirements: ['id' => '\d+', 'customerId' => '\d+'])]
#[ApiSecurity(name: 'apiUser')]
#[ApiSecurity(name: 'apiToken')]
public function postCustomerAction(Team $team, #[MapEntity(mapping: ['customerId' => 'id'])] Customer $customer): Response
public function postCustomerAction(Team $team, #[MapEntity(mapping: ['customerId' => 'id'])] Customer $customer, CustomerRepository $customerRepository): Response
{
if ($team->hasCustomer($customer)) {
throw new BadRequestHttpException('Team has already access to customer');
}
$team->addCustomer($customer);
$this->repository->saveTeam($team);
$customerRepository->saveCustomer($customer);
$view = new View($team, Response::HTTP_OK);
$view->getContext()->setGroups(self::GROUPS_ENTITY);
@@ -256,15 +258,14 @@ final class TeamController extends BaseApiController
#[ApiSecurity(name: 'apiUser')]
#[ApiSecurity(name: 'apiToken')]
#[Rest\Delete(path: '/{id}/customers/{customerId}', name: 'delete_team_customer', requirements: ['id' => '\d+', 'customerId' => '\d+'])]
public function deleteCustomerAction(Team $team, #[MapEntity(mapping: ['customerId' => 'id'])] Customer $customer): Response
public function deleteCustomerAction(Team $team, #[MapEntity(mapping: ['customerId' => 'id'])] Customer $customer, CustomerRepository $customerRepository): Response
{
if (!$team->hasCustomer($customer)) {
throw new BadRequestHttpException('Customer is not assigned to the team');
}
$team->removeCustomer($customer);
$this->repository->saveTeam($team);
$customerRepository->saveCustomer($customer);
$view = new View($team, Response::HTTP_OK);
$view->getContext()->setGroups(self::GROUPS_ENTITY);
@@ -282,15 +283,14 @@ final class TeamController extends BaseApiController
#[Rest\Post(path: '/{id}/projects/{projectId}', name: 'post_team_project', requirements: ['id' => '\d+', 'projectId' => '\d+'])]
#[ApiSecurity(name: 'apiUser')]
#[ApiSecurity(name: 'apiToken')]
public function postProjectAction(Team $team, #[MapEntity(mapping: ['projectId' => 'id'])] Project $project): Response
public function postProjectAction(Team $team, #[MapEntity(mapping: ['projectId' => 'id'])] Project $project, ProjectRepository $projectRepository): Response
{
if ($team->hasProject($project)) {
throw new BadRequestHttpException('Team has already access to project');
}
$team->addProject($project);
$this->repository->saveTeam($team);
$projectRepository->saveProject($project);
$view = new View($team, Response::HTTP_OK);
$view->getContext()->setGroups(self::GROUPS_ENTITY);
@@ -308,15 +308,14 @@ final class TeamController extends BaseApiController
#[ApiSecurity(name: 'apiUser')]
#[ApiSecurity(name: 'apiToken')]
#[Rest\Delete(path: '/{id}/projects/{projectId}', name: 'delete_team_project', requirements: ['id' => '\d+', 'projectId' => '\d+'])]
public function deleteProjectAction(Team $team, #[MapEntity(mapping: ['projectId' => 'id'])] Project $project): Response
public function deleteProjectAction(Team $team, #[MapEntity(mapping: ['projectId' => 'id'])] Project $project, ProjectRepository $projectRepository): Response
{
if (!$team->hasProject($project)) {
throw new BadRequestHttpException('Project is not assigned to the team');
}
$team->removeProject($project);
$this->repository->saveTeam($team);
$projectRepository->saveProject($project);
$view = new View($team, Response::HTTP_OK);
$view->getContext()->setGroups(self::GROUPS_ENTITY);
@@ -334,15 +333,14 @@ final class TeamController extends BaseApiController
#[Rest\Post(path: '/{id}/activities/{activityId}', name: 'post_team_activity', requirements: ['id' => '\d+', 'activityId' => '\d+'])]
#[ApiSecurity(name: 'apiUser')]
#[ApiSecurity(name: 'apiToken')]
public function postActivityAction(Team $team, #[MapEntity(mapping: ['activityId' => 'id'])] Activity $activity): Response
public function postActivityAction(Team $team, #[MapEntity(mapping: ['activityId' => 'id'])] Activity $activity, ActivityRepository $activityRepository): Response
{
if ($team->hasActivity($activity)) {
throw new BadRequestHttpException('Team has already access to activity');
}
$team->addActivity($activity);
$this->repository->saveTeam($team);
$activityRepository->saveActivity($activity);
$view = new View($team, Response::HTTP_OK);
$view->getContext()->setGroups(self::GROUPS_ENTITY);
@@ -360,15 +358,14 @@ final class TeamController extends BaseApiController
#[ApiSecurity(name: 'apiUser')]
#[ApiSecurity(name: 'apiToken')]
#[Rest\Delete(path: '/{id}/activities/{activityId}', name: 'delete_team_activity', requirements: ['id' => '\d+', 'activityId' => '\d+'])]
public function deleteActivityAction(Team $team, #[MapEntity(mapping: ['activityId' => 'id'])] Activity $activity): Response
public function deleteActivityAction(Team $team, #[MapEntity(mapping: ['activityId' => 'id'])] Activity $activity, ActivityRepository $activityRepository): Response
{
if (!$team->hasActivity($activity)) {
throw new BadRequestHttpException('Activity is not assigned to the team');
}
$team->removeActivity($activity);
$this->repository->saveTeam($team);
$activityRepository->saveActivity($activity);
$view = new View($team, Response::HTTP_OK);
$view->getContext()->setGroups(self::GROUPS_ENTITY);

View File

@@ -33,6 +33,7 @@ use FOS\RestBundle\View\View;
use FOS\RestBundle\View\ViewHandlerInterface;
use Nelmio\ApiDocBundle\Annotation\Security as ApiSecurity;
use OpenApi\Attributes as OA;
use Psr\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\ExpressionLanguage\Expression;
use Symfony\Component\Form\FormError;
use Symfony\Component\HttpFoundation\Request;
@@ -40,7 +41,6 @@ use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Component\Validator\Constraints;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
#[Route(path: '/timesheets')]
#[IsGranted('IS_AUTHENTICATED_REMEMBERED')]
@@ -76,6 +76,7 @@ final class TimesheetController extends BaseApiController
#[ApiSecurity(name: 'apiUser')]
#[ApiSecurity(name: 'apiToken')]
#[Rest\QueryParam(name: 'user', requirements: '\d+|all', strict: true, nullable: true, description: "User ID to filter timesheets. Needs permission 'view_other_timesheet', pass 'all' to fetch data for all user (default: current user)")]
#[Rest\QueryParam(name: 'users', map: true, requirements: '\d+', strict: true, nullable: true, default: [], description: 'List of user IDs to filter, e.g.: users[]=1&users[]=2 (ignored if user=all)')]
#[Rest\QueryParam(name: 'customer', requirements: '\d+', strict: true, nullable: true, description: 'Customer ID to filter timesheets')]
#[Rest\QueryParam(name: 'customers', map: true, requirements: '\d+', strict: true, nullable: true, default: [], description: 'List of customer IDs to filter, e.g.: customers[]=1&customers[]=2')]
#[Rest\QueryParam(name: 'project', requirements: '\d+', strict: true, nullable: true, description: 'Project ID to filter timesheets')]
@@ -92,29 +93,38 @@ final class TimesheetController extends BaseApiController
#[Rest\QueryParam(name: 'exported', requirements: '0|1', strict: true, nullable: true, description: 'Use this flag if you want to filter for export state. Allowed values: 0=not exported, 1=exported (default: all)')]
#[Rest\QueryParam(name: 'active', requirements: '0|1', strict: true, nullable: true, description: 'Filter for running/active records. Allowed values: 0=stopped, 1=active (default: all)')]
#[Rest\QueryParam(name: 'billable', requirements: '0|1', strict: true, nullable: true, description: 'Filter for non-/billable records. Allowed values: 0=non-billable, 1=billable (default: all)')]
#[Rest\QueryParam(name: 'full', strict: true, nullable: true, description: 'Allows to fetch fully serialized objects including subresources. Allowed values: true (default: false)')]
#[Rest\QueryParam(name: 'full', requirements: '0|1|true|false', strict: true, nullable: true, description: 'Allows to fetch full objects including subresources. Allowed values: 0|1|false|true (default: false)')]
#[Rest\QueryParam(name: 'term', description: 'Free search term')]
#[Rest\QueryParam(name: 'modified_after', requirements: [new Constraints\DateTime(format: 'Y-m-d\TH:i:s')], strict: true, nullable: true, description: 'Only records changed after this date will be included (format: HTML5). Available since Kimai 1.10 and works only for records that were created/updated since then.')]
public function cgetAction(ParamFetcherInterface $paramFetcher, CustomerRepository $customerRepository, ProjectRepository $projectRepository, ActivityRepository $activityRepository, UserRepository $userRepository): Response
{
$query = new TimesheetQuery(false);
$query->setUser($this->getUser());
$seeAll = false;
if ($this->isGranted('view_other_timesheet')) {
/** @var array<int> $users */
$users = $paramFetcher->get('users');
$userId = $paramFetcher->get('user');
if (\is_string($userId) && $userId !== '') {
if ('all' === $userId) {
$query->setUser(null);
} else {
$user = $userRepository->find($userId);
if ($user === null) {
throw $this->createNotFoundException('Unknown user: ' . $userId);
}
$query->setUser($user);
if ('all' === $userId) {
$seeAll = true;
} elseif (\is_string($userId) && $userId !== '') {
$users[] = (int) $userId;
}
if (!$seeAll) {
foreach ($userRepository->findByIds($users) as $user) {
$query->addUser($user);
}
}
}
if ($seeAll) {
$query->setUser(null);
} elseif (!$query->hasUsers()) {
$query->setUser($this->getUser());
}
/** @var array<int> $customers */
$customers = $paramFetcher->get('customers');
$customer = $paramFetcher->get('customer');
@@ -170,9 +180,10 @@ final class TimesheetController extends BaseApiController
$query->setPageSize((int) $size);
}
/** @var array<string> $tags */
$tags = $paramFetcher->get('tags');
if (\is_array($tags) && \count($tags) > 0) {
$tags = $this->tagRepository->findTagsByName($tags);
$tags = $this->tagRepository->findTagsByName($tags, true);
foreach ($tags as $tag) {
$query->addTag($tag);
}
@@ -239,13 +250,15 @@ final class TimesheetController extends BaseApiController
$query->setModifiedAfter($factory->createDateTime($modifiedAfter));
}
$query->setIsApiCall(true);
$data = $this->repository->getPagerfantaForQuery($query);
$results = (array) $data->getCurrentPageResults();
$view = new View($results, 200);
$this->addPagination($view, $data);
if (null !== $paramFetcher->get('full')) {
$full = $paramFetcher->get('full');
if ($full === '1' || $full === 'true') {
$view->getContext()->setGroups(self::GROUPS_COLLECTION_FULL);
} else {
$view->getContext()->setGroups(self::GROUPS_COLLECTION);
@@ -447,11 +460,15 @@ final class TimesheetController extends BaseApiController
}
/**
* Stops an active timesheet record
* Stops an active timesheet record.
*
* This route is available via GET and PATCH, as users over and over again run into errors when stopping.
* Likely caused by a slow JS engine and a fast-click after page reload.
*/
#[IsGranted('stop', 'timesheet')]
#[OA\Response(response: 200, description: 'Stops an active timesheet record and returns it afterwards.', content: new OA\JsonContent(ref: '#/components/schemas/TimesheetEntity'))]
#[OA\Parameter(name: 'id', in: 'path', description: 'Timesheet record ID to stop', required: true)]
#[Rest\Get(path: '/{id}/stop', name: 'stop_timesheet_get', requirements: ['id' => '\d+'])]
#[Rest\Patch(path: '/{id}/stop', name: 'stop_timesheet', requirements: ['id' => '\d+'])]
#[ApiSecurity(name: 'apiUser')]
#[ApiSecurity(name: 'apiToken')]
@@ -471,6 +488,7 @@ final class TimesheetController extends BaseApiController
#[IsGranted('start', 'timesheet')]
#[OA\Response(response: 200, description: 'Restarts a timesheet record for the same customer, project, activity combination. The current user will be the owner of the new record. Kimai tries to stop running records, which is expected to fail depending on the configured rules. Data will be copied from the original record if requested.', content: new OA\JsonContent(ref: '#/components/schemas/TimesheetEntity'))]
#[OA\Parameter(name: 'id', in: 'path', description: 'Timesheet record ID to restart', required: true)]
#[Rest\Get(path: '/{id}/restart', name: 'restart_timesheet_get', requirements: ['id' => '\d+'])]
#[Rest\Patch(path: '/{id}/restart', name: 'restart_timesheet', requirements: ['id' => '\d+'])]
#[ApiSecurity(name: 'apiUser')]
#[ApiSecurity(name: 'apiToken')]

View File

@@ -23,7 +23,7 @@ use FOS\RestBundle\View\View;
use FOS\RestBundle\View\ViewHandlerInterface;
use Nelmio\ApiDocBundle\Annotation\Security as ApiSecurity;
use OpenApi\Attributes as OA;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Psr\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
@@ -39,6 +39,7 @@ final class UserController extends BaseApiController
public const GROUPS_ENTITY = ['Default', 'Entity', 'User', 'User_Entity'];
public const GROUPS_FORM = ['Default', 'Entity', 'User', 'User_Entity'];
public const GROUPS_COLLECTION = ['Default', 'Collection', 'User'];
public const GROUPS_COLLECTION_FULL = ['Default', 'Collection', 'User', 'User_Entity'];
public function __construct(
private ViewHandlerInterface $viewHandler,
@@ -60,6 +61,7 @@ final class UserController extends BaseApiController
#[Rest\QueryParam(name: 'orderBy', requirements: 'id|username|alias|email', strict: true, nullable: true, description: 'The field by which results will be ordered. Allowed values: id, username, alias, email (default: username)')]
#[Rest\QueryParam(name: 'order', requirements: 'ASC|DESC', strict: true, nullable: true, description: 'The result order. Allowed values: ASC, DESC (default: ASC)')]
#[Rest\QueryParam(name: 'term', description: 'Free search term')]
#[Rest\QueryParam(name: 'full', requirements: '0|1|true|false', strict: true, nullable: true, description: 'Allows to fetch full objects including subresources. Allowed values: 0|1|false|true (default: false)')]
public function cgetAction(ParamFetcherInterface $paramFetcher): Response
{
$query = new UserQuery();
@@ -85,9 +87,16 @@ final class UserController extends BaseApiController
$query->setSearchTerm(new SearchTerm($term));
}
$query->setIsApiCall(true);
$data = $this->repository->getUsersForQuery($query);
$view = new View($data, 200);
$view->getContext()->setGroups(self::GROUPS_COLLECTION);
$full = $paramFetcher->get('full');
if ($full === '1' || $full === 'true') {
$view->getContext()->setGroups(self::GROUPS_COLLECTION_FULL);
} else {
$view->getContext()->setGroups(self::GROUPS_COLLECTION);
}
return $this->viewHandler->handle($view);
}
@@ -197,6 +206,7 @@ final class UserController extends BaseApiController
'include_roles' => $this->isGranted('roles', $profile),
'include_active_flag' => ($profile->getId() !== $this->getUser()->getId()),
'include_preferences' => $this->isGranted('preferences', $profile),
'include_supervisor' => $this->isGranted('supervisor', $profile),
]);
$form->setData($profile);

View File

@@ -20,7 +20,7 @@ use App\Event\ActivityUpdatePreEvent;
use App\Repository\ActivityRepository;
use App\Validator\ValidationFailedException;
use InvalidArgumentException;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Psr\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\Validator\Validator\ValidatorInterface;
/**

Some files were not shown because too many files have changed in this diff Show More