From a0eef1e63b1cfb636c5c95142b8740cff134a19b Mon Sep 17 00:00:00 2001 From: Kyle Hall Date: Wed, 9 Nov 2022 12:09:34 -0500 Subject: [PATCH] Bug 28966: Add Koha::Object(s) for tmp_holdsqueue --- C4/HoldsQueue.pm | 3 +- Koha/Hold/HoldsQueueItem.pm | 46 +++++++++++++++++++++++ Koha/Hold/HoldsQueueItems.pm | 57 +++++++++++++++++++++++++++++ Koha/Schema/Result/TmpHoldsqueue.pm | 12 +++++- 4 files changed, 116 insertions(+), 2 deletions(-) create mode 100644 Koha/Hold/HoldsQueueItem.pm create mode 100644 Koha/Hold/HoldsQueueItems.pm diff --git a/C4/HoldsQueue.pm b/C4/HoldsQueue.pm index 00afb4bdcb..c5b765cdd2 100644 --- a/C4/HoldsQueue.pm +++ b/C4/HoldsQueue.pm @@ -25,9 +25,10 @@ use warnings; use C4::Context; use C4::Circulation qw( GetBranchItemRule ); use Koha::DateUtils qw( dt_from_string ); +use Koha::HoldsQueueItems; use Koha::Items; -use Koha::Patrons; use Koha::Libraries; +use Koha::Patrons; use List::Util qw( shuffle ); use List::MoreUtils qw( any ); diff --git a/Koha/Hold/HoldsQueueItem.pm b/Koha/Hold/HoldsQueueItem.pm new file mode 100644 index 0000000000..986ec969e6 --- /dev/null +++ b/Koha/Hold/HoldsQueueItem.pm @@ -0,0 +1,46 @@ +package Koha::Hold::HoldsQueueItem; + +# 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::Hold::HoldsQueueItem - Koha hold cancellation request Object class + +=head1 API + +=head2 Internal methods + +=head3 _type + +=cut + +sub _type { + return 'TmpHoldsqueue'; +} + +=head1 AUTHORS + +Kyle Hall + +=cut + +1; diff --git a/Koha/Hold/HoldsQueueItems.pm b/Koha/Hold/HoldsQueueItems.pm new file mode 100644 index 0000000000..4b99ed85a9 --- /dev/null +++ b/Koha/Hold/HoldsQueueItems.pm @@ -0,0 +1,57 @@ +package Koha::Hold::HoldsQueueItems; + +# 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::Hold::HoldsQueueItem; + +use base qw(Koha::Objects); + +=head1 NAME + +Koha::Hold::HoldsQueueItems - Koha hold cancellation requests Object set class + +=head1 API + +=head2 Internal methods + +=head3 _type + +=cut + +sub _type { + return 'TmpHoldsqueue'; +} + +=head3 object_class + +=cut + +sub object_class { + return 'Koha::Hold::HoldsQueueItem'; +} + +=head1 AUTHORS + +Kyle Hall + +=cut + +1; diff --git a/Koha/Schema/Result/TmpHoldsqueue.pm b/Koha/Schema/Result/TmpHoldsqueue.pm index 756c9325e4..882a91ad0c 100644 --- a/Koha/Schema/Result/TmpHoldsqueue.pm +++ b/Koha/Schema/Result/TmpHoldsqueue.pm @@ -220,6 +220,16 @@ __PACKAGE__->belongs_to( # Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-11-04 22:42:42 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:RdIrLi+vbzj3ab/UP7e9pw +__PACKAGE__->add_columns( + '+item_level_request' => { is_boolean => 1 } +); + +sub koha_object_class { + 'Koha::HoldsQueueItem'; +} + +sub koha_objects_class { + 'Koha::HoldsQueueItems'; +} -# You can replace this text with custom content, and it will be preserved on regeneration 1; -- 2.30.2