Bugzilla – Attachment 88641 Details for
Bug 22753
Move hold to top button doesn't work if waiting holds exist
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22753: Fix hold priority adjustment, move to top
Bug-22753-Fix-hold-priority-adjustment-move-to-top.patch (text/plain), 9.35 KB, created by
Katrin Fischer
on 2019-04-24 20:24:41 UTC
(
hide
)
Description:
Bug 22753: Fix hold priority adjustment, move to top
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2019-04-24 20:24:41 UTC
Size:
9.35 KB
patch
obsolete
>From 303bd785889a807343a21066f06a4b1979f1c3f5 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 23 Apr 2019 18:03:33 +0000 >Subject: [PATCH] Bug 22753: Fix hold priority adjustment, move to top > >Since the holds table can be split we need to calculate the >first priority for each table. However, currently we use the >first in the loop, not taking into account the waiting status. >This patchset sets the first_priority to the first non-found hold > >Additionally, some clean-up is done to not display the alter >priority arrows for waiting holds. > >To test: >1 - Place several holds on a title >2 - Confirm one of the holds to be waiting >3 - Attempt to move the last hold to the top >4 - Nothing happens >5 - Apply patch >6 - Note that the waiting hold has no options to move in the list >7 - Attempt to move the last hold to the top >8 - It moves as expected! >9 - Split the holds queue by pickup library >10 - PLace some holds for pickup at another branch >11 - Confirm moving these holds works within their own table >12 - Unsplit the queue >13 - Ensure the holds end where you expect (moving in a split > table didn't move above holds form another table) > >Signed-off-by: Liz Rea <wizzyrea@gmail.com> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > .../intranet-tmpl/prog/en/includes/holds_table.inc | 74 ++++++++++++---------- > 1 file changed, 42 insertions(+), 32 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 995c7d28df..9181f19507 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc >@@ -20,7 +20,11 @@ > [% IF SuspendHoldsIntranet %]<th> </th><!-- Suspend Holds Column Header -->[% END %] > </tr> > >+ [% SET first_priority = 0 %] >+ [% SET last_priority = holds.last.priority %] >+ > [% FOREACH hold IN holds %] >+ [% IF !hold.found && first_priority == 0 %][% first_priority = hold.priority %][% END %] > <tr> > <td> > <input type="hidden" name="reserve_id" value="[% hold.reserve_id | html %]" /> >@@ -70,29 +74,31 @@ > </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 | 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 %]"> >- <img src="[% interface | html %]/[% theme | html %]/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 | 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 %]"> >- <img src="[% interface | html %]/[% theme | html %]/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 | 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 %]"> >- <img src="[% interface | html %]/[% theme | html %]/img/go-bottom.png" alt="Go bottom" /> >- </a> >- >- <a title="Move hold down" href="request.pl?action=move&where=down&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 %]"> >- <img src="[% interface | html %]/[% theme | html %]/img/go-down.png" alt="Go down" /> >- </a> >- </td> >+ [% 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 %]"> >+ <img src="[% interface | html %]/[% theme | html %]/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 | 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 %]"> >+ <img src="[% interface | html %]/[% theme | html %]/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 | 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 %]"> >+ <img src="[% interface | html %]/[% theme | html %]/img/go-bottom.png" alt="Go bottom" /> >+ </a> >+ >+ <a title="Move hold down" href="request.pl?action=move&where=down&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 %]"> >+ <img src="[% interface | html %]/[% theme | html %]/img/go-down.png" alt="Go down" /> >+ </a> >+ </td> >+ [% ELSE %] >+ <td></td> >+ [% END %] > [% END %] > > <td> >@@ -161,15 +167,19 @@ > </td> > > [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %] >- <td> >- <a title="Toggle lowest priority" href="request.pl?action=setLowestPriority&borrowernumber=[% hold.borrowernumber | html %]&biblionumber=[% hold.biblionumber | html %]&reserve_id=[% hold.reserve_id | html %]&date=[% hold.date | html %]"> >- [% IF ( hold.lowestPriority ) %] >- <img src="[% interface | html %]/[% theme | html %]/img/go-bottom.png" alt="Unset lowest priority" /> >- [% ELSE %] >- <img src="[% interface | html %]/[% theme | html %]/img/go-down.png" alt="Set to lowest priority" /> >- [% END %] >- </a> >- </td> >+ [% UNLESS hold.found %] >+ <td> >+ <a title="Toggle lowest priority" href="request.pl?action=setLowestPriority&borrowernumber=[% hold.borrowernumber | html %]&biblionumber=[% hold.biblionumber | html %]&reserve_id=[% hold.reserve_id | html %]&date=[% hold.date | html %]"> >+ [% IF ( hold.lowestPriority ) %] >+ <img src="[% interface | html %]/[% theme | html %]/img/go-bottom.png" alt="Unset lowest priority" /> >+ [% ELSE %] >+ <img src="[% interface | html %]/[% theme | html %]/img/go-down.png" alt="Set to lowest priority" /> >+ [% END %] >+ </a> >+ </td> >+ [% ELSE %] >+ <td></td> >+ [% END %] > [% END %] > > <td> >-- >2.11.0
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 22753
:
88551
|
88555
|
88556
| 88641 |
88642