|
Line 0
Link Here
|
|
|
1 |
package Koha::Template::Plugin::ItemGroups; |
| 2 |
|
| 3 |
# Copyright ByWater Solutions 2023 |
| 4 |
|
| 5 |
# This file is part of Koha. |
| 6 |
# |
| 7 |
# Koha is free software; you can redistribute it and/or modify it |
| 8 |
# under the terms of the GNU General Public License as published by |
| 9 |
# the Free Software Foundation; either version 3 of the License, or |
| 10 |
# (at your option) any later version. |
| 11 |
# |
| 12 |
# Koha is distributed in the hope that it will be useful, but |
| 13 |
# WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 |
# GNU General Public License for more details. |
| 16 |
# |
| 17 |
# You should have received a copy of the GNU General Public License |
| 18 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
| 19 |
|
| 20 |
use Modern::Perl; |
| 21 |
|
| 22 |
use Template::Plugin; |
| 23 |
use base qw( Template::Plugin ); |
| 24 |
|
| 25 |
use Koha::Biblio::ItemGroups; |
| 26 |
|
| 27 |
=head1 NAME |
| 28 |
|
| 29 |
Koha::Template::Plugin::ItemGroups - A module for dealing with item groups in templates |
| 30 |
|
| 31 |
=head1 DESCRIPTION |
| 32 |
|
| 33 |
This plugin contains functions for getting all of the item groups for a particular bibliographic record, sorted by display order. |
| 34 |
|
| 35 |
=head2 Methods |
| 36 |
|
| 37 |
=head3 listGroups |
| 38 |
|
| 39 |
[% ItemGroups.listGroups %] |
| 40 |
|
| 41 |
returns all item groups |
| 42 |
|
| 43 |
=cut |
| 44 |
|
| 45 |
sub listGroups { |
| 46 |
my ( $self, $biblionumber ) = @_; |
| 47 |
return Koha::Biblio::ItemGroups->search( |
| 48 |
{ biblio_id => $biblionumber }, |
| 49 |
{ order_by => 'display_order' }, |
| 50 |
); |
| 51 |
} |
| 52 |
|
| 53 |
1; |