Bug 34597: Implementation
authorPedro Amorim <pedro.amorim@ptfs-europe.com>
Thu, 28 Mar 2024 12:52:29 +0000 (12:52 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 11 Jun 2024 09:43:56 +0000 (10:43 +0100)
commite7ddc8665796189d33350d3882d549ae4ef65d96
tree8f8dfbbfac706986c43abdf821f0989ab830eaba
parent5793d9107fe20e11d635009807072bafd42a0b09
Bug 34597: Implementation

New can_patron_place_ill_in_opac method to include all rules
that need checking to determine if a patron is allowed
to place an ILL request on the OPAC or not.
Added effective_BlockExpiredPatronOpacActions_contains rule to
this new method.

Test plan, k-t-d,:
1) Install FreeForm and enable ILLmodule, run:
bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev.sh)
1.5) Checkout FreeForm's reorganize_ILL branch:
  cd /kohadevbox/koha/Koha/Illbackends/FreeForm
  git checkout reorganize_ILL
  koha-plack --restart kohadev
2) Edit a patron category, visit:
<staff_url>/cgi-bin/koha/admin/categories.pl
3) Set 'Placing an ILL request' for the "Block expired patrons" input config
4) Add a new patron of one of the above category, make sure this patron is expired (set an expirydate to the past).
5) Login as that user and visit ILL page in OPAC:
/cgi-bin/koha/opac-illrequests.pl
6) Confirm there is no "Create a new request" button
7) Access the create a new request page url directly:
<opac_url>/cgi-bin/koha/opac-illrequests.pl?op=add_form&backend=FreeForm
8) Confirm you get a 403 page
9) Set the 'Block expired actions' to "Follow system preference BlockExpiredPatronOpacActions"
10) Test different values of the BlockExpiredPatronOpacActions system preference and confirm the behaviour matches what's configured

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Koha/ILL/Request.pm
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt
opac/opac-illrequests.pl