Bug 11764 - Move repeatedly redefined function toUC() into staff-global.js
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / auth_tag_structure.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Administration &rsaquo; Authority MARC framework [% IF ( add_form ) %][% IF ( use_heading_flags_p ) %]
3     [% IF ( heading_modify_tag_p ) %]&rsaquo; [% IF ( authtypecode ) %][% authtypecode %] Framework[% ELSE %]Default framework[% END %] &rsaquo; Modify tag[% END %]
4     [% IF ( heading_add_tag_p ) %]&rsaquo; [% IF ( authtypecode ) %][% authtypecode %] Framework[% ELSE %]Default framework[% END %] &rsaquo; New tag[% END %]
5     [% 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>
6 [% INCLUDE 'doc-head-close.inc' %]
7
8 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
9 [% INCLUDE 'datatables.inc' %]
10 <script type="text/javascript">
11 //<![CDATA[
12  $(document).ready(function() {
13     $("#table_authtagstructure").dataTable($.extend(true, {}, dataTablesDefaults, {
14         "aoColumnDefs": [
15             { "aTargets": [ -1, -2, -3 ], "bSortable": false, "bSearchable": false },
16         ],
17         "iDisplayLength": 20,
18         "aLengthMenu": [[10, 20, 50, 100, -1], [10, 20, 50, 100, "All"]],
19         "sPaginationType": "four_button"
20     }));
21  });
22
23     /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
24     function isNotNull(f,noalert) {
25         if (f.value.length ==0) {
26 return false;
27         }
28         return true;
29     }
30     /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
31     function isNum(v,maybenull) {
32     var n = new Number(v.value);
33     if (isNaN(n)) {
34         return false;
35         }
36     if (maybenull==0 && v.value=='') {
37         return false;
38     }
39     return true;
40     }
41     /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
42     function isDate(f) {
43         var t = Date.parse(f.value);
44         if (isNaN(t)) {
45             return false;
46         }
47     }
48     /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
49     function Check(f) {
50         var ok=1;
51         var _alertString="";
52         var alertString2;
53         if (f.tagfield.value.length==0) {
54             _alertString += "\n- " + _("tag number missing");
55         }
56         if (_alertString.length==0) {
57             document.Aform.submit();
58         } else {
59             alertString2  = _("Form not submitted because of the following problem(s)");
60             alertString2 += "\n------------------------------------------------------------------------------------\n";
61             alertString2 += _alertString;
62             alert(alertString2);
63         }
64     }
65     //]]>
66 </script>
67 </head>
68 <body id="admin_auth_tag_structure" class="admin">
69 [% INCLUDE 'header.inc' %]
70 [% INCLUDE 'cat-search.inc' %]
71
72 <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;
73     <a href="/cgi-bin/koha/admin/authtypes.pl">Authority types</a> &rsaquo;
74     [% IF ( add_form ) %]
75         [% IF ( use_heading_flags_p ) %]
76             [% IF ( heading_modify_tag_p ) %]
77                 [% IF ( authtypecode ) %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=[% authtypecode %]">[% authtypecode %] Framework</a>
78                 [% ELSE %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Default framework</a>
79                 [% END %] &rsaquo; Modify tag
80             [% END %]
81             [% IF ( heading_add_tag_p ) %]
82                 [% IF ( authtypecode ) %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=[% authtypecode %]">[% authtypecode %] framework</a>
83                 [% ELSE %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Default framework</a>
84                 [% END %] &rsaquo; New tag
85             [% END %]
86         [% ELSE %]
87             [% IF ( authtypecode ) %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=[% authtypecode %]">[% authtypecode %] Framework</a>
88             [% ELSE %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Default framework</a>
89             [% END %] &rsaquo; [% action %]
90         [% END %]
91     [% ELSE %]
92         [% IF ( delete_confirm ) %]
93             [% IF ( authtypecode ) %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=[% authtypecode %]">[% authtypecode %] framework</a>
94             [% ELSE %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Default framework</a>
95             [% END %] &rsaquo; Confirm deletion
96         [% ELSE %]
97             [% IF ( delete_confirmed ) %]
98                 [% IF ( authtypecode ) %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=[% authtypecode %]">[% authtypecode %] framework</a>
99                 [% ELSE %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Default framework</a>
100                 [% END %] &rsaquo; Data deleted
101             [% ELSE %]
102                 [% IF ( authtypecode ) %][% authtypecode %] Framework</a>
103                 [% ELSE %]Default framework
104                 [% END %]
105             [% END %]
106         [% END %]
107     [% END %]
108 </div>
109
110 <div id="doc3" class="yui-t2">
111    
112    <div id="bd">
113     <div id="yui-main">
114     <div class="yui-b">
115
116 <h1>Authority MARC framework for [% IF ( authtypecode ) %][% authtypecode %][% ELSE %]default framework[% END %]</h1>
117
118
119 [% IF ( add_form ) %]
120
121     <h2>
122     [% IF ( use_heading_flags_p ) %]
123     [% IF ( heading_modify_tag_p ) %]Modify tag[% END %]
124     [% IF ( heading_add_tag_p ) %]New tag[% END %]
125     [% ELSE %][% action %][% END %]
126     </h2>
127     <form action="[% script_name %]" name="Aform" method="post">
128         <input type="hidden" name="op" value="add_validate" />
129         [% IF ( heading_modify_tag_p ) %]<input type="hidden" name="modif" value="1" />[% END %]
130         <input type="hidden" name="authtypecode" value="[% authtypecode %]" />
131         <fieldset class="rows"><ol>
132         <li><span class="label">Tag: </span>[% searchfield %]</li>
133         <li><label for="liblibrarian">Text for librarians: </label><input type="text" name="liblibrarian" id="liblibrarian" value="[% liblibrarian |html %]" size="40" maxlength="100" /></li>
134         <li><label for="libopac">Text for opac: </label><input type="text" name="libopac" id="libopac" value="[% libopac |html %]" size="40" maxlength="100" /></li>
135         <li><label for="repeatable">Repeatable: </label>
136             [% IF ( repeatable ) %]
137                 <input type="checkbox" name="repeatable" id="repeatable" value="1" checked="checked" />
138             [% ELSE %]
139                 <input type="checkbox" name="repeatable" id="repeatable" value="1" />
140             [% END %]
141         </li>
142         <li><label for="mandatory">Mandatory: </label>
143             [% IF ( mandatory ) %]
144                 <input type="checkbox" name="mandatory" id="mandatory" value="1" checked="checked" />
145             [% ELSE %]
146                 <input type="checkbox" name="mandatory" id="mandatory" value="1" />
147             [% END %]
148             </li>
149         <li><label for="authorised_value">Authorized value: </label>[% authorised_value %] (if you select a value here, the indicators will be limited to the authorized value list)</li>
150 </ol></fieldset>
151         <p><input type="button" value="Submit" class="button" onclick="Check(this.form)" /></p>
152     </form>
153 [% END %]
154
155
156 [% IF ( delete_confirm ) %]
157         <div class="dialog alert">
158         <h3>Confirm deletion</h3>
159         <form action="[% script_name %]" method="post">
160         <table>
161             <tr><th scope="row">Tag: </th><td>[% searchfield %] [% liblibrarian %]</td></tr>
162         </table>
163         <input type="hidden" name="op" value="delete_confirmed" />
164         <input type="hidden" name="authtypecode" value="[% authtypecode %]" />
165         <input type="hidden" name="searchfield" value="[% searchfield %]" />
166         <input type="submit" value="Yes, delete" class="approve"></form>
167         <form action="[% script_name %]" method="get"><input type="submit" class="deny" value="No, do not delete" /></form>
168         </div>
169 [% END %]
170
171 [% IF ( delete_confirmed ) %]
172
173   <div class="dialog message">  <h3>Data deleted</h3>
174     <form action="[% script_name %]" method="post">
175     <input type="hidden" name="authtypecode" value="[% authtypecode %]" />
176     <input type="hidden" name="searchfield" value="[% searchfield %]" />
177     <input type="submit" value="OK" class="submit" />
178     </form></div>
179 [% END %]
180 [% IF ( authtype_create ) %]
181
182     <form action="[% script_name %]" method="post">
183         <input type="hidden" name="op" value="authtype_create_confirm" />
184         <input type="hidden" name="authtypecode" value="[% authtypecode %]" />
185         Create authority framework for [% authtypecode %] using
186         <select name="existingauthtypecode">
187         [% FOREACH existingauthtypeloo IN existingauthtypeloop %]
188             [% IF existingauthtypeloo.value == "" %]
189               <option value="" selected="selected">[% existingauthtypeloo.authtypetext %]</option>
190             [% ELSE %]
191               <option value="[% existingauthtypeloo.value %]">[% existingauthtypeloo.authtypetext %]</option>
192             [% END %]
193         [% END %]
194         </select>
195         <input type="submit" value="OK" class="submit" />
196     </form>
197 [% END %]
198
199
200 [% IF ( else ) %]
201
202 <div id="toolbar" class="btn-toolbar">
203     <div class="btn-group"><a class="btn btn-small" id="newtag" href="/cgi-bin/koha/admin/auth_tag_structure.pl?op=add_form&amp;authtypecode=[% authtypecode %]"><i class="icon-plus"></i> New tag</a></div>
204 </div>
205
206 <h2>Select an authority framework</h2>
207 <form action="[% script_name %]" method="post">
208     <select name="authtypecode">
209     [% FOREACH authtypeloo IN authtypeloop %]
210         [% IF ( authtypeloo.selected ) %]
211         <option value="[% authtypeloo.value %]" selected="selected">[% authtypeloo.authtypetext %]</option>
212         [% ELSE %]
213         <option value="[% authtypeloo.value %]">[% authtypeloo.authtypetext %]</option>
214         [% END %]
215             
216     [% END %]
217     </select>
218     <input type="text" name="searchfield" value="[% searchfield %]" />
219     <input type="submit" value="OK" class="submit" />
220 </form><br />
221 <div id="pagertable_authtagstructure">
222 </div>
223 <table id="table_authtagstructure">
224     <thead>
225         <th>Tag</th>
226         <th>Lib</th>
227         <th>Repeatable</th>
228         <th>Mandatory</th>
229         <th>Authorized<br />value</th>
230         <th>Subfields</th>
231         <th>Edit</th>
232         <th>Delete</th>
233     </thead>
234     [% FOREACH loo IN loop %]
235     [% UNLESS ( loop.odd ) %]
236     <tr class="highlight">
237     [% ELSE %]
238     <tr>
239     [% END %]
240         <td><b>[% loo.tagfield %]</b></td>
241         <td>[% loo.liblibrarian %]</td>
242         <td>[% IF ( loo.repeatable ) %]Yes[% ELSE %]No[% END %]</td>
243         <td>[% IF ( loo.mandatory ) %]Yes[% ELSE %]No[% END %]</td>
244         <td>[% loo.authorised_value %]</td>
245         <td><a href="[% loo.subfield_link %]" class="button">subfields</a></td>
246         <td><a href="[% loo.edit %]">Edit</a></td>
247         <td><a href="[% loo.delete %]">Delete</a></td>
248     </tr>
249     [% END %]
250     </table>
251
252 [% END %]
253
254 </div>
255 </div>
256 <div class="yui-b">
257 [% INCLUDE 'admin-menu.inc' %]
258 </div>
259 </div>
260 [% INCLUDE 'intranet-bottom.inc' %]