Bug 36596 - Opening/closing hours should be forced to be set together
Summary: Opening/closing hours should be forced to be set together
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on: 6796
Blocks:
  Show dependency treegraph
 
Reported: 2024-04-12 12:11 UTC by Tomás Cohen Arazi
Modified: 2024-04-15 17:36 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Cohen Arazi 2024-04-12 12:11:35 UTC
It only seems to make sense to set a closing hour if an opening hour has been set, otherwise it would be open 24 hs :-D

A method needs to be added to Koha::Library:

* set_hours( $dow, $opening, $closing )
* The method needs to throw an exception if one of them is not passed
* If none is passed then it means the library would not be open, and then all hours for the 
* The code for setting the hours in branches.pl should be removed and this method used instead
* The method MUST BE COVERED BY TESTS


NOTE: I don't personally like the chosen column name 'day'. I would use either 'dow' or 'day_of_week'. And it should be clear which one is the first in the comments.
Comment 1 Martin Renvoize 2024-04-15 17:25:32 UTC
Whilst I agree about the column name and the requirement to set both openening and closing.. I'm not so sure about the meaning of no opening/closing.. that could just mean it's a 24h library and open the whole day rather than having an opening/closing time right?
Comment 2 Martin Renvoize 2024-04-15 17:36:20 UTC
We're back into naming consistency territory here.. in repeatable_holidays it's:

> `weekday` smallint(6) DEFAULT NULL COMMENT 'day of the week (0=Sunday, 1=Monday, etc) this closing is repeated on'