Bug 24759: Move OpacRenewalBranch code to Koha::Item
authorNick Clemens <nick@bywatersolutions.com>
Fri, 28 Feb 2020 13:09:29 +0000 (13:09 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 24 Mar 2020 10:47:49 +0000 (10:47 +0000)
commit6de018f65fb285620ad17357bd63897f7088b6d5
tree20f1e31f7666bbd3bb017eeba248a623ccc76649
parentf46e3fafe63b51747e0d56efeb7edf7d3097117a
Bug 24759: Move OpacRenewalBranch code to Koha::Item

This patchset moves all code to calculate the correct renewal branch into Koha::Item.pm

When interface is opac we follow the syspref, otherwise we use the current userenv, or pass through
a defined branch

To test:
1 - Check out an item to a patron
2 - Set allowed renewals in the circ rules to 100 (just so you can keep testing)
3 - Renew the item in staff interface, confirm it is recorded correctly in statistics table (as signed in branch)
4 - Renew via the opac, testing with each setting of OpacRenewalbranch
5 - prove -v t/db_dependent/Koha/Item.t

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
C4/Circulation.pm
Koha/Item.pm
opac/opac-renew.pl
t/db_dependent/Koha/Item.t