Bugzilla – Attachment 166883 Details for
Bug 36498
Allow ability to set display order when adding an item group from item editor
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36498: Add ability to set item group display order from additem.tt
Bug-36498-Add-ability-to-set-item-group-display-or.patch (text/plain), 6.40 KB, created by
Kyle M Hall (khall)
on 2024-05-17 10:34:18 UTC
(
hide
)
Description:
Bug 36498: Add ability to set item group display order from additem.tt
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2024-05-17 10:34:18 UTC
Size:
6.40 KB
patch
obsolete
>From 8c533fbb60518b129caf5a19b07dd90beb5855ce Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Tue, 2 Apr 2024 22:27:45 +0000 >Subject: [PATCH] Bug 36498: Add ability to set item group display order from > additem.tt > >To test: >1. Apply patch, restart_all >2. System preferences -> EnableItemGroups, set to 'Enable'. >3. Find a record and create at least 1 item group. >4. Go to Add item >5. Scroll to the bottom and look for 'Options' underneath 'Add to item group' >6. In the dropdown select 'Create new item group' >7. There should be fields for 'Name' and 'Display order'. >8. Make sure you can add a new item group with and without a display order set. If no display order is set it should default to 0. >9. Try to add a non numerical display order, you should not be able to. > >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > cataloguing/additem.pl | 8 ++-- > .../prog/en/modules/cataloguing/additem.tt | 48 +++++++++++-------- > 2 files changed, 33 insertions(+), 23 deletions(-) > >diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl >index b930565ce4c..eb0d8d2b1cc 100755 >--- a/cataloguing/additem.pl >+++ b/cataloguing/additem.pl >@@ -54,7 +54,7 @@ use URI::Escape qw( uri_escape_utf8 ); > our $dbh = C4::Context->dbh; > > sub add_item_to_item_group { >- my ( $biblionumber, $itemnumber, $item_group, $item_group_description ) = @_; >+ my ( $biblionumber, $itemnumber, $item_group, $item_group_description, $display_order ) = @_; > > return unless $item_group; > >@@ -64,6 +64,7 @@ sub add_item_to_item_group { > { > biblio_id => $biblionumber, > description => $item_group_description, >+ display_order => $display_order, > } > )->store(); > >@@ -136,6 +137,7 @@ my $fa_stickyduedate = $input->param('stickyduedate'); > my $fa_duedatespec = $input->param('duedatespec'); > my $item_group = $input->param('item_group'); > my $item_group_description = $input->param('item_group_description'); >+my $display_order = $input->param('item_group_display_order'); > > our $frameworkcode = &GetFrameworkCode($biblionumber); > >@@ -332,7 +334,7 @@ if ($op eq "cud-additem") { > } > unless ( @errors ) { > $item->store->discard_changes; >- add_item_to_item_group( $item->biblionumber, $item->itemnumber, $item_group, $item_group_description ); >+ add_item_to_item_group( $item->biblionumber, $item->itemnumber, $item_group, $item_group_description, $display_order ); > > # This is a bit tricky : if there is a cookie for the last created item and > # we just added an item, the cookie value is not correct yet (it will be updated >@@ -445,7 +447,7 @@ if ($op eq "cud-additem") { > $current_item = $current_item->unblessed; > add_item_to_item_group( > $item->biblionumber, $item->itemnumber, $item_group, >- $item_group_description >+ $item_group_description, $display_order > ); > > # We count the item only if it was really added >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >index 87756e48197..9cc33673303 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >@@ -266,26 +266,34 @@ > [% FOREACH ig IN item_groups %] > <input type="hidden" id="item-group-[% ig.id | html %]" value="[% ig.description | html %]" /> > [% END %] >- <p> >- <label for="select_item_group">Options: </label> >- <select name="item_group" id="item-group-add-or-create-form-select"> >- <optgroup label="Use existing item group"> >- [% FOREACH ig IN biblio.item_groups.search({}, {order_by => 'display_order'}) %] >- <option value="[% ig.id | html %]">[% ig.description | html %]</option> >- [% END %] >- </optgroup> >- <optgroup label="Other options"> >- <option id="item-group-add-or-create-form-no-add" value="">Do not add to item group</option> >- <option value="create">Create new item group</option> >- </optgroup> >- </select> >- </p> >- >- <p id="item-group-add-or-create-form-description-block"> >- <label for="item_group_description" class="required">Name: </label> >- <input name="item_group_description" id="item-group-add-or-create-form-description" type="text" size="30" class="required" /> >- <span class="required">Required</span> >- </p> >+ <ol> >+ <li> >+ <label for="select_item_group">Options: </label> >+ <select name="item_group" id="item-group-add-or-create-form-select"> >+ <optgroup label="Use existing item group"> >+ [% FOREACH ig IN biblio.item_groups.search({}, {order_by => 'display_order'}) %] >+ <option value="[% ig.id | html %]">[% ig.description | html %]</option> >+ [% END %] >+ </optgroup> >+ <optgroup label="Other options"> >+ <option id="item-group-add-or-create-form-no-add" value="">Do not add to item group</option> >+ <option value="create">Create new item group</option> >+ </optgroup> >+ </select> >+ </li> >+ <div id="item-group-add-or-create-form-description-block"> >+ <li> >+ <label for="item_group_description" class="required">Name: </label> >+ <input name="item_group_description" id="item-group-add-or-create-form-description" type="text" size="30" class="required" /> >+ <span class="required">Required</span> >+ </li> >+ <li> >+ <label for="item_group_display_order">Display order: </label> >+ <input name="item_group_display_order" id="item_group_display_order" type="text" pattern="\d*" size="30" /> >+ <div class="hint">Display order must be numerical</div> >+ </li> >+ </div> >+ </ol> > </fieldset> > [% END %] > >-- >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 36498
:
164303
|
164357
| 166883 |
166884