Bug 20538: Remove the need of writing [% KOHA_VERSION %] everywhere
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / auth_tag_structure.tt
1 [% USE Asset %]
2 [% USE AuthorisedValues %]
3 [% SET footerjs = 1 %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha &rsaquo; Administration &rsaquo; Authority MARC framework [% IF ( add_form ) %][% IF ( use_heading_flags_p ) %]
6     [% IF ( heading_modify_tag_p ) %]&rsaquo; [% IF ( authtypecode ) %][% authtypecode %] Framework[% ELSE %]Default framework[% END %] &rsaquo; Modify tag[% END %]
7     [% IF ( heading_add_tag_p ) %]&rsaquo; [% IF ( authtypecode ) %][% authtypecode %] Framework[% ELSE %]Default framework[% END %] &rsaquo; New tag[% END %]
8     [% 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>
9 [% INCLUDE 'doc-head-close.inc' %]
10
11 [% Asset.css("css/datatables.css") %]
12 </head>
13
14 <body id="admin_auth_tag_structure" class="admin">
15 [% INCLUDE 'header.inc' %]
16 [% INCLUDE 'prefs-admin-search.inc' %]
17
18 <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;
19     <a href="/cgi-bin/koha/admin/authtypes.pl">Authority types</a> &rsaquo;
20     [% IF ( add_form ) %]
21         [% IF ( use_heading_flags_p ) %]
22             [% IF ( heading_modify_tag_p ) %]
23                 [% IF ( authtypecode ) %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=[% authtypecode %]">[% authtypecode %] Framework</a>
24                 [% ELSE %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Default framework</a>
25                 [% END %] &rsaquo; Modify tag
26             [% END %]
27             [% IF ( heading_add_tag_p ) %]
28                 [% IF ( authtypecode ) %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=[% authtypecode %]">[% authtypecode %] framework</a>
29                 [% ELSE %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Default framework</a>
30                 [% END %] &rsaquo; New tag
31             [% END %]
32         [% ELSE %]
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; [% action %]
36         [% END %]
37     [% ELSE %]
38         [% IF ( delete_confirm ) %]
39             [% IF ( authtypecode ) %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=[% authtypecode %]">[% authtypecode %] framework</a>
40             [% ELSE %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Default framework</a>
41             [% END %] &rsaquo; Confirm deletion
42         [% ELSE %]
43             [% IF ( delete_confirmed ) %]
44                 [% IF ( authtypecode ) %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=[% authtypecode %]">[% authtypecode %] framework</a>
45                 [% ELSE %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Default framework</a>
46                 [% END %] &rsaquo; Data deleted
47             [% ELSE %]
48                 [% IF ( authtypecode ) %][% authtypecode %] Framework
49                 [% ELSE %]Default framework
50                 [% END %]
51             [% END %]
52         [% END %]
53     [% END %]
54 </div>
55
56 <div id="doc3" class="yui-t2">
57    
58    <div id="bd">
59     <div id="yui-main">
60     <div class="yui-b">
61
62 <h1>Authority MARC framework for [% IF ( authtypecode ) %][% authtypecode %][% 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 %]" 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 %]" />
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 %]" />
81                         [% searchfield %]
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 %]" 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 %]" method="post">
127             <table>
128                 <tr><th scope="row">Tag: </th><td>[% searchfield %] [% liblibrarian %]</td></tr>
129             </table>
130             <input type="hidden" name="op" value="delete_confirmed" />
131             <input type="hidden" name="authtypecode" value="[% authtypecode %]" />
132             <input type="hidden" name="searchfield" value="[% searchfield %]" />
133             <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete</button>
134         </form>
135         <form action="[% script_name %]" 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 %]" method="post">
145     <input type="hidden" name="authtypecode" value="[% authtypecode %]" />
146     <input type="hidden" name="searchfield" value="[% searchfield %]" />
147     <input type="submit" value="OK" class="submit" />
148     </form></div>
149 [% END %]
150 [% IF ( authtype_create ) %]
151
152     <form action="[% script_name %]" method="post">
153         <input type="hidden" name="op" value="authtype_create_confirm" />
154         <input type="hidden" name="authtypecode" value="[% authtypecode %]" />
155         Create authority framework for [% authtypecode %] using
156         <select name="existingauthtypecode">
157         [% FOREACH existingauthtypeloo IN existingauthtypeloop %]
158             [% IF existingauthtypeloo.value == "" %]
159               <option value="" selected="selected">[% existingauthtypeloo.authtypetext %]</option>
160             [% ELSE %]
161               <option value="[% existingauthtypeloo.value %]">[% existingauthtypeloo.authtypetext %]</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 %]"><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 %]" 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 %]" selected="selected">[% authority_type.authtypetext %]</option>
182         [% ELSE %]
183         <option value="[% authority_type.authtypecode%]">[% authority_type.authtypetext %]</option>
184         [% END %]
185     [% END %]
186     </select>
187     <input type="text" name="searchfield" value="[% searchfield %]" />
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 %]</b></td>
207             <td>[% loo.liblibrarian %]</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 %]</td>
211             <td>
212                 <div class="dropdown">
213                     <a class="btn btn-default btn-xs dropdown-toggle" id="authtagactions[% loo.tagfield %]" 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 %]">
216                         <li><a href="[% loo.subfield_link %]"><i class="fa fa-eye"></i> Subfields</a></li>
217                         <li><a href="[% loo.edit %]"><i class="fa fa-pencil"></i> Edit</a></li>
218                         <li><a href="[% loo.delete %]"><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 </div>
230 </div>
231 <div class="yui-b">
232 [% INCLUDE 'admin-menu.inc' %]
233 </div>
234 </div>
235
236 [% MACRO jsinclude BLOCK %]
237     [% INCLUDE 'datatables.inc' %]
238     [% Asset.js("js/admin-menu.js") %]
239     <script type="text/javascript">
240         $(document).ready(function() {
241             $("#table_authtagstructure").dataTable($.extend(true, {}, dataTablesDefaults, {
242                 "aoColumnDefs": [
243                     { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
244                 ],
245                 "sPaginationType": "four_button"
246             }));
247         });
248     </script>
249 [% END %]
250 [% INCLUDE 'intranet-bottom.inc' %]