pixtur:sounds reasonable to me...
4 years ago
But best solution would be a splitted duration input field like suggested earlier: One float and one dropdown-list with minutes, hours, days, weeks.
brasti:some remarks
4 years ago
I added a suggestion to convert a float value to hours and minutes.
But I have the following question:
When there's a problem with the value not in the correct format, is there a way to cancel the insert or update to the database and return to the edit effort page?
This to avoid the creation of the useless effort record "00-00-00 00:00:00"?
Regards
4 years ago (4. update 3 years ago)
At some point in the function effortEditSubmit() in effort.inc.php the fields are getting parsed.
When there is a problem with parsing of the Datetime fields voor time_start en time_end then the parse function returns zero.
So by checking if:
strToGMTime($effort->time_end) ==0
we can put the validatingvariable $failure to true.
Like this the insert of the record is cancelled and we return back to the effortedit form.
Like that we avoid the creation of records containing zero.
I've uploaded an "effort.inc.php" file where you can see how I solved it.
(look for:
Edited by Brasti)
Some remarks:- I did not find a way to remember the inserted values of the user before parsing them and re-use this values in the editform after the submit. So I chose a default value to avoid the zero for the time_start and time_end value.
- A better way for this would be self-validating fields. So when a user leaves the field the inserted value get's validated. Like suggested in field validation
- When a user creates a new effort in "As_duration" mode streber calculates a value depending on the last booked effort. I don't think this makes any sense. For me a default value of 0 houres at date today is enough.
- I don't now if you now but in the effortedit page (not only but every datetime field) you can change the value of the houres by clicking and dragging the mouse to the left or right on the *h* in <h>. I find this feature not very usefull or handy. I realy doubt if it's used a lot. For me you can dump it.
Regards
3 years ago
ok, added to revision. Thanks for pointing this out!