Bug 28338: Default to holding branch to save clicks
authorTomas Cohen Arazi <tomascohen@theke.io>
Wed, 12 May 2021 20:02:27 +0000 (17:02 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 14 Jun 2021 15:35:19 +0000 (17:35 +0200)
commit333ee7260072c02bb28f2d9e576de0c494f134e6
treebeb746f9d2fffddf475e0682cf0aaa198c4dacd4
parent7fbb07ba59373f9b815c67c3737d1cbafa397736
Bug 28338: Default to holding branch to save clicks

This patch makes request.pl pass the holding library object to the
template, if it is a valid pickup location for the item. This way, the
template can set a good default to save clicks.

To test:
1. Have "Hold pickup library match" set to "Item's home library"
2. Have a record with items in three different branches. For example:
   - item1: homebranch: MPL, holdingbranch: MPL
   - item2: homebranch: FPL, holdingbranch: FPL
   - item3: homebranch: CPL, holdingbranch: IPT
3. Have FPL marked as 'No' for pickup location
4. On the record, open the page for placing a hold for a patron
   (acevedo?)
=> SUCCESS: You are presented the regular hold placing page, with an
extra column on the items for pickup location setting
=> SUCCESS: The item2 (on FPL) cannot be selected, there's a clear message
about not having valid pickup locations
=> FAIL: The other ones don't have anything pre-selected on the
dropdowns
5. Apply this patch
6. Repeat 4 (go back to the record, etc)
=> SUCCESS: Nothing changed BUT the item with holding branch = MPL has
it set by default in the dropdown.
=> SUCCESS: IPT is not a valid pickup location for item3, so not set by
default in this case.
7. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt
reserve/placerequest.pl
reserve/request.pl