Bug 21526: uri escape TT variables when used in 'a href'
[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 | uri %]">[% 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 | uri %]">[% 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 | uri %]">[% 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 | uri %]">[% 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 | uri %]">[% 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 class="main container-fluid">
58     <div class="row">
59         <div class="col-sm-10 col-sm-push-2">
60             <main>
61
62 <h1>Authority MARC framework for [% IF ( authtypecode ) %][% authtypecode | html %][% ELSE %]default framework[% END %]</h1>
63
64
65 [% IF ( add_form ) %]
66
67     <h2>
68     [% IF ( heading_modify_tag_p ) %]Modify tag[% END %]
69     [% IF ( heading_add_tag_p ) %]New tag[% END %]
70     </h2>
71     <form action="[% script_name | html %]" name="Aform" method="post" class="validated">
72         <input type="hidden" name="op" value="add_validate" />
73         [% IF ( heading_modify_tag_p ) %]<input type="hidden" name="modif" value="1" />[% END %]
74         <input type="hidden" name="authtypecode" value="[% authtypecode | html %]" />
75         <fieldset class="rows">
76             <ol>
77                 [% IF ( heading_modify_tag_p ) %]
78                     <li>
79                         <span class="label">Tag: </span>
80                         <input type="hidden" name="tagfield" value="[% searchfield | html %]" />
81                         [% searchfield | html %]
82                     </li>
83                 [% ELSE %]
84                     <li>
85                         <label for="tagfield" class="required">Tag: </label><input type="text" id="tagfield" name="tagfield" size="5" maxlength="3" required="required" class="required" />
86                         <span class="required">Required</span>
87                     </li>
88                 [% END %]
89
90         <li><label for="liblibrarian">Text for librarians: </label><input type="text" name="liblibrarian" id="liblibrarian" value="[% liblibrarian | html %]" size="40" maxlength="100" /></li>
91         <li><label for="libopac">Text for opac: </label><input type="text" name="libopac" id="libopac" value="[% libopac | html %]" size="40" maxlength="100" /></li>
92         <li><label for="repeatable">Repeatable: </label>
93             [% IF ( repeatable ) %]
94                 <input type="checkbox" name="repeatable" id="repeatable" value="1" checked="checked" />
95             [% ELSE %]
96                 <input type="checkbox" name="repeatable" id="repeatable" value="1" />
97             [% END %]
98         </li>
99         <li><label for="mandatory">Mandatory: </label>
100             [% IF ( mandatory ) %]
101                 <input type="checkbox" name="mandatory" id="mandatory" value="1" checked="checked" />
102             [% ELSE %]
103                 <input type="checkbox" name="mandatory" id="mandatory" value="1" />
104             [% END %]
105         </li>
106         <li><label for="authorised_value">Authorized value: </label>
107             <select name="authorised_value" id="authorised_value" size="1">
108                 <option value=""></option>
109                 [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => authorised_value ) %]
110             </select>
111             (if you select a value here, the indicators will be limited to the authorized value list)
112         </li>
113         </ol>
114         </fieldset>
115         <fieldset class="action">
116             <input type="submit" value="Submit" />
117             <a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=[% authtypecode | uri %]" class="cancel">Cancel</a>
118         </fieldset>
119     </form>
120 [% END %]
121
122
123 [% IF ( delete_confirm ) %]
124     <div class="dialog alert">
125         <h3>Confirm deletion</h3>
126         <form action="[% script_name | html %]" method="post">
127             <table>
128                 <tr><th scope="row">Tag: </th><td>[% searchfield | html %] [% liblibrarian | html %]</td></tr>
129             </table>
130             <input type="hidden" name="op" value="delete_confirmed" />
131             <input type="hidden" name="authtypecode" value="[% authtypecode | html %]" />
132             <input type="hidden" name="searchfield" value="[% searchfield | html %]" />
133             <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete</button>
134         </form>
135         <form action="[% script_name | html %]" method="get">
136             <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
137         </form>
138     </div>
139 [% END %]
140
141 [% IF ( delete_confirmed ) %]
142
143   <div class="dialog message">  <h3>Data deleted</h3>
144     <form action="[% script_name | html %]" method="post">
145     <input type="hidden" name="authtypecode" value="[% authtypecode | html %]" />
146     <input type="hidden" name="searchfield" value="[% searchfield | html %]" />
147     <input type="submit" value="OK" class="submit" />
148     </form></div>
149 [% END %]
150 [% IF ( authtype_create ) %]
151
152     <form action="[% script_name | html %]" method="post">
153         <input type="hidden" name="op" value="authtype_create_confirm" />
154         <input type="hidden" name="authtypecode" value="[% authtypecode | html %]" />
155         Create authority framework for [% authtypecode | html %] using
156         <select name="existingauthtypecode">
157         [% FOREACH existingauthtypeloo IN existingauthtypeloop %]
158             [% IF existingauthtypeloo.value == "" %]
159               <option value="" selected="selected">[% existingauthtypeloo.authtypetext | html %]</option>
160             [% ELSE %]
161               <option value="[% existingauthtypeloo.value | html %]">[% existingauthtypeloo.authtypetext | html %]</option>
162             [% END %]
163         [% END %]
164         </select>
165         <input type="submit" value="OK" class="submit" />
166     </form>
167 [% END %]
168
169
170 [% IF ( else ) %]
171
172 <div id="toolbar" class="btn-toolbar">
173     <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>
174 </div>
175
176 <h2>Select an authority framework</h2>
177 <form action="[% script_name | html %]" method="post">
178     <select name="authtypecode">
179     [% FOREACH authority_type IN authority_types%]
180         [% IF authority_type.authtypecode == authtypecode%]
181         <option value="[% authority_type.authtypecode | html %]" selected="selected">[% authority_type.authtypetext | html %]</option>
182         [% ELSE %]
183         <option value="[% authority_type.authtypecode | html %]">[% authority_type.authtypetext | html %]</option>
184         [% END %]
185     [% END %]
186     </select>
187     <input type="text" name="searchfield" value="[% searchfield | html %]" />
188     <input type="submit" value="OK" class="submit" />
189 </form><br />
190 <div id="pagertable_authtagstructure">
191 </div>
192 <table id="table_authtagstructure">
193     <thead>
194         <tr>
195             <th>Tag</th>
196             <th>Lib</th>
197             <th>Repeatable</th>
198             <th>Mandatory</th>
199             <th>Authorized<br />value</th>
200             <th>&nbsp;</th>
201         </tr>
202     </thead>
203     <tbody>
204         [% FOREACH loo IN loop %]
205         <tr>
206             <td><b>[% loo.tagfield | html %]</b></td>
207             <td>[% loo.liblibrarian | html %]</td>
208             <td>[% IF ( loo.repeatable ) %]Yes[% ELSE %]No[% END %]</td>
209             <td>[% IF ( loo.mandatory ) %]Yes[% ELSE %]No[% END %]</td>
210             <td>[% loo.authorised_value | html %]</td>
211             <td>
212                 <div class="dropdown">
213                     <a class="btn btn-default btn-xs dropdown-toggle" id="authtagactions[% loo.tagfield | html %]" role="button" data-toggle="dropdown" href="#">
214                         Actions <b class="caret"></b></a>
215                     <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="authtagactions[% loo.tagfield | html %]">
216                         <li><a href="[% loo.subfield_link | uri %]"><i class="fa fa-eye"></i> Subfields</a></li>
217                         <li><a href="[% loo.edit | uri %]"><i class="fa fa-pencil"></i> Edit</a></li>
218                         <li><a href="[% loo.delete | uri %]"><i class="fa fa-trash"></i> Delete</a></li>
219                     </ul>
220                 </div>
221             </td>
222         </tr>
223         [% END %]
224     </tbody>
225     </table>
226
227 [% END %]
228
229             </main>
230         </div> <!-- /.col-sm-10.col-sm-push-2 -->
231
232         <div class="col-sm-2 col-sm-pull-10">
233             <aside>
234                 [% INCLUDE 'admin-menu.inc' %]
235             </aside>
236         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
237      </div> <!-- /.row -->
238
239 [% MACRO jsinclude BLOCK %]
240     [% INCLUDE 'datatables.inc' %]
241     [% Asset.js("js/admin-menu.js") | $raw %]
242     <script>
243         $(document).ready(function() {
244             $("#table_authtagstructure").dataTable($.extend(true, {}, dataTablesDefaults, {
245                 "aoColumnDefs": [
246                     { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
247                 ],
248                 "sPaginationType": "four_button"
249             }));
250         });
251     </script>
252 [% END %]
253 [% INCLUDE 'intranet-bottom.inc' %]