Giter Site home page Giter Site logo

katjaglassconsulting / approvalbundle Goto Github PK

View Code? Open in Web Editor NEW
11.0 4.0 14.0 4.74 MB

A Kimai Plugin to manage weekly approval workflow

License: MIT License

PHP 84.85% Twig 14.63% Shell 0.52%
kimai kimai-bundle kimai-plugin kimai-timetracking kimai2 kimai2-plugin timetracking

approvalbundle's Introduction

ApprovalBundle

A plugin for Kimai - a timetracking open source tool - to approve timesheets of users on a weekly basis including APIs.

Checkout the Documentation for content information and Troubleshooting if you have issues.

Here is a short live demo (for Kimai2 in version 1):

Example process for Teamleads

Version 1 vs. Version 2

This plugin supports two version of Kimai:

  • the Plugin as located in the main branch, supports the version 2 of Kimai
  • Version 1 support is available in the branch bundle_for_kimai_v1.

For now new updates will be implemented in Version 1 and then migrated to Version 2 later on - major updates are not expected.

Requirements

  • Required Kimai >= 2.8 (for ApprovalBundle in Version 2.x in branch main)
  • Requires Kimai >= 1.16.10 (for ApprovalBundle in Version 1.x in branch bundle_for_kimai_v1)

Optional, but recommended:

Optional, but recommended for version 1:

  • MetaFields plugin - optional setting of working hours per day per user unless specified in ApprovalBundle "Settings workday" (in Kimai 2, this is a new standard setting for users, in the old version it can be set as custom fields)

Features

  • Users can send a week for approval (in sequential order)
  • User lockdown -> a submitted/approved week can no longer be edited (apart from admins) - there is one lockdown date per user (LockdownPerUserBundle)
  • Teamlead/Admin can approve or deny the week
  • Overview of approvals, missing approvals and the status
  • Mailing options to recall approval tasks if outstanding
  • Overview of overtime
  • Overview of break issues according German Law

Status

The approval bundle has been lately updated to support the Kimai version 2.x. The active ongoing development and testing is done on Kimai version 1 as this.

A detailed testing is NOT performed. For this the release is pretty stable, but there might be issues due to different settings, environment etc.

If you experience anything, please report this in GitHub issues.

Issues

It is highly recommended to use the same timezone setting for all users. Furthermore all users should use the same "Start day of the week" setting - everybody should use "Monday". Otherwise issues could appear as, e.g. Monday times can be located on a Sunday when the teamlead and the user using different timezones. Furthermore the "Start day" is used to store the approval week. When the "Start day" is Sunday for a user and Monday for the teamlead, the approval will not work appropriately - an update for this is unlucklily more complex and set to "on-hold".

Please checkout doc_troubleshooting.md for troubleshooting.

Installation

First unzip the plugin into to your Kimai plugins directory:

unzip ApprovalBundle-x.x.zip -d <kimai path>/var/plugins/

And then reload Kimai and install all migrations:

bin/console kimai:reload
bin/console kimai:bundle:approval:install

The plugin should appear now.

Settings

Working time setup (optional)

The ApprovalBundle needs the users working-hours configuration to be available in case you want to display overtime.

  • version 2: this can be found in each users profile at Edit > Employment contract.

  • Version 1 MetaFields for users are required.

    • Custom-Fields -> Users
    • The following fields must be from type = "duration", required field, visible, Role = "ROLE_SUPER_ADMIN", default for most should be default = "28800" (which is for 8 hours), for Saturday/Sunday it should be "0" - the names could be anything, but the meaning is according those descriptions
      • Daily working time Monday (daily_working_time_monday)
      • Daily working time Tuesday (daily_working_time_tuesday)
      • Daily working time Wednesday (daily_working_time_wednesday)
      • Daily working time Thursday (daily_working_time_thursday)
      • Daily working time Friday (daily_working_time_friday)
      • Daily working time Saturday (daily_working_time_saturday)
      • Daily working time Sunday (daily_working_time_sunday)

The daily and weekly hours are displayed. For this the daily working time per day needs to be specified per user. Typically, it might be 8h per week day. But there are very different situations, so someone might only work 4 days a week or less hours a day.

If you do not use the "overtime" these settings are not required. But if you do, these values must then be set for every active user.

Additionally, working hours till an "end date" can be specified directly in the bundle settings. This enables different expected working times for different periods. A user might for example work 8h daily till 15.5.2023, then only 4h daily till 22.08.2023 and then again 8h daily from that day on.

Remark LockdownBundle

The LockdownPerUser bundle also comes along with some custom user fields. An empty value is not accepted for start of approval timeframe, please enter "0000-01-01 00:00:01" for the three lockdockdown fields. The same you can enter for the other two time-settings. The ApprovalBundle will modify the "Lockdown period end" and the "Lockdown grace period".

Team Setup

Next the teams needs to be setup. The teams define which person approves the time for what user. It is typically a picture of the organization. The teamlead is reponsible to approve times from it's team members. A teamlead can also be a member of a different team and for this has also an approver. The super user can perform approvals for all. It is expected that the teamlead has also the role of the teamlead - otherwise he/she cannot see the approvals.

