Merge remote-tracking branch 'kc/new/bug_5868' into kcmaster
[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>
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; [% IF ( add_form ) %][% IF ( use_heading_flags_p ) %]
73     [% IF ( heading_modify_tag_p ) %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Authority MARC Framework</a> &rsaquo; [% IF ( authtypecode ) %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=[% authtypecode %]">[% authtypecode %] Framework</a>[% ELSE %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Default Framework</a>[% END %] &rsaquo; Modify tag[% END %]
74     [% IF ( heading_add_tag_p ) %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Authority MARC Framework</a> &rsaquo; [% IF ( authtypecode ) %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=[% authtypecode %]">[% authtypecode %] Framework</a>[% ELSE %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Default Framework</a>[% END %] &rsaquo; New tag[% END %]
75     [% ELSE %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Authority MARC Framework</a> &rsaquo; [% action %]
76     [% END %]
77     [% ELSE %]
78     [% IF ( delete_confirm ) %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Authority MARC Framework</a> &rsaquo;
79     [% IF ( authtypecode ) %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=[% authtypecode %]">[% authtypecode %] Framework</a>
80     [% ELSE %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Default Framework</a>[% END %] &rsaquo; Confirm Deletion
81     [% ELSE %]
82     [% IF ( delete_confirmed ) %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Authority MARC Framework</a> &rsaquo; Data Deleted
83     [% ELSE %]Authority MARC Framework: [% IF ( authtypecode ) %][% authtypecode %] Framework
84     [% ELSE %]Default Framework[% END %]
85     [% END %]
86     [% END %]
87     [% END %]
88 </div>
89
90 <div id="doc3" class="yui-t2">
91    
92    <div id="bd">
93         <div id="yui-main">
94         <div class="yui-b">
95
96 <h1>Authority MARC framework for [% IF ( authtypecode ) %][% authtypecode %][% ELSE %]default framework[% END %]</h1>
97
98
99 [% IF ( add_form ) %]
100
101     <h2>
102     [% IF ( use_heading_flags_p ) %]
103     [% IF ( heading_modify_tag_p ) %]Modify tag[% END %]
104     [% IF ( heading_add_tag_p ) %]New tag[% END %]
105     [% ELSE %][% action %][% END %]
106     </h2>
107     <form action="[% script_name %]" name="Aform" method="post">
108         <input type="hidden" name="op" value="add_validate" />
109         [% IF ( heading_modify_tag_p ) %]<input type="hidden" name="modif" value="1" />[% END %]
110         <input type="hidden" name="authtypecode" value="[% authtypecode %]" />
111         <fieldset class="rows"><ol>
112                 <li><span class="label">Tag</span>[% searchfield %]</li>
113         <li><label for="liblibrarian">Text for librarians</label><input type="text" name="liblibrarian" id="liblibrarian" value="[% liblibrarian |html %]" size="40" maxlength="100" /></li>
114         <li><label for="libopac">Text for opac</label><input type="text" name="libopac" id="libopac" value="[% libopac |html %]" size="40" maxlength="100" /></li>
115         <li><label for="repeatable">Repeatable</label>
116             [% IF ( repeatable ) %]
117                 <input type="checkbox" name="repeatable" id="repeatable" value="1" checked="checked" />
118             [% ELSE %]
119                 <input type="checkbox" name="repeatable" id="repeatable" value="1" />
120             [% END %]
121         </li>
122         <li><label for="mandatory">Mandatory</label>
123             [% IF ( mandatory ) %]
124                 <input type="checkbox" name="mandatory" id="mandatory" value="1" checked="checked" />
125             [% ELSE %]
126                 <input type="checkbox" name="mandatory" id="mandatory" value="1" />
127             [% END %]
128             </li>
129         <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>
130 </ol></fieldset>
131         <p><input type="button" value="Submit" class="button" onclick="Check(this.form)" /></p>
132     </form>
133 [% END %]
134
135
136 [% IF ( delete_confirm ) %]
137                 <div class="dialog alert">
138                 <h3>Confirm Deletion</h3>
139                 <form action="[% script_name %]" method="post">
140                 <table>
141                         <tr><th scope="row">Tag: </th><td>[% searchfield %] [% liblibrarian %]</td></tr>
142                 </table>
143         <input type="hidden" name="op" value="delete_confirmed" />
144         <input type="hidden" name="authtypecode" value="[% authtypecode %]" />
145         <input type="hidden" name="searchfield" value="[% searchfield %]" />
146                 <input type="submit" value="Yes, Delete" class="approve"></form>
147                 <form action="[% script_name %]" method="get"><input type="submit" class="deny" value="No, Do Not Delete" /></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             <option value="">Default</option>
168         [% FOREACH existingauthtypeloo IN existingauthtypeloop %]
169             <option value="[% existingauthtypeloo.value %]">[% existingauthtypeloo.authtypetext %]</option>
170         [% END %]
171         </select>
172         <input type="submit" value="OK" class="submit" />
173     </form>
174 [% END %]
175
176
177 [% IF ( else ) %]
178
179 <div id="toolbar">
180         <script type="text/javascript">
181         //<![CDATA[
182         // prepare DOM for YUI Toolbar
183          $(document).ready(function() {
184             yuiToolbar();
185          });
186         // YUI Toolbar Functions
187         function yuiToolbar() {
188             new YAHOO.widget.Button("newtag");
189         }       //]]>
190         </script>
191         <ul class="toolbar">
192         <li><a id="newtag" href="/cgi-bin/koha/admin/auth_tag_structure.pl?op=add_form&amp;authtypecode=[% authtypecode %]">New Tag</a></li>
193 </ul></div>
194
195 <h2>Select an authority framework</h2>
196 <form action="[% script_name %]" method="post">
197     <select name="authtypecode">
198         <option value="">Default</option>
199     [% FOREACH authtypeloo IN authtypeloop %]
200                 [% IF ( authtypeloo.selected ) %]
201         <option value="[% authtypeloo.value %]" selected="selected">[% authtypeloo.authtypetext %]</option>
202                 [% ELSE %]
203         <option value="[% authtypeloo.value %]">[% authtypeloo.authtypetext %]</option>
204                 [% END %]
205             
206     [% END %]
207     </select>
208     <input type="text" name="searchfield" value="[% searchfield %]" />
209     <input type="submit" value="OK" class="submit" />
210 </form><br />
211 <span id="pagertable_authtagstructure" class="pager">
212         <form class="formpager">&nbsp;<strong>page(s)</strong>&nbsp;:
213                 <img src="[% interface %]/prog/img/first.png" class="first"/>
214                 <img src="[% interface %]/prog/img/prev.png" class="prev"/>
215                 <input type="text" size="5" class="pagedisplay"/>
216                 <img src="[% interface %]/prog/img/next.png" class="next"/>
217                 <img src="[% interface %]/prog/img/last.png" class="last"/>
218                 , entries/page : 
219                 <select class="pagesize">
220                 <option value="10">10</option>
221                         <option selected="selected" value="20">20</option>
222                         <option value="30">30</option>
223                         <option value="40">40</option>
224                         <option value="50">50</option>
225                         <option value="100">100</option>
226                 </select>
227 </form>
228 </span>
229 <table id="table_authtagstructure">
230     <thead>
231         <th>Tag</th>
232         <th>Lib</th>
233         <th>Repeatable</th>
234         <th>Mandatory</th>
235         <th>Authorized<br />value</th>
236         <th>Subfields</th>
237         <th>Edit</th>
238         <th>Delete</th>
239         </thead>
240     [% FOREACH loo IN loop %]
241         [% UNLESS ( loop.odd ) %]
242         <tr class="highlight">
243         [% ELSE %]
244         <tr>
245         [% END %]
246         <td><b>[% loo.tagfield %]</b></td>
247         <td>[% loo.liblibrarian %]</td>
248         <td>[% IF ( loo.repeatable ) %]Yes[% ELSE %]No[% END %]</td>
249         <td>[% IF ( loo.mandatory ) %]Yes[% ELSE %]No[% END %]</td>
250         <td>[% loo.authorised_value %]</td>
251         <td><a href="[% loo.subfield_link %]" class="button">subfields</a></td>
252         <td><a href="[% loo.edit %]">Edit</a></td>
253         <td><a href="[% loo.delete %]">Delete</a></td>
254     </tr>
255     [% END %]
256     </table>
257
258 [% END %]
259
260 </div>
261 </div>
262 <div class="yui-b">
263 [% INCLUDE 'admin-menu.inc' %]
264 </div>
265 </div>
266 [% INCLUDE 'intranet-bottom.inc' %]