Bug 28805: (follow-up) Fix template logic error
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / members / deletemem.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Price %]
4 [% USE Branches %]
5 [% PROCESS 'i18n.inc' %]
6 [% SET footerjs = 1 %]
7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>[% FILTER collapse %]
9     [% t("Delete patron") | html %] [% INCLUDE 'patron-title.inc' no_html = 1 %] &rsaquo;
10     [% t("Patrons") | html %] &rsaquo;
11     [% t("Koha") | html %]
12 [% END %]</title>
13 [% INCLUDE 'doc-head-close.inc' %]
14 </head>
15 <body id="pat_deletemem" class="pat">
16 [% WRAPPER 'header.inc' %]
17     [% INCLUDE 'patron-search-header.inc' %]
18 [% END %]
19
20 [% WRAPPER 'sub-header.inc' %]
21     [% WRAPPER breadcrumbs %]
22         [% WRAPPER breadcrumb_item %]
23             <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>
24         [% END %]
25         [% WRAPPER breadcrumb_item %]
26             <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% INCLUDE 'patron-title.inc' %]</a>
27         [% END %]
28         [% WRAPPER breadcrumb_item bc_active= 1 %]
29             <span>Delete patron</span>
30         [% END %]
31     [% END #/ WRAPPER breadcrumbs %]
32 [% END #/ WRAPPER sub-header.inc %]
33
34 <div class="main container-fluid">
35     <div class="row">
36         <div class="col-sm-10 col-sm-push-2">
37             <main>
38
39     [% INCLUDE 'members-toolbar.inc' %]
40     [% IF ItemsOnIssues || debits || is_guarantor %]
41         <div class="dialog alert">
42         <h1>Cannot delete patron</h1>
43             <ul>
44             [% IF ( ItemsOnIssues ) %]
45                 <li>Patron has [% ItemsOnIssues | html %] item(s) checked out.</li>
46             [% END %]
47             [% IF debits %]
48                 <li>Patron has [% debits | $Price %] in fines.</li>
49             [% END %]
50             [% IF is_guarantor %]
51                 <li>Patron's record has guaranteed accounts attached.</li>
52             [% END %]
53             </ul>
54     </div>
55     [% ELSIF op == 'delete_confirm' and patron %]
56         [%# TODO add "patron does not exist" unless patron %]
57         <div class="dialog alert">
58             [% IF ItemsOnHold or credits or pending_suggestions > 0 %]
59                 <ul>
60                     [% IF ItemsOnHold %]
61                         <li>Patron has [% ItemsOnHold | html %] hold(s). Deleting patron cancels all their holds.</li>
62                     [% END %]
63                     [% IF credits %]
64                         <li>Patron has a [% credits | $Price %] credit.</li>
65                     [% END %]
66                     [% IF pending_suggestions > 0 %]
67                         <li>Patron has [% pending_suggestions | html %] pending suggestions.</li>
68                     [% END %]
69                 </ul>
70             [% END %]
71             <h1>Are you sure you want to delete the patron [% patron.firstname | html %] [% patron.surname | html %]?</h1>
72             <p>This cannot be undone.</p>
73             <form action="/cgi-bin/koha/members/deletemem.pl">
74                 <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
75                 <input type="hidden" name="member" value="[% patron.borrowernumber | html %]"/>
76                 <input type="hidden" name="op" value="delete_confirmed" />
77                 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete</button>
78             </form>
79             <form action="/cgi-bin/koha/members/moremember.pl">
80                 <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]"/>
81                 <button type="submit" class="deny"><i class="fa fa-fw fa-times"></i> No, do not delete</button>
82             </form>
83         </div>
84     [% END %]
85
86             </main>
87         </div> <!-- /.col-sm-10.col-sm-push-2 -->
88
89         <div class="col-sm-2 col-sm-pull-10">
90             <aside>
91                 [% INCLUDE 'circ-menu.inc' %]
92             </aside>
93         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
94      </div> <!-- /.row -->
95
96 [% MACRO jsinclude BLOCK %]
97     [% INCLUDE 'str/members-menu.inc' %]
98     [% Asset.js("js/members-menu.js") | $raw %]
99 [% END %]
100
101 [% INCLUDE 'intranet-bottom.inc' %]