Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't prompt for a timesheet when only one is active #17

Open
adamgundry opened this issue Sep 12, 2022 · 1 comment
Open

Don't prompt for a timesheet when only one is active #17

adamgundry opened this issue Sep 12, 2022 · 1 comment

Comments

@adamgundry
Copy link

Thanks very much for this tool! I'm finding it very useful.

A small quality-of-life improvement that would be nice to see: when using kimai stop or kimai active -d and there is only one active timesheet, it would be nice if the prompt to select a timesheet was skipped. At the moment there is a prompt with only one option, which seems redundant:

kimai stop
 ----- -------------------------- ---------------------- ------------ ------------ ---------------------------------------------------------- ------ 
  ID    Started at                 Activity               Project      Customer     Description                                                Tags  
 ----- -------------------------- ---------------------- ------------ ------------ ---------------------------------------------------------- ------ 
  217   ...
 ----- -------------------------- ---------------------- ------------ ------------ ---------------------------------------------------------- ------ 

 Please select a timesheet:
  [0] 217
 > 0

                                                                                                                        
 [OK] Stopped 1 active timesheet(s) with ID: 217                                                                        
                                                                                                                       
@kevinpapst
Copy link
Owner

If you are up for a PR, just add an if in that line to check for the amount of active timesheets before asking:
https://github.com/kevinpapst/kimai2-console/blob/master/src/Command/StopCommand.php#L58

Meanwhile you could also use kimai stop --all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants