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