KatjaGlassConsulting / ApprovalBundle

A Kimai Plugin to manage weekly approval workflow
MIT License
11 stars 14 forks source link

Timesheet locks does not seem to working. #37

Closed sj-patel closed 3 months ago

sj-patel commented 4 months ago

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

KatjaGlassConsulting commented 4 months ago

@sammaclennan , do you have time to look into this issue? It's on the Kimai version 2 support version (main), in the version 1 it's working.

kevinpapst commented 4 months ago

@KatjaGlassConsulting does that work without the plugin for user specific lockdown periods?

KatjaGlassConsulting commented 4 months ago

No, it needs the lockdown bundle. But also with the bundle it's not working. I tested this.

KatjaGlassConsulting commented 4 months ago

@kevinpapst , did you have the opportunity to look at this?

kevinpapst commented 4 months ago

No. But I can have quick look if you help me: where in the code are these preferences written?

KatjaGlassConsulting commented 4 months ago

it's in the Approval controller "$this->lockdownRepository->updateLockWeek($approval, $this->approvalRepository);"

corrigenda-admin commented 3 months ago

Hi, love your work on this. Do we know roughly when this will be sorted? I have the same issue on a fresh install.

sammaclennan commented 3 months ago

Apologies all, I've been away for a while and haven't been able to take a look - but I'll try to find some time this week!

sj-patel commented 3 months ago

Hi, Any update on this issue? I would like to use the plugin if possible.

sammaclennan commented 3 months ago

Working on it, haven't quite cracked it yet but should be good to go soon!

sammaclennan commented 3 months ago

Pull request submitted, should resolve the issue.

Turned out I was way overcomplicating it - still new to Symfony/Doctrine!

sj-patel commented 3 months ago

I have installed the latest version, and the plugin seems to work as expected.

Thank you so very much!

sj-patel commented 3 months ago

closing since the bug seems to be fixed.