Bug 27846: admin folder
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / marc_subfields_structure.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% SET footerjs = 1 %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>
6     Koha &rsaquo; Administration &rsaquo;
7     [%- IF ( add_form ) -%]
8         [%- IF ( use_heading_flags_p ) -%]
9             [%- IF ( heading_edit_subfields_p ) -%]
10                 MARC subfield structure &rsaquo; Edit MARC subfields constraints
11             [%- END -%]
12         [%- ELSE -%]
13             MARC subfield structure &rsaquo; [%- action | html -%]
14         [%- END -%]
15     [%- END -%]
16     [%- IF ( delete_confirm ) -%]
17         MARC subfield structure &rsaquo; Confirm deletion of subfield [%- mss.tagsubfield | html -%]
18     [%- END -%]
19     [%- IF ( else ) -%]
20         MARC subfield structure
21     [%- END -%]
22 </title>
23 [% INCLUDE 'doc-head-close.inc' %]
24 <style>.constraints::after { content:  " "; clear: both; display:block; }</style>
25 </head>
26
27 <body id="admin_marc_subfields_structure" class="admin">
28     [% INCLUDE 'header.inc' %]
29     [% INCLUDE 'prefs-admin-search.inc' %]
30
31     <nav aria-label="Breadcrumb" class="breadcrumb">
32         <ol>
33             <li>
34                 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
35             </li>
36             <li>
37                 <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
38             </li>
39             <li>
40                 <a href="/cgi-bin/koha/admin/biblio_framework.pl">MARC frameworks</a>
41             </li>
42             <li>
43                 <a href="/cgi-bin/koha/admin/marctagstructure.pl?frameworkcode=[% frameworkcode | uri %]&amp;searchfield=[% tagfield | uri %]">
44                     [% IF ( frameworkcode ) %]
45                         [% frameworkcode | html %]
46                     [% ELSE %]
47                         Default
48                     [% END %] framework structure
49                 </a>
50             </li>
51
52             [% IF ( add_form ) %]
53                 [% IF ( use_heading_flags_p ) %]
54                     [% IF ( heading_edit_subfields_p ) %]
55                         <li>
56                             <a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=[% tagfield | uri %]&amp;frameworkcode=[% frameworkcode | uri %]">Tag [% tagfield | html %] subfield structure</a>
57                         </li>
58                         <li>
59                             <a href="#" aria-current="page">
60                                 Edit subfields constraints
61                             </a>
62                         </li>
63                     [% END %]
64                 [% ELSE %]
65                     <li>
66                         <a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=[% tagfield | uri %]&amp;frameworkcode=[% frameworkcode | uri %]">Tag [% tagfield | html %] Subfield structure</a>
67                     </li>
68                     <li>
69                         <a href="#" aria-current="page">
70                             [% action | html %]
71                         </a>
72                     </li>
73                 [% END %]
74             [% END %]
75
76             [% IF ( delete_confirm ) %]
77                 <li>
78                     <a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=[% mss.tagfield | uri %]&amp;frameworkcode=[% mss.frameworkcode | uri %]">Tag [% mss.tagfield | html %] Subfield structure</a>
79                 </li>
80                 <li>
81                     <a href="#" aria-current="page">
82                         Confirm deletion of subfield [% mss.tagsubfield | html %]i
83                     </a>
84                 </li>
85             [% END %]
86
87             [% IF ( else ) %]
88                 <li>
89                     <a href="#" aria-current="page">
90                         Tag [% tagfield | html %] Subfield structure
91                     </a>
92                 </li>
93             [% END %]
94         </ol>
95     </nav> <!-- /#breadcrumbs -->
96
97     <div class="main container-fluid">
98         <div class="row">
99             <div class="col-sm-10 col-sm-push-2">
100                 <main>
101
102                     [% IF ( add_form ) %]
103                         <h1>
104                             [% IF ( use_heading_flags_p ) %]
105                                 [% IF ( heading_edit_subfields_p ) %]Tag [% tagfield | html %] Subfield constraints[% END %]
106                             [% ELSE %]
107                                 [% action | html %]
108                             [% END %]
109                         </h1>
110
111                         <form action="[% script_name | html %]" name="Aform" method="post">
112                             <input type="hidden" name="op" value="add_validate" />
113                             <input type="hidden" name="tagfield" value="[% tagfield | html %]" />
114                             <input type="hidden" name="frameworkcode" value="[% frameworkcode | html %]" />
115
116                             <div id="subfieldtabs" class="toptabs numbered">
117                                 <ul>
118                                     [% FOREACH loo IN loop %]
119                                         <li id="tab_subfield_[% loo.urisubfieldcode | html %]">
120                                             [% IF ( loo.new_subfield ) %]
121                                                 <a href="#sub[% loo.urisubfieldcode | uri %]field" title="[% loo.liblibrarian | html_entity %]">New</a>
122                                             [% ELSE %]
123                                                 <a href="#sub[% loo.urisubfieldcode | uri %]field" title="[% loo.liblibrarian | html_entity %]">
124                                                     [% loo.subfieldcode | html %]
125                                                 </a>
126                                             [% END %]
127                                         </li>
128                                     [% END %]
129                                 </ul>
130
131                                 [% FOREACH loo IN loop %]
132                                     <div class="constraints" id="sub[% loo.urisubfieldcode | uri %]field">
133                                         <div id="basic[% loo.urisubfieldcode | html %]" class="contraints">
134                                             <fieldset class="rows">
135                                                 <legend>Basic constraints</legend>
136                                                 <ol>
137                                                     [% IF ( subfieldcode == 0 || subfieldcode ) %]
138                                                         <li>
139                                                             <span class="label">Subfield code:</span>
140                                                             [% loo.subfieldcode | html %] <input type="hidden" name="tagsubfield" value="[% loo.subfieldcode | html %]" />
141                                                         </li>
142                                                     [% ELSE %]
143                                                         <li>
144                                                             <label for="tagsubfield[% loo.row | html %]">Subfield code:</label>
145                                                                 <input type="text" id="tagsubfield[% loo.row | html %]" name="tagsubfield" value="[% loo.subfieldcode | html %]" />
146                                                             </li>
147                                                     [% END %]
148                                                     <li>
149                                                         <label for="liblibrarian[% loo.row | html %]">Text for librarian: </label>
150                                                         <input id="liblibrarian[% loo.row | html %]" type="text" name="liblibrarian" value="[% loo.liblibrarian | html_entity %]" size="40" maxlength="80" />
151                                                     </li>
152                                                     <li>
153                                                         <label for="libopac[% loo.row | html %]">Text for OPAC: </label>
154                                                         <input type="text" id="libopac[% loo.row | html %]" name="libopac" value="[% loo.libopac | html_entity %]" size="40" maxlength="80" />
155                                                     </li>
156                                                     <li>
157                                                         <label for="repeatable[% loo.row | html %]">Repeatable: </label>
158                                                         [% IF loo.repeatable %]
159                                                             <input type="checkbox" id="repeatable[% loo.row | html %]" name="repeatable[% loo.row | html %]" checked="checked" value="1" />
160                                                         [% ELSE %]
161                                                             <input type="checkbox" id="repeatable[% loo.row | html %]" name="repeatable[% loo.row | html %]" value="1" />
162                                                         [% END %]
163                                                     </li>
164                                                     <li>
165                                                         <label for="mandatory[% loo.row | html %]">Mandatory: </label>
166                                                         [% IF loo.mandatory %]
167                                                             <input type="checkbox" id="mandatory[% loo.row | html %]" name="mandatory[% loo.row | html %]" checked="checked" value="1" />
168                                                         [% ELSE %]
169                                                             <input type="checkbox" id="mandatory[% loo.row | html %]" name="mandatory[% loo.row | html %]" value="1" />
170                                                         [% END %]
171                                                     </li>
172                                                     <li>
173                                                         <label for="important[% loo.row | html %]">Important: </label>
174                                                         [% IF loo.important %]
175                                                             <input type="checkbox" id="important[% loo.row | html %]" name="important[% loo.row | html %]" checked="checked" value="1" />
176                                                         [% ELSE %]
177                                                             <input type="checkbox" id="important[% loo.row | html %]" name="important[% loo.row | html %]" value="1" />
178                                                         [% END %]
179                                                     </li>
180                                                     <li><label for="tab[% loo.row | html %]">Managed in tab: </label>
181                                                         <select name="tab" tabindex="" size="1" id="tab[% loo.row | html %]">
182                                                         [%- IF ( loo.tab ==  -1 ) -%]
183                                                             <option value="-1" selected="selected">ignore</option>
184                                                         [%- ELSE -%]
185                                                             <option value="-1">ignore</option>
186                                                         [%- END -%]
187                                                         [%- FOREACH t IN [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] -%]
188                                                             [%- IF ( loo.tab ==  t ) -%]
189                                                             <option value="[%- t | html -%]" selected="selected">[%- t | html -%]</option>
190                                                             [%- ELSE -%]
191                                                             <option value="[%- t | html -%]">[%- t | html -%]</option>
192                                                             [%- END -%]
193                                                         [%- END -%]
194                                                         [%- IF ( loo.tab ==  10 ) -%]
195                                                             <option value="10" selected="selected">items (10)</option>
196                                                         [%- ELSE -%]
197                                                             <option value="10">items (10)</option>
198                                                         [%- END -%]
199                                                         </select>
200                                                         <div class="hint">Ignore means that the subfield does not display in the record editor</div>
201                                                     </li>
202                                                 </ol>
203                                             </fieldset> <!-- /.rows -->
204                                         </div> <!-- /#basic[% loo.urisubfieldcode | html %] -->
205
206                                         <div id="advanced[% loo.urisubfieldcode | html %]" class="contraints">
207                                             <fieldset class="rows">
208                                                 <legend>Advanced constraints</legend>
209                                                 <ol>
210                                                     <li>
211                                                         <label for="defaultvalue[% loo.row | html %]">Default value:</label>
212                                                         <input type="text" name="defaultvalue" id="defaultvalue[% loo.row | html %]" value="[% loo.defaultvalue | html %]" />
213                                                     </li>
214                                                     <li>
215                                                         <label for="maxlength[% loo.row | html %]">Max length:</label>
216                                                         <input type="text" id="maxlength[% loo.row | html %]" name="maxlength" value="[% loo.maxlength | html %]" size="4" />
217                                                     </li>
218                                                     <li>
219                                                         [% IF loo.hidden_protected %]
220                                                             <input type="hidden" id="hidden-[% loo.row | html %]" name="hidden" value="[% loo.hidden | html %]" data-koha-protected="1" />
221                                                         [% ELSE %]
222                                                             <input type="hidden" id="hidden-[% loo.row | html %]" name="hidden" value="[% loo.hidden | html %]" />
223                                                         [% END %]
224                                                         <label for="hidden[% loo.row | html %]">Visibility: </label>
225                                                         <input type="checkbox" id="hidden_opac_[% loo.row | html %]" class="inclusive_[% loo.row | html %]" name="hidden_opac_[% loo.row | html %]"/>
226                                                         <label for="hidden_opac_[% loo.row | html %]" style="float: none;">OPAC</label>
227                                                         <input type="checkbox" id="hidden_intranet_[% loo.row | html %]" class="inclusive_[% loo.row | html %]" name="hidden_intranet_[% loo.row | html %]"/>
228                                                         <label for="hidden_intranet_[% loo.row | html %]" style="float: none;">Intranet</label>
229                                                         <input type="checkbox" id="hidden_editor_[% loo.row | html %]" class="inclusive_[% loo.row | html %]" name="hidden_editor_[% loo.row | html %]"/>
230                                                         <label for="hidden_editor_[% loo.row | html %]" style="float: none;">Editor</label>
231                                                         <input type="checkbox" id="hidden_collapsed_[% loo.row | html %]" class="inclusive_[% loo.row | html %]" name="hidden_collapsed_[% loo.row | html %]"/>
232                                                         <label for="hidden_collapsed_[% loo.row | html %]" style="float: none;">Collapsed</label>
233                                                         <input type="checkbox" id="hidden_flagged_[% loo.row | html %]" name="flagged_[% loo.row | html %]"/>
234                                                         <label for="hidden_flagged_[% loo.row | html %]" style="float: none;">Flagged</label>
235                                                     </li>
236                                                     <li>
237                                                         <label for="isurl[% loo.row | html %]">Is a URL:</label>
238                                                         [% IF loo.isurl %]
239                                                             <input type="checkbox" id="isurl[% loo.row | html %]" name="isurl[% loo.row | html %]" checked="checked" value="1" />
240                                                         [% ELSE %]
241                                                             <input type="checkbox" id="isurl[% loo.row | html %]" name="isurl[% loo.row | html %]" value="1" />
242                                                         [% END %]
243                                                         <div class="hint">If checked, it means that the subfield is a URL and can be clicked</div>
244                                                     </li>
245                                                     <li>
246                                                         <label for="link[% loo.row | html %]">Link:</label>
247                                                         <input type="text" id="link[% loo.row | html %]" name="link" value="[% loo.link | html %]" size="10" maxlength="80" />
248                                                         <div class="hint">An index name, e.g. title or Local-Number</div>
249                                                     </li>
250                                                     <li>
251                                                         <label for="kohafield[% loo.row | html %]">Koha link:</label>
252                                                         <!-- This select should be DISABLED; value is submitted by the following hidden input -->
253                                                         <select name="kohafield" id="kohafield[% loo.row | html %]" size="1" disabled>
254                                                         [% FOREACH value IN loo.kohafields %]
255                                                         [% IF ( value == loo.kohafield ) %]
256                                                             <option value="[% value | html %]" selected="selected">[% value | html %]</option>
257                                                         [% ELSE %]
258                                                             <option value="[% value | html %]">[% value | html %]</option>
259                                                         [% END %]
260                                                         [% END %]
261                                                         </select>
262                                                         <!-- Do NOT remove this next hidden input! We need it to save kohafield. -->
263                                                         <input type="hidden" name="kohafield" value="[% loo.kohafield | html %]"/>
264                                                     </li>
265                                                 </ol>
266                                             </fieldset> <!-- /.rows -->
267                                         </div> <!-- /#advanced[% loo.urisubfieldcode | html %] -->
268
269                                         <div id="oth[% loo.urisubfieldcode | html %]" class="constraints">
270                                             <fieldset class="rows">
271                                                 <legend>Other options (choose one)</legend>
272                                                 <ol>
273                                                     <li>
274                                                         <label for="authorised_value[% loo.row | html %]">Authorized value:</label>
275                                                         <select name="authorised_value" id="authorised_value[% loo.row | html %]" size="1">
276                                                         <option value=""></option>
277                                                         [% FOREACH value IN loo.authorised_values %]
278                                                             [% IF ( value == loo.authorised_value ) %]
279                                                                 <option value="[% value | html %]" selected="selected">[% value | html %]</option>
280                                                             [% ELSE %]
281                                                                 <option value="[% value | html %]">[% value | html %]</option>
282                                                             [% END %]
283                                                         [% END %]
284                                                         </select>
285                                                     </li>
286                                                     <li>
287                                                         <label for="authtypecode[% loo.row | html %]">Thesaurus:</label>
288                                                         <select name="authtypecode" id="authtypecode[% loo.row | html %]" size="1">
289                                                         [% FOREACH value IN loo.authtypes %]
290                                                             [% IF ( value == loo.authtypecode ) %]
291                                                                 <option value="[% value | html %]" selected="selected">[% value | html %]</option>
292                                                             [% ELSE %]
293                                                                 <option value="[% value | html %]">[% value | html %]</option>
294                                                             [% END %]
295                                                         [% END %]
296                                                         </select>
297                                                     </li>
298                                                     <li>
299                                                         <label for="value_builder[% loo.row | html %]">Plugin:</label>
300                                                         <select name="value_builder" id="value_builder[% loo.row | html %]" size="1">
301                                                         [% FOREACH value IN loo.value_builders %]
302                                                             [% IF ( value == loo.value_builder ) %]
303                                                                 <option value="[% value | html %]" selected="selected">[% value | html %]</option>
304                                                             [% ELSE %]
305                                                                 <option value="[% value | html %]">[% value | html %]</option>
306                                                             [% END %]
307                                                         [% END %]
308                                                         </select>
309                                                     </li>
310                                                 </ol>
311                                             </fieldset> <!-- /.rows -->
312                                         </div> <!-- /#oth[% loo.urisubfieldcode | html %] -->
313                                     </div><!-- /constraints -->
314                                 [% END # /FOREACH loo %]
315                             </div><!-- /subfieldtabs -->
316
317                             <fieldset class="action">
318                                 <input type="submit" value="Save changes" /> <a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=[% tagfield  | uri %]&amp;frameworkcode=[% frameworkcode | uri %]" class="cancel">Cancel</a>
319                             </fieldset>
320                         </form>
321                     [% END # /IF ( add_form ) %]
322
323                     [% IF ( delete_confirm ) %]
324                         <div class="dialog alert">
325                             <h3>Confirm deletion of subfield [% mss.tagsubfield | html %]?</h3>
326                             <p>Subfield: [% mss.tagsubfield | html %]</p>
327                             <p>Description: [% mss.liblibrarian | html_entity %]</p>
328
329                             <form action="[% delete_link | html %]" method="post"><input type="hidden" name="op" value="delete_confirmed" />
330                                 <input type="hidden" name="tagfield" value="[% mss.tagfield | html %]" />
331                                 <input type="hidden" name="tagsubfield" value="[% mss.tagsubfield | html %]" />
332                                 <input type="hidden" name="frameworkcode" value="[% mss.frameworkcode | html %]" />
333                                 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete this subfield</button>
334                             </form>
335
336
337                             <form action="[% script_name | html %]" method="post">
338                                 <input type="hidden" name="tagfield" value="[% mss.tagfield | html %]" />
339                                 <input type="hidden" name="tagsubfield" value="[% mss.tagsubfield | html %]" />
340                                 <input type="hidden" name="frameworkcode" value="[% mss.frameworkcode | html %]" />
341                                 <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
342                             </form>
343                         </div> <!-- /.dialog.alert -->
344                     [% END # /IF ( delete_confirm ) %]
345
346                     [% IF ( else ) %]
347                         <h1>MARC subfield structure admin for [% tagfield | html %] [% IF ( frameworkcode ) %](framework [% frameworkcode | html %])[% ELSE %](default framework)[% END %]</h1>
348
349                         <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>
350                         <p>The column 'Koha field' shows that the subfield is linked with a Koha field.</p>
351
352                         <table id="table_marcsubfieldstructure">
353                             <thead>
354                                 <tr>
355                                     <th>Subfield</th>
356                                     <th>Text</th>
357                                     <th>Constraints</th>
358                                     <th class="NoSort noExport">Actions</th>
359                                 </tr>
360                             </thead>
361                             <tbody>
362                                 [% FOREACH loo IN loop %]
363                                     <tr>
364                                         <td><a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?op=add_form&amp;tagfield=[% loo.tagfield | uri %]&amp;frameworkcode=[% frameworkcode | uri %]#sub[% loo.tagsubfield | uri %]field">[% loo.tagsubfield | html %]</a></td>
365                                         <td>
366                                             [% IF loo.tab == -1 %]
367                                                 <em>[% loo.liblibrarian | html_entity %]</em>
368                                             [% ELSE %]
369                                                 [% loo.liblibrarian | html_entity %]
370                                             [% END %]
371                                         </td>
372                                         <td>
373                                             [% IF loo.tab == -1 %]
374                                                 <em>subfield ignored</em>
375                                             [% ELSE %]
376                                                 Tab:[% loo.tab | html %],
377                                                 [% IF ( loo.kohafield ) %] | Koha field: [% loo.kohafield | html %], [% END %]
378                                                 [% IF ( loo.repeatable ) %]Repeatable, [% ELSE %]Not repeatable,[% END %]
379                                                 [% IF ( loo.mandatory ) %]Mandatory, [% ELSE %]Not mandatory,[% END %]
380                                                 [% IF ( loo.important ) %]Important, [% ELSE %]Not important,[% END %]
381                                                 [% IF ( loo.seealso ) %] | See Also: [% loo.seealso | html %],[% END %]
382                                                 [% IF ( loo.hidden ) %]hidden,[% END %]
383                                                 [% IF ( loo.isurl ) %]is a URL,[% END %]
384                                                 [% IF ( loo.authorised_value ) %] | Auth value:[% loo.authorised_value | html %],[% END %]
385                                                 [% IF ( loo.authtypecode ) %] | Authority:[% loo.authtypecode | html %],[% END %]
386                                                 [% IF ( loo.value_builder ) %] | Plugin:[% loo.value_builder | html %],[% END %]
387                                                 [% IF ( loo.link ) %] | Link:[% loo.link | html %],[% END %]
388                                             [% END %]
389                                         </td>
390                                         <td class="actions">
391                                             <a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?op=add_form&amp;tagfield=[% loo.tagfield | uri %]&amp;frameworkcode=[% frameworkcode | uri %]#sub[% loo.tagsubfield | uri %]field" class="btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a>
392                                             <a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?op=delete_confirm&amp;tagfield=[% loo.tagfield | uri %]&amp;tagsubfield=[% loo.tagsubfield | uri %]&amp;frameworkcode=[% frameworkcode | uri %]" class="btn btn-default btn-xs"><i class="fa fa-trash"></i> Delete</a>
393                                         </td>
394                                     </tr>
395                                 [% END %]
396                             </tbody>
397                         </table> <!-- /#table_marcsubfieldstructure -->
398
399                         <form action="[% script_name | html %]" method="get">
400                             <fieldset class="action"><input type="hidden" name="op" value="add_form" />
401                                 <input type="hidden" name="tagfield" value="[% edit_tagfield | html %]" />
402                                 <input type="hidden" name="frameworkcode" value="[% edit_frameworkcode | html %]" />
403                                 <input type="submit" value="Edit subfields" />
404                                 <a class="cancel" href="marctagstructure.pl?searchfield=[% tagfield | uri %]&amp;frameworkcode=[% frameworkcode | html %]">Cancel</a>
405                             </fieldset>
406                         </form>
407
408                     [% END # /IF else %]
409
410                 </main>
411             </div> <!-- /.col-sm-10.col-sm-push-2 -->
412
413             <div class="col-sm-2 col-sm-pull-10">
414                 <aside>
415                     [% INCLUDE 'admin-menu.inc' %]
416                 </aside>
417             </div> <!-- /.col-sm-2.col-sm-pull-10 -->
418         </div> <!-- /.row -->
419
420     [% MACRO jsinclude BLOCK %]
421         [% INCLUDE 'datatables.inc' %]
422         [% Asset.js("js/admin-menu.js") | $raw %]
423         [% Asset.js("js/marc_subfields_structure.js") | $raw %]
424     [% END %]
425
426     [% INCLUDE 'intranet-bottom.inc' %]