Bug 18856: Don't show cancel option for waiting holds in OPAC
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 10 Jan 2018 19:49:33 +0000 (16:49 -0300)
committerFridolin Somers <fridolin.somers@biblibre.com>
Mon, 16 Jul 2018 09:57:58 +0000 (11:57 +0200)
commitaa8ab8d0e789d1ece38206b069b2369778d58161
tree376bf76ad7da1b4d8d1daa186993cef51afccff0
parent2bfb7a68d4d598f4b42f8e6f33c4e501e4db4aab
Bug 18856: Don't show cancel option for waiting holds in OPAC

This is the alternative patch of Kyle's
"""
If a hold is 'waiting' for the patron to collect then the patron should
be prevented from cancelling the hold via their account in the opac.
If a patron tries to cancel the hold, Koha will give an 'are you sure'
alert and when you click Yes the page just refreshes and the hold
remains.
Staff can cancel the hold from the staff interface but they can then
action the waiting hold.
I think therefore that it is correct behaviour that a patron cannot
cancel a hold when it reaches waiting state via the opac but it would be
useful to either have a warning to prevent the cancellation or a useful
message when they attempt to do so.

The template was using a method that tells Koha if *staff* can cancel a
hold,
instead of patron.

Test Plan:
1) Set up a waiting hold
2) Try to cancel it from the opac
3) Note you cannot
4) Apply this patch
5) Reload the page
6) Note the cancel button has disappeared for found holds
"""

It sounds better to keep the ->is_cancelable method, for readability

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 710c0e5df644731cee15f91b4ebc62924f7f85c9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Koha/Hold.pm
t/db_dependent/Hold.t