Bug 15801: Koha::BiblioFrameworks - Remove C4::Koha::getframeworks
[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="[% interface %]/[% theme %]/css/datatables.css" />
9 [% INCLUDE 'datatables.inc' %]
10 <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.cookie.min.js"></script>
11
12 <script type="text/javascript">
13 //<![CDATA[
14
15 $(document).ready(function() {
16     $("#table_marctagstructure").dataTable($.extend(true, {}, dataTablesDefaults, {
17         "aoColumnDefs": [
18             { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
19         ],
20         "sPaginationType": "four_button"
21     }));
22     $("#select_display").on("change",function(){
23         var checked = $(this).prop("checked") ? 1: 0;
24         $.cookie('marctagstructure_selectdisplay', checked);
25         this.form.submit();
26     });
27 });
28
29 //]]>
30 </script>
31 </head>
32 <body id="admin_marctagstructure" class="admin">
33 [% INCLUDE 'header.inc' %]
34 [% INCLUDE 'cat-search.inc' %]
35
36 <div id="breadcrumbs">
37          <a href="/cgi-bin/koha/mainpage.pl">Home</a>
38 &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
39 &rsaquo; <a href="/cgi-bin/koha/admin/biblio_framework.pl">MARC frameworks</a>
40 [% IF ( add_form ) %]
41 &rsaquo; <a href="/cgi-bin/koha/admin/marctagstructure.pl?frameworkcode=[% frameworkcode %]">[% frameworktext %] ([% frameworkcode %])</a>
42 &rsaquo; [% action %] [% searchfield %]
43 [% ELSIF ( else ) %]
44 &rsaquo; <a href="/cgi-bin/koha/admin/marctagstructure.pl?frameworkcode=[% frameworkcode %]">[% IF ( frameworkcode ) %][% frameworktext %] ([% frameworkcode %])[% ELSE %]Default MARC framework[% END %]</a>
45 [% ELSIF ( delete_confirm ) %]
46 &rsaquo; <a href="/cgi-bin/koha/admin/marctagstructure.pl?frameworkcode=[% frameworkcode %]">[% frameworktext %] ([% frameworkcode %])</a>
47 &rsaquo; Confirm deletion of tag '[% searchfield %]'
48 [% ELSIF ( delete_confirmed ) %]
49 &rsaquo; <a href="/cgi-bin/koha/admin/marctagstructure.pl?frameworkcode=[% frameworkcode %]">[% frameworktext %] ([% frameworkcode %])</a>
50 &rsaquo; Data deleted
51 [% END %]
52 </div>
53
54 <div id="doc3" class="yui-t2">
55   <div id="bd">
56     <div id="yui-main">
57       <div class="yui-b">
58
59 [% IF ( else ) %]
60 <div id="toolbar" class="btn-toolbar">
61     <a class="btn btn-small" id="addtag" href="/cgi-bin/koha/admin/marctagstructure.pl?op=add_form&amp;frameworkcode=[% frameworkcode %]"><i class="fa fa-plus"></i> New tag</a>
62 </div>[% END %]
63
64 <h1>MARC Framework for [% IF ( frameworkcode ) %][% frameworktext %] ([% frameworkcode %])[% ELSE %]default MARC framework[% END %]</h1>
65
66 [% IF ( add_form ) %]
67
68     <form action="[% script_name %]" name="Aform" method="post" class="validated">
69         
70       <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" />
71         <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
72
73         <ol>
74             <li>
75                 [% IF ( heading_modify_tag_p ) %]
76                     <input type="hidden" name="tagfield" value="[% searchfield %]" />
77                     <span class="label">Tag:</span>
78                     [% searchfield %]
79                 [% ELSE %]
80                     <label for="tagfield" class="required">Tag: </label>
81                     <input id="tagfield" type="text" name="tagfield" value="[% searchfield %]" maxlength="3" size="3" required="required" class="required" />
82                     <span class="required">Required</span>
83                 [% END %]
84             </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>
88         [% IF ( repeatable ) %]
89             <input type="checkbox" name="repeatable" id="repeatable" value="1" checked="checked" />
90         [% ELSE %]
91             <input type="checkbox" name="repeatable" id="repeatable" value="1" />
92         [% END %]
93     </li>
94     <li><label for="mandatory">Mandatory: </label>
95         [% IF ( mandatory ) %]
96             <input type="checkbox" name="mandatory" id="mandatory" value="1" checked="checked" />
97         [% ELSE %]
98             <input type="checkbox" name="mandatory" id="mandatory" value="1" />
99         [% END %]
100     </li>
101     <li><label for="authorised_value">Authorized value: </label>
102         <select name="authorised_value" id="authorised_value" size="1">
103         [% FOREACH value IN authorised_value.values %]
104         [% IF ( value == authorised_value.default ) %]
105             <option value="[% value %]" selected="selected">[% value %]</option>
106         [% ELSE %]
107             <option value="[% value %]">[% value %]</option>
108         [% END %]
109         [% END %]
110         </select>
111         (if you select a value here, the indicators will be limited to the authorized value list)</li>
112 </ol></fieldset> 
113     <fieldset class="action">
114         <input type="submit" value="Save changes" />
115         <a class="cancel" href="[% script_name %]?frameworkcode=[% frameworkcode %]">Cancel</a>
116     </fieldset>
117     </form>
118 [% END %]
119
120
121 [% IF ( delete_confirm ) %]
122     <div class="dialog alert">
123         <h3>Confirm deletion of tag <span class="ex">'[% searchfield %]'</span>?</h3>
124         <p>Tag: [% searchfield %]</p>
125         <p>Description: [% liblibrarian %]</p>
126         <form action="[% script_name %]" method="post">
127             <input type="hidden" name="op" value="delete_confirmed" />
128             <input type="hidden" name="searchfield" value="[% searchfield %]" />
129             <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
130             <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete this tag</button>
131         </form>
132         <form action="[% script_name %]" method="get"><input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
133             <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
134         </form>
135     </div>
136 [% END %]
137
138 [% IF ( delete_confirmed ) %]
139
140     <div class="dialog message"><h3>Tag deleted</h3>
141     <form action="[% script_name %]" method="post"><input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
142         <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> OK</button>
143     </form></div>
144 [% END %]
145 [% IF ( framework_create ) %]
146
147     <form action="[% script_name %]" method="post">
148         <input type="hidden" name="op" value="framework_create_confirm" />
149         <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
150         Create framework for [% frameworkcode %] ([% frameworktext %]) using
151         <select name="existingframeworkcode">
152             <option value="">Default</option>
153         [% FOREACH existingframeworkloo IN existingframeworkloop %]
154             <option value="[% existingframeworkloo.value %]">[% existingframeworkloo.frameworktext %]</option>
155         [% END %]
156         </select>
157         <input type="submit" value="OK" />
158     </form>
159 [% END %]
160
161
162 [% IF ( else ) %]
163 <form name="f" action="[% script_name %]" method="post">
164 <fieldset style="padding:.5em;">
165         <label for="searchfield"><strong>Search for tag:</strong> </label>
166         <input type="text" name="searchfield" id="searchfield" size="4" value="[% searchfield %]" />
167
168 <label for="frameworkcode"><strong>In framework:</strong> </label>
169         <select id="frameworkcode" name="frameworkcode">
170             <option value="">Default</option>
171             [% FOREACH framework IN frameworks %]
172             [% IF framework.frameworkcode == frameworkcode %]
173                 <option value="[% framework.frameworkcode %]" selected="selected">[% framework.frameworktext %]</option>
174                 [% ELSE %]
175                 <option value="[% framework.frameworkcode %]">[% framework.frameworktext %]</option>
176                 [% END %]
177             [% END %]
178         </select>
179     <input type="submit" value="Search" />
180 <p>        <label for="select_display">Display only used tags/subfields</label>
181         [% IF ( select_display ) %]
182             <input type="checkbox" name="select_display" id="select_display" value="True" checked="checked" />
183         [% ELSE %]
184             <input type="checkbox" name="select_display" id="select_display" value="True" />
185         [% END %]</p>
186 </fieldset>
187 </form>
188
189     <table id="table_marctagstructure">
190     <thead>
191         <tr>
192         <th>Tag</th>
193         <th>Lib</th>
194         <th>Repeatable</th>
195         <th>Mandatory</th>
196         <th>Auth value</th>
197         <th>&nbsp;</th>
198         </tr>
199     </thead>
200     <tbody>
201     [% IF ( select_display ) %]
202         [% FOREACH loo IN loop %]
203         <tr>
204             <td>[% loo.tagfield %]</td>
205             <td>
206                 [% loo.liblibrarian %]
207                 [% FOREACH subfield IN loo.subfields %]
208                     <p>
209                         Tab:[% subfield.tab %] | $[% subfield.tagsubfield %]
210                         [% 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 %]
211                     </p>
212                 [% END %]
213             </td>
214             <td>[% IF ( loo.repeatable ) %]Yes[% ELSE %]No[% END %]</td>
215             <td>[% IF ( loo.mandatory ) %]Yes[% ELSE %]No[% END %]</td>
216             <td>[% loo.authorised_value %]</td>
217             <td>
218                 <div class="dropdown">
219                     <a class="btn btn-mini dropdown-toggle" id="marctagactions[% loo.tagfield %]" role="button" data-toggle="dropdown" href="#">
220                         Actions <b class="caret"></b></a>
221                     <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="marctagactions[% loo.tagfield %]">
222                         <li><a href="[% loo.subfield_link %]"><i class="fa fa-eye"></i> Subfields</a></li>
223                         <li><a href="[% loo.edit %]"><i class="fa fa-pencil"></i> Edit</a></li>
224                         <li><a href="[% loo.delete %]"><i class="fa fa-trash"></i> Delete</a></li>
225                     </ul>
226                 </div>
227             </td>
228         </tr>
229         [% END %]
230     [% ELSE %]
231     [% FOREACH loo IN loop %]
232     <tr>
233         <td>[% loo.tagfield %]</td>
234         <td>[% loo.liblibrarian %]</td>
235         <td>[% IF ( loo.repeatable ) %]Yes[% ELSE %]No[% END %]</td>
236         <td>[% IF ( loo.mandatory ) %]Yes[% ELSE %]No[% END %]</td>
237         <td>[% loo.authorised_value %]</td>
238         <td>
239             <div class="dropdown">
240                 <a class="btn btn-mini dropdown-toggle" id="marctagactions[% loo.tagfield %]" role="button" data-toggle="dropdown" href="#">
241                     Actions <b class="caret"></b></a>
242                 <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="marctagactions[% loo.tagfield %]">
243                     <li><a href="[% loo.subfield_link %]"><i class="fa fa-eye"></i> Subfields</a></li>
244                     <li><a href="[% loo.edit %]"><i class="fa fa-pencil"></i> Edit</a></li>
245                     <li><a href="[% loo.delete %]"><i class="fa fa-trash"></i> Delete</a></li>
246                 </ul>
247             </div>
248         </td>
249     </tr>
250     [% END %]
251     [% END %]
252     </tbody>
253     </table>
254
255
256
257 [% END %]
258
259
260     </div>
261   </div>
262 <div class="yui-b">
263 [% INCLUDE 'admin-menu.inc' %]
264 </div>
265 </div>
266 [% INCLUDE 'intranet-bottom.inc' %]