Bug 19603: Move admin templates JavaScript to the footer: Patrons and circulation
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / marc_subfields_structure.tt
1 [% SET footerjs = 1 %]
2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Koha &rsaquo; Administration &rsaquo;[% IF ( add_form ) %][% IF ( use_heading_flags_p ) %][% IF ( heading_edit_subfields_p ) %] MARC subfield structure &rsaquo; Edit MARC subfields constraints[% END %][% ELSE %] MARC subfield structure &rsaquo; [% action %][% END %][% END %]
4 [% IF ( delete_confirm ) %] MARC subfield structure &rsaquo; Confirm deletion of subfield [% tagsubfield %][% END %][% IF ( delete_confirmed ) %] MARC subfield structure &rsaquo; Subfield deleted[% END %][% IF ( else ) %]MARC subfield structure[% END %]</title>
5 [% INCLUDE 'doc-head-close.inc' %]
6 </head>
7
8 <body id="admin_marc_subfields_structure" class="admin">
9 [% INCLUDE 'header.inc' %]
10 [% INCLUDE 'prefs-admin-search.inc' %]
11
12 <div id="breadcrumbs">
13   <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> &rsaquo; <a href="/cgi-bin/koha/admin/biblio_framework.pl">MARC frameworks</a> &rsaquo; <a href="/cgi-bin/koha/admin/marctagstructure.pl?frameworkcode=[% frameworkcode %]&amp;searchfield=[% tagfield | uri %]">[% IF ( frameworkcode ) %][% frameworkcode %][% ELSE %]Default[% END %] framework structure</a> &rsaquo;
14   [% IF ( add_form ) %]
15   [% IF ( use_heading_flags_p ) %]
16   [% IF ( heading_edit_subfields_p ) %] <a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=[% tagfield | uri %]&amp;frameworkcode=[% frameworkcode %]">Tag [% tagfield | html %] subfield structure</a> &rsaquo; Edit subfields constraints
17   [% END %]
18   [% ELSE %] <a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=[% tagfield | uri %]&amp;frameworkcode=[% frameworkcode %]">Tag [% tagfield | html %] Subfield structure</a> &rsaquo; [% action %]
19   [% END %]
20   [% END %]
21 [% IF ( delete_confirm ) %] <a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=[% tagfield | uri %]&amp;frameworkcode=[% frameworkcode %]">Tag [% tagfield | html %] Subfield structure</a> &rsaquo; Confirm deletion of subfield [% tagsubfield %]
22 [% END %]
23 [% IF ( delete_confirmed ) %] <a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=[% tagfield | uri %]&amp;frameworkcode=[% frameworkcode %]">Tag [% tagfield | html %] subfield structure</a> &rsaquo; Subfield deleted
24 [% END %]
25 [% IF ( else ) %]Tag [% tagfield | html %] Subfield structure[% END %]
26 </div>
27
28 <div id="doc3" class="yui-t2">
29
30     <div id="bd">
31     <div id="yui-main">
32     <div class="yui-b">
33
34 [% IF ( add_form ) %]
35     <h1>
36         [% IF ( use_heading_flags_p ) %]
37             [% IF ( heading_edit_subfields_p ) %]Tag [% tagfield | html %] Subfield constraints[% END %]
38         [% ELSE %]
39             [% action %]
40         [% END %]
41     </h1>
42     <form action="[% script_name %]" name="Aform" method="post">
43     <input type="hidden" name="op" value="add_validate" />
44     <input type="hidden" name="tagfield" value="[% tagfield | html %]" />
45     <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
46     <div id="subfieldtabs" class="toptabs numbered">
47    <ul>
48         [% FOREACH loo IN loop %]
49             [% IF ( loo.new_subfield ) %]
50                 <li><a href="#sub[% loo.urisubfieldcode %]field" title="[% loo.liblibrarian | html_entity %]">New</a></li>
51             [% ELSE %]
52                 <li><a href="#sub[% loo.urisubfieldcode %]field" title="[% loo.liblibrarian | html_entity %]">
53                     [% loo.subfieldcode %]
54                </a></li>
55             [% END %]
56         [% END %]
57     </ul>
58     
59     [% FOREACH loo IN loop %] 
60         <div class="constraints" id="sub[% loo.urisubfieldcode %]field">
61
62                <h3><a href="#basic[% loo.urisubfieldcode %]">Basic constraints</a></h3>
63                     <div id="basic[% loo.urisubfieldcode %]">
64                     <fieldset class="rows">
65                         <ol>
66                                 [% IF ( subfieldcode == 0 || subfieldcode ) %] 
67                                 <li><span class="label">Subfield code:</span> [% loo.subfieldcode %] <input type="hidden" name="tagsubfield" value="[% loo.subfieldcode %]" /></li>
68                                 [% ELSE %]
69                                 <li><label for="tagsubfield[% loo.row %]">Subfield code:</label> <input type="text" id="tagsubfield[% loo.row %]" name="tagsubfield" value="[% loo.subfieldcode %]" /></li>
70                                 [% END %]
71                         <li><label for="liblibrarian[% loo.row %]">Text for librarian: </label><input id="liblibrarian[% loo.row %]" type="text" name="liblibrarian" value="[% loo.liblibrarian | html_entity %]" size="40" maxlength="80" /></li>
72                         <li><label for="libopac[% loo.row %]">Text for OPAC: </label><input type="text" id="libopac[% loo.row %]" name="libopac" value="[% loo.libopac | html_entity %]" size="40" maxlength="80" /></li>
73                         <li>
74                             <label for="repeatable[% loo.row %]">Repeatable: </label>
75                             [% IF loo.repeatable %]
76                                 <input type="checkbox" id="repeatable[% loo.row %]" name="repeatable[% loo.row %]" checked="checked" value="1" />
77                             [% ELSE %]
78                                 <input type="checkbox" id="repeatable[% loo.row %]" name="repeatable[% loo.row %]" value="1" />
79                             [% END %]
80                         </li>
81                         <li>
82                             <label for="mandatory[% loo.row %]">Mandatory: </label>
83                             [% IF loo.mandatory %]
84                                 <input type="checkbox" id="mandatory[% loo.row %]" name="mandatory[% loo.row %]" checked="checked" value="1" />
85                             [% ELSE %]
86                                 <input type="checkbox" id="mandatory[% loo.row %]" name="mandatory[% loo.row %]" value="1" />
87                             [% END %]
88                         </li>
89                         <li><label for="tab[% loo.row %]">Managed in tab: </label>
90                             <select name="tab" tabindex="" size="1" id="tab[% loo.row %]">
91                             [%- IF ( loo.tab ==  -1 ) -%]
92                                 <option value="-1" selected="selected">ignore</option>
93                             [%- ELSE -%]
94                                 <option value="-1">ignore</option>
95                             [%- END -%]
96                             [%- FOREACH t IN [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] -%]
97                                 [%- IF ( loo.tab ==  t ) -%]
98                                 <option value="[%- t -%]" selected="selected">[%- t -%]</option>
99                                 [%- ELSE -%]
100                                 <option value="[%- t -%]">[%- t -%]</option>
101                                 [%- END -%]
102                             [%- END -%]
103                             [%- IF ( loo.tab ==  10 ) -%]
104                                 <option value="10" selected="selected">items (10)</option>
105                             [%- ELSE -%]
106                                 <option value="10">items (10)</option>
107                             [%- END -%]
108                             </select>
109                             (ignore means that the subfield does not display in the record editor)
110                         </li>
111                         </ol>
112                     </fieldset>
113                     </div>
114
115
116             <h3><a href="#advanced[% loo.urisubfieldcode %]">Advanced constraints</a></h3>
117             <div id="advanced[% loo.urisubfieldcode %]">
118             <fieldset class="rows">
119                 <ol><li><label for="defaultvalue[% loo.row %]">Default value:</label>
120                     <input type="text" name="defaultvalue" id="defaultvalue[% loo.row %]" value="[% loo.defaultvalue %]" /></li>
121                                 <li><label for="maxlength[% loo.row %]">Max length:</label><input type="text" id="maxlength[% loo.row %]" name="maxlength" value="[% loo.maxlength %]" size="4" /> (see online help)</li>
122                 <li><input type="hidden" id="hidden-[% loo.row %]" name="hidden" value="[% loo.hidden %]" />
123                     <label for="hidden[% loo.row %]" style="float: none;">Visibility: </label>
124                     <input type="checkbox" id="hidden_opac_[% loo.row %]" class="inclusive_[% loo.row %]" name="hidden_opac_[% loo.row %]"/>
125                     <label for="hidden_opac_[% loo.row %]" style="float: none;">OPAC</label>
126                     <input type="checkbox" id="hidden_intranet_[% loo.row %]" class="inclusive_[% loo.row %]" name="hidden_intranet_[% loo.row %]"/>
127                     <label for="hidden_intranet_[% loo.row %]" style="float: none;">Intranet</label>
128                     <input type="checkbox" id="hidden_editor_[% loo.row %]" class="inclusive_[% loo.row %]" name="hidden_editor_[% loo.row %]"/>
129                     <label for="hidden_editor_[% loo.row %]" style="float: none;">Editor</label>
130                     <input type="checkbox" id="hidden_collapsed_[% loo.row %]" class="inclusive_[% loo.row %]" name="hidden_collapsed_[% loo.row %]"/>
131                     <label for="hidden_collapsed_[% loo.row %]" style="float: none;">Collapsed</label>
132                     <input type="checkbox" id="hidden_flagged_[% loo.row %]" name="flagged_[% loo.row %]"/>
133                     <label for="hidden_flagged_[% loo.row %]" style="float: none;">Flagged</label>
134                 </li>
135                 <li>
136                     <label for="isurl[% loo.row %]">Is a URL:</label>
137                     [% IF loo.isurl %]
138                         <input type="checkbox" id="isurl[% loo.row %]" name="isurl[% loo.row %]" checked="checked" value="1" />
139                     [% ELSE %]
140                         <input type="checkbox" id="isurl[% loo.row %]" name="isurl[% loo.row %]" value="1" />
141                     [% END %]
142                     (if checked, it means that the subfield is a URL and can be clicked)
143                 </li>
144                 <li><label for="link[% loo.row %]">Link:</label><input type="text" id="link[% loo.row %]" name="link" value="[% loo.link %]" size="10" maxlength="80" /> (e.g., Title or Local-Number) <span class="error"><em>NOTE: If you change this value you must ask your administrator to run misc/batchRebuildBiblioTables.pl.</em></span></li>
145                 <li>
146                     <label for="kohafield[% loo.row %]">Koha link:</label>
147                     <!-- This select should be DISABLED; value is submitted by the following hidden input -->
148                     <select name="kohafield" id="kohafield[% loo.row %]" size="1" disabled>
149                     [% FOREACH value IN loo.kohafields %]
150                       [% IF ( value == loo.kohafield ) %]
151                         <option value="[% value %]" selected="selected">[% value %]</option>
152                       [% ELSE %]
153                         <option value="[% value %]">[% value %]</option>
154                       [% END %]
155                     [% END %]
156                     </select>
157                     <!-- Do NOT remove this next hidden input! We need it to save kohafield. -->
158                     <input type="hidden" name="kohafield" value="[% loo.kohafield %]"/>
159                 </li>
160                         </ol>
161             </fieldset>
162             </div>
163             <h3><a href="#oth[% loo.urisubfieldcode %]">Other options (choose one)</a></h3>
164             <div id="oth[% loo.urisubfieldcode %]">
165             <fieldset class="rows">
166                         <ol>
167                             <li>
168                                 <label for="authorised_value[% loo.row %]">Authorized value:</label>
169                                 <select name="authorised_value" id="authorised_value[% loo.row %]" size="1">
170                                 <option value=""></option>
171                                 [% FOREACH value IN loo.authorised_values %]
172                                     [% IF ( value == loo.authorised_value ) %]
173                                     <option value="[% value %]" selected="selected">[% value %]</option>
174                                     [% ELSE %]
175                                     <option value="[% value %]">[% value %]</option>
176                                     [% END %]
177                                 [% END %]
178                                 </select>
179                             </li>
180                             <li>
181                                 <label for="authtypecode[% loo.row %]">Thesaurus:</label>
182                                 <select name="authtypecode" id="authtypecode[% loo.row %]" size="1">
183                                 [% FOREACH value IN loo.authtypes %]
184                                     [% IF ( value == loo.authtypecode ) %]
185                                     <option value="[% value %]" selected="selected">[% value %]</option>
186                                     [% ELSE %]
187                                     <option value="[% value %]">[% value %]</option>
188                                     [% END %]
189                                 [% END %]
190                                 </select>
191                             </li>
192                             <li>
193                                 <label for="value_builder[% loo.row %]">Plugin:</label>
194                                 <select name="value_builder" id="value_builder[% loo.row %]" size="1">
195                                 [% FOREACH value IN loo.value_builders %]
196                                     [% IF ( value == loo.value_builder ) %]
197                                     <option value="[% value %]" selected="selected">[% value %]</option>
198                                     [% ELSE %]
199                                     <option value="[% value %]">[% value %]</option>
200                                     [% END %]
201                                 [% END %]
202                                 </select>
203                             </li>
204                         </ol>
205             </fieldset>
206             </div>
207         </div><!-- /content_sub -->
208         [% END %]
209                 </div><!-- /content -->
210     <fieldset class="action">
211         <input type="submit" value="Save changes" /> <a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=[% tagfield  | uri %]&amp;frameworkcode=[% frameworkcode %]" class="cancel">Cancel</a>
212     </fieldset>
213     </form>
214 [% END %]
215
216 [% IF ( delete_confirm ) %]
217
218     <div class="dialog alert">
219         <h3>Confirm deletion of subfield [% tagsubfield %]?</h3>
220         <p>Subfield: [% tagsubfield %]</p>
221         <p>Description: [% liblibrarian | html_entity %]</p>
222
223         <form action="[% delete_link %]" method="post"><input type="hidden" name="op" value="delete_confirmed" />
224             <input type="hidden" name="searchfield" value="[% searchfield %]" />
225             <input type="hidden" name="tagfield" value="[% tagfield | html %]" />
226             <input type="hidden" name="tagsubfield" value="[% tagsubfield %]" />
227             <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
228             <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete this subfield</button>
229         </form>
230
231
232         <form action="[% script_name %]" method="post">
233             <input type="hidden" name="searchfield" value="[% searchfield %]" />
234             <input type="hidden" name="tagfield" value="[% tagfield | html%]" />
235             <input type="hidden" name="tagsubfield" value="[% tagsubfield %]" />
236             <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
237             <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
238         </form>
239     </div>
240
241 [% END %]
242
243 [% IF ( delete_confirmed ) %]
244
245     <h3>Data deleted</h3>
246     <form action="[% script_name %]" method="post">
247         <input type="hidden" name="tagfield" value="[% tagfield | html %]" />
248     <input type="submit" value="OK" />
249     </form>
250 [% END %]
251
252
253 [% IF ( else ) %]
254 <h1>MARC subfield structure admin for [% tagfield | html %] [% IF ( frameworkcode ) %](framework [% frameworkcode %])[% ELSE %](default framework)[% END %]</h1>
255 <p>This screen shows the subfields associated with the selected tag. You can edit subfields or add a new one by clicking on edit.</p>
256 <p>The column 'Koha field' shows that the subfield is linked with a Koha field.</p>
257
258 <table>
259 <tr>
260     <th>Subfield</th>
261     <th>Text</th>
262     <th>Constraints</th>
263     <th>Actions</th>
264 </tr>
265 [% FOREACH loo IN loop %]
266 <tr>
267     <td><a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?op=add_form&amp;tagfield=[% loo.tagfield %]&amp;frameworkcode=[% frameworkcode %]#sub[% loo.tagsubfield %]field">[% loo.tagsubfield %]</a></td>
268     <td>
269         [% IF ( loo.subfield_ignored ) %]
270             <i>[% loo.liblibrarian | html_entity %]</i>
271         [% ELSE %]
272             [% loo.liblibrarian | html_entity %]
273         [% END %]
274     </td>
275     <td>
276         [% IF ( loo.subfield_ignored ) %]
277             <i>subfield ignored</i>
278         [% ELSE %]
279             Tab:[% loo.tab %],
280             [% IF ( loo.kohafield ) %] | Koha field: [% loo.kohafield %], [% END %]
281             [% IF ( loo.repeatable ) %]Repeatable, [% ELSE %]Not repeatable,[% END %]
282             [% IF ( loo.mandatory ) %]Mandatory, [% ELSE %]Not mandatory,[% END %]
283             [% IF ( loo.seealso ) %] | See Also: [% loo.seealso %],[% END %]
284             [% IF ( loo.hidden ) %]hidden,[% END %]
285             [% IF ( loo.isurl ) %]is a URL,[% END %]
286             [% IF ( loo.authorised_value ) %] | Auth value:[% loo.authorised_value %],[% END %]
287             [% IF ( loo.authtypecode ) %] | Authority:[% loo.authtypecode %],[% END %]
288             [% IF ( loo.value_builder ) %] | Plugin:[% loo.value_builder %],[% END %]
289             [% IF ( loo.link ) %] | Link:[% loo.link %],[% END %]
290         [% END %]
291     </td>
292     <td class="actions">
293         <a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?op=add_form&amp;tagfield=[% loo.tagfield %]&amp;frameworkcode=[% frameworkcode %]#sub[% loo.tagsubfield %]field" class="btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a>
294         <a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?op=delete_confirm&amp;tagfield=[% loo.tagfield %]&amp;tagsubfield=[% loo.tagsubfield %]&amp;frameworkcode=[% frameworkcode %]" class="btn btn-default btn-xs"><i class="fa fa-trash"></i> Delete</a>
295     </td>
296 </tr>
297 [% END %]
298 </table>
299
300 <form action="[% script_name %]" method="get">
301     <fieldset class="action"><input type="hidden" name="op" value="add_form" />
302     <input type="hidden" name="tagfield" value="[% edit_tagfield %]" />
303     <input type="hidden" name="frameworkcode" value="[% edit_frameworkcode %]" />
304     <input type="submit" value="Edit subfields" />
305         <a class="cancel" href="marctagstructure.pl?searchfield=[% tagfield | uri %]&amp;frameworkcode=[% frameworkcode %]">Cancel</a>
306         </fieldset>
307 </form>
308
309 [% END %]
310
311
312
313 </div>
314 </div>
315 <div class="yui-b noprint">
316     [% INCLUDE 'admin-menu.inc' %]
317 </div>
318 </div>
319
320 [% MACRO jsinclude BLOCK %]
321     <script type="text/javascript" src="[% interface %]/[% theme %]/js/admin-menu.js"></script>
322     <script type="text/javascript" src="[% interface %]/[% theme %]/js/marc_subfields_structure.js"></script>
323 [% END %]
324 [% INCLUDE 'intranet-bottom.inc' %]