Bug 7483: fixes on breadcrumbs in Authority administration
[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 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
8 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.pager.js"></script>
9 <script type="text/javascript" id="js">$(document).ready(function() {
10         $("#table_authtagstructure").tablesorter({
11                 sortList: [[0,0]],
12                 headers: { 5: { sorter: false},6: { sorter: false},7: { sorter: false}}
13         }).tablesorterPager({container: $("#pagertable_authtagstructure"),positionFixed: false,size: 20});
14 }); </script>
15 <script type="text/javascript">
16 //<![CDATA[
17     /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
18     function isNotNull(f,noalert) {
19         if (f.value.length ==0) {
20 return false;
21         }
22         return true;
23     }
24     /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
25     function toUC(f) {
26         var x=f.value.toUpperCase();
27         f.value=x;
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             <option value="">Default</option>
188         [% FOREACH existingauthtypeloo IN existingauthtypeloop %]
189             <option value="[% existingauthtypeloo.value %]">[% existingauthtypeloo.authtypetext %]</option>
190         [% END %]
191         </select>
192         <input type="submit" value="OK" class="submit" />
193     </form>
194 [% END %]
195
196
197 [% IF ( else ) %]
198
199 <div id="toolbar">
200         <script type="text/javascript">
201         //<![CDATA[
202         // prepare DOM for YUI Toolbar
203          $(document).ready(function() {
204             yuiToolbar();
205          });
206         // YUI Toolbar Functions
207         function yuiToolbar() {
208             new YAHOO.widget.Button("newtag");
209         }       //]]>
210         </script>
211         <ul class="toolbar">
212     <li><a id="newtag" href="/cgi-bin/koha/admin/auth_tag_structure.pl?op=add_form&amp;authtypecode=[% authtypecode %]">New tag</a></li>
213 </ul></div>
214
215 <h2>Select an authority framework</h2>
216 <form action="[% script_name %]" method="post">
217     <select name="authtypecode">
218         <option value="">Default</option>
219     [% FOREACH authtypeloo IN authtypeloop %]
220                 [% IF ( authtypeloo.selected ) %]
221         <option value="[% authtypeloo.value %]" selected="selected">[% authtypeloo.authtypetext %]</option>
222                 [% ELSE %]
223         <option value="[% authtypeloo.value %]">[% authtypeloo.authtypetext %]</option>
224                 [% END %]
225             
226     [% END %]
227     </select>
228     <input type="text" name="searchfield" value="[% searchfield %]" />
229     <input type="submit" value="OK" class="submit" />
230 </form><br />
231 <div id="pagertable_authtagstructure">
232 [% INCLUDE 'table-pager.inc' perpage='20' %]
233 </div>
234 <table id="table_authtagstructure">
235     <thead>
236         <th>Tag</th>
237         <th>Lib</th>
238         <th>Repeatable</th>
239         <th>Mandatory</th>
240         <th>Authorized<br />value</th>
241         <th>Subfields</th>
242         <th>Edit</th>
243         <th>Delete</th>
244         </thead>
245     [% FOREACH loo IN loop %]
246         [% UNLESS ( loop.odd ) %]
247         <tr class="highlight">
248         [% ELSE %]
249         <tr>
250         [% END %]
251         <td><b>[% loo.tagfield %]</b></td>
252         <td>[% loo.liblibrarian %]</td>
253         <td>[% IF ( loo.repeatable ) %]Yes[% ELSE %]No[% END %]</td>
254         <td>[% IF ( loo.mandatory ) %]Yes[% ELSE %]No[% END %]</td>
255         <td>[% loo.authorised_value %]</td>
256         <td><a href="[% loo.subfield_link %]" class="button">subfields</a></td>
257         <td><a href="[% loo.edit %]">Edit</a></td>
258         <td><a href="[% loo.delete %]">Delete</a></td>
259     </tr>
260     [% END %]
261     </table>
262
263 [% END %]
264
265 </div>
266 </div>
267 <div class="yui-b">
268 [% INCLUDE 'admin-menu.inc' %]
269 </div>
270 </div>
271 [% INCLUDE 'intranet-bottom.inc' %]