Bug 20538: Remove the need of writing [% KOHA_VERSION %] everywhere
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / members / update-child.tt
blobd5cd97456538654cc48efea5275d8c6bb761740b
1 [% USE Asset %]
2 [% SET footerjs = 1 %]
3 [% INCLUDE 'doc-head-open.inc' %]
4 <title>Koha &rsaquo; Choose adult category</title>
5 [% INCLUDE 'doc-head-close.inc' %]
6 [% Asset.css("css/datatables.css") %]
7 </head>
9 <body id="pat_update-child" class="pat">
10     <div class="container-fluid">
12 [% IF ( MULTI ) %]
14     <h3> Choose adult category </h3>
16     [% IF patron_categories %]
17         <form method="post" action="update-child.pl">
18             <fieldset>
19                 <table id="catst">
20                     <thead>
21                         <tr>
22                         <th>&nbsp;</th>
23                         <th>Code</th>
24                         <th>Description</th>
25                         </tr>
26                     </thead>
27                     <tbody>
28                         [% FOREACH patron_category IN patron_categories %]
29                             <tr>
30                                 <td>
31                                     <input type="radio" id="catcode[% patron_category.categorycode %]" name="catcode" value="[% patron_category.categorycode %]" />
32                                 </td>
33                                 <td>[% patron_category.categorycode  %]</td>
34                                 <td><label for="catcode[% patron_category.categorycode %]"><strong>[% patron_category.description %]</strong></label></td>
35                             </tr>
36                         [% END %]
37                     </tbody>
38                 </table>
39                 <input type="hidden" name="op" value="update" />
40                 <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
41                 <input type="hidden" name="catcode" value="[% catcode %]" />
42                 <input type="hidden" name="cattype" value="[% cattype %]" />
43                 <input type="hidden" name="catcode_multi" value="[% CATCODE_MULTI %]" />
44                 <fieldset class="action">
45                     <input class="submit" type="submit" value="Submit" />
46                     <a href="#" class="cancel close">Cancel</a>
47                 </fieldset>
48             </fieldset>
49         </form>
50     [% END %]
51 [% END %]
54 [% MACRO jsinclude BLOCK %]
55     [% INCLUDE 'datatables.inc' %]
56     <script type="text/javascript">
58         /* Set some variables needed in members-menu.js */
59         var advsearch = "[% advsearch %]";
60         var dateformat = "[% dateformat %]";
61         var CAN_user_borrowers = "[% CAN_user_borrowers %]";
62         var CAN_user_borrowers_edit_borrowers = "[% CAN_user_borrowers_edit_borrowers %]";
63         var NorwegianPatronDBEnable = "[% NorwegianPatronDBEnable %]";
64         var CATCODE_MULTI = "[% CATCODE_MULTI %]";
65         var catcode = "[% catcode %]";
66         var destination = "[% destination %]";
68         $(document).ready(function() {
69             $("#catst").dataTable($.extend(true, {}, dataTablesDefaults, {
70                 "sDom": 't',
71                 "aaSorting": [[ 2, "asc" ]],
72                 "aoColumnDefs": [
73                     { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false }
74                 ],
75                 "bPaginate": false
76             }));
77         });
78     </script>
79     [% IF ( CONFIRM ) %]
80         <script type="text/javascript">
81             function confirm_updatechild() {
82                 var is_confirmed = window.confirm('Are you sure you want to update this child to an Adult category?  This cannot be undone.');
83                 if (is_confirmed) {
84                         window.location='/cgi-bin/koha/members/update-child.pl?op=update&borrowernumber=[% borrowernumber %]&catcode=[% catcode %]&catcode_multi=[% CATCODE_MULTI %]';
85                 }
86             }
88             confirm_updatechild([% borrowernumber %]);
89         </script>
90     [% END %]
91     [% IF ( SUCCESS ) %]
92         <script type="text/javascript">
93             self.opener.location.href='/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]';
94             window.close();
95         </script>
96     [% END %]
97     [% Asset.js("js/members-menu.js") %]
98 [% END %]
100 [% INCLUDE 'intranet-bottom.inc' popup_window=1 %]