Approval Settings

The final approval settings can be done via Hours approval > Settings. A customer for off-days can be set - then break times are not considered for those. The E-Mail link will be used as prefix to have the mails containing the correct links for approval views. You might want to enter something like https://kimai.example.com/. The approval week start date defines a date where the approval workflow should start. All prior unapproved weeks are ignored.

Then there are two toggle options available: the Calculate breaktime issues can be used to deactivate the calculation of breaktime issues. In Germany, there is a law available that specific break times must be available. For this in the Approved weeks report there are red hints when the German worktime rules are not followed, e.g. someone worked 8 hours without an appropriate break. If you are not located in Germany, you can switch it off as this might be irrelevant for you.

The Display Overtime options allows to calculate and display expected hours and overtime hours. For example, a colleague is working 40 hours a week. When she is working the concrete week 45 hours, she has 5 hours overtime for that week. The expected hours are to be entered in the Employment contract per day and/or in the Settings workdays. Remark: if you set all expected working hours to zero, you see the summed up actual working hours. When this option is active, there is also an overview tab for "Overtime" showing the submitted/approved weeks including their times. If you are not interested in "Overtime" at all, then this can be deactivated.

Screenshot Settings

Role Settings

There are two new roles available for the team approval. The view_team_approval ideally should be YES for all but the user. This allows up from the teamlead hierarchy to see the approvals of their team. The view_all_approval should either be YES for System-Admin only or for System-Admin and Admin, depending on your schema.

Mail

Per default, mails are send to teamleads when a user submits an approval. When someone accepts or rejects an approval, a mail is send to the user. There are two options available in the settings to deactivate this functionality.

Make sure to setup Kimai that mails can be send accordingly. Please see here for instructions how to setup and check.

Functionality of Lockdown (requires LockdownBundle)

With the lockdown bundle the lockdown periods can be set per user and no longer per system option. For this it is possible that user 1 has a lockdown date as of 01.01.2022 whereas user 2 could have for example a lockdown date of 15.01.2022. Per user - a locktime frame can be defined by "Lockdown period start" and "Lockdown period end". Considering also the "Lockdown grace period" (how long after the locktime end it should still be possible to edit time entries) - this defines which time entries can be modified by the user. Please checkout the general lockdown period documentation here for detailed information - the same principle is applied, but "per user".

When a week is submitted for approval, then this or any prior week should be locked - no time modifications for that week should be possible. This timesheet lock must be available per user. The following graphic shows an example.

Example schema for lockdown

When "User A" has submitted weeks 1-3 for approval, then this user can submit week 4 next and can not modify any times including week 3 or prior. "User B" is a bit slower with week submission - only submitted week 1 and 2 - and has as current lock date the last day of week 2. For this "User B" is able to create/modify/delete time sheets in week 3 and 4.

To have this functionality available, the ApprovalBundle changes the "Lockdown period end" and "Lockdown grace period". Typically, both values will be set to the last day/second of the approval end date. In case this date is in the future (for example when submitting weeks which are upcoming) - then the end grace is the current day to prohibit any editing for the future.

APIs

There are various APIs available for the ApprovalBundle. Please check out the API swagger documentation for the various endpoints and their parameters (<kimai_path>/api/doc).

Overview of APIs:

  • Get next-approval-week
  • Get status of selected week (approval open, submitted, approved, rejected)
  • Get overtime for specified year
  • Get weekly overtime overview for all weeks from provided date and later
  • Post a "submit of approval" for a specified week

Cronjobs

Cronjobs can be setup to activate mailings with respect to outstanding approval processes. The following commands are available:

All commands are run with the command: bin/console kimai:bundle:approval:{{ command from table }} Command send lists of users (without system-admin and disabled users)

E.g. bin/console kimai:bundle:approval:admin-not-submitted-users

Command Email to: Contents
admin-not-submitted-users System-Admin List of all users with his 'not submitted' weeks. Command send lists of users (without system-admin and disabled users).
teamlead-not-submitted-last-week Active team-leaders List of team users with his 'not submitted' weeks. Command send lists of users (without system-admin and disabled users).
user-not-submitted-weeks All active users (without admins and System-Admin) List of weeks that are 'not submitted'.

Contribution

Many thanks go to HMR-IT which had been highly involved in this project at the beginning.

Additional thanks go to Milo Ivir for additional translations and to Kevin Papst for code enhancements and the update to use this bundle with less pre-requisites.

Many thanks to Kevin Papst, Vitor Mattos and Sam MacLennan for working on the migration of the ApprovalBundle supporting Kimai 2.

Thanks also to Brett Meyer, Kevin Papst and Sam MacLennan for their participation and pull requests.

approvalbundle's People

Contributors

brmeyer avatar katjaglassconsulting avatar kevinpapst avatar maclucassen avatar milotype avatar sammaclennan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

approvalbundle's Issues

Support for monthly approval

For regular invoices it is more handy to approve the monthly timesheet. Otherwise you need to approve 4 different timesheets.

Can't delete user when they have approval history

If I attempt to delete a user that has events related to timesheet approval Kimai pops up saying the user was deleted, but the user is never deleted.

