From 7a502f5ffa7a75d1d56480c4201e677e7d6fe04b Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 31 Oct 2014 14:00:23 -0400 Subject: [PATCH] [SIGNED OFF] Bug 13184 - Circulation template problems if OnSiteCheckouts is off but OnSiteCheckoutsForce is on Checks in the circulation template for on-site checkouts preferences did not take into account the possibility that someone might have accidentally turned OnSiteCheckouts off but left OnSiteCheckoutsForce turned on. This patch amends the template logic so that it works correctly for various combinations of settings. To test, apply the patch and test the following combinations of circumstances. Testing using both a patron who is blocked (expired, restricted, etc) and a patron who is not blocked, test with... 1. OnSiteCheckouts is on, OnSiteCheckoutsForce is on 2. OnSiteCheckouts is off, OnSiteCheckoutsForce is on 3. OnSiteCheckouts is off, OnSiteCheckoutsForce is off 4. OnSiteCheckouts is on, OnSiteCheckoutsForce is off Confirm that the checkout form is shown or not shown correctly according to the preferences you have set. Confirm that the "Only on-site checkouts are allowed" message is only shown in case #1. Note: This patch includes whitespace changes, so please diff accordingly. Signed-off-by: Nick Clemens --- .../prog/en/modules/circ/circulation.tt | 33 ++++++++++---------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt index 0779a5d..7421979 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -499,7 +499,7 @@ No patron matched [% message %] [% IF ( borrowernumber ) %]
-[% IF !noissues || Koha.Preference('OnSiteCheckoutsForce') %] +[% IF ( !noissues ) || ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') )%] [% IF ( flagged ) %]
[% ELSE %] @@ -573,7 +573,7 @@ No patron matched [% message %]
[% END %] [% IF ( noissues ) %] - [% IF ( Koha.Preference('OnSiteCheckoutsForce') ) %] + [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
[% ELSE %]
@@ -583,22 +583,23 @@ No patron matched [% message %] [% END %] [% IF flagged %] - [% IF NOT noissues || ( noissues && Koha.Preference('OnSiteCheckoutsForce') ) %] -
- [% ELSE %] -

Checking out to [% INCLUDE 'patron-title.inc' %]

-
- [% END %] -

- [% IF noissues %] - Cannot check out! - [% IF Koha.Preference('OnSiteCheckoutsForce') %] - Only on-site checkouts are allowed - [% END %] + [% IF ( noissues ) %] + [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %] +
+ [% ELSE %] +

Checking out to [% INCLUDE 'patron-title.inc' %]

+
+ [% END %] +

+ Cannot check out! + [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %] + Only on-site checkouts are allowed + [% END %] +

[% ELSE %] - Attention: +
+

Attention:

[% END %] -

    -- 1.7.10.4