https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43492 --- Comment #17 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 205378 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=205378&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, each with its own type, replacing the fixed one-row-per-weekday library_hours editor. - admin/branches.pl: 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 "simple" slots (see Koha::Library::OpeningHours->unlinked_slots) via the new facade. Slots that are part of a closes_opening_id link (open on one day, close on a later one) are never touched by this editor - they can only be created/edited via the API, so this simple per-row form can't corrupt a link it has no controls for. - branches.tt: each weekday now renders zero or more slot rows (day, type, open time, close time) 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. The type dropdown is populated from the OPENING_HOURS_TYPE authorised value category via the existing AuthorisedValues plugin - no bespoke vocabulary UI needed. Also fixes a pre-existing typo ("noEnerSubmit") that meant close_time inputs never actually got the enter-key-submit guard, and updates the libraries list page's DataTable to read the new typed library_opening_hours embed (Bug 43492's REST commit), filtering to the GENERAL type and grouping potentially-multiple slots per weekday. 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, run `yarn build`, 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), and at least one with a non-GENERAL type (add one via Administration > Authorized values > OPENING_HOURS_TYPE first). 4. Save. Reload the edit page and the view page: all ranges should be present, correctly grouped by weekday, with the right type selected. 5. Remove a range and re-save: it should no longer be listed or stored. 6. Via the API or a Perl one-liner, create a slot that opens on one day and doesn't close until a later one (closes_opening_id). Confirm it does NOT appear in this form, and re-saving the form leaves it completely untouched. 7. Confirm the libraries list page's "Library hours" column still shows each library's GENERAL hours correctly. -- You are receiving this mail because: You are watching all bug changes.