The logs show the following:

[2024-05-22T05:03:40.080146+00:00] app.CRITICAL: An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (kimai.kimai2_ext_approval_history, CONSTRAINT FK_A8341CE3FE65F000 FOREIGN KEY (approval_id) REFERENCES kimai2_ext_approval (id)) [] {"channel":"app"}

I can see the approval history for the user but don't see any way to delete this data so there is no way for me to delete the user.

Setting to "Teamlead self-approve"

Allow a setting that enables a teamlead to approve their own timesheets - in some companies the orgranization of approval should be that way.

Installation Error

Hi, I've been getting the following error when trying to install the latest approvals module. I'm using Kimai 2.0.24

In PluginMetadata.php line 59:

  Bundle "ApprovalBundle" defines an invalid Kimai minimum version in extra.kimai.require. Please provide an integer as in Constants::VERSION_ID.

I'm having a little trouble finding PluginMetadata.php, I was wondering if you could point me in the right direction? Thanks

Error 500: Internal Server Error, when use overtime endpoint

The overtime also has some issues. I am still struggeling with the API. Does these work in your environment? You can to click your profile -> API access and then click the book icon "swagger api doc". When you have defined an api key, on the swagger api you can test it by authorization (use your username and api passoword) and then go to the api endpoint to test.

The swagger API doc does not open for me "{"code":500,"message":"Internal Server Error"}" - when I remove all approval APIs (rename .php to .php_ for example), then the doc is up and running.

Nevertheless, I already merge so that can be used as base.

Originally posted by @KatjaGlassConsulting in #22 (comment)

Can not have access to terminal

No posible run the command "bin/console kimai:bundle:approval:install".
¿Its posible import the tables from phpmyadmin to enable plugin?

Support Sunday as Start of Week

Would it be possible to look into supporting Sunday as the work week start date? This would be helpful when all users are in the same time zone.

I'd be happy to try taking a look at this in my free time if I had a little context to any known technical issues that would break functionality if the work week was set to start on Sunday.

Thank you.

Team lead does not see approval requests

When I request an approval as a team member, only the admin sees the request, not the team lead. It worked in the beginning but then I changed some values for the role "Activity (Team member)" (and changed the settings back) and it looks that since then it stopped working. How can I debug the missing "Hours approval" entry for the team lead? Email is sent (however with an incorrect host in the url and when I fix the host, I get 404).

Approval workflow for timesheets - Settings Error

Hi,

I have added Approval workflow for timesheets/Hours Approval plugin with this plugin already added
Now, i am trying to setup hours approval plugin , but i am not able to do it.
I Don't known how to set settings for this, please provide me support for this.

Can you please solve this my issue, I am not Getting option of approve and reject.
In below screenshot shows Setting are not configured yet, when i am trying to configure settings its showing empty data.
can you please, tell me how to solve this.

Screenshot:
image

Users with the ROLE_SUPER_ADMIN can not submit timesheets.

Would it be possible to show users with the super admin role in the approved weeks report?

We have more senior members of our technical staff assigned the super admin role in order to create/restore backups or make system configuration changes. Other members are assigned the admin role to allow them support options without giving them access to breaking changes.

We're using SAML as our only authentication method with form login disabled. I used the console to demote the users and submit their timesheets; the super admin role will be reassigned on their next login due to the SAML group memberships.

Currently my thoughts workarounds are we'd need to make an additional paid Azure AD account for each super admin user (we force two step) and have them use two account or create a copy of the super admin role in Kimai and assign them that role instead of the build in role.

It would be nice if super admins could submit a sheet (currently there's no option to submit because they're excluded from the report) that could be approved by any teamlead of theirs.

Updates

The latest PR #28 caused issues that kimai no longer starts as the routes are no longer found. For this the update is gone into feature/v2_updates branch. @kevinpapst, could you please check? In my windows installation when I do the refresh I get:

[2024-01-06 08:27:40] [request] CRITICAL: Uncaught PHP Exception Twig\Error\RuntimeError: "An exception has been thrown during the rendering of a template ("Unable to generate a URL for the named route "approval_bundle_report" as such route does not exist.")." at C:\temp\git\kimai_2_5\vendor\kevinpapst\tabler-bundle\templates\includes\menu.html.twig line 17 {"exception":"[object] (Twig\Error\RuntimeError(code: 0): An exception has been thrown during the rendering of a template ("Unable to generate a URL for the named route "approval_bundle_report" as such route does not exist."). at C:\temp\git\kimai_2_5\vendor\kevinpapst\tabler-bundle\templates\includes\menu.html.twig:17)\n[previous exception] [object] (Symfony\Component\Routing\Exception\RouteNotFoundException(code: 0): Unable to generate a URL for the named route "approval_bundle_report" as such route does not exist. at C:\temp\git\kimai_2_5\vendor\symfony\routing\Generator\CompiledUrlGenerator.php:50)"} []

I guess changing the includes caused this issue.

Times editable after approval

Hi there, thanks for the great plugin!

