Bugzilla – Attachment 125067 Details for
Bug 29049
Holds page shows too many priority options in pulldown
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29049: Simply holds priorty dropdown logic on request.pl
Bug-29049-Simply-holds-priorty-dropdown-logic-on-r.patch (text/plain), 8.86 KB, created by
Andrew Fuerste-Henry
on 2021-09-20 14:21:44 UTC
(
hide
)
Description:
Bug 29049: Simply holds priorty dropdown logic on request.pl
Filename:
MIME Type:
Creator:
Andrew Fuerste-Henry
Created:
2021-09-20 14:21:44 UTC
Size:
8.86 KB
patch
obsolete
>From dfbfbbfa7997702f2c537694f9725650dcc2c6ca Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 17 Sep 2021 13:59:25 +0000 >Subject: [PATCH] Bug 29049: Simply holds priorty dropdown logic on request.pl > >This patch makes a few changes: >1 - If we are not splitting the queue ( HoldsSplitQueue == 'nothing' ) then > there are no changes for 'virtual' vs 'actual' numbering >2 - If we are splitting the queue you cannot use the dropdown, so we do not need to process the options >3 - If the hold is 'found' we do not need to process the options >4 - We can simply use the 'last priority' to build the options, we do not need to process in the script >5 - We can use a block to build the options >6 - Remove a stray holds.index > >To test: > 1 - Place 5 holds on a bib > 2 - 'Find' two of the holds i.e. check them in to set status to 'transit' or 'waiting' > 3 - View the holds page for the biblio > 4 - Inspect the priorty dropdown for the found holds, note they have options for 1-5 but are disabled > 5 - Note the dropdowns for other holds have options 1-5 > 6 - Note options 4&5 in the dropdowns have no effect > 7 - Apply patch > 8 - Inspect the priority dopdowns on the found holds > 9 - Note they only show their found status >10 - Note the other dropdowns only show options 1-3 >11 - Test with other HoldsSplitQueue options and HoldsSplitQueueNumbering >12 - When holds queue is split, no dropdowns should be active and should show only their current priority >13 - When HoldsSplitQueueNumbering is 'virtual' the dropdown should be disabled and correctly count the number of unfound holds in the list > >Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> >--- > .../prog/en/includes/holds_table.inc | 67 ++++++++++--------- > reserve/request.pl | 12 ---- > 2 files changed, 35 insertions(+), 44 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc >index 59f33cd2a0..c0799f245d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc >@@ -25,19 +25,47 @@ > [% SET first_priority = 0 %] > [% SET last_priority = holds.last.priority %] > >+ [% BLOCK priority_dropdown %] >+ [% SET loop_priority = 1 %] >+ [% WHILE loop_priority <= last_priority %] >+ [% IF this_priority == loop_priority %] >+ <option value="[% loop_priority | html %]" selected="selected">[% loop_priority | html %]</option> >+ [% ELSE %] >+ <option value="[% loop_priority | html %]">[% loop_priority | html %]</option> >+ [% END %] >+ [% loop_priority = loop_priority + 1 %] >+ [% END %] >+ [% END %] >+ >+ > [% FOREACH hold IN holds %] >- [% IF !hold.found && first_priority == 0 %][% first_priority = hold.priority %][% END %] >+ [% IF !hold.found && first_priority == 0 %] >+ [% first_priority = hold.priority %] >+ [% found_holds = loop.index() %] >+ [% END %] >+ [% IF Koha.Preference('HoldsSplitQueueNumbering') == 'actual' %] >+ [% this_priority = hold.priority %] >+ [% ELSE %] >+ [% this_priority = loop.count() - found_holds %] >+ [% END %] > <tr> > <td> > <input type="hidden" name="reserve_id" value="[% hold.reserve_id | html %]" /> > <input type="hidden" name="borrowernumber" value="[% hold.borrowernumber | html %]" /> > <input type="hidden" name="biblionumber" value="[% hold.biblionumber | html %]" /> > [% IF Koha.Preference('HoldsSplitQueue') == "nothing" && !hold.found %] >- <select name="rank-request" class="rank-request" data-hold-id="[% hold.reserve_id | html %]"> >+ <select name="rank-request" class="rank-request" data-hold-id="[% hold.reserve_id | html %]">i >+ [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %] >+ [% PROCESS priority_dropdown %] >+ [% ELSE %] >+ <option value="[% hold.priority | html %]" selected="selected">[% this_priority | html %]</option> >+ [% END %] >+ >+ <option value="del">del</option> >+ </select> > [% ELSE %] > <input type="hidden" name="rank-request" class="rank-request" value="[% hold.priority | html %]" data-hold-id="[% hold.reserve_id | html %]"> > <select name="rank-request" class="rank-request" disabled="disabled" data-hold-id="[% hold.reserve_id | html %]"> >- [% END %] > [% IF ( hold.found ) %] > [% IF ( hold.intransit ) %] > <option value="T" selected="selected">In transit</option> >@@ -46,42 +74,17 @@ > [% ELSE %] > <option value="W" selected="selected">Waiting</option> > [% END %] >+ [% ELSE %] >+ <option value="[% hold.priority | html %]" selected="selected">[% this_priority | html %]</option> > [% 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 | html %]" selected="selected">[% optionloo.num | html %]</option> >- [% ELSE %] >- <option value="[% optionloo.num | html %]">[% optionloo.num | html %]</option> >- [% END %] >- [% END %] >- [% ELSE %] >- [% SET ranker = 1 %] >- [% FOREACH h IN holds %] >- [% NEXT IF h.found %] >- [% IF ( h.priority == hold.priority ) %] >- <option value="[% h.priority | html %]" selected="selected">[% ranker | html %]</option> >- [% ELSE %] >- <option value="[% h.priority | html %]">[% ranker | html %]</option> >- [% END %] >- [% ranker = ranker + 1 %] >- [% END %] >- [% END %] >- [% ELSIF !hold.found %] >- <option value="[% hold.priority | html %]" selected="selected">[% hold.priority | html %]</option> >- [% END %] >- >- <option value="del">del</option> >- </select> >+ </select> >+ [% END %] > </td> > > [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %] > [% UNLESS hold.found %] > [% SET prev_priority = loop.prev.priority %] > [% SET next_priority = loop.next.priority %] >- [% holds.index | html %] > > <td style="white-space:nowrap;"> > <a title="Move hold up" href="request.pl?action=move&where=up&first_priority=[% first_priority | html %]&last_priority=[% last_priority | html %]&prev_priority=[% prev_priority | html %]&next_priority=[% next_priority | html %]&borrowernumber=[% hold.borrowernumber | html %]&biblionumber=[% hold.biblionumber | html %]&reserve_id=[% hold.reserve_id | html %]&date=[% hold.date | html %]"> >diff --git a/reserve/request.pl b/reserve/request.pl >index 6ab8ba7ac5..60f9d833b0 100755 >--- a/reserve/request.pl >+++ b/reserve/request.pl >@@ -659,17 +659,6 @@ foreach my $biblionumber (@biblionumbers) { > { > my $priority = $res->priority(); > my %reserve; >- my @optionloop; >- for ( my $i = 1 ; $i <= $totalcount ; $i++ ) { >- push( >- @optionloop, >- { >- num => $i, >- selected => ( $i == $priority ), >- } >- ); >- } >- > if ( $res->is_found() ) { > $reserve{'holdingbranch'} = $res->item()->holdingbranch(); > $reserve{'biblionumber'} = $res->item()->biblionumber(); >@@ -702,7 +691,6 @@ foreach my $biblionumber (@biblionumbers) { > $reserve{'barcode'} = $res->item() ? $res->item()->barcode() : undef; > $reserve{'priority'} = $res->priority(); > $reserve{'lowestPriority'} = $res->lowestPriority(); >- $reserve{'optionloop'} = \@optionloop; > $reserve{'suspend'} = $res->suspend(); > $reserve{'suspend_until'} = $res->suspend_until(); > $reserve{'reserve_id'} = $res->reserve_id(); >-- >2.20.1
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 29049
:
124992
|
125013
|
125067
|
125068
|
125306
|
125307
|
125308
|
125309
|
125310
|
125397