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)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 17 May 2018 14:40:03 +0000 (11:40 -0300)
commit710c0e5df644731cee15f91b4ebc62924f7f85c9
tree9e38517f14604e9829ec67fcb84dd5015394aaaf
parent45b6ea652797288d2910b121e3009696c847791d
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>
Koha/Hold.pm
t/db_dependent/Hold.t