Bugzilla – Attachment 9078 Details for
Bug 7940
Placing a hold on a single item from the staff cart causes errors
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7940 - Placing a hold on a single item from the staff cart causes errors
Bug-7940---Placing-a-hold-on-a-single-item-from-th.patch (text/plain), 2.78 KB, created by
Kyle M Hall
on 2012-04-10 15:51:24 UTC
(
hide
)
Description:
Bug 7940 - Placing a hold on a single item from the staff cart causes errors
Filename:
MIME Type:
Creator:
Kyle M Hall
Created:
2012-04-10 15:51:24 UTC
Size:
2.78 KB
patch
obsolete
>From abe0bdddf25ad15d9e4ae96308bbd0203ba35ba0 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 10 Apr 2012 11:36:36 -0400 >Subject: [PATCH] Bug 7940 - Placing a hold on a single item from the staff cart causes errors > >This is caused by the javascript function placeHold() in basket.pl >The cause of this error is thus: when a staff member uses the cart >to place holds on multiple items at once, the cart redirects to >reserver/request.pl with the params 'biblionumbers' ( a string of >biblionumbers separated by slashes ( e.g. '5/4/3/' ) and the param >multi_hold with a value of 1. > >When multi_hold is enabled, request.pl splits the string 'biblionumbers' >on those slashes and works on that list. > >In placeHold(), when only one item is checked, the system passes >the param biblionumbers with a single biblionumber ( e.g. '5/' ) >and does *not* pass the multi_hold param. This causes request.pl >to not parse the biblionumbers param, and thus reserve.pl has >no biblionumber to work on ( hence our error here ). > >There are two options to resolve this: >A) Add the multi_hold param even for a single hold from the cart. >B) In the event of a single hold being placed from the cart, > switch to the standard single hold url ( i.e. request.pl?biblionumber=234 ) > >This commit resolves the situation using option B, as it seems more >logical than using the multi-holds system for a single hold. >--- > .../intranet-tmpl/prog/en/modules/basket/basket.tt | 29 +++++++++++++------ > 1 files changed, 20 insertions(+), 9 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt >index b575fe9..8d5c8ed 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt >@@ -29,15 +29,26 @@ function placeHold () { > alert(MSG_NO_RECORD_SELECTED); > return false; > } >- var bibs = ""; >- var badBibs = false; >- $(checkedItems).each(function() { >- var bib = $(this).val(); >- bibs += bib + "/"; >- }); >- >- var newloc = "/cgi-bin/koha/reserve/request.pl?biblionumbers=" + bibs; >- if ($(checkedItems).size() > 1) { newloc += "&multi_hold=1"; } >+ >+ var newloc; >+ >+ if ($(checkedItems).size() > 1) { >+ var bibs = ""; >+ $(checkedItems).each(function() { >+ var bib = $(this).val(); >+ bibs += bib + "/"; >+ }); >+ >+ newloc = "/cgi-bin/koha/reserve/request.pl?biblionumbers=" + bibs + "&multi_hold=1"; >+ } else { >+ var bib = ""; >+ $(checkedItems).each(function() { >+ bib = $(this).val(); >+ }); >+ >+ newloc = "/cgi-bin/koha/reserve/request.pl?biblionumber=" + bib; >+ } >+ > window.opener.location = newloc; > window.close(); > } >-- >1.7.2.5
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 7940
:
9077
|
9078
|
9079
|
9095