From d4d9e0f2fecdd04709aaa749db7532d073cdd2d7 Mon Sep 17 00:00:00 2001
From: Aleisha <aleishaamohia@hotmail.com>
Date: Tue, 16 Feb 2016 01:21:28 +0000
Subject: [PATCH] [SIGNED-OFF] Bug 15823: Can still access patron discharge
 slip without having the syspref on

To test:
1) Ensure syspref useDischarge is disabled
2) Go to http://localhost:8081/cgi-bin/koha/members/discharge.pl?borrowernumber=X
3) Validate that you are still able to generate a discharge slip for this patron
4) Apply patch and refresh page
5) Confirm that you get an error message and can no longer generate a discharge.

Sponsored-by: Catalyst IT

NOTE: If the useDischarge system preference is enabled, there is a Discharge
      tab displayed when viewing patron details. This closes a direct URL issue.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
---
 koha-tmpl/intranet-tmpl/prog/en/modules/members/discharge.tt | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/discharge.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/discharge.tt
index 45757d2..afdb0c3 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/discharge.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/discharge.tt
@@ -20,6 +20,11 @@
     <div class="yui-b">
 <div class="yui-g">
 <h3>Discharge</h3>
+
+[% UNLESS Koha.Preference('useDischarge') %]
+    <div class="dialog alert">Staff members are not allowed to discharge borrowers, nor borrowers to request a discharge.</div>
+[% ELSE %]
+
 [% FOR message IN messages %]
     <div class="dialog [% message.type %]">
     [% IF message.code == "unable_to_generate_pdf" %]
@@ -59,10 +64,8 @@
         </tbody>
     </table>
 [% END %]
-
+[% END %]
 </div>
-
-
 </div>
 </div>
 <div class="yui-b">
-- 
2.1.4