Bug 33304 - Report schedule form time input element attribute type changed to improve valid time value entry
Summary: Report schedule form time input element attribute type changed to improve val...
Status: Failed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Adam Styles
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-22 11:51 UTC by Adam Styles
Modified: 2023-06-23 05:15 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
report schedule start time input fix (152.08 KB, image/png)
2023-03-22 11:51 UTC, Adam Styles
Details
Bug 33304: Report schedule form time input element attribute type changed to improves valid time value entry (2.23 KB, patch)
2023-03-22 11:57 UTC, Adam Styles
Details | Diff | Splinter Review
Bug 33304: Report schedule form time input element attribute type changed to improves valid time value entry (2.28 KB, patch)
2023-04-07 02:31 UTC, David Nind
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Styles 2023-03-22 11:51:48 UTC
Created attachment 148518 [details]
report schedule start time input fix

Hello community,

I offer an enhancement for the task scheduler form:
/cgi-bin/koha/tools/scheduler.pl via scheduler.tt 

The time input element currently has an 'text' value for type attribute. This requires a user to enter a valid time string for any scheduled report manually which is no fun. I have created patch in scheduler.tt that changes the type attribute value from 'text' to 'time' which makes the input of valid time easy. This change leveraged standard web form principles of html5 and would be compatible with any modern browser such as chrome, firefox and safari etc.

Patch incoming.

Thoughts and feedback invited.

Thanks. 8-)
Comment 1 Adam Styles 2023-03-22 11:57:06 UTC
Created attachment 148519 [details] [review]
Bug 33304: Report schedule form time input element attribute type changed to improves valid time value entry

I offer an enhancement for the task scheduler form:
/cgi-bin/koha/tools/scheduler.pl via scheduler.tt

The time input element currently has an 'text' value for type attribute. This requires a user to enter a valid time string for any scheduled report manually which is no fun. I have created patch in scheduler.tt that changes the type attribute value from 'text' to 'time' which makes the input of valid time easy. This change leveraged standard web form principles of html5 and would be compatible with any modern browser such as chrome, firefox and safari.

To test:
1) login to koha instance
2) navigate to report module from home page
3) create test report with basic action and save. (no actual run of report is requires, simply need to save with valid syntax)
...
SELECT id
FROM biblio_metadata
LIMIT 1
...
4) Press 'Schedule' icon from nav options
5) Enter relevant time value for schedule in 'time' input element which now has type 'time' attribute 3.00 pm, added easily.
6) Enter valid future date
7) Enter valid email address and press 'Save'
8) SIGN OFF
Comment 2 David Nind 2023-04-07 02:31:55 UTC
Created attachment 149252 [details] [review]
Bug 33304: Report schedule form time input element attribute type changed to improves valid time value entry

I offer an enhancement for the task scheduler form:
/cgi-bin/koha/tools/scheduler.pl via scheduler.tt

The time input element currently has an 'text' value for type attribute. This requires a user to enter a valid time string for any scheduled report manually which is no fun. I have created patch in scheduler.tt that changes the type attribute value from 'text' to 'time' which makes the input of valid time easy. This change leveraged standard web form principles of html5 and would be compatible with any modern browser such as chrome, firefox and safari.

To test:
1) login to koha instance
2) navigate to report module from home page
3) create test report with basic action and save. (no actual run of report is requires, simply need to save with valid syntax)
...
SELECT id
FROM biblio_metadata
LIMIT 1
...
4) Press 'Schedule' icon from nav options
5) Enter relevant time value for schedule in 'time' input element which now has type 'time' attribute 3.00 pm, added easily.
6) Enter valid future date
7) Enter valid email address and press 'Save'
8) SIGN OFF

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 David Nind 2023-04-07 02:32:33 UTC
This is a great idea!
Comment 4 Adam Styles 2023-04-08 01:36:34 UTC
Hi David,

Thanks for the sign off!

I know I would use this in my daily drive Koha once implemented.

8-)
Comment 5 David Nind 2023-04-08 17:43:13 UTC
(In reply to Adam Styles from comment #4)
> Hi David,
> 
> Thanks for the sign off!
> 
> I know I would use this in my daily drive Koha once implemented.
> 
> 8-)

No problem Adam!

Good luck with the QA process - there is a long list of items waiting for QA, so it may take some time 8-( (see the dashboard under 'Bug statuses' https://dashboard.koha-community.org/ ).

David
Comment 6 Katrin Fischer 2023-04-22 14:22:51 UTC
This is a bit of an odd one for me. It looks like the form is not really up to 'Koha standard' to begin with. Meaning that time and date should not really be separate input fields. It should all be handled by he datepicker.

Also: with the change, it doesn't work according to the TimeFormat preference still. In my case I see PM/AM times now, while TimeFormat is set to 24 hours.

This makes me unsure of if it's better than before or not. 

Adam, would you be interested in having a look in how to use Flatpickr to achieve the same goal here? An example for date and time can be seen in circulation when specifying a due date for example.
Comment 7 Adam Styles 2023-04-23 23:11:06 UTC
Hi Katrin,

Thanks for this feed back. I did not take into account any system preferences that might be applied to date/time format for this solution. I am happy to investigate how I can use Flatpickr to rebuild this. Thanks for the 'circulation' example.

Stay tuned for a new patch soon.

Thanks.
Comment 8 Adam Styles 2023-06-23 05:15:25 UTC
Hi Katrin,

opps I will get onto this one.
Apologies for delay in new patch.

Stay tuned.

Thanks.