I just approved a task of 4 hours length for a member of a team as the team leader and then changed the tracked time to 3 hours as the team member. I would think that either the team member should not be able to change approved items any more (probably they should be locked for edit once they are submitted for approval) or the approval should be removed ones the entry has been changed. Please advise.

Tag names

Hi Katja,

one request - not regarding the code: is there a reason you started adding the v to the tag names?

In the past the tag names only included the version itself.

Bildschirmfoto 2024-01-12 um 13 04 38

If you prefer the v, you could call the release v1.0.1 and the tag 1.0.1 ?

I stumbled upon it, while writing a bash script that use the versions from the store page, which don't mention the v:

Bildschirmfoto 2024-01-12 um 13 22 50

Total vs Expected Duration

weekly working hours
Mo-Do 8h
Fr: 7h
Total 39h.

Total Duration is 39h but why expected duration is showing 46h. It looks like that somehow weekends also calculated. We use also the vacation / sick day and controlling plugin
hours_approval
grafik

grafik

grafik

"To Approve" tab needs white font color for dark theme

Thank you for everything you do! We love Kimai!

I'm starting to experiment with this plugin and noticed the To Approve tab's data table doesn't appear to update for dark mode. The text is there (I'm highlighting one row). Is it a simple update to switch it to the white font? Happy to help with a contribution...

image

DB Error during installation

Kimai Version: 2.10.0
Approval Version: 2.0.2

During installation of the bundle I got the following error:

sudo docker exec kimai-kimai-1 /opt/kimai/bin/console kimai:bundle:approval:install

Starting installation of plugin: ApprovalBundle ...
===================================================

[notice] Migrating up to ApprovalBundle\Migrations\Version20231016134127
[error] Migration ApprovalBundle\Migrations\Version20221118162725 failed during Execution. Error: "An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #3 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'kimai.ap.end_date' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by"
 [ERROR] Failed to install database for bundle ApprovalBundle. An exception
         occurred while executing a query: SQLSTATE[42000]: Syntax error or
         access violation: 1055 Expression #3 of SELECT list is not in GROUP BY
         clause and contains nonaggregated column 'kimai.ap.end_date' which is
         not functionally dependent on columns in GROUP BY clause; this is
         incompatible with sql_mode=only_full_group_by 

When I try to start installation again I get the following error:

sudo docker exec kimai-kimai-1 /opt/kimai/bin/console kimai:bundle:approval:install

Starting installation of plugin: ApprovalBundle ...
===================================================

[notice] Migrating up to ApprovalBundle\Migrations\Version20231016134127
[error] Migration ApprovalBundle\Migrations\Version20221118162725 failed during Execution. Error: "An exception occurred while executing a query: SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'kimai2_ext_approval_workday_history' already exists"
 [ERROR] Failed to install database for bundle ApprovalBundle. An exception
         occurred while executing a query: SQLSTATE[42S01]: Base table or view
         already exists: 1050 Table 'kimai2_ext_approval_workday_history' 

I've testet the App and started an approval request and do get an db errer / missing table issue:
kimai-1 | [2024-02-19T20:19:29.643313+00:00] request.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\TableNotFoundException: "An exception occurred while executing a query: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'kimai.kimai2_ext_approval_overtime_history' doesn't exist" at ExceptionConverter.php line 49 {"exception":"[object] (Doctrine\\DBAL\\Exception\\TableNotFoundException(code: 1146): An exception occurred while executing a query: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'kimai.kimai2_ext_approval_overtime_history' doesn't exist at /opt/kimai/vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php:49)\n[previous exception] [object] (Doctrine\\DBAL\\Driver\\PDO\\Exception(code: 1146): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'kimai.kimai2_ext_approval_overtime_history' doesn't exist at /opt/kimai/vendor/doctrine/dbal/src/Driver/PDO/Exception.php:28)\n[previous exception] [object] (PDOException(code: 42S02): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'kimai.kimai2_ext_approval_overtime_history' doesn't exist at /opt/kimai/vendor/doctrine/dbal/src/Driver/PDO/Statement.php:130)"} {"channel":"request"}

The lockdown per user plugin I've installed after the installation of the approval bundle. Maybe this caused the issue.

For now I disabled the Apps.

sudo touch plugins/ApprovalBundle/.disabled
sudo touch plugins/LockdownPerUserBundle/.disabled

Opening approvals for active timesheets creates an error

Hi there,

maybe I am doing something wrong but whenever I open the approval view on a user which has an active timesheet an error this displayed. Can you maybe help me?

The error message is the following:

