Bugzilla – Attachment 164303 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.29 KB, created by
Lucas Gass (lukeg)
on 2024-04-02 22:40:19 UTC
(
hide
)
Description:
Bug 36498: Add ability to set item group display order from additem.tt
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2024-04-02 22:40:19 UTC
Size:
6.29 KB
patch
obsolete
>From dd7c34f7cdf0784e865d8b0c6f0b3aa9e0d54fda 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. >--- > 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 b930565ce4..eb0d8d2b1c 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 87756e4819..9cc3367330 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