Browse Source
Rebasing was a nightmare, so I'm squashing the sign off follow-ups to ease the pain with any future rebases Includes: Bug 23051: (follow-up) Refactor renewal code As per Nick's first point in comment #20, the code that tests for renewability and renews items has been refactored into it's own function. Bug 23051: (follow-up) Provide feedback For renewals that fail when a fine is being paid off, this patch causes any errors to be passed back to the template for display. Addresses the second point in Nick's comment #20 Bug 23051: (follow-up) Fix unit tests As raised by Nick in comment #35 Bug 23051: (follow-up) Fix/improve feedback This follow up patch addresses the following parts of Nick's feedback in comment #35: - it would be nice to get feedback on what was successfully renewed as well - In general I think I would prefer to see 'ok' and 'not_ok' returned as a single 'renewal_results' array - There is no listing of errors if I use the 'pay' button on an individual fine Bug 23051: (follow-up) Refactor methods This follow up patch addresses the following parts of Nick's feedback in comment #35: - I don't really like that the functions are internal functions and then exported - I think the pref description should highlight that if 'RenewalPeriodBase' is set to due date, there may be doubled charges Bug 23051: (follow-up) Add SIP summary This follow up patch addresses the following parts of Nick's feedback in comment #35: - Ideally SIP would get feedback in a screen message Bug 23051: (follow-up) Renewing in OPAC This follow up patch addresses the following parts of Nick's feedback in comment #35: - I am also not sure about the code path if a patron paid fines on the opac (via paypal etc.) but renewals are not allowed on the opac. We've introduced the syspref RenewAccruingItemInOpac (default is off) which, when enabled, will cause items attached to fines that are paid off in the OPAC (via payment plugins), to be automatically renewed. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>20.05.x
20 changed files with 397 additions and 133 deletions
@ -0,0 +1,8 @@ |
|||
$DBversion = 'XXX'; # will be replaced by the RM |
|||
if( CheckVersion( $DBversion ) ) { |
|||
|
|||
$dbh->do( q| INSERT IGNORE INTO systempreferences (variable, value, explanation, options, type) VALUES ('RenewAccruingItemInOpac', '0', 'If enabled, when the fines on an item accruing is paid off in the OPAC via a payment plugin, attempt to renew that item. If the syspref "RenewalPeriodBase" is set to "due date", renewed items may still be overdue', '', 'YesNo'); | ); |
|||
|
|||
SetVersion( $DBversion ); |
|||
print "Upgrade to $DBversion done (Bug 23051 - Add RenewAccruingItemInOpac syspref)\n"; |
|||
} |
@ -0,0 +1,12 @@ |
|||
[% IF renew_results && renew_results.size > 0 %] |
|||
<div class="alert"> |
|||
The fines on the following items were paid off, renewal results are displayed below: |
|||
[% FOREACH result IN renew_results %] |
|||
[% IF result.success %] |
|||
<p>[% INCLUDE 'biblio-title.inc' biblio=result.item.biblio %] ( [% result.item.barcode | html %] ): Renewed - due [% result.info | html %]</p> |
|||
[% ELSE %] |
|||
<p>[% INCLUDE 'biblio-title.inc' biblio=result.item.biblio %] ( [% result.item.barcode | html %] ): Not renewed - [% INCLUDE 'renew_strings.inc' error=result.info %]</p> |
|||
[% END %] |
|||
[% END %] |
|||
</div> |
|||
[% END %] |
@ -0,0 +1,32 @@ |
|||
[% SWITCH error %] |
|||
[% CASE 'no_item' %] |
|||
No matching item could be found |
|||
[% CASE 'no_checkout' %] |
|||
Item is not checked out |
|||
[% CASE 'too_soon' %] |
|||
Cannot yet be renewed |
|||
[% CASE 'too_many' %] |
|||
Renewed the maximum number of times |
|||
[% CASE 'auto_too_soon' %] |
|||
Scheduled for automatic renewal and cannot yet be renewed |
|||
[% CASE 'auto_too_late' %] |
|||
Scheduled for automatic renewal and cannot yet be any more |
|||
[% CASE 'auto_account_expired' %] |
|||
Scheduled for automatic renewal and cannot be renewed because the patron's account has expired |
|||
[% CASE 'auto_renew' %] |
|||
Scheduled for automatic renewal |
|||
[% CASE 'auto_too_much_oweing' %] |
|||
Scheduled for automatic renewal |
|||
[% CASE 'on_reserve' %] |
|||
On hold for another patron |
|||
[% CASE 'patron_restricted' %] |
|||
Patron is currently restricted |
|||
[% CASE 'item_denied_renewal' %] |
|||
Item is not allowed renewal |
|||
[% CASE 'onsite_checkout' %] |
|||
Item is an onsite checkout |
|||
[% CASE 'has_fine' %] |
|||
Item has an outstanding fine |
|||
[% CASE %] |
|||
Unknown error |
|||
[% END %] |
Loading…
Reference in new issue