https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43492

--- Comment #7 from Martin Renvoize (ashimema) 
<[email protected]> ---
Created attachment 205328
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=205328&action=edit
Bug 43492: Rework the library opening hours administration interface

Reworks the Administration > Libraries edit/view screens to support any
number of time ranges per weekday for the GENERAL opening hours type,
replacing the fixed one-row-per-weekday library_hours editor.

- admin/branches.pl: adds a Koha::Library->opening_hours accessor and
  replaces the old day[]/open_time[]/close_time[] handling (which wrote
  directly to Koha::Library::Hour(s)) with a full replace-on-save of the
  library's GENERAL type slots via the new facade. Other opening hours
  types are untouched here - they're managed via the API (Bug 43494).
- branches.tt: each weekday now renders zero or more slot rows plus an
  "Add another time range" control; a slot whose close time is not after
  its open time is accepted as closing the next day (no separate control
  needed - this falls straight out of the facade's own rule). Also fixes
  a pre-existing typo ("noEnerSubmit") that meant close_time inputs never
  actually got the enter-key-submit guard.
- Koha::Library.pm: adds the opening_hours() accessor itself (the
  Calendar-aware composition on top of it lands in Bug 43493).

Note: until Bug 43493 migrates C4::Circulation::CalcDateDue onto the new
facade, hours entered through this updated form do not yet affect due
date calculations - CalcDateDue still reads the legacy library_hours
table directly. Likewise, the libraries list page's "Library hours"
preview column still reads library_hours via the existing REST API
embed and will not reflect hours entered here until Bug 43494 lands the
typed embed.

Also verified in-browser that Bug 37456's reported issue (unable to type
times directly) no longer reproduces - the flatpickr time-only fields
already accept typed input.

Test plan:
1. Apply this patch and restart_all.
2. Administration > Libraries > edit a library.
3. Add several time ranges to a weekday, including one where the close
   time is earlier than the open time (e.g. 22:00-02:00).
4. Save. Reload the edit page and the view page: all ranges should be
   present and correctly grouped by weekday.
5. Remove a range and re-save: it should no longer be listed or stored.

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to