View | Details | Raw Unified | Return to bug 30489
Collapse All | Expand All

(-)a/admin/auth_subfields_structure.pl (-1 / +1 lines)
Lines 138-144 if ($op eq 'add_form') { Link Here
138
	$template->param('heading_edit_subfields_p' => 1);
138
	$template->param('heading_edit_subfields_p' => 1);
139
	$template->param(action => "Edit subfields",
139
	$template->param(action => "Edit subfields",
140
							tagfield => $tagfield,
140
							tagfield => $tagfield,
141
							tagfieldinput => "<input type=\"hidden\" name=\"tagfield\" value=\"$tagfield\" />",
141
                            tagsubfield => $tagsubfield,
142
							loop => \@loop_data,
142
							loop => \@loop_data,
143
							more_tag => $tagfield);
143
							more_tag => $tagfield);
144
144
(-)a/admin/marc_subfields_structure.pl (+1 lines)
Lines 199-204 if ( $op eq 'add_form' ) { Link Here
199
    $template->param(
199
    $template->param(
200
        action   => "Edit subfields",
200
        action   => "Edit subfields",
201
        tagfield => $tagfield,
201
        tagfield => $tagfield,
202
        tagsubfield => $tagsubfield,
202
        loop           => \@loop_data,
203
        loop           => \@loop_data,
203
        more_tag       => $tagfield
204
        more_tag       => $tagfield
204
    );
205
    );
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_subfields_structure.tt (-159 / +178 lines)
Lines 87-268 Link Here
87
        <input type="hidden" name="tagfield" value="[% tagfield | html %]" />
87
        <input type="hidden" name="tagfield" value="[% tagfield | html %]" />
88
        <input type="hidden" name="authtypecode" value="[% authtypecode | html %]" />
88
        <input type="hidden" name="authtypecode" value="[% authtypecode | html %]" />
89
        <fieldset class="action"><input type="submit" class="submit" value="Save changes" /> <a class="cancel" href="/cgi-bin/koha/admin/auth_subfields_structure.pl?tagfield=[% tagfield | uri %]&amp;authtypecode=[% authtypecode | uri %]">Cancel</a></fieldset>
89
        <fieldset class="action"><input type="submit" class="submit" value="Save changes" /> <a class="cancel" href="/cgi-bin/koha/admin/auth_subfields_structure.pl?tagfield=[% tagfield | uri %]&amp;authtypecode=[% authtypecode | uri %]">Cancel</a></fieldset>
90
91
        [% BLOCK outputsubfield %][% FILTER collapse %]
92
            [% SWITCH ( subfieldanchor ) %]
93
                [%   CASE "@" %]
94
                AT
95
                [%   CASE "%" %]
96
                %
97
                [%   CASE  %]
98
                [% subfieldanchor | html %]
99
            [% END %]
100
        [% END %][% END %]
101
90
        <div id="subfieldtabs" class="toptabs numbered">
102
        <div id="subfieldtabs" class="toptabs numbered">
91
            <ul>
103
            <ul class="nav nav-tabs" role="tablist">
92
                [% FOREACH loo IN loop %]
104
                [% FOREACH loo IN loop %]
93
                    <li id="tab_subfield_[% loo.tagsubfield | html %]">
105
                    <li role="presentation" id="tab_subfield_[%- PROCESS outputsubfield subfieldanchor = loo.tagsubfield -%]">
94
                        [% IF ( loo.new_subfield ) %]
106
                        [% IF ( loo.new_subfield ) %]
95
                            <a href="#sub[% loo.tagsubfield | html_entity %]field" title="[% loo.liblibrarian | html_entity %]">New</a>
107
                            <a href="#sub[%- PROCESS outputsubfield subfieldanchor = loo.tagsubfield -%]field"  aria-controls="sub[%- PROCESS outputsubfield subfieldanchor = loo.tagsubfield -%]field" role="tab" data-toggle="tab" title="[% loo.liblibrarian | html %]">New</a>
96
                        [% ELSE %]
108
                        [% ELSE %]
97
                            <a href="#sub[% loo.tagsubfield | html_entity %]field" title="[% loo.liblibrarian | html_entity %]">[% loo.tagsubfield | html %]</a>
109
                            <a href="#sub[%- PROCESS outputsubfield subfieldanchor = loo.tagsubfield -%]field"  aria-controls="sub[%- PROCESS outputsubfield subfieldanchor = loo.tagsubfield -%]field" role="tab" data-toggle="tab" title="[% loo.liblibrarian | html %]">[% loo.tagsubfield | html %]</a>
98
                        [% END %]
110
                        [% END %]
99
                    </li>
111
                    </li>
100
                [% END %]
112
                [% END %]
101
            </ul>
113
            </ul>
114
            <div class="tab-content">
115
                [% FOREACH loo IN loop %]
116
                    <div role="tabpanel" class="tab-pane" id="sub[%- PROCESS outputsubfield subfieldanchor = loo.tagsubfield -%]field">
117
                        <fieldset class="rows"><ol>
102
118
103
        [% FOREACH loo IN loop %]
119
                            [% IF ( loo.new_subfield ) %]
104
        <div id="sub[% loo.tagsubfield | html %]field">
120
                                <li>
105
            <fieldset class="rows"><ol>
121
                                    <label for="tagsubfieldinput[% loo.row | html %]">Subfield code: </label>
106
122
                                    <input type="text" name="tagsubfield" value="[% loo.tagsubfield | html %]" size="1" id="tagsubfield" maxlength="1" />
107
                [% IF ( loo.new_subfield ) %]
123
                                </li>
108
                    <li>
124
                            [% ELSE %]
109
                        <label for="tagsubfieldinput[% loo.row | html %]">Subfield code: </label>
125
                                <li>
110
                        <input type="text" name="tagsubfield" value="[% loo.tagsubfield | html %]" size="1" id="tagsubfield" maxlength="1" />
126
                                    <input type="hidden" name="tagsubfield" value="[% loo.tagsubfield | html %]" />
111
                    </li>
127
                                </li>
112
                [% ELSE %]
128
                            [% END %]
113
                    <li>
114
                        <input type="hidden" name="tagsubfield" value="[% loo.tagsubfield | html %]" />
115
                    </li>
116
                [% END %]
117
                <li>
118
                    <label for="repeatable[% loo.row | html %]">Repeatable: </label>
119
                    [% IF loo.repeatable %]
120
                        <input type="checkbox" id="repeatable[% loo.row | html %]" name="repeatable[% loo.row | html %]" checked="checked" value="1" />
121
                    [% ELSE %]
122
                        <input type="checkbox" id="repeatable[% loo.row | html %]" name="repeatable[% loo.row | html %]" value="1" />
123
                    [% END %]
124
                </li>
125
                <li>
126
                    <label for="mandatory[% loo.row | html %]">Mandatory: </label>
127
                    [% IF loo.mandatory %]
128
                        <input type="checkbox" id="mandatory[% loo.row | html %]" name="mandatory[% loo.row | html %]" checked="checked" value="1" />
129
                    [% ELSE %]
130
                        <input type="checkbox" id="mandatory[% loo.row | html %]" name="mandatory[% loo.row | html %]" value="1" />
131
                    [% END %]
132
                </li>
133
                <li><label for="liblibrarian[% loo.row | html %]">Text for librarian: </label><input id="liblibrarian[% loo.row | html %]" type="text" name="liblibrarian" value="[% loo.liblibrarian | html_entity %]" size="40" maxlength="80" /></li>
134
                <li><label for="libopac[% loo.row | html %]">Text for OPAC: </label><input type="text" id="libopac[% loo.row | html %]" name="libopac" value="[% loo.libopac | html_entity %]" size="40" maxlength="80" /></li>
135
                <li><label for="tab[% loo.row | html %]">Managed in tab: </label>
136
                    <select name="tab" id="tab[% loo.row | html %]">
137
                        [%- IF ( loo.tab ==  -1 ) -%]
138
                        <option value="-1" selected="selected">ignore</option>
139
                        [%- ELSE -%]
140
                        <option value="-1">ignore</option>
141
                        [%- END -%]
142
                    [%- FOREACH t IN [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'] -%]
143
                        [%- IF ( loo.tab ==  t && t.length>0 ) -%]
144
                        <option value="[%- t | html -%]" selected="selected">[%- t | html -%]</option>
145
                        [%- ELSIF ( loo.tab ==  t ) -%]
146
                        <option value="[%- t | html -%]" selected="selected">&nbsp;</option>
147
                        [%- ELSE -%]
148
                        <option value="[%- t | html -%]">[%- t | html -%]</option>
149
                        [%- END -%]
150
                    [%- END -%]
151
                    </select>
152
                    <div class="hint">Ignore means that the subfield does not display in the record editor</div>
153
                </li>
154
                <li>
155
                    <fieldset>
156
                        <legend>Display</legend>
157
                        <ol>
158
                            <li><label for="ohidden[% loo.row | html %]">Select to display or not:</label>
159
                                <select name="ohidden" id="ohidden[% loo.row | html %]">
160
                                    [%- IF ( loo.hidden ==  0 ) -%]
161
                                    <option value= "0" selected="selected">Show all</option>
162
                                    <option value="1">Hide all</option>
163
                                    [%- ELSE -%]
164
                                    [%# All other non-zero values mean: Hide %]
165
                                    <option value= "0">Show all</option>
166
                                    <option value="1" selected="selected">Hide all</option>
167
                                    [%- END -%]
168
                                </select>
169
                            </li>
170
                        </ol>
171
                    </fieldset>
172
                </li>
173
                <li>
174
                    <fieldset class="rows">
175
                        <legend>Advanced constraints:</legend>
176
                        <ol>
177
                            <li>
129
                            <li>
178
                                <label for="isurl[% loo.row | html %]">Is a URL:</label>
130
                                <label for="repeatable[% loo.row | html %]">Repeatable: </label>
179
                                [% IF loo.isurl %]
131
                                [% IF loo.repeatable %]
180
                                    <input type="checkbox" id="isurl[% loo.row | html %]" name="isurl[% loo.row | html %]" checked="checked" value="1" />
132
                                    <input type="checkbox" id="repeatable[% loo.row | html %]" name="repeatable[% loo.row | html %]" checked="checked" value="1" />
181
                                [% ELSE %]
133
                                [% ELSE %]
182
                                    <input type="checkbox" id="isurl[% loo.row | html %]" name="isurl[% loo.row | html %]" value="1" />
134
                                    <input type="checkbox" id="repeatable[% loo.row | html %]" name="repeatable[% loo.row | html %]" value="1" />
183
                                [% END %]
135
                                [% END %]
184
                                <span class="hint">If checked, it means that the subfield is a URL and can be clicked.</span>
185
                            </li>
136
                            </li>
186
                            <li>
137
                            <li>
187
                                <label for="defaultvalue[% loo.row | html %]">Default value:</label>
138
                                <label for="mandatory[% loo.row | html %]">Mandatory: </label>
188
                                <input type="text" name="defaultvalue" id="defaultvalue[% loo.row | html %]" value="[% loo.defaultvalue | html %]" />
139
                                [% IF loo.mandatory %]
140
                                    <input type="checkbox" id="mandatory[% loo.row | html %]" name="mandatory[% loo.row | html %]" checked="checked" value="1" />
141
                                [% ELSE %]
142
                                    <input type="checkbox" id="mandatory[% loo.row | html %]" name="mandatory[% loo.row | html %]" value="1" />
143
                                [% END %]
189
                            </li>
144
                            </li>
190
                        </ol>
145
                            <li><label for="liblibrarian[% loo.row | html %]">Text for librarian: </label><input id="liblibrarian[% loo.row | html %]" type="text" name="liblibrarian" value="[% loo.liblibrarian | html_entity %]" size="40" maxlength="80" /></li>
191
                    </fieldset>
146
                            <li><label for="libopac[% loo.row | html %]">Text for OPAC: </label><input type="text" id="libopac[% loo.row | html %]" name="libopac" value="[% loo.libopac | html_entity %]" size="40" maxlength="80" /></li>
192
                </li>
147
                            <li><label for="tab[% loo.row | html %]">Managed in tab: </label>
193
                <li>
148
                                <select name="tab" id="tab[% loo.row | html %]">
194
                    <fieldset><legend>Help input</legend>    
149
                                    [%- IF ( loo.tab ==  -1 ) -%]
195
                        <ol>
150
                                    <option value="-1" selected="selected">ignore</option>
196
                            <li>
197
                                <label for="kohafield[% loo.row | html %]">Koha field:</label>
198
                                <select name="kohafield" id="kohafield[% loo.row | html %]">
199
                                [%- FOREACH value IN loo.kohafields %]
200
                                    [% IF ( value == loo.kohafield  && value.length>0 ) -%]
201
                                    <option value="[% value | html %]" selected="selected">[% value | html %]</option>
202
                                    [%- ELSIF ( value == loo.kohafield ) -%]
203
                                    <option value="[% value | html %]" selected="selected">&nbsp;</option>
204
                                    [%- ELSIF ( value.length==0 ) -%]
205
                                    <option value="[% value | html %]">&nbsp;</option>
206
                                    [%- ELSE -%]
151
                                    [%- ELSE -%]
207
                                    <option value="[% value | html %]">[% value | html %]</option>
152
                                    <option value="-1">ignore</option>
208
                                    [%- END -%]
153
                                    [%- END -%]
209
                                [%- END %]
154
                                [%- FOREACH t IN [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'] -%]
210
                                </select>
155
                                    [%- IF ( loo.tab ==  t && t.length>0 ) -%]
211
                            </li>
156
                                    <option value="[%- t | html -%]" selected="selected">[%- t | html -%]</option>
212
                            <li>
157
                                    [%- ELSIF ( loo.tab ==  t ) -%]
213
                                <label for="authorised_value[% loo.row | html %]">Authorized value:</label>
158
                                    <option value="[%- t | html -%]" selected="selected">&nbsp;</option>
214
                                <select name="authorised_value" id="authorised_value[% loo.row | html %]">
215
                                [%- FOREACH value IN loo.authorised_values %]
216
                                    [% IF ( value == loo.authorised_value && value.length>0 ) -%]
217
                                    <option value="[% value | html %]" selected="selected">[% value | html %]</option>
218
                                    [%- ELSIF ( value == loo.authorised_value ) -%]
219
                                    <option value="[% value | html %]" selected>&nbsp;</option>
220
                                    [%- ELSIF ( value.length==0 ) -%]
221
                                    <option value="[% value | html %]">&nbsp;</option>
222
                                    [%- ELSE -%]
159
                                    [%- ELSE -%]
223
                                    <option value="[% value | html %]">[% value | html %]</option>
160
                                    <option value="[%- t | html -%]">[%- t | html -%]</option>
224
                                    [%- END -%]
161
                                    [%- END -%]
225
                                [%- END %]
162
                                [%- END -%]
226
                                </select>
163
                                </select>
164
                                <div class="hint">Ignore means that the subfield does not display in the record editor</div>
227
                            </li>
165
                            </li>
228
                            <li>
166
                            <li>
229
                                <label for="frameworkcode[% loo.row | html %]">Thesaurus:</label>
167
                                <fieldset>
230
                                <select name="frameworkcode" id="frameworkcode[% loo.row | html %]">
168
                                    <legend>Display</legend>
231
                                [%- FOREACH value IN loo.frameworkcodes %]
169
                                    <ol>
232
                                    [% IF ( value == loo.frameworkcode && value.length>0 ) -%]
170
                                        <li><label for="ohidden[% loo.row | html %]">Select to display or not:</label>
233
                                    <option value="[% value | html %]" selected="selected">[% value | html %]</option>
171
                                            <select name="ohidden" id="ohidden[% loo.row | html %]">
234
                                    [%- ELSIF ( value == loo.frameworkcode ) -%]
172
                                                [%- IF ( loo.hidden ==  0 ) -%]
235
                                    <option value="[% value | html %]" selected="selected">&nbsp;</option>
173
                                                <option value= "0" selected="selected">Show all</option>
236
                                    [%- ELSIF ( value.length==0 ) -%]
174
                                                <option value="1">Hide all</option>
237
                                    <option value="[% value | html %]">&nbsp;</option>
175
                                                [%- ELSE -%]
238
                                    [%- ELSE -%]
176
                                                [%# All other non-zero values mean: Hide %]
239
                                    <option value="[% value | html %]">[% value | html %]</option>
177
                                                <option value= "0">Show all</option>
240
                                    [%- END -%]
178
                                                <option value="1" selected="selected">Hide all</option>
241
                                [%- END %]
179
                                                [%- END -%]
242
                                </select>
180
                                            </select>
181
                                        </li>
182
                                    </ol>
183
                                </fieldset>
243
                            </li>
184
                            </li>
244
                            <li>
185
                            <li>
245
                                <label for="value_builder[% loo.row | html %]">Plugin:</label>
186
                                <fieldset class="rows">
246
                                <select name="value_builder" id="value_builder[% loo.row | html %]">
187
                                    <legend>Advanced constraints:</legend>
247
                                [%- FOREACH value IN loo.value_builders %]
188
                                    <ol>
248
                                    [% IF ( value == loo.value_builder && value.length>0 ) -%]
189
                                        <li>
249
                                    <option value="[% value | html %]" selected="selected">[% value | html %]</option>
190
                                            <label for="isurl[% loo.row | html %]">Is a URL:</label>
250
                                    [%- ELSIF ( value == loo.value_builder ) -%]
191
                                            [% IF loo.isurl %]
251
                                    <option value="[% value | html %]" selected="selected">&nbsp;</option>
192
                                                <input type="checkbox" id="isurl[% loo.row | html %]" name="isurl[% loo.row | html %]" checked="checked" value="1" />
252
                                    [%- ELSIF ( value.length==0 ) -%]
193
                                            [% ELSE %]
253
                                    <option value="[% value | html %]">&nbsp;</option>
194
                                                <input type="checkbox" id="isurl[% loo.row | html %]" name="isurl[% loo.row | html %]" value="1" />
254
                                    [%- ELSE -%]
195
                                            [% END %]
255
                                    <option value="[% value | html %]">[% value | html %]</option>
196
                                            <span class="hint">If checked, it means that the subfield is a URL and can be clicked.</span>
256
                                    [%- END -%]
197
                                        </li>
257
                                [%- END %]
198
                                        <li>
258
                                </select>
199
                                            <label for="defaultvalue[% loo.row | html %]">Default value:</label>
200
                                            <input type="text" name="defaultvalue" id="defaultvalue[% loo.row | html %]" value="[% loo.defaultvalue | html %]" />
201
                                        </li>
202
                                    </ol>
203
                                </fieldset>
259
                            </li>
204
                            </li>
260
                        </ol>
205
                            <li>
261
                    </fieldset>
206
                                <fieldset><legend>Help input</legend>
262
                </li>
207
                                    <ol>
263
            </ol></fieldset><br class="clear" />
208
                                        <li>
264
        </div>
209
                                            <label for="kohafield[% loo.row | html %]">Koha field:</label>
265
        [% END %]
210
                                            <select name="kohafield" id="kohafield[% loo.row | html %]">
211
                                            [%- FOREACH value IN loo.kohafields %]
212
                                                [% IF ( value == loo.kohafield  && value.length>0 ) -%]
213
                                                <option value="[% value | html %]" selected="selected">[% value | html %]</option>
214
                                                [%- ELSIF ( value == loo.kohafield ) -%]
215
                                                <option value="[% value | html %]" selected="selected">&nbsp;</option>
216
                                                [%- ELSIF ( value.length==0 ) -%]
217
                                                <option value="[% value | html %]">&nbsp;</option>
218
                                                [%- ELSE -%]
219
                                                <option value="[% value | html %]">[% value | html %]</option>
220
                                                [%- END -%]
221
                                            [%- END %]
222
                                            </select>
223
                                        </li>
224
                                        <li>
225
                                            <label for="authorised_value[% loo.row | html %]">Authorized value:</label>
226
                                            <select name="authorised_value" id="authorised_value[% loo.row | html %]">
227
                                            [%- FOREACH value IN loo.authorised_values %]
228
                                                [% IF ( value == loo.authorised_value && value.length>0 ) -%]
229
                                                <option value="[% value | html %]" selected="selected">[% value | html %]</option>
230
                                                [%- ELSIF ( value == loo.authorised_value ) -%]
231
                                                <option value="[% value | html %]" selected>&nbsp;</option>
232
                                                [%- ELSIF ( value.length==0 ) -%]
233
                                                <option value="[% value | html %]">&nbsp;</option>
234
                                                [%- ELSE -%]
235
                                                <option value="[% value | html %]">[% value | html %]</option>
236
                                                [%- END -%]
237
                                            [%- END %]
238
                                            </select>
239
                                        </li>
240
                                        <li>
241
                                            <label for="frameworkcode[% loo.row | html %]">Thesaurus:</label>
242
                                            <select name="frameworkcode" id="frameworkcode[% loo.row | html %]">
243
                                            [%- FOREACH value IN loo.frameworkcodes %]
244
                                                [% IF ( value == loo.frameworkcode && value.length>0 ) -%]
245
                                                <option value="[% value | html %]" selected="selected">[% value | html %]</option>
246
                                                [%- ELSIF ( value == loo.frameworkcode ) -%]
247
                                                <option value="[% value | html %]" selected="selected">&nbsp;</option>
248
                                                [%- ELSIF ( value.length==0 ) -%]
249
                                                <option value="[% value | html %]">&nbsp;</option>
250
                                                [%- ELSE -%]
251
                                                <option value="[% value | html %]">[% value | html %]</option>
252
                                                [%- END -%]
253
                                            [%- END %]
254
                                            </select>
255
                                        </li>
256
                                        <li>
257
                                            <label for="value_builder[% loo.row | html %]">Plugin:</label>
258
                                            <select name="value_builder" id="value_builder[% loo.row | html %]">
259
                                            [%- FOREACH value IN loo.value_builders %]
260
                                                [% IF ( value == loo.value_builder && value.length>0 ) -%]
261
                                                <option value="[% value | html %]" selected="selected">[% value | html %]</option>
262
                                                [%- ELSIF ( value == loo.value_builder ) -%]
263
                                                <option value="[% value | html %]" selected="selected">&nbsp;</option>
264
                                                [%- ELSIF ( value.length==0 ) -%]
265
                                                <option value="[% value | html %]">&nbsp;</option>
266
                                                [%- ELSE -%]
267
                                                <option value="[% value | html %]">[% value | html %]</option>
268
                                                [%- END -%]
269
                                            [%- END %]
270
                                            </select>
271
                                        </li>
272
                                    </ol>
273
                                </fieldset>
274
                            </li>
275
                        </ol></fieldset><br class="clear" />
276
                    </div>
277
                [% END %]
278
            </div> <!-- /.tab-content -->
266
        </div>
279
        </div>
267
    </form>
280
    </form>
268
[% END %]
281
[% END %]
Lines 310-316 Link Here
310
    [% FOREACH loo IN loop %]
323
    [% FOREACH loo IN loop %]
311
    <tr>
324
    <tr>
312
        <td>
325
        <td>
313
            <a href="/cgi-bin/koha/admin/auth_subfields_structure.pl?op=add_form&tagfield=[% tagfield | uri %]&authtypecode=[% authtypecode | uri %]#sub[% loo.tagsubfield | uri %]field">[% loo.tagsubfield | html %]</a>
326
            <a href="/cgi-bin/koha/admin/auth_subfields_structure.pl?op=add_form&tagfield=[% tagfield | uri %]&authtypecode=[% authtypecode | uri %]#sub[% subfieldanchor | uri %]field">[% loo.tagsubfield | html %]</a>
314
        </td>
327
        </td>
315
        <td>
328
        <td>
316
            [% IF loo.tab == -1 %]
329
            [% IF loo.tab == -1 %]
Lines 341-347 Link Here
341
            [% END %]
354
            [% END %]
342
        </td>
355
        </td>
343
        <td class="actions">
356
        <td class="actions">
344
            <a href="/cgi-bin/koha/admin/auth_subfields_structure.pl?op=add_form&tagfield=[% tagfield | uri %]&authtypecode=[% authtypecode | uri %]#sub[% loo.tagsubfield | uri %]field" class="btn btn-default btn-xs"><i class="fa fa-pencil" aria-hidden="true"></i> Edit</a>
357
            <a href="/cgi-bin/koha/admin/auth_subfields_structure.pl?op=add_form&tagfield=[% tagfield | uri %]&tagsubfield=[% loo.tagsubfield | uri %]&authtypecode=[% authtypecode | uri %]#sub[% loo.tagsubfield | uri %]field" class="btn btn-default btn-xs"><i class="fa fa-pencil" aria-hidden="true"></i> Edit</a>
345
            <a href="/cgi-bin/koha/admin/auth_subfields_structure.pl?op=delete_confirm&amp;tagfield=[% loo.tagfield | uri %]&amp;tagsubfield=[% loo.tagsubfield | uri %]&amp;authtypecode=[% authtypecode | uri %]" class="btn btn-default btn-xs"><i class="fa fa-trash" aria-hidden="true"></i> Delete</a>
358
            <a href="/cgi-bin/koha/admin/auth_subfields_structure.pl?op=delete_confirm&amp;tagfield=[% loo.tagfield | uri %]&amp;tagsubfield=[% loo.tagsubfield | uri %]&amp;authtypecode=[% authtypecode | uri %]" class="btn btn-default btn-xs"><i class="fa fa-trash" aria-hidden="true"></i> Delete</a>
346
        </td>
359
        </td>
347
    </tr>
360
    </tr>
Lines 382-390 Link Here
382
                paginate: false
395
                paginate: false
383
            }));
396
            }));
384
397
385
            var tabs = $('#subfieldtabs').tabs();
398
            [% IF ( tagsubfield && tagsubfield == "@") %]
399
                $("#subfieldtabs a[href='#subATfield']").tab("show");
400
            [% ELSIF ( tagsubfield && tagsubfield != "@") %]
401
                $("#subfieldtabs a[href='#sub[% tagsubfield | html %]field']").tab("show");
402
            [% ELSE  %]
403
                $("#subfieldtabs a:first").tab("show");
404
            [% END %]
405
386
            var current_index;
406
            var current_index;
387
            tabs.find( ".ui-tabs-nav" ).sortable({
407
            $("#subfieldtabs > ul").sortable({
388
                axis: "x",
408
                axis: "x",
389
                start: function (e, ui) {
409
                start: function (e, ui) {
390
                    current_index = $(ui.item[0]).index();
410
                    current_index = $(ui.item[0]).index();
Lines 394-406 Link Here
394
                    if (current_index < new_index) new_index++;
414
                    if (current_index < new_index) new_index++;
395
                    var subfield_code = $(ui.item[0]).attr('id').replace( /^tab_subfield_/, '');
415
                    var subfield_code = $(ui.item[0]).attr('id').replace( /^tab_subfield_/, '');
396
                    var content = $('#sub' + subfield_code + 'field');
416
                    var content = $('#sub' + subfield_code + 'field');
397
                    var panels = $("#subfieldtabs > div");
417
                    var panels = $("#subfieldtabs .tab-pane");
398
                    if ( new_index < $(panels).size() ){
418
                    if ( new_index < $(panels).size() ){
399
                        $(content).insertBefore($("#subfieldtabs > div")[new_index]);
419
                        $(content).insertBefore( panels[new_index]);
400
                    } else {
420
                    } else {
401
                        $(content).insertAfter($("#subfieldtabs > div")[new_index-1]);
421
                        $(content).insertAfter( panels[new_index-1]);
402
                    }
422
                    }
403
                    tabs.tabs("refresh");
404
                }
423
                }
405
            });
424
            });
406
425
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tt (-176 / +193 lines)
Lines 124-137 Link Here
124
                            <input type="hidden" name="tagfield" value="[% tagfield | html %]" />
124
                            <input type="hidden" name="tagfield" value="[% tagfield | html %]" />
125
                            <input type="hidden" name="frameworkcode" value="[% frameworkcode | html %]" />
125
                            <input type="hidden" name="frameworkcode" value="[% frameworkcode | html %]" />
126
126
127
                            [% BLOCK outputsubfield %][% FILTER collapse %]
128
                                [% SWITCH ( subfieldanchor ) %]
129
                                    [%   CASE "@" %]
130
                                    AT
131
                                    [%   CASE "%" %]
132
                                    %
133
                                    [%   CASE  %]
134
                                    [% subfieldanchor | html %]
135
                                [% END %]
136
                            [% END %][% END %]
137
127
                            <div id="subfieldtabs" class="toptabs numbered">
138
                            <div id="subfieldtabs" class="toptabs numbered">
128
                                <ul>
139
                                 <ul class="nav nav-tabs" role="tablist">
129
                                    [% FOREACH loo IN loop %]
140
                                    [% FOREACH loo IN loop %]
130
                                        <li id="tab_subfield_[% loo.urisubfieldcode | html %]">
141
                                        <li id="tab_subfield_[%- PROCESS outputsubfield subfieldanchor = loo.subfieldcode -%]" class="tab-item" role="presentation">
131
                                            [% IF ( loo.new_subfield ) %]
142
                                            [% IF ( loo.new_subfield ) %]
132
                                                <a href="#sub[% loo.urisubfieldcode | uri %]field" title="[% loo.liblibrarian | html_entity %]">New</a>
143
                                                <a href="#sub[%- PROCESS outputsubfield subfieldanchor = loo.subfieldcode -%]field" aria-controls="sub[%- PROCESS outputsubfield subfieldanchor = loo.subfieldcode -%]field" role="tab" data-toggle="tab" title="[% loo.liblibrarian | html_entity %]">New</a>
133
                                            [% ELSE %]
144
                                            [% ELSE %]
134
                                                <a href="#sub[% loo.urisubfieldcode | uri %]field" title="[% loo.liblibrarian | html_entity %]">
145
                                                <a href="#sub[%- PROCESS outputsubfield subfieldanchor = loo.subfieldcode -%]field" aria-controls="sub[%- PROCESS outputsubfield subfieldanchor = loo.subfieldcode -%]field" role="tab" data-toggle="tab" title="[% loo.liblibrarian | html_entity %]">
135
                                                    [% loo.subfieldcode | html %]
146
                                                    [% loo.subfieldcode | html %]
136
                                                </a>
147
                                                </a>
137
                                            [% END %]
148
                                            [% END %]
Lines 139-328 Link Here
139
                                    [% END %]
150
                                    [% END %]
140
                                </ul>
151
                                </ul>
141
152
142
                                [% FOREACH loo IN loop %]
153
                                <div class="tab-content">
143
                                    <div class="constraints" id="sub[% loo.urisubfieldcode | uri %]field">
154
144
                                        <div id="basic[% loo.urisubfieldcode | html %]" class="contraints">
155
                                    [% FOREACH loo IN loop %]
145
                                            <fieldset class="rows">
156
                                        <div class="constraints tab-pane" role="tabpanel" id="sub[%- PROCESS outputsubfield subfieldanchor = loo.subfieldcode -%]field">
146
                                                <legend>Basic constraints</legend>
157
                                            <div id="basic[%- PROCESS outputsubfield subfieldanchor = loo.subfieldcode -%]" class="contraints">
147
                                                <ol>
158
                                                <fieldset class="rows">
148
                                                    [% IF ( subfieldcode == 0 || subfieldcode ) %]
159
                                                    <legend>Basic constraints</legend>
149
                                                        <li>
160
                                                    <ol>
150
                                                            <span class="label">Subfield code:</span>
161
                                                        [% IF ( subfieldcode == 0 || subfieldcode ) %]
151
                                                            [% loo.subfieldcode | html %] <input type="hidden" name="tagsubfield" value="[% loo.subfieldcode | html %]" />
162
                                                            <li>
152
                                                        </li>
163
                                                                <span class="label">Subfield code:</span>
153
                                                    [% ELSE %]
164
                                                                [% loo.subfieldcode | html %] <input type="hidden" name="tagsubfield" value="[% loo.subfieldcode | html %]" />
154
                                                        <li>
155
                                                            <label for="tagsubfield[% loo.row | html %]">Subfield code:</label>
156
                                                                <input type="text" id="tagsubfield[% loo.row | html %]" name="tagsubfield" value="[% loo.subfieldcode | html %]" />
157
                                                            </li>
165
                                                            </li>
158
                                                    [% END %]
159
                                                    <li>
160
                                                        <label for="liblibrarian[% loo.row | html %]">Text for librarian: </label>
161
                                                        <input id="liblibrarian[% loo.row | html %]" type="text" name="liblibrarian" value="[% loo.liblibrarian | html_entity %]" size="40" maxlength="80" />
162
                                                    </li>
163
                                                    <li>
164
                                                        <label for="libopac[% loo.row | html %]">Text for OPAC: </label>
165
                                                        <input type="text" id="libopac[% loo.row | html %]" name="libopac" value="[% loo.libopac | html_entity %]" size="40" maxlength="80" />
166
                                                    </li>
167
                                                    <li>
168
                                                        <label for="repeatable[% loo.row | html %]">Repeatable: </label>
169
                                                        [% IF loo.repeatable %]
170
                                                            <input type="checkbox" id="repeatable[% loo.row | html %]" name="repeatable[% loo.row | html %]" checked="checked" value="1" />
171
                                                        [% ELSE %]
166
                                                        [% ELSE %]
172
                                                            <input type="checkbox" id="repeatable[% loo.row | html %]" name="repeatable[% loo.row | html %]" value="1" />
167
                                                            <li>
168
                                                                <label for="tagsubfield[% loo.row | html %]">Subfield code:</label>
169
                                                                    <input type="text" id="tagsubfield[% loo.row | html %]" name="tagsubfield" value="[% loo.subfieldcode | html %]" />
170
                                                                </li>
173
                                                        [% END %]
171
                                                        [% END %]
174
                                                    </li>
172
                                                        <li>
175
                                                    <li>
173
                                                            <label for="liblibrarian[% loo.row | html %]">Text for librarian: </label>
176
                                                        <label for="mandatory[% loo.row | html %]">Mandatory: </label>
174
                                                            <input id="liblibrarian[% loo.row | html %]" type="text" name="liblibrarian" value="[% loo.liblibrarian | html_entity %]" size="40" maxlength="80" />
177
                                                        [% IF loo.mandatory %]
175
                                                        </li>
178
                                                            <input type="checkbox" id="mandatory[% loo.row | html %]" name="mandatory[% loo.row | html %]" checked="checked" value="1" />
176
                                                        <li>
179
                                                        [% ELSE %]
177
                                                            <label for="libopac[% loo.row | html %]">Text for OPAC: </label>
180
                                                            <input type="checkbox" id="mandatory[% loo.row | html %]" name="mandatory[% loo.row | html %]" value="1" />
178
                                                            <input type="text" id="libopac[% loo.row | html %]" name="libopac" value="[% loo.libopac | html_entity %]" size="40" maxlength="80" />
181
                                                        [% END %]
179
                                                        </li>
182
                                                    </li>
180
                                                        <li>
183
                                                    <li>
181
                                                            <label for="repeatable[% loo.row | html %]">Repeatable: </label>
184
                                                        <label for="important[% loo.row | html %]">Important: </label>
182
                                                            [% IF loo.repeatable %]
185
                                                        [% IF loo.important %]
183
                                                                <input type="checkbox" id="repeatable[% loo.row | html %]" name="repeatable[% loo.row | html %]" checked="checked" value="1" />
186
                                                            <input type="checkbox" id="important[% loo.row | html %]" name="important[% loo.row | html %]" checked="checked" value="1" />
184
                                                            [% ELSE %]
187
                                                        [% ELSE %]
185
                                                                <input type="checkbox" id="repeatable[% loo.row | html %]" name="repeatable[% loo.row | html %]" value="1" />
188
                                                            <input type="checkbox" id="important[% loo.row | html %]" name="important[% loo.row | html %]" value="1" />
186
                                                            [% END %]
189
                                                        [% END %]
187
                                                        </li>
190
                                                    </li>
188
                                                        <li>
191
                                                    <li><label for="tab[% loo.row | html %]">Managed in tab: </label>
189
                                                            <label for="mandatory[% loo.row | html %]">Mandatory: </label>
192
                                                        <select name="tab" tabindex="" id="tab[% loo.row | html %]">
190
                                                            [% IF loo.mandatory %]
193
                                                        [%- IF ( loo.tab ==  -1 ) -%]
191
                                                                <input type="checkbox" id="mandatory[% loo.row | html %]" name="mandatory[% loo.row | html %]" checked="checked" value="1" />
194
                                                            <option value="-1" selected="selected">ignore</option>
192
                                                            [% ELSE %]
195
                                                        [%- ELSE -%]
193
                                                                <input type="checkbox" id="mandatory[% loo.row | html %]" name="mandatory[% loo.row | html %]" value="1" />
196
                                                            <option value="-1">ignore</option>
194
                                                            [% END %]
197
                                                        [%- END -%]
195
                                                        </li>
198
                                                        [%- FOREACH t IN [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] -%]
196
                                                        <li>
199
                                                            [%- IF ( loo.tab ==  t ) -%]
197
                                                            <label for="important[% loo.row | html %]">Important: </label>
200
                                                            <option value="[%- t | html -%]" selected="selected">[%- t | html -%]</option>
198
                                                            [% IF loo.important %]
199
                                                                <input type="checkbox" id="important[% loo.row | html %]" name="important[% loo.row | html %]" checked="checked" value="1" />
200
                                                            [% ELSE %]
201
                                                                <input type="checkbox" id="important[% loo.row | html %]" name="important[% loo.row | html %]" value="1" />
202
                                                            [% END %]
203
                                                        </li>
204
                                                        <li><label for="tab[% loo.row | html %]">Managed in tab: </label>
205
                                                            <select name="tab" tabindex="" id="tab[% loo.row | html %]">
206
                                                            [%- IF ( loo.tab ==  -1 ) -%]
207
                                                                <option value="-1" selected="selected">ignore</option>
201
                                                            [%- ELSE -%]
208
                                                            [%- ELSE -%]
202
                                                            <option value="[%- t | html -%]">[%- t | html -%]</option>
209
                                                                <option value="-1">ignore</option>
203
                                                            [%- END -%]
210
                                                            [%- END -%]
204
                                                        [%- END -%]
211
                                                            [%- FOREACH t IN [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] -%]
205
                                                        [%- IF ( loo.tab ==  10 ) -%]
212
                                                                [%- IF ( loo.tab ==  t ) -%]
206
                                                            <option value="10" selected="selected">items (10)</option>
213
                                                                <option value="[%- t | html -%]" selected="selected">[%- t | html -%]</option>
207
                                                        [%- ELSE -%]
214
                                                                [%- ELSE -%]
208
                                                            <option value="10">items (10)</option>
215
                                                                <option value="[%- t | html -%]">[%- t | html -%]</option>
209
                                                        [%- END -%]
216
                                                                [%- END -%]
210
                                                        </select>
217
                                                            [%- END -%]
211
                                                        <div class="hint">Ignore means that the subfield does not display in the record editor</div>
218
                                                            [%- IF ( loo.tab ==  10 ) -%]
212
                                                    </li>
219
                                                                <option value="10" selected="selected">items (10)</option>
213
                                                </ol>
220
                                                            [%- ELSE -%]
214
                                            </fieldset> <!-- /.rows -->
221
                                                                <option value="10">items (10)</option>
215
                                        </div> <!-- /#basic[% loo.urisubfieldcode | html %] -->
222
                                                            [%- END -%]
216
223
                                                            </select>
217
                                        <div id="advanced[% loo.urisubfieldcode | html %]" class="contraints">
224
                                                            <div class="hint">Ignore means that the subfield does not display in the record editor</div>
218
                                            <fieldset class="rows">
225
                                                        </li>
219
                                                <legend>Advanced constraints</legend>
226
                                                    </ol>
220
                                                <ol>
227
                                                </fieldset> <!-- /.rows -->
221
                                                    <li>
228
                                            </div> <!-- /#basic[%- PROCESS outputsubfield subfieldanchor = subfieldcode -%] -->
222
                                                        <label for="defaultvalue[% loo.row | html %]">Default value:</label>
229
223
                                                        <input type="text" name="defaultvalue" id="defaultvalue[% loo.row | html %]" value="[% loo.defaultvalue | html %]" />
230
                                            <div id="advanced[%- PROCESS outputsubfield subfieldanchor = loo.subfieldcode -%]" class="contraints">
224
                                                    </li>
231
                                                <fieldset class="rows">
225
                                                    <li>
232
                                                    <legend>Advanced constraints</legend>
226
                                                        <label for="maxlength[% loo.row | html %]">Max length:</label>
233
                                                    <ol>
227
                                                        <input type="text" id="maxlength[% loo.row | html %]" name="maxlength" value="[% loo.maxlength | html %]" size="4" />
234
                                                        <li>
228
                                                    </li>
235
                                                            <label for="defaultvalue[% loo.row | html %]">Default value:</label>
229
                                                    <li>
236
                                                            <input type="text" name="defaultvalue" id="defaultvalue[% loo.row | html %]" value="[% loo.defaultvalue | html %]" />
230
                                                        [% IF loo.hidden_protected %]
237
                                                        </li>
231
                                                            <input type="hidden" id="hidden-[% loo.row | html %]" name="hidden" value="[% loo.hidden | html %]" data-koha-protected="1" />
238
                                                        <li>
232
                                                        [% ELSE %]
239
                                                            <label for="maxlength[% loo.row | html %]">Max length:</label>
233
                                                            <input type="hidden" id="hidden-[% loo.row | html %]" name="hidden" value="[% loo.hidden | html %]" />
240
                                                            <input type="text" id="maxlength[% loo.row | html %]" name="maxlength" value="[% loo.maxlength | html %]" size="4" />
234
                                                        [% END %]
241
                                                        </li>
235
                                                        <label for="hidden[% loo.row | html %]">Visibility: </label>
242
                                                        <li>
236
                                                        <input type="checkbox" id="hidden_opac_[% loo.row | html %]" class="inclusive_[% loo.row | html %]" name="hidden_opac_[% loo.row | html %]"/>
243
                                                            [% IF loo.hidden_protected %]
237
                                                        <label for="hidden_opac_[% loo.row | html %]" style="float: none;">OPAC</label>
244
                                                                <input type="hidden" id="hidden-[% loo.row | html %]" name="hidden" value="[% loo.hidden | html %]" data-koha-protected="1" />
238
                                                        <input type="checkbox" id="hidden_intranet_[% loo.row | html %]" class="inclusive_[% loo.row | html %]" name="hidden_intranet_[% loo.row | html %]"/>
239
                                                        <label for="hidden_intranet_[% loo.row | html %]" style="float: none;">Intranet</label>
240
                                                        <input type="checkbox" id="hidden_editor_[% loo.row | html %]" class="inclusive_[% loo.row | html %]" name="hidden_editor_[% loo.row | html %]"/>
241
                                                        <label for="hidden_editor_[% loo.row | html %]" style="float: none;">Editor</label>
242
                                                        <input type="checkbox" id="hidden_collapsed_[% loo.row | html %]" class="inclusive_[% loo.row | html %]" name="hidden_collapsed_[% loo.row | html %]"/>
243
                                                        <label for="hidden_collapsed_[% loo.row | html %]" style="float: none;">Collapsed</label>
244
                                                        <input type="checkbox" id="hidden_flagged_[% loo.row | html %]" name="flagged_[% loo.row | html %]"/>
245
                                                        <label for="hidden_flagged_[% loo.row | html %]" style="float: none;">Flagged</label>
246
                                                    </li>
247
                                                    <li>
248
                                                        <label for="isurl[% loo.row | html %]">Is a URL:</label>
249
                                                        [% IF loo.isurl %]
250
                                                            <input type="checkbox" id="isurl[% loo.row | html %]" name="isurl[% loo.row | html %]" checked="checked" value="1" />
251
                                                        [% ELSE %]
252
                                                            <input type="checkbox" id="isurl[% loo.row | html %]" name="isurl[% loo.row | html %]" value="1" />
253
                                                        [% END %]
254
                                                        <span class="hint">If checked, it means that the subfield is a URL and can be clicked</span>
255
                                                    </li>
256
                                                    <li>
257
                                                        <label for="link[% loo.row | html %]">Link:</label>
258
                                                        <input type="text" id="link[% loo.row | html %]" name="link" value="[% loo.link | html %]" size="10" maxlength="80" />
259
                                                        <div class="hint">An index name, e.g. title or Local-Number</div>
260
                                                    </li>
261
                                                    <li>
262
                                                        <label for="kohafield[% loo.row | html %]">Koha link:</label>
263
                                                        <!-- This select should be DISABLED; value is submitted by the following hidden input -->
264
                                                        <select name="kohafield" id="kohafield[% loo.row | html %]" disabled>
265
                                                        [% FOREACH value IN loo.kohafields %]
266
                                                        [% IF ( value == loo.kohafield ) %]
267
                                                            <option value="[% value | html %]" selected="selected">[% value | html %]</option>
268
                                                        [% ELSE %]
269
                                                            <option value="[% value | html %]">[% value | html %]</option>
270
                                                        [% END %]
271
                                                        [% END %]
272
                                                        </select>
273
                                                        <!-- Do NOT remove this next hidden input! We need it to save kohafield. -->
274
                                                        <input type="hidden" name="kohafield" value="[% loo.kohafield | html %]"/>
275
                                                    </li>
276
                                                </ol>
277
                                            </fieldset> <!-- /.rows -->
278
                                        </div> <!-- /#advanced[% loo.urisubfieldcode | html %] -->
279
280
                                        <div id="oth[% loo.urisubfieldcode | html %]" class="constraints">
281
                                            <fieldset class="rows">
282
                                                <legend>Other options (choose one)</legend>
283
                                                <ol>
284
                                                    <li>
285
                                                        <label for="authorised_value[% loo.row | html %]">Authorized value:</label>
286
                                                        <select name="authorised_value" id="authorised_value[% loo.row | html %]">
287
                                                        <option value=""></option>
288
                                                        [% FOREACH value IN loo.authorised_values %]
289
                                                            [% IF ( value == loo.authorised_value ) %]
290
                                                                <option value="[% value | html %]" selected="selected">[% value | html %]</option>
291
                                                            [% ELSE %]
245
                                                            [% ELSE %]
292
                                                                <option value="[% value | html %]">[% value | html %]</option>
246
                                                                <input type="hidden" id="hidden-[% loo.row | html %]" name="hidden" value="[% loo.hidden | html %]" />
293
                                                            [% END %]
247
                                                            [% END %]
294
                                                        [% END %]
248
                                                            <label for="hidden[% loo.row | html %]">Visibility: </label>
295
                                                        </select>
249
                                                            <input type="checkbox" id="hidden_opac_[% loo.row | html %]" class="inclusive_[% loo.row | html %]" name="hidden_opac_[% loo.row | html %]"/>
296
                                                    </li>
250
                                                            <label for="hidden_opac_[% loo.row | html %]" style="float: none;">OPAC</label>
297
                                                    <li>
251
                                                            <input type="checkbox" id="hidden_intranet_[% loo.row | html %]" class="inclusive_[% loo.row | html %]" name="hidden_intranet_[% loo.row | html %]"/>
298
                                                        <label for="authtypecode[% loo.row | html %]">Thesaurus:</label>
252
                                                            <label for="hidden_intranet_[% loo.row | html %]" style="float: none;">Intranet</label>
299
                                                        <select name="authtypecode" id="authtypecode[% loo.row | html %]">
253
                                                            <input type="checkbox" id="hidden_editor_[% loo.row | html %]" class="inclusive_[% loo.row | html %]" name="hidden_editor_[% loo.row | html %]"/>
300
                                                        [% FOREACH value IN loo.authtypes %]
254
                                                            <label for="hidden_editor_[% loo.row | html %]" style="float: none;">Editor</label>
301
                                                            [% IF ( value == loo.authtypecode ) %]
255
                                                            <input type="checkbox" id="hidden_collapsed_[% loo.row | html %]" class="inclusive_[% loo.row | html %]" name="hidden_collapsed_[% loo.row | html %]"/>
302
                                                                <option value="[% value | html %]" selected="selected">[% value | html %]</option>
256
                                                            <label for="hidden_collapsed_[% loo.row | html %]" style="float: none;">Collapsed</label>
257
                                                            <input type="checkbox" id="hidden_flagged_[% loo.row | html %]" name="flagged_[% loo.row | html %]"/>
258
                                                            <label for="hidden_flagged_[% loo.row | html %]" style="float: none;">Flagged</label>
259
                                                        </li>
260
                                                        <li>
261
                                                            <label for="isurl[% loo.row | html %]">Is a URL:</label>
262
                                                            [% IF loo.isurl %]
263
                                                                <input type="checkbox" id="isurl[% loo.row | html %]" name="isurl[% loo.row | html %]" checked="checked" value="1" />
303
                                                            [% ELSE %]
264
                                                            [% ELSE %]
304
                                                                <option value="[% value | html %]">[% value | html %]</option>
265
                                                                <input type="checkbox" id="isurl[% loo.row | html %]" name="isurl[% loo.row | html %]" value="1" />
305
                                                            [% END %]
266
                                                            [% END %]
306
                                                        [% END %]
267
                                                            <span class="hint">If checked, it means that the subfield is a URL and can be clicked</span>
307
                                                        </select>
268
                                                        </li>
308
                                                    </li>
269
                                                        <li>
309
                                                    <li>
270
                                                            <label for="link[% loo.row | html %]">Link:</label>
310
                                                        <label for="value_builder[% loo.row | html %]">Plugin:</label>
271
                                                            <input type="text" id="link[% loo.row | html %]" name="link" value="[% loo.link | html %]" size="10" maxlength="80" />
311
                                                        <select name="value_builder" id="value_builder[% loo.row | html %]">
272
                                                            <div class="hint">An index name, e.g. title or Local-Number</div>
312
                                                        [% FOREACH value IN loo.value_builders %]
273
                                                        </li>
313
                                                            [% IF ( value == loo.value_builder ) %]
274
                                                        <li>
275
                                                            <label for="kohafield[% loo.row | html %]">Koha link:</label>
276
                                                            <!-- This select should be DISABLED; value is submitted by the following hidden input -->
277
                                                            <select name="kohafield" id="kohafield[% loo.row | html %]" disabled>
278
                                                            [% FOREACH value IN loo.kohafields %]
279
                                                            [% IF ( value == loo.kohafield ) %]
314
                                                                <option value="[% value | html %]" selected="selected">[% value | html %]</option>
280
                                                                <option value="[% value | html %]" selected="selected">[% value | html %]</option>
315
                                                            [% ELSE %]
281
                                                            [% ELSE %]
316
                                                                <option value="[% value | html %]">[% value | html %]</option>
282
                                                                <option value="[% value | html %]">[% value | html %]</option>
317
                                                            [% END %]
283
                                                            [% END %]
318
                                                        [% END %]
284
                                                            [% END %]
319
                                                        </select>
285
                                                            </select>
320
                                                    </li>
286
                                                            <!-- Do NOT remove this next hidden input! We need it to save kohafield. -->
321
                                                </ol>
287
                                                            <input type="hidden" name="kohafield" value="[% loo.kohafield | html %]"/>
322
                                            </fieldset> <!-- /.rows -->
288
                                                        </li>
323
                                        </div> <!-- /#oth[% loo.urisubfieldcode | html %] -->
289
                                                    </ol>
324
                                    </div><!-- /constraints -->
290
                                                </fieldset> <!-- /.rows -->
325
                                [% END # /FOREACH loo %]
291
                                            </div> <!-- /#advanced[%- PROCESS outputsubfield subfieldanchor = subfieldcode -%] -->
292
293
                                            <div id="oth[%- PROCESS outputsubfield subfieldanchor = loo.subfieldcode -%]" class="constraints">
294
                                                <fieldset class="rows">
295
                                                    <legend>Other options (choose one)</legend>
296
                                                    <ol>
297
                                                        <li>
298
                                                            <label for="authorised_value[% loo.row | html %]">Authorized value:</label>
299
                                                            <select name="authorised_value" id="authorised_value[% loo.row | html %]">
300
                                                            <option value=""></option>
301
                                                            [% FOREACH value IN loo.authorised_values %]
302
                                                                [% IF ( value == loo.authorised_value ) %]
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
                                                        <li>
311
                                                            <label for="authtypecode[% loo.row | html %]">Thesaurus:</label>
312
                                                            <select name="authtypecode" id="authtypecode[% loo.row | html %]">
313
                                                            [% FOREACH value IN loo.authtypes %]
314
                                                                [% IF ( value == loo.authtypecode ) %]
315
                                                                    <option value="[% value | html %]" selected="selected">[% value | html %]</option>
316
                                                                [% ELSE %]
317
                                                                    <option value="[% value | html %]">[% value | html %]</option>
318
                                                                [% END %]
319
                                                            [% END %]
320
                                                            </select>
321
                                                        </li>
322
                                                        <li>
323
                                                            <label for="value_builder[% loo.row | html %]">Plugin:</label>
324
                                                            <select name="value_builder" id="value_builder[% loo.row | html %]">
325
                                                            [% FOREACH value IN loo.value_builders %]
326
                                                                [% IF ( value == loo.value_builder ) %]
327
                                                                    <option value="[% value | html %]" selected="selected">[% value | html %]</option>
328
                                                                [% ELSE %]
329
                                                                    <option value="[% value | html %]">[% value | html %]</option>
330
                                                                [% END %]
331
                                                            [% END %]
332
                                                            </select>
333
                                                        </li>
334
                                                    </ol>
335
                                                </fieldset> <!-- /.rows -->
336
                                            </div> <!-- /#oth[%- PROCESS outputsubfield subfieldanchor = loo.subfieldcode -%] -->
337
                                        </div><!-- /constraints -->
338
                                    [% END # /FOREACH loo %]
339
                                </div> <!-- /.tab-content -->
326
                            </div><!-- /subfieldtabs -->
340
                            </div><!-- /subfieldtabs -->
327
341
328
                            <fieldset class="action">
342
                            <fieldset class="action">
Lines 399-405 Link Here
399
                                            [% END %]
413
                                            [% END %]
400
                                        </td>
414
                                        </td>
401
                                        <td class="actions">
415
                                        <td class="actions">
402
                                            <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>
416
                                            <a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?op=add_form&amp;tagfield=[% loo.tagfield | uri %]&tagsubfield=[% loo.tagsubfield | uri %]&amp;frameworkcode=[% frameworkcode | uri %]#sub[% loo.tagsubfield | uri %]field" class="btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a>
403
                                            <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>
417
                                            <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>
404
                                        </td>
418
                                        </td>
405
                                    </tr>
419
                                    </tr>
Lines 431-436 Link Here
431
    [% MACRO jsinclude BLOCK %]
445
    [% MACRO jsinclude BLOCK %]
432
        [% INCLUDE 'datatables.inc' %]
446
        [% INCLUDE 'datatables.inc' %]
433
        [% Asset.js("js/admin-menu.js") | $raw %]
447
        [% Asset.js("js/admin-menu.js") | $raw %]
448
        <script>
449
            var tagsubfield = "[% tagsubfield | html %]";
450
        </script>
434
        [% Asset.js("js/marc_subfields_structure.js") | $raw %]
451
        [% Asset.js("js/marc_subfields_structure.js") | $raw %]
435
    [% END %]
452
    [% END %]
436
453
(-)a/koha-tmpl/intranet-tmpl/prog/js/marc_subfields_structure.js (-8 / +14 lines)
Lines 1-8 Link Here
1
/* global dataTablesDefaults */
1
/* global dataTablesDefaults tagsubfield */
2
$(document).ready(function() {
2
$(document).ready(function() {
3
    var tabs = $('#subfieldtabs').tabs();
3
    if( tagsubfield && tagsubfield == "@"){
4
        $("#subfieldtabs a[href='#subATfield']").tab("show");
5
    } else if ( tagsubfield && tagsubfield != "@"){
6
        $("#subfieldtabs a[href='#sub" + tagsubfield + "field'").tab("show");
7
    } else {
8
        $("#subfieldtabs a:first").tab("show");
9
    }
10
4
    var current_index;
11
    var current_index;
5
    tabs.find( ".ui-tabs-nav" ).sortable({
12
    $("#subfieldtabs > ul").sortable({
6
        axis: "x",
13
        axis: "x",
7
        start: function (e, ui) {
14
        start: function (e, ui) {
8
            current_index = $(ui.item[0]).index();
15
            current_index = $(ui.item[0]).index();
Lines 12-26 $(document).ready(function() { Link Here
12
            if (current_index < new_index) new_index++;
19
            if (current_index < new_index) new_index++;
13
            var subfield_code = $(ui.item[0]).attr('id').replace( /^tab_subfield_/, '');
20
            var subfield_code = $(ui.item[0]).attr('id').replace( /^tab_subfield_/, '');
14
            var content = $('#sub' + subfield_code + 'field');
21
            var content = $('#sub' + subfield_code + 'field');
15
            var panels = $("#subfieldtabs > div");
22
            var panels = $("#subfieldtabs .tab-pane");
16
            if ( new_index < $(panels).size() ){
23
            if ( new_index < $(panels).size() ){
17
                $(content).insertBefore($("#subfieldtabs > div")[new_index]);
24
                $(content).insertBefore( panels[new_index]);
18
            } else {
25
            } else {
19
                $(content).insertAfter($("#subfieldtabs > div")[new_index-1]);
26
                $(content).insertAfter( panels[new_index-1]);
20
            }
27
            }
21
            tabs.tabs("refresh");
22
        }
28
        }
23
    });
29
    });
30
24
    $("input[id^='hidden_']").click(setHiddenValue);
31
    $("input[id^='hidden_']").click(setHiddenValue);
25
    $("input[id^='hidden-']").each(function() {
32
    $("input[id^='hidden-']").each(function() {
26
        populateHiddenCheckboxes($(this).attr('id').split('-')[1]);
33
        populateHiddenCheckboxes($(this).attr('id').split('-')[1]);
27
- 

Return to bug 30489