RFC: Multiple hold requests (revisited)
I am a new developer working on some 3.2 items for the Howard County Library. I'm trying to tackle an RFC that was published a while ago. It specifies the ability to request holds on multiple items at one time. I have just updated the wiki with new details: http://wiki.koha.org/doku.php?id=en:development:rfcs3.2:rfc32_place_hold_mul... After studying the code a while, I think I have a handle on an approach. I wanted to give the community the opportunity to offer warnings, advice, or ridicule, as warranted. As the wiki implies, these are the things I thought I would need to change to implement the biggest piece, which is to allow multiple holds from the search results page: 1. Add a "Place Hold" button to the search results page. I did this in my sandbox by tweaking "opac-results.tmpl" and "basket.js" (trying to mirror the flow of the "Save" button's functionality). Use this to pass the list of checked biblio numbers to the "opac-reserve.pl" script. 2. Redesign the "opac-reserve.tmpl" template to allow for a list of biblio items, rather than just one. For each biblio, allow the selection of "next available" or "particular item" (if allowed). 3. Update "opac-reserve.pl" to handle multiple biblio numbers and the new template. Is there any reason I shouldn't proceed (carefully) along these lines? I've also noticed what appear to be some irregularities in the behavior of this feature as it is currently implemented in 3.2. I don't know if it is due to the code or my lack of understanding. First, when selecting a "Place Hold" link on the results page, the "opac-reserve.pl" script appears to get called twice on the server with the same arguments. I understand that several round trips are made through the same script to implement the overall flow, but I cannot figure out why just one click causes it to be called twice. The second call appears to be redundant, unless I'm missing something. Also, the end of the "opac-reserve.tmpl" template has a section that appears to be dead code. It is guarded by a check for the "item_types_selected" template variable, but I can't find anyplace that this could be set. The second official trip through the perl script results in a redirect to "opac-user.pl", so the "opac- reserve.tmpl" never even gets used more than once during the flow (at least as far as I can see). Any thoughts on all this are appreciated. -Steve --- Stephen Edwards Alloy Computing, LLC sedwards@alloycomputing.com
Hi Stephen, On Thu, Feb 5, 2009 at 11:36 AM, Stephen G. Edwards <sedwards@alloycomputing.com> wrote: 1. Add a "Place Hold" button to the search results page. I did this in my
sandbox by tweaking "opac-results.tmpl" and "basket.js" (trying to mirror the flow of the "Save" button's functionality). Use this to pass the list of checked biblio numbers to the "opac-reserve.pl" script. 2. Redesign the "opac-reserve.tmpl" template to allow for a list of biblio items, rather than just one. For each biblio, allow the selection of "next available" or "particular item" (if allowed). 3. Update "opac-reserve.pl" to handle multiple biblio numbers and the new template. Is there any reason I shouldn't proceed (carefully) along these lines?
This looks sensible to me.
The second call appears to be redundant, unless I'm missing something.
It is redundant. The second call to opac-reserve.pl is coming from a bug in the part of the template that displays item type icons; if there is no icon associated with an item's item type, an <img> tag like this is still produced: <img src="" alt="" title="" /> The browsers is evidently handling src="" by assuming that it should retrieve the page again, thus running the script for a second time.
Also, the end of the "opac-reserve.tmpl" template has a section that appears to be dead code. It is guarded by a check for the "item_types_selected" template variable, but I can't find anyplace that this could be set. The
Yes, that appears to be dead. Regards, Galen -- Galen Charlton VP, Research & Development, LibLime galen.charlton@liblime.com p: 1-888-564-2457 x709 skype: gmcharlt
participants (2)
-
Galen Charlton -
Stephen G. Edwards