kevinpapst / kimai2-console

Console application for Kimai remote access - time-tracking via bash
https://www.kimai.org/store/console-phar.html
MIT License
13 stars 1 forks source link

Allow to create time records with specified time and duration #7

Open cmhe opened 4 years ago

cmhe commented 4 years ago

kimai2-console could be a useful tool to create time records via scripts from the shell in bulk. That would be useful for instance to import longer vacation, sick-leave periods or national holidays. (In case kimai2 is used to track attendance and working hours.)

To do that, the kimai2-console would need an option to specify the date and duration of those entries when creating them.

drustan commented 7 months ago

This would be a real plus. So far, since it impossible to specify a custom starting date and hour, to add a past event, I create the timesheet first with kimai start -d "what I did", immediately stop it with kimai stop and then use the Web UI to adjust the date and start/stop time. Not very handy :sweat_smile:

kevinpapst commented 7 months ago

Then add an option here: https://github.com/kevinpapst/kimai2-console/blob/master/src/Command/StartCommand.php#L33

And some lines deeper you pass in these values to the form. Methods can be found here: https://github.com/kimai/api-php/blob/main/lib/Model/TimesheetEditForm.php#L290 https://github.com/kimai/api-php/blob/main/lib/Model/TimesheetEditForm.php#L314

Once it works, you create a PR so everyone benefits 😄