Koha/koha-tmpl/intranet-tmpl/prog/en/modules/members/deletemem.tt
Jonathan Druart 81431ee28a Bug 20226: Centralize update child code (CATCODE_MULTI)
Code and variables to deal with the update child feature are not
centralized but copied/pasted in several scripts. Which leads to issues
obsviously (bug 20805 for instance).

Moreover the strings used by the templates are also in several template
files (or .inc)

To deal with that this patch introduces the idea to create 1 .inc file
per .js file
Here we have members-menu.inc for members-menu.js

Test plan:
- Remove all your adult categories (categories.category_type='A')
- Create a patron with a child category
- Try to update to adult category
=> The entry does no longer appears! (This is a change in the behaviour)
- Create one adult category
- Update to adult category
=> There is a JS confirmation message, if you accept the patron will
be updated to the adult category
- Create (at least) another adult category
- Create another child
- Update to adult category
=> No more confirmation message but a popup to select the adult category
- Pick one
=> The patron has been updated to the adult category

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2018-08-14 11:58:26 +00:00

70 lines
2.7 KiB
Text

[% USE Asset %]
[% USE Price %]
[% USE Branches %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Delete patron [% patron.firstname %] [% patron.surname %]</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
<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; Delete patron [% patron.firstname %] [% patron.surname %]</div>
<div id="doc3" class="yui-t2">
<div id="bd">
<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 | $Price %] in fines.</li>
[% END %]
[% IF ( guarantees ) %]
<li>Patron's record has guaranteed accounts attached.</li>
[% END %]
</ul>
</div>
[% ELSIF op == 'delete_confirm' and patron %]
[%# TODO add "patron does not exist" unless patron %]
<div class="dialog alert">
<h3>Are you sure you want to delete the patron [% patron.firstname %] [% patron.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="[% patron.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="[% patron.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>
<div class="yui-b">
[% INCLUDE 'circ-menu.inc' %]
</div>
</div>
[% MACRO jsinclude BLOCK %]
[% INCLUDE 'str/members-menu.inc' %]
[% Asset.js("js/members-menu.js") %]
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]