Bugzilla – Attachment 158148 Details for
Bug 34234
Item groups dropdown in detail page modal does not respect display order
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34234: Add template plugin for listing and sorting ItemGroups
Bug-34234-Add-template-plugin-for-listing-and-sort.patch (text/plain), 3.61 KB, created by
Lucas Gass (lukeg)
on 2023-10-31 17:26:50 UTC
(
hide
)
Description:
Bug 34234: Add template plugin for listing and sorting ItemGroups
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2023-10-31 17:26:50 UTC
Size:
3.61 KB
patch
obsolete
>From 8afefba2dba295e28fc255885eefcae70932fa64 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Tue, 31 Oct 2023 17:12:13 +0000 >Subject: [PATCH] Bug 34234: Add template plugin for listing and sorting > ItemGroups > >This patch adds a template plugin to handle the retreiving and sorting of ItemGroups. > >1. EnableItemGroups >2. Find a record and add some new item groups with display orders that are different from the order in which the groups were added >3. Check the checkbox next to one or more items and click the link to "Add/move to item group" >4. Notice that the values in the dropdown do not respect the display order. >5. Apply patch, restart all >6. Check again, sorting should be correct. >--- > Koha/Template/Plugin/ItemGroups.pm | 53 +++++++++++++++++++ > .../prog/en/modules/catalogue/detail.tt | 3 +- > 2 files changed, 55 insertions(+), 1 deletion(-) > create mode 100644 Koha/Template/Plugin/ItemGroups.pm > >diff --git a/Koha/Template/Plugin/ItemGroups.pm b/Koha/Template/Plugin/ItemGroups.pm >new file mode 100644 >index 00000000000..eda845d154d >--- /dev/null >+++ b/Koha/Template/Plugin/ItemGroups.pm >@@ -0,0 +1,53 @@ >+package Koha::Template::Plugin::ItemGroups; >+ >+# Copyright ByWater Solutions 2023 >+ >+# 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 <http://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+ >+use Template::Plugin; >+use base qw( Template::Plugin ); >+ >+use Koha::Biblio::ItemGroups; >+ >+=head1 NAME >+ >+Koha::Template::Plugin::ItemGroups - A module for dealing with item groups in templates >+ >+=head1 DESCRIPTION >+ >+This plugin contains functions for getting all of the item groups for a particular bibliographic record, sorted by display order. >+ >+=head2 Methods >+ >+=head3 listGroups >+ >+[% ItemGroups.listGroups %] >+ >+returns all item groups >+ >+=cut >+ >+sub listGroups { >+ my ( $self, $biblionumber ) = @_; >+ return Koha::Biblio::ItemGroups->search( >+ { biblio_id => $biblionumber }, >+ { order_by => 'display_order' }, >+ ); >+} >+ >+1; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >index 88630069da2..010a38dce9f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -9,6 +9,7 @@ > [% USE Frameworks %] > [% USE Price %] > [% USE TablesSettings %] >+[% USE ItemGroups %] > [% PROCESS 'i18n.inc' %] > [% SET CoverImagePlugins = KohaPlugins.get_plugins_intranet_cover_images %] > >@@ -1248,7 +1249,7 @@ > <p> > <label for="item_group" class="required">Item group: </label> > <select name="item_group" id="item-group-add-form-select"> >- [% FOREACH ig IN biblio.item_groups %] >+ [% FOREACH ig IN ItemGroups.listGroups(biblionumber) %] > <option value="[% ig.id | html %]">[% ig.description | html %]</option> > [% END %] > </select> >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 34234
:
158148
|
158294
|
158328
|
158329
|
160442
|
160542
|
160543
|
160992
|
161019
|
161760