Bug 20226: Centralize update child code (CATCODE_MULTI)
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / members / update-child.tt
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>
8
9 <body id="pat_update-child" class="pat">
10     <div class="container-fluid">
11
12 [% IF ( MULTI ) %]
13
14     <h3> Choose adult category </h3>
15
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="cattype" value="[% cattype %]" />
42                 <fieldset class="action">
43                     <input class="submit" type="submit" value="Submit" />
44                     <a href="#" class="cancel close">Cancel</a>
45                 </fieldset>
46             </fieldset>
47         </form>
48     [% END %]
49 [% END %]
50
51
52 [% MACRO jsinclude BLOCK %]
53     [% INCLUDE 'datatables.inc' %]
54     <script type="text/javascript">
55
56         $(document).ready(function() {
57             $("#catst").dataTable($.extend(true, {}, dataTablesDefaults, {
58                 "sDom": 't',
59                 "aaSorting": [[ 2, "asc" ]],
60                 "aoColumnDefs": [
61                     { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false }
62                 ],
63                 "bPaginate": false
64             }));
65         });
66     </script>
67     [% IF ( SUCCESS ) %]
68         <script type="text/javascript">
69             self.opener.location.href='/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]';
70             window.close();
71         </script>
72     [% END %]
73     [% INCLUDE 'str/members-menu.inc' %]
74     [% Asset.js("js/members-menu.js") %]
75 [% END %]
76
77 [% INCLUDE 'intranet-bottom.inc' popup_window=1 %]