From 402938f7cdc8e7f4670e9b92a2738f2304ddbcdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Cohen=20Arazi?= Date: Wed, 8 Apr 2026 15:32:11 -0300 Subject: [PATCH] Bug 42310: Add Koha::Calendar::* Object classes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Four Koha::Object + Koha::Objects pairs following the Koha::City(ies) pattern: - Koha::Calendar::WeeklyClosure(s) -> library_weekly_closures - Koha::Calendar::RepeatingClosure(s) -> library_repeating_closures - Koha::Calendar::SingleClosure(s) -> library_single_closures - Koha::Calendar::Exception(s) -> library_closure_exceptions DBIC schema files to be generated via the 'dbic' alias in KTD after the database migration runs. Signed-off-by: Tomás Cohen Arazi Signed-off-by: David Nind Signed-off-by: Martin Renvoize Signed-off-by: Tomás Cohen Arazi Signed-off-by: Pedro Amorim --- Koha/Calendar/Exception.pm | 42 ++++++++++++++++++++++++ Koha/Calendar/Exceptions.pm | 52 ++++++++++++++++++++++++++++++ Koha/Calendar/RepeatingClosure.pm | 42 ++++++++++++++++++++++++ Koha/Calendar/RepeatingClosures.pm | 52 ++++++++++++++++++++++++++++++ Koha/Calendar/SingleClosure.pm | 42 ++++++++++++++++++++++++ Koha/Calendar/SingleClosures.pm | 52 ++++++++++++++++++++++++++++++ Koha/Calendar/WeeklyClosure.pm | 42 ++++++++++++++++++++++++ Koha/Calendar/WeeklyClosures.pm | 52 ++++++++++++++++++++++++++++++ 8 files changed, 376 insertions(+) create mode 100644 Koha/Calendar/Exception.pm create mode 100644 Koha/Calendar/Exceptions.pm create mode 100644 Koha/Calendar/RepeatingClosure.pm create mode 100644 Koha/Calendar/RepeatingClosures.pm create mode 100644 Koha/Calendar/SingleClosure.pm create mode 100644 Koha/Calendar/SingleClosures.pm create mode 100644 Koha/Calendar/WeeklyClosure.pm create mode 100644 Koha/Calendar/WeeklyClosures.pm diff --git a/Koha/Calendar/Exception.pm b/Koha/Calendar/Exception.pm new file mode 100644 index 0000000000..c9cc342f56 --- /dev/null +++ b/Koha/Calendar/Exception.pm @@ -0,0 +1,42 @@ +package Koha::Calendar::Exception; + +# Copyright 2026 Theke Solutions +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# Koha is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . + +use Modern::Perl; + +use Koha::Database; + +use base qw(Koha::Object); + +=head1 NAME + +Koha::Calendar::Exception - Koha closure exception (open override) Object class + +=head1 API + +=head2 Internal methods + +=head3 _type + +=cut + +sub _type { + return 'LibraryClosureException'; +} + +1; diff --git a/Koha/Calendar/Exceptions.pm b/Koha/Calendar/Exceptions.pm new file mode 100644 index 0000000000..67c748ca0e --- /dev/null +++ b/Koha/Calendar/Exceptions.pm @@ -0,0 +1,52 @@ +package Koha::Calendar::Exceptions; + +# Copyright 2026 Theke Solutions +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# Koha is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . + +use Modern::Perl; + +use Koha::Database; + +use Koha::Calendar::Exception; + +use base qw(Koha::Objects); + +=head1 NAME + +Koha::Calendar::Exceptions - Koha closure exception Object set class + +=head1 API + +=head2 Class methods + +=head3 _type + +=cut + +sub _type { + return 'LibraryClosureException'; +} + +=head3 object_class + +=cut + +sub object_class { + return 'Koha::Calendar::Exception'; +} + +1; diff --git a/Koha/Calendar/RepeatingClosure.pm b/Koha/Calendar/RepeatingClosure.pm new file mode 100644 index 0000000000..215656abf1 --- /dev/null +++ b/Koha/Calendar/RepeatingClosure.pm @@ -0,0 +1,42 @@ +package Koha::Calendar::RepeatingClosure; + +# Copyright 2026 Theke Solutions +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# Koha is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . + +use Modern::Perl; + +use Koha::Database; + +use base qw(Koha::Object); + +=head1 NAME + +Koha::Calendar::RepeatingClosure - Koha annual repeating closure Object class + +=head1 API + +=head2 Internal methods + +=head3 _type + +=cut + +sub _type { + return 'LibraryRepeatingClosure'; +} + +1; diff --git a/Koha/Calendar/RepeatingClosures.pm b/Koha/Calendar/RepeatingClosures.pm new file mode 100644 index 0000000000..6a3513bab1 --- /dev/null +++ b/Koha/Calendar/RepeatingClosures.pm @@ -0,0 +1,52 @@ +package Koha::Calendar::RepeatingClosures; + +# Copyright 2026 Theke Solutions +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# Koha is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . + +use Modern::Perl; + +use Koha::Database; + +use Koha::Calendar::RepeatingClosure; + +use base qw(Koha::Objects); + +=head1 NAME + +Koha::Calendar::RepeatingClosures - Koha annual repeating closure Object set class + +=head1 API + +=head2 Class methods + +=head3 _type + +=cut + +sub _type { + return 'LibraryRepeatingClosure'; +} + +=head3 object_class + +=cut + +sub object_class { + return 'Koha::Calendar::RepeatingClosure'; +} + +1; diff --git a/Koha/Calendar/SingleClosure.pm b/Koha/Calendar/SingleClosure.pm new file mode 100644 index 0000000000..52b01204f5 --- /dev/null +++ b/Koha/Calendar/SingleClosure.pm @@ -0,0 +1,42 @@ +package Koha::Calendar::SingleClosure; + +# Copyright 2026 Theke Solutions +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# Koha is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . + +use Modern::Perl; + +use Koha::Database; + +use base qw(Koha::Object); + +=head1 NAME + +Koha::Calendar::SingleClosure - Koha single-date closure Object class + +=head1 API + +=head2 Internal methods + +=head3 _type + +=cut + +sub _type { + return 'LibrarySingleClosure'; +} + +1; diff --git a/Koha/Calendar/SingleClosures.pm b/Koha/Calendar/SingleClosures.pm new file mode 100644 index 0000000000..f39a16a824 --- /dev/null +++ b/Koha/Calendar/SingleClosures.pm @@ -0,0 +1,52 @@ +package Koha::Calendar::SingleClosures; + +# Copyright 2026 Theke Solutions +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# Koha is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . + +use Modern::Perl; + +use Koha::Database; + +use Koha::Calendar::SingleClosure; + +use base qw(Koha::Objects); + +=head1 NAME + +Koha::Calendar::SingleClosures - Koha single-date closure Object set class + +=head1 API + +=head2 Class methods + +=head3 _type + +=cut + +sub _type { + return 'LibrarySingleClosure'; +} + +=head3 object_class + +=cut + +sub object_class { + return 'Koha::Calendar::SingleClosure'; +} + +1; diff --git a/Koha/Calendar/WeeklyClosure.pm b/Koha/Calendar/WeeklyClosure.pm new file mode 100644 index 0000000000..5c949718cb --- /dev/null +++ b/Koha/Calendar/WeeklyClosure.pm @@ -0,0 +1,42 @@ +package Koha::Calendar::WeeklyClosure; + +# Copyright 2026 Theke Solutions +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# Koha is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . + +use Modern::Perl; + +use Koha::Database; + +use base qw(Koha::Object); + +=head1 NAME + +Koha::Calendar::WeeklyClosure - Koha weekly closure Object class + +=head1 API + +=head2 Internal methods + +=head3 _type + +=cut + +sub _type { + return 'LibraryWeeklyClosure'; +} + +1; diff --git a/Koha/Calendar/WeeklyClosures.pm b/Koha/Calendar/WeeklyClosures.pm new file mode 100644 index 0000000000..3e77e4d71b --- /dev/null +++ b/Koha/Calendar/WeeklyClosures.pm @@ -0,0 +1,52 @@ +package Koha::Calendar::WeeklyClosures; + +# Copyright 2026 Theke Solutions +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# Koha is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . + +use Modern::Perl; + +use Koha::Database; + +use Koha::Calendar::WeeklyClosure; + +use base qw(Koha::Objects); + +=head1 NAME + +Koha::Calendar::WeeklyClosures - Koha weekly closure Object set class + +=head1 API + +=head2 Class methods + +=head3 _type + +=cut + +sub _type { + return 'LibraryWeeklyClosure'; +} + +=head3 object_class + +=cut + +sub object_class { + return 'Koha::Calendar::WeeklyClosure'; +} + +1;