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