Patch #24005

Settings to accept 0 hours time entries and for maximum hours per user and day

Added by Helder Manuel Torres Vieira 11 months ago. Updated 21 days ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Time tracking
Target version:4.0.0

Description

This patch modifies the existing limitation on the TimeEntry model to enable the introduction of hours with values 0 or superior to 24 hours.

About the limitation for values superior to 24 hours, this is due to having 1 time value based on a concrete day, whereby the maximum hours that are usable per day are 24.

About the limitation to introduce hours with value 0, this is due to the objective of a time entry is to be able to enter a time dedication superior to 0 minutes, for what makes no sense for the users to be able to create this kind of entries.

The patch has been tested on the last Trunk version (15839)

time_entries_day.diff Magnifier (2.77 KB) Helder Manuel Torres Vieira, 2016-10-05 20:09

time_2.png (36.2 KB) Helder Manuel Torres Vieira, 2016-10-05 20:10

time_1.png (46 KB) Helder Manuel Torres Vieira, 2016-10-05 20:10

time_3.png (40.2 KB) Helder Manuel Torres Vieira, 2016-10-05 20:10

time_4.png (62.6 KB) Helder Manuel Torres Vieira, 2016-10-05 20:10

exceed time entry 2nd entry.PNG - max time 2nd entry (42.1 KB) Randa Bustami, 2017-07-26 10:52

exceed time entry.png - max time first entry (23.6 KB) Randa Bustami, 2017-07-26 10:52


Related issues

Duplicated by Redmine - Defect #26450: user can enter more than 24 hours in the same day Closed

Associated revisions

Revision 16832
Added by Jean-Philippe Lang 28 days ago

Adds settings for time entry hours validation (#24005).

Revision 16833
Added by Jean-Philippe Lang 28 days ago

Adds i18n strings for #24005.

History

#1 Updated by Helder Manuel Torres Vieira 11 months ago

#2 Updated by Toshi MARUYAMA 10 months ago

  • Subject changed from Improve the hours validation on the TimeEntry model to Reject over 24 hours on time entry

#3 Updated by César Lizurey about 1 month ago

Personally, I don't agree because I need:
  • for the moment, "0" hour because I use custom fields for time tracking, allowing me to count "seconds" or "days";
  • it should always be possible to enter all the hours spent when somebody is back from a mission. For example, I often send my dev outside, where they don't have access to Redmine. When they're back I just ask them the number of hours IN TOTAL, and not to enter the number of hours for each day. It's far more confortable.

I think that limitations should always be an option and not a compulsory restiction for all the users :)

#4 Updated by Andrey Lobanov (RedSoft) about 1 month ago

César Lizurey wrote:

Personally, I don't agree because I need:
  • for the moment, "0" hour because I use custom fields for time tracking, allowing me to count "seconds" or "days";
  • it should always be possible to enter all the hours spent when somebody is back from a mission. For example, I often send my dev outside, where they don't have access to Redmine. When they're back I just ask them the number of hours IN TOTAL, and not to enter the number of hours for each day. It's far more confortable.

I think that limitations should always be an option and not a compulsory restiction for all the users :)

Totally agree with César Lizurey.

#5 Updated by Mischa The Evil about 1 month ago

  • Subject changed from Reject over 24 hours on time entry to Reject 0 hour and over 24 hours on time entry

Helder Manuel Torres Vieira wrote:

About the limitation to introduce hours with value 0, [...]

FWIW: Jean-Philippe Lang said the following about this in #9090#note-3:

[...] Some people might use time entries with 0 hours for specific purpose, I'm not really in favor of removing this possibility. We need more feedback before doing this change.

#6 Updated by Mischa The Evil about 1 month ago

  • Duplicated by Defect #26450: user can enter more than 24 hours in the same day added

#7 Updated by Jean-Philippe Lang about 1 month ago

About the limitation for values superior to 24 hours, this is due to having 1 time value based on a concrete day, whereby the maximum hours that are usable per day are 24.

We should check existing timelogs to make sure that the total hours logged by a user on one day is <= 24h. Checking that each single timelog is <= 24h like in the proposed patch does not prevent users to log more than 24h on one day.
Right?

I think we definitely need to make this restrictions configurable, for example with these 2 settings:
  • Accept 0h timelogs (yes/no)
  • Maximum hours that a user can log on a single day

#8 Updated by Randa Bustami about 1 month ago

Jean-Philippe Lang wrote:

About the limitation for values superior to 24 hours, this is due to having 1 time value based on a concrete day, whereby the maximum hours that are usable per day are 24.

We should check existing timelogs to make sure that the total hours logged by a user on one day is <= 24h. Checking that each single timelog is <= 24h like in the proposed patch does not prevent users to log more than 24h on one day.
Right?

I think we definitely need to make this restrictions configurable, for example with these 2 settings:
  • Accept 0h timelogs (yes/no)
  • Maximum hours that a user can log on a single day

this will be excellent, in which version we can see this pls ?

#9 Updated by Jean-Philippe Lang 28 days ago

  • Subject changed from Reject 0 hour and over 24 hours on time entry to Settings to accept 0 hours time entries and for maximum hours per user and day
  • Status changed from New to Closed
  • Assignee set to Jean-Philippe Lang
  • Target version set to 4.0.0

Randa Bustami wrote:

this will be excellent, in which version we can see this pls ?

The feature is committed in r16832, it will included in 4.0.

#10 Updated by Randa Bustami 22 days ago

we had Applied the code and the system prevent to log more than 24 hours/ entry. but the issue is still we can log more than 24 hours in another entry for the same date
the system should have 2 validation
1- check hours not to exceed 24 hours
2- check if the user have another entry in the same date so the total of all entries for that date should not exceed 24 hours
pls check the attached screenshot

#11 Updated by Jean-Philippe Lang 21 days ago

Randa Bustami wrote:

we had Applied the code and the system prevent to log more than 24 hours/ entry. but the issue is still we can log more than 24 hours in another entry for the same date

Make sure that you have configured the maximum hours that can be logged on one day (eg. 24h). By default, it is set to 999: go to Admin -> Settings -> Time Tracking -> Maximum hours that can be logged per day and user.

This issue is closed, please reopen a new one if it does not work as expected.

Also available in: Atom PDF