[2022-09-15 10:00:15] request.CRITICAL: Uncaught PHP Exception Error: "Call to a member function format() on null" at /var/www/kimai2/var/plugins/ApprovalBundle/Toolbox/BreakTimeCheckToolGER.php line 161 {"exception":"[object] (Error(code: 0): Call to a member function format() on null at /var/www/kimai2/var/plugins/ApprovalBundle/Toolbox/BreakTimeCheckToolGER.php:161)"} []
[2022-09-15 10:00:15] php.CRITICAL: Uncaught Error: Call to a member function format() on null {"exception":"[object] (Error(code: 0): Call to a member function format() on null at /var/www/kimai2/var/plugins/ApprovalBundle/Toolbox/BreakTimeCheckToolGER.php:161)"} []
[2022-09-15 10:00:15] php.INFO: Deprecated: usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero {"exception":"[object] (ErrorException(code: 0): Deprecated: usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero at /var/www/kimai2/var/plugins/ApprovalBundle/Toolbox/BreakTimeCheckToolGER.php:156)"} []
[2022-09-15 10:00:15] request.INFO: Matched route "approval_bundle_report". {"route":"approval_bundle_report","route_parameters":{"_route":"approval_bundle_report","_controller":"KimaiPlugin\\ApprovalBundle\\Controller\\WeekReportController::weekByUser","_locale":"de"},"request_uri":"https://.../de/approval-report/week_by_user?date=2022-09-12&user=49","method":"GET"} []

Thank you for any kind of help :)

Kind regards,
Tim

Setting to "include admins"

Create a new setting to include also admins - simple change currently available in outdated branch IncludeAdmin

After Install - Preferences in Profiles Casues Error

Good Day,

I have installed this on a Synology NAS DS1520+, It was working really well. I've purchased the Kiosk and installed it. It worked problem free. I then purchased and installed Approval bundle. After following instructions, I can no longer view others or my own Preferences.

I'm still figuring out how exactly the Approval process works but first step is to resolve this issue.

Kimai Version: 1.28.1 stable (prod)

Log File:

[2022-12-09 17:06:26] request.CRITICAL: Uncaught PHP Exception Symfony\Component\Form\Exception\TransformationFailedException: "Unable to transform data for property path "value": App\Utils\Duration::format(): Argument #1 ($seconds) must be of type ?int, string given, called in /volume1/web/timeclock/src/Form/DataTransformer/DurationStringToSecondsTransformer.php on line 42" at /volume1/web/timeclock/vendor/symfony/form/Form.php line 1080 {"exception":"[object] (Symfony\\Component\\Form\\Exception\\TransformationFailedException(code: 0): Unable to transform data for property path \"value\": App\\Utils\\Duration::format(): Argument #1 ($seconds) must be of type ?int, string given, called in /volume1/web/timeclock/src/Form/DataTransformer/DurationStringToSecondsTransformer.php on line 42 at /volume1/web/timeclock/vendor/symfony/form/Form.php:1080, Symfony\\Component\\Form\\Exception\\TransformationFailedException(code: 0): App\\Utils\\Duration::format(): Argument #1 ($seconds) must be of type ?int, string given, called in /volume1/web/timeclock/src/Form/DataTransformer/DurationStringToSecondsTransformer.php on line 42 at /volume1/web/timeclock/src/Form/DataTransformer/DurationStringToSecondsTransformer.php:44)"} []


[2022-12-09 17:06:26] request.INFO: Matched route "user_profile_preferences". {"route":"user_profile_preferences","route_parameters":{"_route":"user_profile_preferences","_controller":"App\\Controller\\ProfileController::preferencesAction","_locale":"en","username":"GCrispin"},"request_uri":"https://192.168.0.150:7777/en/profile/GCrispin/prefs","method":"GET"} []

PHP:

Version 	8.0.23
Modules 	Core, date, libxml, pcre, ctype, dom, fileinfo, filter, hash, json, mbstring, pcntl, SPL, PDO, readline, Reflection, session, SimpleXML, standard, tokenizer, xml, xmlreader, xmlwriter, mysqlnd, cgi-fcgi, apcu, bcmath, bz2, calendar, curl, dba, exif, ftp, gd, gettext, gmp, iconv, imagick, imap, intl, ldap, mailparse, mysqli, openssl, pdo_dblib, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, zlib, posix, shmop, soap, sockets, sodium, sqlite3, ssh2, sysvmsg, sysvsem, sysvshm, xsl, zip, Phar, Zend OPcache
allow_url_fopen 	1
allow_url_include 	0
default_charset 	UTF-8
default_mimetype 	text/html
display_errors 	unknown
error_log 	unknown
error_reporting 	22519
log_errors 	1
max_execution_time 	240
memory_limit 	512M
open_basedir 	unknown
post_max_size 	32M
sys_temp_dir 	/var/services/tmp
date.timezone 	US/Arizona

Composer Packages:

