Bug 10651 - Use new DataTables include in administration templates
[koha-equinox.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / marctagstructure.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Administration &rsaquo;
3 [% IF ( add_form ) %]MARC frameworks &rsaquo; [% action %] [% searchfield %][% END %]
4 [% IF ( delete_confirm ) %]MARC frameworks &rsaquo; Confirm deletion of tag '[% searchfield %]'[% END %]
5 [% IF ( delete_confirmed ) %]MARC frameworks &rsaquo;  Data deleted[% END %]
6 [% IF ( else ) %]MARC frameworks[% END %]</title>
7 [% INCLUDE 'doc-head-close.inc' %]
8 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
9 [% INCLUDE 'datatables.inc' %]
10
11 <script type="text/javascript">
12 //<![CDATA[
13 function Check(f) {
14     var _alertString="";
15     var alertString2;
16     if (f.tagfield.value.length==0) {
17         _alertString += "\n- " + _("tag number missing");
18     }
19     if (_alertString.length==0) {
20         document.Aform.submit();
21     } else {
22         alertString2  = _("Form not submitted because of the following problem(s)");
23         alertString2 += "\n------------------------------------------------------------------------------------\n";
24         alertString2 += _alertString;
25         alert(alertString2);
26     }
27 }
28
29 $(document).ready(function() {
30     $("#table_marctagstructure").dataTable($.extend(true, {}, dataTablesDefaults, {
31         "aoColumnDefs": [
32             { "aTargets": [ -1, -2, -3 ], "bSortable": false, "bSearchable": false },
33         ],
34         "aLengthMenu": [[10, 20, 50, 100, -1], [10, 20, 50, 100, "All"]],
35         "iDisplayLength": 20,
36         "sPaginationType": "four_button"
37     }));
38 });
39
40 //]]>
41 </script>
42 </head>
43 <body id="admin_marctagstructure" class="admin">
44 [% INCLUDE 'header.inc' %]
45 [% INCLUDE 'cat-search.inc' %]
46
47 <div id="breadcrumbs">
48          <a href="/cgi-bin/koha/mainpage.pl">Home</a>
49 &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
50 &rsaquo; <a href="/cgi-bin/koha/admin/biblio_framework.pl">MARC frameworks</a>
51 [% IF ( add_form ) %]
52 &rsaquo; <a href="/cgi-bin/koha/admin/marctagstructure.pl?frameworkcode=[% frameworkcode %]">[% frameworktext %] ([% frameworkcode %])</a>
53 &rsaquo; [% action %] [% searchfield %]
54 [% ELSIF ( else ) %]
55 &rsaquo; <a href="/cgi-bin/koha/admin/marctagstructure.pl?frameworkcode=[% frameworkcode %]">[% IF ( frameworkcode ) %][% frameworktext %] ([% frameworkcode %])[% ELSE %]Default MARC framework[% END %]</a>
56 [% ELSIF ( delete_confirm ) %]
57 &rsaquo; <a href="/cgi-bin/koha/admin/marctagstructure.pl?frameworkcode=[% frameworkcode %]">[% frameworktext %] ([% frameworkcode %])</a>
58 &rsaquo; Confirm deletion of tag '[% searchfield %]'
59 [% ELSIF ( delete_confirmed ) %]
60 &rsaquo; <a href="/cgi-bin/koha/admin/marctagstructure.pl?frameworkcode=[% frameworkcode %]">[% frameworktext %] ([% frameworkcode %])</a>
61 &rsaquo; Data deleted
62 [% END %]
63 </div>
64
65 <div id="doc3" class="yui-t2">
66   <div id="bd">
67     <div id="yui-main">
68       <div class="yui-b">
69
70 [% IF ( else ) %]
71 <div id="toolbar" class="btn-toolbar">
72     <a class="btn btn-small" id="addtag" href="/cgi-bin/koha/admin/marctagstructure.pl?op=add_form&amp;frameworkcode=[% frameworkcode %]"><i class="icon-plus"></i> New tag</a>
73 </div>[% END %]
74
75 <h1>MARC Framework for [% IF ( frameworkcode ) %][% frameworktext %] ([% frameworkcode %])[% ELSE %]default MARC framework[% END %]</h1>
76
77 [% IF ( add_form ) %]
78
79     <form action="[% script_name %]" name="Aform" method="post">
80         
81       <fieldset class="rows"><legend>[% IF ( use_heading_flags_p ) %][% IF ( heading_modify_tag_p ) %]Modify tag <input type="hidden" name="modif" value="1" />[% searchfield %][% END %][% IF ( heading_add_tag_p ) %]Add tag[% END %][% ELSE %][% action %][% END %]</legend>  <input type="hidden" name="op" value="add_validate" />
82         <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
83
84         <ol> <li><label for="tagfield">Tag: </label><input id="tagfield" type="text" name="tagfield" value="[% searchfield %]" maxlength="3" size="3" /></li>    
85     <li><label for="liblibrarian">Label for lib: </label><input type="text" id="liblibrarian" name="liblibrarian" value="[% liblibrarian |html %]" size="40" maxlength="100" /></li>
86     <li><label for="libopac">Label for opac: </label><input type="text" id="libopac" name="libopac" value="[% libopac |html %]" size="40" maxlength="100" /></li>
87     <li><label for="repeatable">Repeatable: </label>[% repeatable %]</li>
88     <li><label for="mandatory">Mandatory: </label>[% mandatory %]</li>
89     <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>
90 </ol></fieldset> 
91     <fieldset class="action">
92         <input type="submit" value="Save Changes" onclick="Check(this.form)" />
93         <a class="cancel" href="[% script_name %]?frameworkcode=[% frameworkcode %]">Cancel</a>
94     </fieldset>
95     </form>
96 [% END %]
97
98
99 [% IF ( delete_confirm ) %]
100
101 <div class="dialog alert"><h3>Confirm deletion of tag <span class="ex">'[% searchfield %]'</span>?</h3>
102     <p>Tag: [% searchfield %]</p>
103     <p>Description: [% liblibrarian %]</p>
104     <form action="[% script_name %]" method="post">
105         <input type="hidden" name="op" value="delete_confirmed" />
106         <input type="hidden" name="searchfield" value="[% searchfield %]" /><input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
107         <input type="submit" class="approve" value="Yes, Delete this Tag" /></form>
108         
109         <form action="[% script_name %]" method="get"><input type="hidden" name="frameworkcode" value="[% frameworkcode %]" /><input type="submit" value="No, Do Not Delete" class="deny" /></form></div>
110 [% END %]
111
112 [% IF ( delete_confirmed ) %]
113
114     <div class="dialog message"><h3>Tag deleted</h3>
115     <form action="[% script_name %]" method="post"><input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
116     <input type="submit" value="OK" class="approve" />
117     </form></div>
118 [% END %]
119 [% IF ( framework_create ) %]
120
121     <form action="[% script_name %]" method="post">
122         <input type="hidden" name="op" value="framework_create_confirm" />
123         <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
124         Create framework for [% frameworkcode %] ([% frameworktext %]) using
125         <select name="existingframeworkcode">
126             <option value="">Default</option>
127         [% FOREACH existingframeworkloo IN existingframeworkloop %]
128             <option value="[% existingframeworkloo.value %]">[% existingframeworkloo.frameworktext %]</option>
129         [% END %]
130         </select>
131         <input type="submit" value="OK" />
132     </form>
133 [% END %]
134
135
136 [% IF ( else ) %]
137 <form name="f" action="[% script_name %]" method="post">
138 <fieldset style="padding:.5em;">
139         <label for="searchfield"><strong>Search for tag:</strong> </label>
140         <input type="text" name="searchfield" id="searchfield" size="4" value="[% searchfield %]" />
141
142 <label for="frameworkcode"><strong>In framework:</strong> </label>
143         <select id="frameworkcode" name="frameworkcode">
144             <option value="">Default</option>
145             [% FOREACH frameworkloo IN frameworkloop %]
146             [% IF ( frameworkloo.selected ) %]
147                 <option value="[% frameworkloo.value %]" selected="selected">[% frameworkloo.frameworktext %]</option>
148                 [% ELSE %]
149                 <option value="[% frameworkloo.value %]">[% frameworkloo.frameworktext %]</option>
150                 [% END %]
151             [% END %]
152         </select>
153     <input type="submit" value="Search" />
154 <p>        <label for="select_display">Display only used tags/subfields</label>
155         [% IF ( select_display ) %]
156             <input type="checkbox" name="select_display" id="select_display" value="True" checked="checked"  onchange="this.form.submit();" />
157         [% ELSE %]
158             <input type="checkbox" name="select_display" id="select_display" value="True" onchange="this.form.submit();" />
159         [% END %]</p>
160 </fieldset>
161 </form>
162
163     <table id="table_marctagstructure">
164     <thead>
165         <tr>
166         <th>Tag</th>
167         <th>Lib</th>
168         <th>Repeatable</th>
169         <th>Mandatory</th>
170         <th>Auth value</th>
171         <th>Subfields</th>
172         <th>Edit</th>
173         <th>Delete</th>
174         </tr>
175         </thead>
176     <tbody>
177     [% IF ( select_display ) %]
178         [% FOREACH loo IN loop %]
179             [% IF ( loop.odd ) %]<tr>[% ELSE %]<tr class="highlight">[% END %]
180             <td>[% loo.tagfield %]</td>
181             <td>[% loo.liblibrarian %]</td>
182             <td>[% IF ( loo.repeatable ) %]Yes[% ELSE %]No[% END %]</td>
183             <td>[% IF ( loo.mandatory ) %]Yes[% ELSE %]No[% END %]</td>
184             <td>[% loo.authorised_value %]</td>
185             <td><a href="[% loo.subfield_link %]">subfields</a></td>
186             <td><a href="[% loo.edit %]">Edit</a></td>
187             <td><a href="[% loo.delete %]">Delete</a></td>
188         </tr>
189       [% IF ( loop.odd ) %]<tr>[% ELSE %]<tr class="highlight">[% END %]
190             <td>&nbsp;</td>
191             <td colspan="7">
192                 [% FOREACH subfield IN loo.subfields %]
193                     <p> Tab:[% subfield.tab %] | $[% subfield.tagsubfield %]
194                             [% subfield.liblibrarian %] [% IF ( subfield.kohafield ) %][% subfield.kohafield %][% END %][% IF ( subfield.repeatable ) %], repeatable[% END %][% IF ( subfield.mandatory ) %], Mandatory[% END %][% IF ( subfield.seealso ) %], See [% subfield.seealso %][% END %][% IF ( subfield.authorised_value ) %], [% subfield.authorised_value %][% END %][% IF ( subfield.authtypecode ) %], [% subfield.authtypecode %][% END %][% IF ( subfield.value_builder ) %], [% subfield.value_builder %][% END %]
195                     </p>
196                 [% END %]
197             </td>
198         </tr>
199         [% END %]
200     [% ELSE %]
201     [% FOREACH loo IN loop %]
202     [% IF ( loop.odd ) %]<tr>[% ELSE %]<tr class="highlight">[% END %]
203         <td>[% loo.tagfield %]</td>
204         <td>[% loo.liblibrarian %]</td>
205         <td>[% IF ( loo.repeatable ) %]Yes[% ELSE %]No[% END %]</td>
206         <td>[% IF ( loo.mandatory ) %]Yes[% ELSE %]No[% END %]</td>
207         <td>[% loo.authorised_value %]</td>
208         <td><a href="[% loo.subfield_link %]">Subfields</a></td>
209         <td><a href="[% loo.edit %]">Edit</a></td>
210         <td><a href="[% loo.delete %]">Delete</a></td>
211     </tr>
212     [% END %]
213     [% END %]
214     </tbody>
215     </table>
216
217
218
219 [% END %]
220
221
222     </div>
223   </div>
224 <div class="yui-b">
225 [% INCLUDE 'admin-menu.inc' %]
226 </div>
227 </div>
228 [% INCLUDE 'intranet-bottom.inc' %]