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