beberlei/doctrineextensions 	v1.3.0
behat/transliterator 	v1.5.0
composer/package-versions-deprecated 	1.11.99.5
doctrine/annotations 	1.13.3
doctrine/cache 	2.2.0
doctrine/collections 	1.8.0
doctrine/common 	3.4.3
doctrine/dbal 	2.13.9
doctrine/deprecations 	v0.5.3
doctrine/doctrine-bundle 	2.7.0
doctrine/doctrine-migrations-bundle 	3.2.2
doctrine/event-manager 	1.2.0
doctrine/inflector 	2.0.6
doctrine/instantiator 	1.4.1
doctrine/lexer 	1.2.3
doctrine/migrations 	3.4.2
doctrine/orm 	2.13.3
doctrine/persistence 	2.5.5
doctrine/sql-formatter 	1.1.3
egulias/email-validator 	3.2.1
erusev/parsedown 	1.7.4
exsyst/swagger 	v0.4.2
ezyang/htmlpurifier 	v4.16.0
friendsofphp/proxy-manager-lts 	v1.0.13
friendsofsymfony/rest-bundle 	3.4.0
gedmo/doctrine-extensions 	v3.9.0
handcraftedinthealps/rest-routing-bundle 	1.0.6
jms/metadata 	2.7.0
jms/serializer 	3.18.2
jms/serializer-bundle 	4.2.0
kevinpapst/adminlte-bundle 	3.6.1
laminas/laminas-code 	3.4.1
laminas/laminas-escaper 	2.9.0
laminas/laminas-eventmanager 	3.4.0
laminas/laminas-zendframework-bridge 	1.4.1
league/csv 	9.7.4
league/html-to-markdown 	5.1.0
lorenzo/pinky 	1.0.7
maennchen/zipstream-php 	2.1.0
markbaker/complex 	3.0.1
markbaker/matrix 	3.0.0
monolog/monolog 	1.27.1
mpdf/mpdf 	v8.1.2
myclabs/deep-copy 	1.11.0
myclabs/php-enum 	1.8.4
nelmio/api-doc-bundle 	v3.10.1
nelmio/cors-bundle 	2.2.0
onelogin/php-saml 	3.6.1
pagerfanta/pagerfanta 	v2.7.3
paragonie/random_compat 	v9.99.100
php-http/message-factory 	v1.0.2
phpdocumentor/reflection-common 	2.2.0
phpdocumentor/reflection-docblock 	5.3.0
phpdocumentor/type-resolver 	1.6.1
phpoffice/phpspreadsheet 	1.25.2
phpoffice/phpword 	0.18.3
phpstan/phpdoc-parser 	1.13.0
psr/cache 	1.0.1
psr/container 	1.1.1
psr/http-client 	1.0.1
psr/http-factory 	1.0.1
psr/http-message 	1.0.1
psr/log 	1.1.4
psr/simple-cache 	1.0.1
robrichards/xmlseclibs 	3.1.1
sensio/framework-extra-bundle 	v6.2.8
setasign/fpdi 	v2.3.6
symfony/amazon-mailer 	v4.4.37
symfony/asset 	v4.4.46
symfony/cache 	v4.4.48
symfony/cache-contracts 	v2.5.2
symfony/config 	v4.4.44
symfony/console 	v4.4.48
symfony/css-selector 	v4.4.44
symfony/debug 	v4.4.44
symfony/dependency-injection 	v4.4.44
symfony/deprecation-contracts 	v2.5.2
symfony/doctrine-bridge 	v4.4.48
symfony/dotenv 	v4.4.37
symfony/error-handler 	v4.4.44
symfony/event-dispatcher 	v4.4.44
symfony/event-dispatcher-contracts 	v1.1.13
symfony/expression-language 	v4.4.47
symfony/filesystem 	v4.4.42
symfony/finder 	v4.4.44
symfony/flex 	v1.19.3
symfony/form 	v4.4.48
symfony/framework-bundle 	v4.4.47
symfony/google-mailer 	v4.4.41
symfony/http-client 	v4.4.47
symfony/http-client-contracts 	v2.5.2
symfony/http-foundation 	v4.4.48
symfony/http-kernel 	v4.4.48
symfony/inflector 	v4.4.44
symfony/intl 	v4.4.47
symfony/mailchimp-mailer 	v4.4.40
symfony/mailer 	v4.4.48
symfony/mailgun-mailer 	v4.4.40
symfony/mime 	v4.4.47
symfony/monolog-bridge 	v4.4.43
symfony/monolog-bundle 	v3.8.0
symfony/options-resolver 	v4.4.44
symfony/polyfill-ctype 	v1.26.0
symfony/polyfill-intl-grapheme 	v1.26.0
symfony/polyfill-intl-icu 	v1.26.0
symfony/polyfill-intl-idn 	v1.26.0
symfony/polyfill-intl-normalizer 	v1.26.0
symfony/polyfill-php73 	v1.26.0
symfony/polyfill-php80 	v1.26.0
symfony/polyfill-php81 	v1.26.0
symfony/polyfill-uuid 	v1.26.0
symfony/postmark-mailer 	v4.4.40
symfony/property-access 	v4.4.44
symfony/property-info 	v4.4.47
symfony/routing 	v4.4.44
symfony/security-bundle 	v4.4.44
symfony/security-core 	v4.4.48
symfony/security-csrf 	v4.4.37
symfony/security-guard 	v4.4.46
symfony/security-http 	v4.4.48
symfony/sendgrid-mailer 	v4.4.40
symfony/serializer 	v4.4.47
symfony/service-contracts 	v2.5.2
symfony/stopwatch 	v4.4.46
symfony/string 	v5.4.15
symfony/translation 	v4.4.47
symfony/translation-contracts 	v2.5.2
symfony/twig-bridge 	v4.4.45
symfony/twig-bundle 	v4.4.41
symfony/uid 	v5.4.13
symfony/validator 	v4.4.48
symfony/var-dumper 	v4.4.47
symfony/var-exporter 	v4.4.43
symfony/webpack-encore-bundle 	v1.16.0
symfony/yaml 	v4.4.45
tijsverkoyen/css-to-inline-styles 	2.2.5
twig/cssinliner-extra 	v3.4.0
twig/extra-bundle 	v3.4.0
twig/inky-extra 	v3.4.0
twig/intl-extra 	v3.4.2
twig/string-extra 	v3.4.0
twig/twig 	v3.4.3
webmozart/assert 	1.11.0
willdurand/jsonp-callback-validator 	v2.0.0
willdurand/negotiation 	3.1.0
zircote/swagger-php 	2.1.2

