Bug 13618: Add html filters to all the variables
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / auth_tag_structure.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE AuthorisedValues %]
4 [% SET footerjs = 1 %]
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Koha &rsaquo; Administration &rsaquo; Authority MARC framework [% IF ( add_form ) %][% IF ( use_heading_flags_p ) %]
7     [% IF ( heading_modify_tag_p ) %]&rsaquo; [% IF ( authtypecode ) %][% authtypecode | html %] Framework[% ELSE %]Default framework[% END %] &rsaquo; Modify tag[% END %]
8     [% IF ( heading_add_tag_p ) %]&rsaquo; [% IF ( authtypecode ) %][% authtypecode | html %] Framework[% ELSE %]Default framework[% END %] &rsaquo; New tag[% END %]
9     [% ELSE %]&rsaquo; [% action | html %][% END %][% END %][% IF ( delete_confirm ) %]&rsaquo; [% IF ( authtypecode ) %][% authtypecode | html %] Framework[% ELSE %]Default framework[% END %] &rsaquo; Confirm deletion[% END %][% IF ( delete_confirmed ) %]&rsaquo; [% IF ( authtypecode ) %][% authtypecode | html %] Framework[% ELSE %]Default framework[% END %] &rsaquo; Data deleted[% END %]</title>
10 [% INCLUDE 'doc-head-close.inc' %]
11
12 [% Asset.css("css/datatables.css") | $raw %]
13 </head>
14
15 <body id="admin_auth_tag_structure" class="admin">
16 [% INCLUDE 'header.inc' %]
17 [% INCLUDE 'prefs-admin-search.inc' %]
18
19 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> &rsaquo;
20     <a href="/cgi-bin/koha/admin/authtypes.pl">Authority types</a> &rsaquo;
21     [% IF ( add_form ) %]
22         [% IF ( use_heading_flags_p ) %]
23             [% IF ( heading_modify_tag_p ) %]
24                 [% IF ( authtypecode ) %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=[% authtypecode | html %]">[% authtypecode | html %] Framework</a>
25                 [% ELSE %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Default framework</a>
26                 [% END %] &rsaquo; Modify tag
27             [% END %]
28             [% IF ( heading_add_tag_p ) %]
29                 [% IF ( authtypecode ) %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=[% authtypecode | html %]">[% authtypecode | html %] framework</a>
30                 [% ELSE %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Default framework</a>
31                 [% END %] &rsaquo; New tag
32             [% END %]
33         [% ELSE %]
34             [% IF ( authtypecode ) %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=[% authtypecode | html %]">[% authtypecode | html %] Framework</a>
35             [% ELSE %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Default framework</a>
36             [% END %] &rsaquo; [% action | html %]
37         [% END %]
38     [% ELSE %]
39         [% IF ( delete_confirm ) %]
40             [% IF ( authtypecode ) %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=[% authtypecode | html %]">[% authtypecode | html %] framework</a>
41             [% ELSE %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Default framework</a>
42             [% END %] &rsaquo; Confirm deletion
43         [% ELSE %]
44             [% IF ( delete_confirmed ) %]
45                 [% IF ( authtypecode ) %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=[% authtypecode | html %]">[% authtypecode | html %] framework</a>
46                 [% ELSE %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Default framework</a>
47                 [% END %] &rsaquo; Data deleted
48             [% ELSE %]
49                 [% IF ( authtypecode ) %][% authtypecode | html %] Framework
50                 [% ELSE %]Default framework
51                 [% END %]
52             [% END %]
53         [% END %]
54     [% END %]
55 </div>
56
57 <div id="doc3" class="yui-t2">
58    
59    <div id="bd">
60     <div id="yui-main">
61     <div class="yui-b">
62
63 <h1>Authority MARC framework for [% IF ( authtypecode ) %][% authtypecode | html %][% ELSE %]default framework[% END %]</h1>
64
65
66 [% IF ( add_form ) %]
67
68     <h2>
69     [% IF ( heading_modify_tag_p ) %]Modify tag[% END %]
70     [% IF ( heading_add_tag_p ) %]New tag[% END %]
71     </h2>
72     <form action="[% script_name | html %]" name="Aform" method="post" class="validated">
73         <input type="hidden" name="op" value="add_validate" />
74         [% IF ( heading_modify_tag_p ) %]<input type="hidden" name="modif" value="1" />[% END %]
75         <input type="hidden" name="authtypecode" value="[% authtypecode | html %]" />
76         <fieldset class="rows">
77             <ol>
78                 [% IF ( heading_modify_tag_p ) %]
79                     <li>
80                         <span class="label">Tag: </span>
81                         <input type="hidden" name="tagfield" value="[% searchfield | html %]" />
82                         [% searchfield | html %]
83                     </li>
84                 [% ELSE %]
85                     <li>
86                         <label for="tagfield" class="required">Tag: </label><input type="text" id="tagfield" name="tagfield" size="5" maxlength="3" required="required" class="required" />
87                         <span class="required">Required</span>
88                     </li>
89                 [% END %]
90
91         <li><label for="liblibrarian">Text for librarians: </label><input type="text" name="liblibrarian" id="liblibrarian" value="[% liblibrarian | html %]" size="40" maxlength="100" /></li>
92         <li><label for="libopac">Text for opac: </label><input type="text" name="libopac" id="libopac" value="[% libopac | html %]" size="40" maxlength="100" /></li>
93         <li><label for="repeatable">Repeatable: </label>
94             [% IF ( repeatable ) %]
95                 <input type="checkbox" name="repeatable" id="repeatable" value="1" checked="checked" />
96             [% ELSE %]
97                 <input type="checkbox" name="repeatable" id="repeatable" value="1" />
98             [% END %]
99         </li>
100         <li><label for="mandatory">Mandatory: </label>
101             [% IF ( mandatory ) %]
102                 <input type="checkbox" name="mandatory" id="mandatory" value="1" checked="checked" />
103             [% ELSE %]
104                 <input type="checkbox" name="mandatory" id="mandatory" value="1" />
105             [% END %]
106         </li>
107         <li><label for="authorised_value">Authorized value: </label>
108             <select name="authorised_value" id="authorised_value" size="1">
109                 <option value=""></option>
110                 [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => authorised_value ) %]
111             </select>
112             (if you select a value here, the indicators will be limited to the authorized value list)
113         </li>
114         </ol>
115         </fieldset>
116         <fieldset class="action">
117             <input type="submit" value="Submit" />
118             <a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=[% authtypecode | html %]" class="cancel">Cancel</a>
119         </fieldset>
120     </form>
121 [% END %]
122
123
124 [% IF ( delete_confirm ) %]
125     <div class="dialog alert">
126         <h3>Confirm deletion</h3>
127         <form action="[% script_name | html %]" method="post">
128             <table>
129                 <tr><th scope="row">Tag: </th><td>[% searchfield | html %] [% liblibrarian | html %]</td></tr>
130             </table>
131             <input type="hidden" name="op" value="delete_confirmed" />
132             <input type="hidden" name="authtypecode" value="[% authtypecode | html %]" />
133             <input type="hidden" name="searchfield" value="[% searchfield | html %]" />
134             <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete</button>
135         </form>
136         <form action="[% script_name | html %]" method="get">
137             <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
138         </form>
139     </div>
140 [% END %]
141
142 [% IF ( delete_confirmed ) %]
143
144   <div class="dialog message">  <h3>Data deleted</h3>
145     <form action="[% script_name | html %]" method="post">
146     <input type="hidden" name="authtypecode" value="[% authtypecode | html %]" />
147     <input type="hidden" name="searchfield" value="[% searchfield | html %]" />
148     <input type="submit" value="OK" class="submit" />
149     </form></div>
150 [% END %]
151 [% IF ( authtype_create ) %]
152
153     <form action="[% script_name | html %]" method="post">
154         <input type="hidden" name="op" value="authtype_create_confirm" />
155         <input type="hidden" name="authtypecode" value="[% authtypecode | html %]" />
156         Create authority framework for [% authtypecode | html %] using
157         <select name="existingauthtypecode">
158         [% FOREACH existingauthtypeloo IN existingauthtypeloop %]
159             [% IF existingauthtypeloo.value == "" %]
160               <option value="" selected="selected">[% existingauthtypeloo.authtypetext | html %]</option>
161             [% ELSE %]
162               <option value="[% existingauthtypeloo.value | html %]">[% existingauthtypeloo.authtypetext | html %]</option>
163             [% END %]
164         [% END %]
165         </select>
166         <input type="submit" value="OK" class="submit" />
167     </form>
168 [% END %]
169
170
171 [% IF ( else ) %]
172
173 <div id="toolbar" class="btn-toolbar">
174     <div class="btn-group"><a class="btn btn-default btn-sm" id="newtag" href="/cgi-bin/koha/admin/auth_tag_structure.pl?op=add_form&amp;authtypecode=[% authtypecode | html %]"><i class="fa fa-plus"></i> New tag</a></div>
175 </div>
176
177 <h2>Select an authority framework</h2>
178 <form action="[% script_name | html %]" method="post">
179     <select name="authtypecode">
180     [% FOREACH authority_type IN authority_types%]
181         [% IF authority_type.authtypecode == authtypecode%]
182         <option value="[% authority_type.authtypecode | html %]" selected="selected">[% authority_type.authtypetext | html %]</option>
183         [% ELSE %]
184         <option value="[% authority_type.authtypecode | html %]">[% authority_type.authtypetext | html %]</option>
185         [% END %]
186     [% END %]
187     </select>
188     <input type="text" name="searchfield" value="[% searchfield | html %]" />
189     <input type="submit" value="OK" class="submit" />
190 </form><br />
191 <div id="pagertable_authtagstructure">
192 </div>
193 <table id="table_authtagstructure">
194     <thead>
195         <tr>
196             <th>Tag</th>
197             <th>Lib</th>
198             <th>Repeatable</th>
199             <th>Mandatory</th>
200             <th>Authorized<br />value</th>
201             <th>&nbsp;</th>
202         </tr>
203     </thead>
204     <tbody>
205         [% FOREACH loo IN loop %]
206         <tr>
207             <td><b>[% loo.tagfield | html %]</b></td>
208             <td>[% loo.liblibrarian | html %]</td>
209             <td>[% IF ( loo.repeatable ) %]Yes[% ELSE %]No[% END %]</td>
210             <td>[% IF ( loo.mandatory ) %]Yes[% ELSE %]No[% END %]</td>
211             <td>[% loo.authorised_value | html %]</td>
212             <td>
213                 <div class="dropdown">
214                     <a class="btn btn-default btn-xs dropdown-toggle" id="authtagactions[% loo.tagfield | html %]" role="button" data-toggle="dropdown" href="#">
215                         Actions <b class="caret"></b></a>
216                     <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="authtagactions[% loo.tagfield | html %]">
217                         <li><a href="[% loo.subfield_link | html %]"><i class="fa fa-eye"></i> Subfields</a></li>
218                         <li><a href="[% loo.edit | html %]"><i class="fa fa-pencil"></i> Edit</a></li>
219                         <li><a href="[% loo.delete | html %]"><i class="fa fa-trash"></i> Delete</a></li>
220                     </ul>
221                 </div>
222             </td>
223         </tr>
224         [% END %]
225     </tbody>
226     </table>
227
228 [% END %]
229
230 </div>
231 </div>
232 <div class="yui-b">
233 [% INCLUDE 'admin-menu.inc' %]
234 </div>
235 </div>
236
237 [% MACRO jsinclude BLOCK %]
238     [% INCLUDE 'datatables.inc' %]
239     [% Asset.js("js/admin-menu.js") | $raw %]
240     <script type="text/javascript">
241         $(document).ready(function() {
242             $("#table_authtagstructure").dataTable($.extend(true, {}, dataTablesDefaults, {
243                 "aoColumnDefs": [
244                     { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
245                 ],
246                 "sPaginationType": "four_button"
247             }));
248         });
249     </script>
250 [% END %]
251 [% INCLUDE 'intranet-bottom.inc' %]