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