Server:

System 	Linux NAS 4.4.180+ #42962 SMP Tue Oct 18 15:07:03 CST 2022 x86_64
Build Date 	Oct 13 2022 17:42:26
Build System 	Linux 56a9f2be1f8c 4.19.0-9-amd64 #1 SMP Debian 4.19.118-2+deb10u1 (2020-06-07) x86_64 GNU/Linux
Server API 	FPM/FastCGI
Virtual Directory Support 	disabled
Configuration File (php.ini) Path 	/usr/local/etc/php80/cli
Loaded Configuration File 	/volume1/@appstore/PHP8.0/misc/php-fpm.ini
Scan this dir for additional .ini files 	no value
Additional .ini files parsed 	/usr/syno/etc/packages/WebStation/php_profile/219057db-268a-4a93-97d2-44d8a025df59/conf.d/user_settings.ini, /run/php-fpm/conf.d/timezone.ini
PHP API 	20200930
PHP Extension 	20200930
Zend Extension 	420200930
Zend Extension Build 	API420200930,NTS
PHP Extension Build 	API20200930,NTS
Debug Build 	no
Thread Safety 	disabled
Zend Signal Handling 	enabled
Zend Memory Manager 	enabled
Zend Multibyte Support 	provided by mbstring
IPv6 Support 	enabled
DTrace Support 	disabled
Registered PHP Streams 	php, file, glob, data, http, ftp, compress.bzip2, https, ftps, compress.zlib, ssh2.shell, ssh2.exec, ssh2.tunnel, ssh2.scp, ssh2.sftp, zip, phar
Registered Stream Socket Transports 	tcp, udp, unix, udg, ssl, tls, tlsv1.0, tlsv1.1, tlsv1.2, tlsv1.3
Registered Stream Filters 	string.rot13, string.toupper, string.tolower, convert.*, consumed, dechunk, bzip2.*, convert.iconv.*, zlib.*

Approval without duration

Would it be possible to add a mode where you do not have to specify the daily working times?

I am sure you have valid reasons in your use-case.
But I see many scenarios, where you want to approve / reject times without the necessity of checking daily working times.

Times change and working contracts do not require to have such a setup nowadays 😁

Auto Submit for Previous Weeks?

Hi,

This is more a feature request, currently when someone tries to Submit a week but missed a week it comes up with the warning:

"Please add previous weeks to approve".

When people have a couple of weeks off on holiday, they have to go back and do previous weeks. Is it possible to get it to auto submit any previous weeks by default? Like a round up? Wasnt sure if thats possible?

Thanks.

Mike

minor permission issue

Hi Katja,

first of all thanks for releasing this great plugin for Kimai2!

We figured out a minor issue with the permission structure:
If user X is teamlead of Team D and member of Team S and got the permission 'view_team_approval' this user can see approvals and submissions of all users which are in the same team as user X (even if user X is team member in this team only). If this permission is not granted, user X is not able to see or approve their team members submitted weeks.

In terms of usability an additional permission 'view_team_approval (Teamlead)' would be great, which displays week reports of users only if user X is teamlead of the accordingly team.

Best regards

Uncaught PHP Exception

Hello,

New to Kimai and the Approval plugin. It is entirely likely that I have misconfigured something. However, I ran through the setup process multiple times and got a successful message during installation.

Here is what I am running into after the plugin has been successfully installed. I am getting the following exception and Error 500 on the application. Could you please let me know if this is a setup error on my part or something else:

Setup:

Host OS: MacOS Sonoma
Docker setup using Kimai documentation
Kimai version: 2.11.0
Plugins:

  • LockdownPerUserBunle
  • ApprovalBundle

Error:

