Bugzilla – Attachment 69917 Details for
Bug 19636
Hold priority changes incorrectly via dropdown select
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19636: Hold priority changes incorrectly via dropdown select
Bug-19636-Hold-priority-changes-incorrectly-via-dr.patch (text/plain), 2.68 KB, created by
Jonathan Druart
on 2017-12-19 16:02:10 UTC
(
hide
)
Description:
Bug 19636: Hold priority changes incorrectly via dropdown select
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-12-19 16:02:10 UTC
Size:
2.68 KB
patch
obsolete
>From 3a11a8dfe8d63a3a0fedb553e658c2e229fcf104 Mon Sep 17 00:00:00 2001 >From: Lari Taskula <lari.taskula@jns.fi> >Date: Thu, 16 Nov 2017 14:24:52 +0200 >Subject: [PATCH] Bug 19636: Hold priority changes incorrectly via dropdown > select > >This patch sorts holds in UI after priority is changed via "Priority" >dropdown. > >It fixes confusion where the form is posted and each row is individually >processed one by one - and due to conflict in priority value, the latter >row always gets the chosen value instead of what the user actually might >have wanted to change. > >To reproduce: >1. Place 3 holds on a record >2. See existing holds (cgi-bin/koha/reserve/request.pl?biblionumber=XXX) >3. By using the dropdown menu under "Priority" column, change the first > hold's priority to last (3). Do not touch other priorities. >4. Click Update hold(s) >5. Observe the hold did not get your selected priority 3, but 2 instead. > >To test: >1. Apply patch >2. Place 3 holds on a record >3. See existing holds (cgi-bin/koha/reserve/request.pl?biblionumber=XXX) >4. By using the dropdown menu under "Priority" column, change the first > hold's priority to last (3). Do not touch other priorities. >5. Observe this hold was automatically moved to the last row in the user > interface. >6. Click Update hold(s) >7. Observe the hold has your selected priority 3. > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > .../intranet-tmpl/prog/en/modules/reserve/request.tt | 20 ++++++++++++++++++++ > 1 file changed, 20 insertions(+) > >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 c84576bac3..8639b40da7 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -161,6 +161,26 @@ function checkMultiHold() { > $("#requestany").prop("checked",true); > } > }); >+ var prev_rank_request; >+ $("select[name=rank-request]").on("focus", function() { >+ prev_rank_request = $(this).val(); >+ }).change(function() { >+ var row = $(this).parents("tr:first"); >+ var value = parseInt($(this).val()); >+ var after = row.parent().find("tr:nth-child("+(value+1)+")"); >+ >+ if (prev_rank_request > value) { >+ row.insertBefore(after); >+ } else { >+ row.insertAfter(after); >+ } >+ >+ var next_priority = 1; >+ $("select[name=rank-request]").each(function () { >+ $(this).val(next_priority); >+ next_priority++; >+ }); >+ }); > > $(".clear-date").on("click",function(e){ > e.preventDefault(); >-- >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 19636
:
69180
|
69195
| 69917