Bugzilla – Attachment 72442 Details for
Bug 19469
Add ability to split view of holds view on record by pickup library and/or itemtype
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19469: Add ability to split view of holds view on record by pickup library and/or itemtype
Bug-19469-Add-ability-to-split-view-of-holds-view-.patch (text/plain), 41.81 KB, created by
Tomás Cohen Arazi (tcohen)
on 2018-03-05 19:25:27 UTC
(
hide
)
Description:
Bug 19469: Add ability to split view of holds view on record by pickup library and/or itemtype
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2018-03-05 19:25:27 UTC
Size:
41.81 KB
patch
obsolete
>From 5f48bfca0f665f05b85649381e22527b8d432335 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Sat, 30 Sep 2017 08:02:57 -0400 >Subject: [PATCH] Bug 19469: Add ability to split view of holds view on record > by pickup library and/or itemtype >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >It is possible to set up circulation rules to limit trapping of holds by pickup library and itemtype. >To make it easier to understand which holds will be trapped in a given circumstance, >it would be nice if we could optionally group holds by pickup library and/or itemtype. > >Test Plan: >1) Apply this patch set >2) Run updatedatabase.pl >3) Enable AllowHoldItemTypeSelection >4) Pick a record and create holds with various pickup libraries and itemtype combinations >5) Enable HoldsSplitQueueNumbering >6) Try the different combinations of HoldsSplitQueue >7) Ensure the hold "arrows" move the items correctly > * Up and down arrows should move hold above or below the adjacent hold within a hold fieldset > * Top and borrom arrows should move hold to the top or bottom within a hold fieldset > >Sponsored-by: Stockholm University Library > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> > >Followed test plan, patch worked as described. Also passed QA test tool > >Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz> >Signed-off-by: Andreas Hedström Mace <andreas.hedstrom.mace@sub.su.se> >Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com> >--- > C4/Reserves.pm | 25 +- > .../data/mysql/atomicupdate/split_holds_queue.sql | 3 + > installer/data/mysql/sysprefs.sql | 1 + > koha-tmpl/intranet-tmpl/prog/css/staff-global.css | 8 + > .../intranet-tmpl/prog/en/includes/holds_table.inc | 200 ++++++++++++++++ > .../en/modules/admin/preferences/circulation.pref | 14 ++ > .../prog/en/modules/reserve/request.tt | 257 +++++++-------------- > reserve/request.pl | 10 +- > t/db_dependent/Holds.t | 8 +- > 9 files changed, 333 insertions(+), 193 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/split_holds_queue.sql > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index 73b86b606c..60355c3d96 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -1177,7 +1177,7 @@ sub _get_itype { > > =head2 AlterPriority > >- AlterPriority( $where, $reserve_id ); >+ AlterPriority( $where, $reserve_id, $prev_priority, $next_priority, $first_priority, $last_priority ); > > This function changes a reserve's priority up, down, to the top, or to the bottom. > Input: $where is 'up', 'down', 'top' or 'bottom'. Biblionumber, Date reserve was placed >@@ -1185,7 +1185,7 @@ Input: $where is 'up', 'down', 'top' or 'bottom'. Biblionumber, Date reserve was > =cut > > sub AlterPriority { >- my ( $where, $reserve_id ) = @_; >+ my ( $where, $reserve_id, $prev_priority, $next_priority, $first_priority, $last_priority ) = @_; > > my $hold = Koha::Holds->find( $reserve_id ); > return unless $hold; >@@ -1195,21 +1195,18 @@ sub AlterPriority { > return; > } > >- if ( $where eq 'up' || $where eq 'down' ) { >- >- my $priority = $hold->priority; >- $priority = $where eq 'up' ? $priority - 1 : $priority + 1; >- _FixPriority({ reserve_id => $reserve_id, rank => $priority }) >- >+ if ( $where eq 'up' ) { >+ return unless $prev_priority; >+ _FixPriority({ reserve_id => $reserve_id, rank => $prev_priority }) >+ } elsif ( $where eq 'down' ) { >+ return unless $next_priority; >+ _FixPriority({ reserve_id => $reserve_id, rank => $next_priority }) > } elsif ( $where eq 'top' ) { >- >- _FixPriority({ reserve_id => $reserve_id, rank => '1' }) >- >+ _FixPriority({ reserve_id => $reserve_id, rank => $first_priority }) > } elsif ( $where eq 'bottom' ) { >- >- _FixPriority({ reserve_id => $reserve_id, rank => '999999' }); >- >+ _FixPriority({ reserve_id => $reserve_id, rank => $last_priority }); > } >+ > # FIXME Should return the new priority > } > >diff --git a/installer/data/mysql/atomicupdate/split_holds_queue.sql b/installer/data/mysql/atomicupdate/split_holds_queue.sql >new file mode 100644 >index 0000000000..f612dd44d1 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/split_holds_queue.sql >@@ -0,0 +1,3 @@ >+INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES >+('HoldsSplitQueue','nothing','nothing|branch|itemtype|branch_itemtype','In the staff client, split the holds view by the given criteria','Choice'), >+('HoldsSplitQueueNumbering', 'actual', 'actual|virtual', 'If the holds queue is split, decide if the acual priorities should be displayed', 'Choice'); >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 76bb2cc03a..95881e1a53 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -192,6 +192,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('HoldFeeMode','not_always','any_time_is_placed|not_always|any_time_is_collected','Set the hold fee mode','Choice'), > ('HoldsLog','0',NULL,'If ON, log create/cancel/suspend/resume actions on holds.','YesNo'), > ('HoldsQueueSkipClosed', '0', NULL, 'If enabled, any libraries that are closed when the holds queue is built will be ignored for the purpose of filling holds.', 'YesNo'), >+('HoldsSplitQueue','nothing','nothing|branch|itemtype|branch_itemtype','In the staff client, split the holds view by the given criteria','Choice'), > ('HoldsToPullStartDate','2',NULL,'Set the default start date for the Holds to pull list to this many days ago','Integer'), > ('HomeOrHoldingBranch','holdingbranch','holdingbranch|homebranch','Used by Circulation to determine which branch of an item to check with independent branches on, and by search to determine which branch to choose for availability ','Choice'), > ('HouseboundModule',0,'','If ON, enable housebound module functionality.','YesNo'), >diff --git a/koha-tmpl/intranet-tmpl/prog/css/staff-global.css b/koha-tmpl/intranet-tmpl/prog/css/staff-global.css >index 3ab9d7e1ec..7632485121 100644 >--- a/koha-tmpl/intranet-tmpl/prog/css/staff-global.css >+++ b/koha-tmpl/intranet-tmpl/prog/css/staff-global.css >@@ -368,6 +368,14 @@ fieldset { > border-radius:5px; > } > >+fieldset.standard { >+ background-color:#f4f8f9 !important; >+} >+ >+fieldset.contrast { >+ background-color:#F3F3F3 !important; >+} >+ > fieldset.lastchecked { > margin-bottom : 0; > border-bottom-width: 0; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc >new file mode 100644 >index 0000000000..38e14e45b0 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc >@@ -0,0 +1,200 @@ >+<table> >+ <tr> >+ [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %] >+ <th>Priority</th> >+ <th> </th> >+ [% ELSE %] >+ <th>Delete?</th> >+ [% END %] >+ <th>Patron</th> >+ <th>Notes</th> >+ <th>Date</th> >+ <th>Expiration</th> >+ <th>Pickup library</th> >+ <th>Details</th> >+ [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %] >+ <th><img src="[% interface %]/[% theme %]/img/go-bottom.png" alt="Toggle set to lowest priority" /></th> >+ [% END %] >+ <th> </th> >+ [% IF SuspendHoldsIntranet %]<th> </th><!-- Suspend Holds Column Header -->[% END %] >+ </tr> >+ >+ [% FOREACH hold IN holds %] >+ <tr> >+ <td> >+ <input type="hidden" name="reserve_id" value="[% hold.reserve_id %]" /> >+ <input type="hidden" name="borrowernumber" value="[% hold.borrowernumber %]" /> >+ <input type="hidden" name="biblionumber" value="[% hold.biblionumber %]" /> >+ <select name="rank-request"> >+ [% IF ( hold.found ) %] >+ [% IF ( hold.intransit ) %] >+ <option value="T" selected="selected">In transit</option> >+ [% ELSE %] >+ <option value="W" selected="selected">Waiting</option> >+ [% END %] >+ [% END %] >+ >+ [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %] >+ [% IF Koha.Preference('HoldsSplitQueueNumbering') == 'actual' %] >+ [% FOREACH optionloo IN hold.optionloop %] >+ [% IF ( optionloo.selected ) %] >+ <option value="[% optionloo.num %]" selected="selected">[% optionloo.num %]</option> >+ [% ELSE %] >+ <option value="[% optionloo.num %]">[% optionloo.num %]</option> >+ [% END %] >+ [% END %] >+ [% ELSE %] >+ [% FOREACH h IN holds %] >+ [% IF ( h.priority == hold.priority ) %] >+ <option value="[% h.priority %]" selected="selected">[% loop.index + 1 %]</option> >+ [% ELSE %] >+ <option value="[% h.priority %]">[% loop.index + 1 %]</option> >+ [% END %] >+ [% END %] >+ [% END %] >+ [% ELSIF !hold.found %] >+ <option value="[% hold.priority %]" selected="selected">[% hold.priority %]</option> >+ [% END %] >+ >+ <option value="del">del</option> >+ </select> >+ </td> >+ >+ [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %] >+ [% SET first_priority = holds.first.priority %] >+ [% SET last_priority = holds.last.priority %] >+ [% SET prev_priority = loop.prev.priority %] >+ [% SET next_priority = loop.next.priority %] >+ [% holds.index %] >+ >+ <td style="white-space:nowrap;"> >+ <a title="Move hold up" href="request.pl?action=move&where=up&first_priority=[% first_priority %]&last_priority=[% last_priority %]&prev_priority=[% prev_priority %]&next_priority=[% next_priority %]&borrowernumber=[% hold.borrowernumber %]&biblionumber=[% hold.biblionumber %]&reserve_id=[% hold.reserve_id %]&date=[% hold.date %]"> >+ <img src="[% interface %]/[% theme %]/img/go-up.png" alt="Go up" /> >+ </a> >+ >+ <a title="Move hold to top" href="request.pl?action=move&where=top&first_priority=[% first_priority %]&last_priority=[% last_priority %]&prev_priority=[% prev_priority %]&next_priority=[% next_priority %]&borrowernumber=[% hold.borrowernumber %]&biblionumber=[% hold.biblionumber %]&reserve_id=[% hold.reserve_id %]&date=[% hold.date %]"> >+ <img src="[% interface %]/[% theme %]/img/go-top.png" alt="Go top" /> >+ </a> >+ >+ <a title="Move hold to bottom" href="request.pl?action=move&where=bottom&first_priority=[% first_priority %]&last_priority=[% last_priority %]&prev_priority=[% prev_priority %]&next_priority=[% next_priority %]&borrowernumber=[% hold.borrowernumber %]&biblionumber=[% hold.biblionumber %]&reserve_id=[% hold.reserve_id %]&date=[% hold.date %]"> >+ <img src="[% interface %]/[% theme %]/img/go-bottom.png" alt="Go bottom" /> >+ </a> >+ >+ <a title="Move hold down" href="request.pl?action=move&where=down&first_priority=[% first_priority %]&last_priority=[% last_priority %]&prev_priority=[% prev_priority %]&next_priority=[% next_priority %]&borrowernumber=[% hold.borrowernumber %]&biblionumber=[% hold.biblionumber %]&reserve_id=[% hold.reserve_id %]&date=[% hold.date %]"> >+ <img src="[% interface %]/[% theme %]/img/go-down.png" alt="Go down" /> >+ </a> >+ </td> >+ [% END %] >+ >+ <td> >+ <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% hold.borrowernumber %]" > >+ [% IF ( hold.hidename ) %] >+ [% hold.cardnumber (hold.borrowernumber) %] >+ [% ELSE %] >+ [% hold.firstname %] [% hold.surname %] >+ [% END %] >+ </a> >+ </td> >+ >+ <td>[% hold.notes %]</td> >+ <td>[% hold.date %]</td> >+ <td>[% hold.expirationdate %]</td> >+ >+ <td> >+ [% IF ( hold.found ) %] >+ [% IF ( hold.atdestination ) %] >+ [% IF ( hold.found ) %] >+ Item waiting at <b> [% hold.wbrname %]</b> <input type="hidden" name="pickup" value="[% hold.wbrcode %]" /> since [% hold.waiting_date | $KohaDates %] >+ [% ELSE %] >+ Waiting to be pulled <input type="hidden" name="pickup" value="[% hold.wbrcode %]" /> >+ [% END %] >+ [% ELSE %] >+ Item being transferred to <b> [% hold.wbrname %]</b> <input type="hidden" name="pickup" value="[% hold.wbrcode %]" /> >+ [% END %] >+ [% ELSE %] >+ [% IF Koha.Preference('IndependentBranches') && Branches.all().size == 1 %] >+ [% Branches.GetName(hold.branchcode) %] <input type="hidden" name="pickup" value="[% hold.branchcode %]" /> >+ [% ELSE %] >+ <select name="pickup"> >+ [% PROCESS options_for_libraries libraries => Branches.all( selected => hold.branchcode ) %] >+ </select> >+ [% END %] >+ [% END %] >+ </td> >+ >+ <td> >+ [% IF ( hold.found ) %] >+ <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% hold.biblionumber %]"> >+ [% IF ( hold.barcodenumber ) %] >+ [% hold.barcodenumber %] >+ <input type="hidden" name="itemnumber" value="[% hold.itemnumber %]" /> >+ [% ELSE %] >+ No barcode >+ [% END %] >+ </a> >+ [% ELSE %] >+ [% IF ( hold.item_level_hold ) %] >+ <i> >+ Only item >+ <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% hold.biblionumber %]"> >+ [% IF ( hold.barcodenumber ) %] >+ [% hold.barcodenumber %] >+ <input type="hidden" name="itemnumber" value="[% hold.itemnumber %]" /> >+ [% ELSE %] >+ No barcode >+ [% END %] >+ </a> >+ </i> >+ [% ELSE %] >+ [% IF hold.itemtype %] >+ <i>Next available [% ItemTypes.GetDescription( hold.itemtype ) %] item</i> >+ [% ELSE %] >+ <i>Next available</i> >+ [% END %] >+ >+ <input type="hidden" name="itemnumber" value="" /> >+ [% END %] >+ [% END %] >+ </td> >+ >+ [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %] >+ <td> >+ <a title="Toggle lowest priority" href="request.pl?action=setLowestPriority&borrowernumber=[% hold.borrowernumber %]&biblionumber=[% hold.biblionumber %]&reserve_id=[% hold.reserve_id %]&date=[% hold.date %]"> >+ [% IF ( hold.lowestPriority ) %] >+ <img src="[% interface %]/[% theme %]/img/go-bottom.png" alt="Unset lowest priority" /> >+ [% ELSE %] >+ <img src="[% interface %]/[% theme %]/img/go-down.png" alt="Set to lowest priority" /> >+ [% END %] >+ </a> >+ </td> >+ [% END %] >+ >+ <td> >+ <a class="cancel-hold" title="Cancel hold" href="request.pl?action=cancel&borrowernumber=[% hold.borrowernumber %]&biblionumber=[% hold.biblionumber %]&reserve_id=[% hold.reserve_id %]&date=[% hold.date %]"> >+ <img src="[% interface %]/[% theme %]/img/x.png" alt="Cancel" /> >+ </a> >+ </td> >+ >+ [% IF SuspendHoldsIntranet %] >+ <td> >+ [% UNLESS ( hold.found ) %] >+ <input type="button" value="[% IF ( hold.suspend ) %]Unsuspend[% ELSE %]Suspend[% END %]" onclick="window.location.href='request.pl?action=toggleSuspend&reserve_id=[% hold.reserve_id %]&borrowernumber=[% hold.borrowernumber %]&biblionumber=[% hold.biblionumber %]&date=[% hold.date %]&suspend_until=' + $('#suspend_until_[% hold.reserve_id %]').val()" /> >+ >+ [% IF AutoResumeSuspendedHolds %] >+ <label for="suspend_until_[% hold.reserve_id %]">[% IF ( hold.suspend ) %] on [% ELSE %] until [% END %]</label> >+ <input name="suspend_until" id="suspend_until_[% hold.reserve_id %]" size="10" value="[% hold.suspend_until | $KohaDates %]" class="datepicker suspend_until_datepicker" /> >+ <a href='#' onclick="document.getElementById('suspend_until_[% hold.reserve_id %]').value='';">Clear date</a> >+ [% ELSE %] >+ <input type="hidden" name="suspend_until" id="suspend_until_[% hold.reserve_id %]" value=""/> >+ [% END %] >+ >+ [% ELSE %] >+ <input type="hidden" name="suspend_until" value="" /> >+ [% END %] >+ </td> >+ [% END # IF SuspendHoldsIntranet %] >+ >+ </tr> >+ >+ [% END %] >+</table> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >index 178a048e91..4b925eb7e5 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >@@ -506,6 +506,20 @@ Circulation: > no: "Don't cumulate" > - the restriction periods. > Holds Policy: >+ - >+ - In the staff client, split the holds queue into separate tables by >+ - pref: HoldsSplitQueue >+ choices: >+ nothing: nothing >+ branch: "pickup library" >+ itemtype: "hold itemtype" >+ branch_itemtype: "pickup library & itemtype" >+ - >+ - If the holds queue is split, show librarians >+ - pref: HoldsSplitQueueNumbering >+ choices: >+ actual: "the actual priority, which may be out of order" >+ virtual: "'virtual' priorities, where each group is numbered separately" > - > - pref: AllowHoldItemTypeSelection > choices: >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >index ab6807a74b..b82cdbb4df 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -1,3 +1,4 @@ >+[% USE Dumper %] > [% USE Koha %] > [% USE KohaDates %] > [% USE Branches %] >@@ -721,194 +722,106 @@ function checkMultiHold() { > > [% FOREACH biblioloo IN biblioloop %] > [% IF ( biblioloo.reserveloop ) %] >- <table> >- [% IF ( multi_hold ) %] >- <caption><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber %]">[% biblioloo.title |html %]</a></caption> >- [% END %] >- >- <tr> >- [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %] >- <th>Priority</th> >- <th> </th> >- [% ELSE %] >- <th>Delete?</th> >- [% END %] >- <th>Patron</th> >- <th>Notes</th> >- <th>Date</th> >- <th>Expiration</th> >- <th>Pickup library</th> >- <th>Details</th> >- [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %] >- <th><img src="[% interface %]/[% theme %]/img/go-bottom.png" alt="Toggle set to lowest priority" /></th> >- [% END %] >- <th> </th> >- [% IF SuspendHoldsIntranet %]<th> </th><!-- Suspend Holds Column Header -->[% END %] >- </tr> >- >- [% FOREACH reserveloo IN biblioloo.reserveloop %] >- <tr> >- <td> >- <input type="hidden" name="reserve_id" value="[% reserveloo.reserve_id %]" /> >- <input type="hidden" name="borrowernumber" value="[% reserveloo.borrowernumber %]" /> >- <input type="hidden" name="biblionumber" value="[% reserveloo.biblionumber %]" /> >- <select name="rank-request"> >- [% IF ( reserveloo.found ) %] >- [% IF ( reserveloo.intransit ) %] >- <option value="T" selected="selected">In transit</option> >- [% ELSE %] >- <option value="W" selected="selected">Waiting</option> >- [% END %] >- [% END %] >- >- [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %] >- [% FOREACH optionloo IN reserveloo.optionloop %] >- [% IF ( optionloo.selected ) %] >- <option value="[% optionloo.num %]" selected="selected">[% optionloo.num %]</option> >- [% ELSE %] >- <option value="[% optionloo.num %]">[% optionloo.num %]</option> >- [% END %] >- [% END %] >- [% ELSIF !reserveloo.found %] >- <option value="[% reserveloo.priority %]" selected="selected">[% reserveloo.priority %]</option> >- [% END %] >+ [% IF ( multi_hold ) %] >+ <h3> >+ <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.biblionumber %]"> >+ [% biblioloo.title | html %] >+ </a> >+ </h3> >+ [% END %] > >- <option value="del">del</option> >- </select> >- </td> >+ [% IF Koha.Preference('HoldsSplitQueue') == 'branch' %] >+ [% SET branchcodes = [] %] > >- [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %] >- <td style="white-space:nowrap;"> >- <a title="Move hold up" href="request.pl?action=move&where=up&borrowernumber=[% reserveloo.borrowernumber %]&biblionumber=[% reserveloo.biblionumber %]&reserve_id=[% reserveloo.reserve_id %]&date=[% reserveloo.date %]"> >- <img src="[% interface %]/[% theme %]/img/go-up.png" alt="Go up" /> >- </a> >+ [% FOREACH h IN biblioloo.reserveloop %] >+ [% branchcodes.push( h.branchcode ) %] >+ [% END %] >+ [% branchcodes = branchcodes.unique %] > >- <a title="Move hold to top" href="request.pl?action=move&where=top&borrowernumber=[% reserveloo.borrowernumber %]&biblionumber=[% reserveloo.biblionumber %]&reserve_id=[% reserveloo.reserve_id %]&date=[% reserveloo.date %]"> >- <img src="[% interface %]/[% theme %]/img/go-top.png" alt="Go top" /> >- </a> >+ [% FOREACH b IN branchcodes.sort %] >+ [% SET holds_by_branch = [] %] >+ [% FOREACH h IN biblioloo.reserveloop %] >+ [% IF h.branchcode == b %] >+ [% holds_by_branch.push( h ) %] >+ [% END %] >+ [% END %] >+ <fieldset> >+ <legend>[% Branches.GetName( b ) %]</legend> >+ [% INCLUDE holds_table.inc holds=holds_by_branch %] >+ </fieldset> >+ [% END %] >+ [% ELSIF Koha.Preference('HoldsSplitQueue') == 'itemtype' %] >+ [% SET itemtypes = [] %] > >- <a title="Move hold to bottom" href="request.pl?action=move&where=bottom&borrowernumber=[% reserveloo.borrowernumber %]&biblionumber=[% reserveloo.biblionumber %]&reserve_id=[% reserveloo.reserve_id %]&date=[% reserveloo.date %]"> >- <img src="[% interface %]/[% theme %]/img/go-bottom.png" alt="Go bottom" /> >- </a> >+ [% FOREACH h IN biblioloo.reserveloop %] >+ [% itemtypes.push( h.itemtype ) %] >+ [% END %] >+ [% itemtypes = itemtypes.unique %] > >- <a title="Move hold down" href="request.pl?action=move&where=down&borrowernumber=[% reserveloo.borrowernumber %]&biblionumber=[% reserveloo.biblionumber %]&reserve_id=[% reserveloo.reserve_id %]&date=[% reserveloo.date %]"> >- <img src="[% interface %]/[% theme %]/img/go-down.png" alt="Go down" /> >- </a> >- </td> >+ [% FOREACH i IN itemtypes.sort %] >+ [% SET holds_by_itemtype = [] %] >+ [% FOREACH h IN biblioloo.reserveloop %] >+ [% IF h.itemtype == i %] >+ [% holds_by_itemtype.push( h ) %] > [% END %] >+ [% END %] > >- <td> >- <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% reserveloo.borrowernumber %]" > >- [% IF ( reserveloo.hidename ) %] >- [% reserveloo.cardnumber (reserveloo.borrowernumber) %] >- [% ELSE %] >- [% reserveloo.firstname %] [% reserveloo.surname %] >- [% END %] >- </a> >- </td> >- >- <td>[% reserveloo.notes %]</td> >- <td>[% reserveloo.date %]</td> >- <td>[% reserveloo.expirationdate %]</td> >- >- <td> >- [% IF ( reserveloo.found ) %] >- [% IF ( reserveloo.atdestination ) %] >- [% IF ( reserveloo.found ) %] >- Item waiting at <b> [% reserveloo.wbrname %]</b> <input type="hidden" name="pickup" value="[% reserveloo.wbrcode %]" /> since [% reserveloo.waiting_date | $KohaDates %] >- [% ELSE %] >- Waiting to be pulled <input type="hidden" name="pickup" value="[% reserveloo.wbrcode %]" /> >- [% END %] >- [% ELSE %] >- Item being transferred to <b> [% reserveloo.wbrname %]</b> <input type="hidden" name="pickup" value="[% reserveloo.wbrcode %]" /> >- [% END %] >- [% ELSE %] >- [% IF Koha.Preference('IndependentBranches') && Branches.all().size == 1 %] >- [% Branches.GetName(reserveloo.branchcode) %] <input type="hidden" name="pickup" value="[% reserveloo.branchcode %]" /> >- [% ELSE %] >- <select name="pickup"> >- [% PROCESS options_for_libraries libraries => Branches.all( selected => reserveloo.branchcode ) %] >- </select> >- [% END %] >- [% END %] >- </td> >- >- <td> >- [% IF ( reserveloo.found ) %] >- <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% reserveloo.biblionumber %]"> >- [% IF ( reserveloo.barcodenumber ) %] >- [% reserveloo.barcodenumber %] >- <input type="hidden" name="itemnumber" value="[% reserveloo.itemnumber %]" /> >- [% ELSE %] >- No barcode >- [% END %] >- </a> >- [% ELSE %] >- [% IF ( reserveloo.item_level_hold ) %] >- <i> >- Only item >- <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% reserveloo.biblionumber %]"> >- [% IF ( reserveloo.barcodenumber ) %] >- [% reserveloo.barcodenumber %] >- <input type="hidden" name="itemnumber" value="[% reserveloo.itemnumber %]" /> >- [% ELSE %] >- No barcode >- [% END %] >- </a> >- </i> >- [% ELSE %] >- [% IF reserveloo.itemtype %] >- <i>Next available [% ItemTypes.GetDescription( reserveloo.itemtype ) %] item</i> >- [% ELSE %] >- <i>Next available</i> >- [% END %] >+ <fieldset> >+ [% IF i %] >+ <legend>[% ItemTypes.GetDescription( i ) %]</legend> >+ [% ELSE %] >+ <legend>Any item type</legend> >+ [% END %] >+ [% INCLUDE holds_table.inc holds=holds_by_itemtype %] >+ </fieldset> >+ [% END %] >+ [% ELSIF Koha.Preference('HoldsSplitQueue') == 'branch_itemtype' %] >+ [% SET branchcodes = [] %] > >- <input type="hidden" name="itemnumber" value="" /> >- [% END %] >+ [% FOREACH h IN biblioloo.reserveloop %] >+ [% branchcodes.push( h.branchcode ) %] >+ [% END %] >+ [% branchcodes = branchcodes.unique %] >+ >+ [% FOREACH b IN branchcodes.sort %] >+ <fieldset class="contrast"> >+ <legend>[% Branches.GetName( b ) %]</legend> >+ [% SET holds_by_branch = [] %] >+ [% FOREACH h IN biblioloo.reserveloop %] >+ [% IF h.branchcode == b %] >+ [% holds_by_branch.push( h ) %] > [% END %] >- </td> >- >- [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %] >- <td> >- <a title="Toggle lowest priority" href="request.pl?action=setLowestPriority&borrowernumber=[% reserveloo.borrowernumber %]&biblionumber=[% reserveloo.biblionumber %]&reserve_id=[% reserveloo.reserve_id %]&date=[% reserveloo.date %]"> >- [% IF ( reserveloo.lowestPriority ) %] >- <img src="[% interface %]/[% theme %]/img/go-bottom.png" alt="Unset lowest priority" /> >- [% ELSE %] >- <img src="[% interface %]/[% theme %]/img/go-down.png" alt="Set to lowest priority" /> >- [% END %] >- </a> >- </td> > [% END %] > >- <td> >- <a class="cancel-hold" title="Cancel hold" href="request.pl?action=cancel&borrowernumber=[% reserveloo.borrowernumber %]&biblionumber=[% reserveloo.biblionumber %]&reserve_id=[% reserveloo.reserve_id %]&date=[% reserveloo.date %]"> >- <img src="[% interface %]/[% theme %]/img/x.png" alt="Cancel" /> >- </a> >- </td> >- >- [% IF SuspendHoldsIntranet %] >- <td> >- [% UNLESS ( reserveloo.found ) %] >- <input type="button" value="[% IF ( reserveloo.suspend ) %]Unsuspend[% ELSE %]Suspend[% END %]" onclick="window.location.href='request.pl?action=toggleSuspend&reserve_id=[% reserveloo.reserve_id %]&borrowernumber=[% reserveloo.borrowernumber %]&biblionumber=[% reserveloo.biblionumber %]&date=[% reserveloo.date %]&suspend_until=' + $('#suspend_until_[% reserveloo.reserve_id %]').val()" /> >- >- [% IF AutoResumeSuspendedHolds %] >- <label for="suspend_until_[% reserveloo.reserve_id %]">[% IF ( reserveloo.suspend ) %] on [% ELSE %] until [% END %]</label> >- <input name="suspend_until" id="suspend_until_[% reserveloo.reserve_id %]" size="10" value="[% reserveloo.suspend_until | $KohaDates %]" class="datepicker suspend_until_datepicker" /> >- <a href='#' onclick="document.getElementById('suspend_until_[% reserveloo.reserve_id %]').value='';">Clear date</a> >- [% ELSE %] >- <input type="hidden" name="suspend_until" id="suspend_until_[% reserveloo.reserve_id %]" value=""/> >- [% END %] >+ [% SET itemtypes = [] %] >+ [% FOREACH h IN holds_by_branch %] >+ [% itemtypes.push( h.itemtype ) %] >+ [% END %] >+ [% itemtypes = itemtypes.unique %] > >+ [% FOREACH i IN itemtypes.sort %] >+ <fieldset class="standard"> >+ [% IF i %] >+ <legend>[% ItemTypes.GetDescription( i ) %]</legend> > [% ELSE %] >- <input type="hidden" name="suspend_until" value="" /> >+ <legend>Any item type</legend> > [% END %] >- </td> >- [% END # IF SuspendHoldsIntranet %] > >- </tr> >+ [% SET holds_by_itemtype = [] %] >+ [% FOREACH h IN holds_by_branch %] >+ [% IF h.itemtype == i %] >+ [% holds_by_itemtype.push( h ) %] >+ [% END %] >+ [% END %] >+ [% INCLUDE holds_table.inc holds=holds_by_itemtype %] >+ </fieldset> >+ [% END %] >+ </fieldset> >+ [% END %] >+ [% ELSE %] >+ [% INCLUDE holds_table.inc holds=biblioloo.reserveloop %] >+ [% END %] > >- [% END %] <!-- existing reserveloop --> >- </table> > [% END %]<!-- /reserveloop --> > [% END %]<!-- /biblioloop --> > >diff --git a/reserve/request.pl b/reserve/request.pl >index d94a8ab6af..d225e26f09 100755 >--- a/reserve/request.pl >+++ b/reserve/request.pl >@@ -87,9 +87,13 @@ my $action = $input->param('action'); > $action ||= q{}; > > if ( $action eq 'move' ) { >- my $where = $input->param('where'); >- my $reserve_id = $input->param('reserve_id'); >- AlterPriority( $where, $reserve_id ); >+ my $where = $input->param('where'); >+ my $reserve_id = $input->param('reserve_id'); >+ my $prev_priority = $input->param('prev_priority'); >+ my $next_priority = $input->param('next_priority'); >+ my $first_priority = $input->param('first_priority'); >+ my $last_priority = $input->param('last_priority'); >+ AlterPriority( $where, $reserve_id, $prev_priority, $next_priority, $first_priority, $last_priority ); > } elsif ( $action eq 'cancel' ) { > my $reserve_id = $input->param('reserve_id'); > my $hold = Koha::Holds->find( $reserve_id ); >diff --git a/t/db_dependent/Holds.t b/t/db_dependent/Holds.t >index 1e6c234487..e9bf70953c 100755 >--- a/t/db_dependent/Holds.t >+++ b/t/db_dependent/Holds.t >@@ -210,19 +210,19 @@ is( $holds->next->itemnumber, $itemnumber, "Test ModReserveMinusPriority()" ); > > $holds = $biblio->holds; > $hold = $holds->next; >-AlterPriority( 'top', $hold->reserve_id ); >+AlterPriority( 'top', $hold->reserve_id, undef, 2, 1, 6 ); > $hold = Koha::Holds->find( $reserveid ); > is( $hold->priority, '1', "Test AlterPriority(), move to top" ); > >-AlterPriority( 'down', $hold->reserve_id ); >+AlterPriority( 'down', $hold->reserve_id, undef, 2, 1, 6 ); > $hold = Koha::Holds->find( $reserveid ); > is( $hold->priority, '2', "Test AlterPriority(), move down" ); > >-AlterPriority( 'up', $hold->reserve_id ); >+AlterPriority( 'up', $hold->reserve_id, 1, 3, 1, 6 ); > $hold = Koha::Holds->find( $reserveid ); > is( $hold->priority, '1', "Test AlterPriority(), move up" ); > >-AlterPriority( 'bottom', $hold->reserve_id ); >+AlterPriority( 'bottom', $hold->reserve_id, undef, 2, 1, 6 ); > $hold = Koha::Holds->find( $reserveid ); > is( $hold->priority, '6', "Test AlterPriority(), move to bottom" ); > >-- >2.16.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 19469
:
68166
|
68167
|
68168
|
68169
|
68347
|
68348
|
68609
|
72304
|
72305
|
72441
|
72442
|
72443
|
72501
|
74260
|
74328
|
74329
|
74330
|
74331
|
74332
|
74333
|
74334
|
74909
|
78506
|
78507
|
78508
|
78509
|
78510
|
78511
|
78512
|
78513
|
78526
|
78529
|
78707
|
81828
|
81829