Bug 19641: (follow-up) Move patron templates to the footer
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / members / deletemem.tt
index 49c4ad2..660fd93 100644 (file)
@@ -1,30 +1,56 @@
+[% SET footerjs = 1 %]
 [% INCLUDE 'doc-head-open.inc' %]
-<title>Koha &rsaquo; Can't Delete Patron</title>
+<title>Koha &rsaquo; Delete patron [% firstname %] [% surname %]</title>
 [% INCLUDE 'doc-head-close.inc' %]
 </head>
-<body>
+<body id="pat_deletemem" class="pat">
 [% INCLUDE 'header.inc' %]
 [% INCLUDE 'patron-search.inc' %]
 
-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>  &rsaquo; Cannot Delete Patron</div>
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> &rsaquo; Delete patron [% firstname %] [% surname %]</div>
 <div id="doc3" class="yui-t2">
    
    <div id="bd">
-       <div id="yui-main">
-       <div class="yui-b">
-       [% INCLUDE 'members-toolbar.inc' %]
-       <div class="dialog alert">
-       <h3>Cannot Delete Patron</h3>
-               <ul>[% IF ( ItemsOnIssues ) %]
-                       <li>Patron has [% ItemsOnIssues %] item(s) checked out.</li>
-               [% END %]
-               [% IF ( charges ) %]
-                       <li>Patron has [% charges %] in fines.</li>
-               [% END %]
-               [% IF ( guarantees ) %]
-                       <li>Patron's record has guaranteed accounts attached.</li>
-               [% END %]</ul>
-       </div>
+    <div id="yui-main">
+    <div class="yui-b">
+    [% INCLUDE 'members-toolbar.inc' %]
+    [% IF ( ItemsOnIssues || charges || guarantees ) %]
+        <div class="dialog alert">
+        <h3>Cannot delete patron</h3>
+            <ul>
+            [% IF ( ItemsOnIssues ) %]
+                <li>Patron has [% ItemsOnIssues %] item(s) checked out.</li>
+            [% END %]
+            [% IF ( charges ) %]
+                <li>Patron has [% charges %] in fines.</li>
+            [% END %]
+            [% IF ( guarantees ) %]
+                <li>Patron's record has guaranteed accounts attached.</li>
+            [% END %]
+            </ul>
+    </div>
+    [% ELSIF op == 'delete_confirm' and borrowernumber %]
+        [%# TODO add "patron does not exist" unless borrowernumber %]
+        <div class="dialog alert">
+            <h3>Are you sure you want to delete the patron [% firstname %] [% surname %]? This cannot be undone.</h3>
+            <form action="/cgi-bin/koha/members/deletemem.pl">
+                <input type="hidden" name="csrf_token" value="[% csrf_token %]" />
+                <input type="hidden" name="member" value="[% borrowernumber %]"/>
+                <input type="hidden" name="op" value="delete_confirmed" />
+                <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete</button>
+            </form>
+            <form action="/cgi-bin/koha/members/moremember.pl">
+                <input type="hidden" name="borrowernumber" value="[% borrowernumber %]"/>
+                <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
+            </form>
+        </div>
+    [% END %]
+    [% IF ( keeplocal ) %]
+        <div class="dialog message">
+        <h3>Remote record deleted, local record kept</h3>
+        <p>Patron was marked for deletion from Norwegian national patron database, but the local record was kept.</p>
+        </div>
+    [% END %]
 </div>
 </div>
 
@@ -32,4 +58,9 @@
 [% INCLUDE 'circ-menu.inc' %]
 </div>
 </div>
-[% INCLUDE 'intranet-bottom.inc' %]
\ No newline at end of file
+
+[% MACRO jsinclude BLOCK %]
+    <script type="text/javascript" src="[% interface %]/[% theme %]/js/members-menu_[% KOHA_VERSION %].js"></script>
+[% END %]
+
+[% INCLUDE 'intranet-bottom.inc' %]