2024-02-19 21:15:41 localhost:8001 127.0.0.1 - - [20/Feb/2024:03:15:41 +0000] "GET / HTTP/1.1" 302 581 "-" "curl/7.88.1"
2024-02-19 21:16:01 localhost:8001 127.0.0.1 - - [20/Feb/2024:03:16:01 +0000] "GET / HTTP/1.1" 302 581 "-" "curl/7.88.1"
2024-02-19 21:16:16 [2024-02-20T03:16:16.161439+00:00] request.INFO: Matched route "approval_bundle_report". {"route":"approval_bundle_report","route_parameters":{"_route":"approval_bundle_report","_controller":"KimaiPlugin\\ApprovalBundle\\Controller\\WeekReportController::weekByUser","_locale":"en"},"request_uri":"http://localhost:8001/en/approval/week_by_user","method":"GET"} {"channel":"request"}
2024-02-19 21:16:16 [2024-02-20T03:16:16.187868+00:00] request.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\DriverException: "An exception occurred while executing a query: SQLSTATE[HY000]: General error: 1525 Incorrect DATE value: 'now'" at ExceptionConverter.php line 117 {"exception":"[object] (Doctrine\\DBAL\\Exception\\DriverException(code: 1525): An exception occurred while executing a query: SQLSTATE[HY000]: General error: 1525 Incorrect DATE value: 'now' at /opt/kimai/vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php:117)\n[previous exception] [object] (Doctrine\\DBAL\\Driver\\PDO\\Exception(code: 1525): SQLSTATE[HY000]: General error: 1525 Incorrect DATE value: 'now' at /opt/kimai/vendor/doctrine/dbal/src/Driver/PDO/Exception.php:28)\n[previous exception] [object] (PDOException(code: HY000): SQLSTATE[HY000]: General error: 1525 Incorrect DATE value: 'now' at /opt/kimai/vendor/doctrine/dbal/src/Driver/PDO/Statement.php:130)"} {"channel":"request"}
2024-02-19 21:16:16 localhost:8001 xxx.xxx.xx.x - - [20/Feb/2024:03:16:16 +0000] "GET /en/approval/week_by_user HTTP/1.1" 500 1939 "http://localhost:8001/en/admin/plugins/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36"
2024-02-19 21:16:21 localhost:8001 127.0.0.1 - - [20/Feb/2024:03:16:21 +0000] "GET / HTTP/1.1" 302 581 "-" "curl/7.88.1"

Timesheet locks does not seem to working.

Hello,

This could be a newbie issue. I apologize if that is the case. However, after fresh (successful) installation of the plugin and configuring the user and other settings, I have the following user preferences:

+----+---------+--------------------------+---------------------+
| id | user_id | name                     | value               |
+----+---------+--------------------------+---------------------+
| 53 |       2 | __wizards__              | intro,profile       |
| 27 |       2 | calendar_initial_view    | month               |
| 30 |       2 | daily_stats              |                     |
| 31 |       2 | export_decimal           |                     |
| 29 |       2 | favorite_routes          |                     |
| 24 |       2 | first_weekday            | monday              |
| 21 |       2 | hourly_rate              | 0                   |
| 22 |       2 | internal_rate            | NULL                |
| 20 |       2 | language                 | en                  |
| 23 |       2 | locale                   | en                  |
| 35 |       2 | lockdown_grace_period    | 0000-01-01 00:00:01 |
| 33 |       2 | lockdown_period_end      | 0000-01-01 00:00:01 |
| 32 |       2 | lockdown_period_start    | 0000-01-01 00:00:01 |
| 34 |       2 | lockdown_period_timezone | NULL                |
| 28 |       2 | login_initial_view       | timesheet           |
| 25 |       2 | skin                     | default             |
| 19 |       2 | timezone                 | America/Los_Angeles |
| 26 |       2 | update_browser_title     | 1                   |
+----+---------+--------------------------+---------------------+

After creating the first timesheet and sending it for approval, additional preferences are created in user_preferences table; however, the lockdown_period* settings do not change. End result is that timesheets are not locking.

mysql> select * from kimai2_user_preferences where user_id=2;
+----+---------+------------------------------------------+---------------------+
| id | user_id | name                                     | value               |
+----+---------+------------------------------------------+---------------------+
| 53 |       2 | __wizards__                              | intro,profile       |
| 27 |       2 | calendar_initial_view                    | month               |
| 30 |       2 | daily_stats                              |                     |
| 31 |       2 | export_decimal                           |                     |
| 29 |       2 | favorite_routes                          |                     |
| 24 |       2 | first_weekday                            | monday              |
| 21 |       2 | hourly_rate                              | 0                   |
| 22 |       2 | internal_rate                            | NULL                |
| 20 |       2 | language                                 | en                  |
| 23 |       2 | locale                                   | en                  |
| 35 |       2 | lockdown_grace_period                    | 0000-01-01 00:00:01 |
| 33 |       2 | lockdown_period_end                      | 0000-01-01 00:00:01 |
| 32 |       2 | lockdown_period_start                    | 0000-01-01 00:00:01 |
| 34 |       2 | lockdown_period_timezone                 | NULL                |
| 28 |       2 | login_initial_view                       | timesheet           |
| 25 |       2 | skin                                     | default             |
| 57 |       2 | timesheet_rules_lockdown_grace_period    | 2024-02-24 14:19:11 |
| 55 |       2 | timesheet_rules_lockdown_period_end      | 2024-02-25 23:59:59 |
| 54 |       2 | timesheet_rules_lockdown_period_start    | 0000-01-01 00:00:01 |
| 56 |       2 | timesheet_rules_lockdown_period_timezone | America/Los_Angeles |
| 19 |       2 | timezone                                 | America/Los_Angeles |
| 26 |       2 | update_browser_title                     | 1                   |
+----+---------+------------------------------------------+---------------------+

I went through the troubleshooting guide and set the user/approver and lockdown values as recommended.

Thanks!

Jay

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.