View | Details | Raw Unified | Return to bug 34234
Collapse All | Expand All

(-)a/Koha/Template/Plugin/ItemGroups.pm (+53 lines)
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;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-2 / +2 lines)
Lines 9-14 Link Here
9
[% USE Frameworks %]
9
[% USE Frameworks %]
10
[% USE Price %]
10
[% USE Price %]
11
[% USE TablesSettings %]
11
[% USE TablesSettings %]
12
[% USE ItemGroups %]
12
[% PROCESS 'i18n.inc' %]
13
[% PROCESS 'i18n.inc' %]
13
[% SET CoverImagePlugins = KohaPlugins.get_plugins_intranet_cover_images %]
14
[% SET CoverImagePlugins = KohaPlugins.get_plugins_intranet_cover_images %]
14
15
Lines 1248-1254 Link Here
1248
                        <p>
1249
                        <p>
1249
                            <label for="item_group" class="required">Item group: </label>
1250
                            <label for="item_group" class="required">Item group: </label>
1250
                            <select name="item_group" id="item-group-add-form-select">
1251
                            <select name="item_group" id="item-group-add-form-select">
1251
                                [% FOREACH ig IN biblio.item_groups %]
1252
                                [% FOREACH ig IN ItemGroups.listGroups(biblionumber) %]
1252
                                    <option value="[% ig.id | html %]">[% ig.description | html %]</option>
1253
                                    <option value="[% ig.id | html %]">[% ig.description | html %]</option>
1253
                                [% END %]
1254
                                [% END %]
1254
                            </select>
1255
                            </select>
1255
- 

Return to bug 34234