Bug 15843: Move MARC subfields structure JavaScript into separate file
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / marc_subfields_structure.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <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 %]
3 [% 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>
4 [% INCLUDE 'doc-head-close.inc' %]
5 <script type="text/javascript" src="[% themelang %]/js/marc_subfields_structure.js"></script>
6 </head>
7 <body id="admin_marc_subfields_structure" class="admin">
8 [% INCLUDE 'header.inc' %]
9 [% INCLUDE 'cat-search.inc' %]
10
11 <div id="breadcrumbs">
12   <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;
13   [% IF ( add_form ) %]
14   [% IF ( use_heading_flags_p ) %]
15   [% 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
16   [% END %]
17   [% 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 %]
18   [% END %]
19   [% END %]
20 [% 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 %]
21 [% END %]
22 [% 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
23 [% END %]
24 [% IF ( else ) %]Tag [% tagfield | html %] Subfield structure[% END %]
25 </div>
26
27 <div id="doc" class="yui-t7">
28    
29    <div id="bd">
30         <div id="yui-main">
31         <div class="yui-g">
32
33 [% IF ( add_form ) %]
34     <h1>
35         [% IF ( use_heading_flags_p ) %]
36             [% IF ( heading_edit_subfields_p ) %]Tag [% tagfield | html %] Subfield constraints[% END %]
37         [% ELSE %]
38             [% action %]
39         [% END %]
40     </h1>
41     <form action="[% script_name %]" name="Aform" method="post">
42     <input type="hidden" name="op" value="add_validate" />
43     <input type="hidden" name="tagfield" value="[% tagfield | html %]" />
44     <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
45     <div id="subfieldtabs" class="toptabs numbered">
46    <ul>
47         [% FOREACH loo IN loop %]
48             [% IF ( loo.new_subfield ) %]
49                 <li><a href="#sub[% loo.urisubfieldcode %]field" title="[% loo.liblibrarian %]">New</a></li>
50             [% ELSE %]
51                 <li><a href="#sub[% loo.urisubfieldcode %]field" title="[% loo.liblibrarian %]">
52                     [% loo.subfieldcode %]
53                </a></li>
54             [% END %]
55         [% END %]
56     </ul>
57     
58     [% FOREACH loo IN loop %] 
59         <div class="constraints" id="sub[% loo.urisubfieldcode %]field">
60
61                <h3><a href="#basic[% loo.urisubfieldcode %]">Basic constraints</a></h3>
62                     <div id="basic[% loo.urisubfieldcode %]">
63                     <fieldset class="rows">
64                         <ol>
65                                 [% IF ( subfieldcode == 0 || subfieldcode ) %] 
66                                 <li><span class="label">Subfield code:</span> [% loo.subfieldcode %] <input type="hidden" name="tagsubfield" value="[% loo.subfieldcode %]" /></li>
67                                 [% ELSE %]
68                                 <li><label for="tagsubfield[% loo.row %]">Subfield code:</label> <input type="text" id="tagsubfield[% loo.row %]" name="tagsubfield" value="[% loo.subfieldcode %]" /></li>
69                                 [% END %]
70                                 <li><label for="liblibrarian[% loo.row %]">Text for librarian: </label><input id="liblibrarian[% loo.row %]" type="text" name="liblibrarian" value="[% loo.liblibrarian %]" size="40" maxlength="80" /></li>
71                                 <li><label for="libopac[% loo.row %]">Text for OPAC: </label><input type="text" id="libopac[% loo.row %]" name="libopac" value="[% loo.libopac %]" size="40" maxlength="80" /></li>
72                                 <li><label for="repeatable[% loo.row %]">Repeatable: </label>[% loo.repeatable %]</li>
73                                 <li><label for="mandatory[% loo.row %]">Mandatory: </label>[% loo.mandatory %]</li>
74                         <li><label for="tab[% loo.row %]">Managed in tab: </label>
75                             <select name="tab" tabindex="" size="1" id="[% loo.tab.id %]">
76                             [%- IF ( loo.tab.default ==  -1 ) -%]
77                                 <option value="-1" selected="selected">ignore</option>
78                             [%- ELSE -%]
79                                 <option value="-1">ignore</option>
80                             [%- END -%]
81                             [%- FOREACH t IN [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] -%]
82                                 [%- IF ( loo.tab.default ==  t ) -%]
83                                 <option value="[%- t -%]" selected="selected">[%- t -%]</option>
84                                 [%- ELSE -%]
85                                 <option value="[%- t -%]">[%- t -%]</option>
86                                 [%- END -%]
87                             [%- END -%]
88                             [%- IF ( loo.tab.default ==  10 ) -%]
89                                 <option value="10" selected="selected">items (10)</option>
90                             [%- ELSE -%]
91                                 <option value="10">items (10)</option>
92                             [%- END -%]
93                             </select>
94                             (ignore means that the subfield does not display in the record editor)
95                         </li>
96                         </ol>
97                     </fieldset>
98                     </div>
99
100
101             <h3><a href="#adv[% loo.urisubfieldcode %]">Advanced constraints</a></h3>
102             <div id="adv[% loo.urisubfieldcode %]">
103             <fieldset class="rows">
104                 <ol><li><label for="defaultvalue[% loo.row %]">Default value:</label>
105                     <input type="text" name="defaultvalue" id="defaultvalue[% loo.row %]" value="[% loo.defaultvalue %]" /></li>
106                                 <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>
107                 <li><input type="hidden" id="hidden-[% loo.row %]" name="hidden" value="[% loo.hidden %]" />
108                     <label for="hidden[% loo.row %]" style="float: none;">Visibility: </label>
109                     <input type="checkbox" id="hidden_opac_[% loo.row %]" class="inclusive_[% loo.row %]" name="hidden_opac_[% loo.row %]"/>
110                     <label for="hidden_opac_[% loo.row %]" style="float: none;">OPAC</label>
111                     <input type="checkbox" id="hidden_intranet_[% loo.row %]" class="inclusive_[% loo.row %]" name="hidden_intranet_[% loo.row %]"/>
112                     <label for="hidden_intranet_[% loo.row %]" style="float: none;">Intranet</label>
113                     <input type="checkbox" id="hidden_editor_[% loo.row %]" class="inclusive_[% loo.row %]" name="hidden_editor_[% loo.row %]"/>
114                     <label for="hidden_editor_[% loo.row %]" style="float: none;">Editor</label>
115                     <input type="checkbox" id="hidden_collapsed_[% loo.row %]" class="inclusive_[% loo.row %]" name="hidden_collapsed_[% loo.row %]"/>
116                     <label for="hidden_collapsed_[% loo.row %]" style="float: none;">Collapsed</label>
117                     <input type="checkbox" id="hidden_flagged_[% loo.row %]" name="flagged_[% loo.row %]"/>
118                     <label for="hidden_flagged_[% loo.row %]" style="float: none;">Flagged</label>
119                 </li>
120                 <li><label for="isurl[% loo.row %]">Is a URL:</label>[% loo.isurl %] (if checked, it means that the subfield is a URL and can be clicked)</li>
121                 <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>
122                 <li>
123                     <label for="kohafield[% loo.row %]">Koha link:</label>
124                     <select name="kohafield" id="[% loo.kohafield.id %]" size="1">
125                     [% FOREACH value IN loo.kohafield.values %]
126                       [% IF ( value == loo.kohafield.default ) %]
127                         <option value="[% value %]" selected="selected">[% value %]</option>
128                       [% ELSE %]
129                         <option value="[% value %]">[% value %]</option>
130                       [% END %]
131                     [% END %]
132                     </select>
133                 </li>
134                         </ol>
135             </fieldset>
136             </div>
137             <h3><a href="#oth[% loo.urisubfieldcode %]">Other options (choose one)</a></h3>
138             <div id="oth[% loo.urisubfieldcode %]">
139             <fieldset class="rows">
140                         <ol>
141                             <li>
142                                 <label for="authorised_value[% loo.row %]">Authorized value:</label>
143                                 <select name="authorised_value" id="[% loo.authorised_value.id %]" size="1">
144                                 [% FOREACH value IN loo.authorised_value.values %]
145                                     [% IF ( value == loo.authorised_value.default ) %]
146                                     <option value="[% value %]" selected="selected">[% value %]</option>
147                                     [% ELSE %]
148                                     <option value="[% value %]">[% value %]</option>
149                                     [% END %]
150                                 [% END %]
151                                 </select>
152                             </li>
153                             <li>
154                                 <label for="authtypecode[% loo.row %]">Thesaurus:</label>
155                                 <select name="authtypecode" id="[% loo.authtypes.id %]" size="1">
156                                 [% FOREACH value IN loo.authtypes.values %]
157                                     [% IF ( value == loo.authtypes.default ) %]
158                                     <option value="[% value %]" selected="selected">[% value %]</option>
159                                     [% ELSE %]
160                                     <option value="[% value %]">[% value %]</option>
161                                     [% END %]
162                                 [% END %]
163                                 </select>
164                             </li>
165                             <li>
166                                 <label for="value_builder[% loo.row %]">Plugin:</label>
167                                 <select name="value_builder" id="[% loo.value_builder.id %]" size="1">
168                                 [% FOREACH value IN loo.value_builder.values %]
169                                     [% IF ( value == loo.value_builder.default ) %]
170                                     <option value="[% value %]" selected="selected">[% value %]</option>
171                                     [% ELSE %]
172                                     <option value="[% value %]">[% value %]</option>
173                                     [% END %]
174                                 [% END %]
175                                 </select>
176                             </li>
177                         </ol>
178             </fieldset>
179             </div>
180         </div><!-- /content_sub -->
181         [% END %]
182                 </div><!-- /content -->
183     <fieldset class="action">
184         <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>
185     </fieldset>
186     </form>
187 [% END %]
188
189 [% IF ( delete_confirm ) %]
190
191 <h3>Confirm deletion of subfield [% tagsubfield %]?</h3>
192     <p>Subfield: [% tagsubfield %]</p>
193     <p>Description: [% liblibrarian %]</p>
194
195             <form action="[% delete_link %]" method="post"><input type="hidden" name="op" value="delete_confirmed" />
196                 <input type="hidden" name="searchfield" value="[% searchfield %]" />
197                 <input type="hidden" name="tagfield" value="[% tagfield  | html %]" />
198                                 <input type="hidden" name="tagsubfield" value="[% tagsubfield %]" />
199                                 <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
200                                 <input type="submit" value="Yes, delete this subfield" />
201             </form>
202                         
203                         <form action="[% script_name %]" method="post">
204                         <input type="hidden" name="searchfield" value="[% searchfield %]" />
205                         <input type="hidden" name="tagfield" value="[% tagfield | html %]" />
206                         <input type="hidden" name="tagsubfield" value="[% tagsubfield %]" />
207                         <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
208                         <input type="submit" value="No, do not delete" />
209             </form>
210 [% END %]
211
212 [% IF ( delete_confirmed ) %]
213
214     <h3>Data deleted</h3>
215     <form action="[% script_name %]" method="post">
216         <input type="hidden" name="tagfield" value="[% tagfield | html %]" />
217     <input type="submit" value="OK" />
218     </form>
219 [% END %]
220
221
222 [% IF ( else ) %]
223 <h1>MARC subfield structure admin for [% tagfield | html %] [% IF ( frameworkcode ) %](framework [% frameworkcode %])[% ELSE %](default framework)[% END %]</h1>
224 <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>
225 <p>The column 'Koha field' shows that the subfield is linked with a Koha field.</p>
226
227 <table>
228 <tr>
229     <th>Subfield</th>
230     <th>Text</th>
231     <th>Constraints</th>
232     <th>Edit</th>
233     <th>Delete</th>
234 </tr>
235 [% FOREACH loo IN loop %]
236 <tr>
237     <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>
238     <td>
239         [% IF ( loo.subfield_ignored ) %]
240             <i>[% loo.liblibrarian %]</i>
241         [% ELSE %]
242             [% loo.liblibrarian %]
243         [% END %]
244     </td>
245     <td>
246         [% IF ( loo.subfield_ignored ) %]
247             <i>subfield ignored</i>
248         [% ELSE %]
249             Tab:[% loo.tab %],
250             [% IF ( loo.kohafield ) %] | Koha field: [% loo.kohafield %], [% END %]
251             [% IF ( loo.repeatable ) %]Repeatable, [% ELSE %]Not repeatable,[% END %]
252             [% IF ( loo.mandatory ) %]Mandatory, [% ELSE %]Not mandatory,[% END %]
253             [% IF ( loo.seealso ) %] | See Also: [% loo.seealso %],[% END %]
254             [% IF ( loo.hidden ) %]hidden,[% END %]
255             [% IF ( loo.isurl ) %]is a URL,[% END %]
256             [% IF ( loo.authorised_value ) %] | Auth value:[% loo.authorised_value %],[% END %]
257             [% IF ( loo.authtypecode ) %] | Authority:[% loo.authtypecode %],[% END %]
258             [% IF ( loo.value_builder ) %] | Plugin:[% loo.value_builder %],[% END %]
259             [% IF ( loo.link ) %] | Link:[% loo.link %],[% END %]
260         [% END %]
261     </td>
262     <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">Edit</a></td>
263     <td><a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?op=delete_confirm&amp;tagfield=[% loo.tagfield %]&amp;tagsubfield=[% loo.tagsubfield %]&amp;frameworkcode=[% frameworkcode %]">Delete</a></td>
264 </tr>
265 [% END %]
266 </table>
267
268 <form action="[% script_name %]" method="get">
269     <fieldset class="action"><input type="hidden" name="op" value="add_form" />
270     <input type="hidden" name="tagfield" value="[% edit_tagfield %]" />
271     <input type="hidden" name="frameworkcode" value="[% edit_frameworkcode %]" />
272     <input type="submit" value="Edit subfields" />
273         <a class="cancel" href="marctagstructure.pl?searchfield=[% tagfield | uri %]&amp;frameworkcode=[% frameworkcode %]">Cancel</a>
274         </fieldset>
275 </form>
276
277 [% END %]
278
279
280
281 </div>
282 </div>
283 </div>
284 [% INCLUDE 'intranet-bottom.inc' %]