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

(-)a/admin/auth_subfields_structure.pl (-26 / +14 lines)
Lines 122-128 if ($op eq 'add_form') { Link Here
122
    $row_data{tagsubfield}      = "";
122
    $row_data{tagsubfield}      = "";
123
    $row_data{liblibrarian}     = "";
123
    $row_data{liblibrarian}     = "";
124
    $row_data{libopac}          = "";
124
    $row_data{libopac}          = "";
125
    $row_data{seealso}          = "";
126
    $row_data{hidden}           = "000";
125
    $row_data{hidden}           = "000";
127
    $row_data{repeatable}       = 0;
126
    $row_data{repeatable}       = 0;
128
    $row_data{mandatory}        = 0;
127
    $row_data{mandatory}        = 0;
Lines 148-183 if ($op eq 'add_form') { Link Here
148
} elsif ($op eq 'add_validate') {
147
} elsif ($op eq 'add_validate') {
149
	$template->param(tagfield => "$input->param('tagfield')");
148
	$template->param(tagfield => "$input->param('tagfield')");
150
	my @tagsubfield	= $input->multi_param('tagsubfield');
149
	my @tagsubfield	= $input->multi_param('tagsubfield');
151
	my @liblibrarian	= $input->multi_param('liblibrarian');
152
	my @libopac		= $input->multi_param('libopac');
153
	my @kohafield		= ''.$input->param('kohafield');
150
	my @kohafield		= ''.$input->param('kohafield');
154
	my @tab				= $input->multi_param('tab');
155
	my @seealso		= $input->multi_param('seealso');
156
    my @ohidden             = $input->multi_param('ohidden');
157
    my @authorised_value_categories = $input->multi_param('authorised_value');
158
	my $authtypecode	= $input->param('authtypecode');
151
	my $authtypecode	= $input->param('authtypecode');
159
	my @frameworkcodes	= $input->multi_param('frameworkcode');
152
	my @frameworkcodes	= $input->multi_param('frameworkcode');
160
	my @value_builder	=$input->multi_param('value_builder');
161
    my @defaultvalue = $input->multi_param('defaultvalue');
162
153
163
    my $display_order;
154
    my $display_order;
164
	for (my $i=0; $i<= $#tagsubfield ; $i++) {
155
	for (my $i=0; $i<= $#tagsubfield ; $i++) {
165
		my $tagfield			=$input->param('tagfield');
156
        my $tagfield         = $input->param('tagfield');
166
		my $tagsubfield		=$tagsubfield[$i];
157
        my $tagsubfield      = $tagsubfield[$i];
167
		$tagsubfield="@" unless $tagsubfield ne '';
158
        my $liblibrarian     = $input->param("liblibrarian_$i");
168
		my $liblibrarian		=$liblibrarian[$i];
159
        my $libopac          = $input->param("libopac_$i");
169
		my $libopac			=$libopac[$i];
160
        my $repeatable       = $input->param("repeatable_$i") ? 1 : 0;
170
		my $repeatable		=$input->param("repeatable$i")?1:0;
161
        my $mandatory        = $input->param("mandatory_$i") ? 1 : 0;
171
		my $mandatory		=$input->param("mandatory$i")?1:0;
162
        my $kohafield        = $input->param("kohafield_$i");
172
		my $kohafield		=$kohafield[$i];
163
        my $tab              = $input->param("tab_$i");
173
		my $tab				=$tab[$i];
164
        my $defaultvalue     = $input->param("defaultvalue_$i");
174
		my $seealso				=$seealso[$i];
165
        my $authorised_value = $input->param("authorised_value_$i");
175
        my $authorised_value = $authorised_value_categories[$i];
166
        my $frameworkcode    = $frameworkcodes[$i];
176
		my $frameworkcode		=$frameworkcodes[$i];
167
        my $value_builder    = $input->param("value_builder_$i");
177
		my $value_builder=$value_builder[$i];
168
        my $hidden           = $input->param("hidden_$i");
178
        my $defaultvalue = $defaultvalue[$i];
169
        my $isurl            = $input->param("isurl_$i") ? 1 : 0;
179
		my $hidden = $ohidden[$i]; #collate from 3 hiddens;
180
		my $isurl = $input->param("isurl$i")?1:0;
181
        if ($liblibrarian) {
170
        if ($liblibrarian) {
182
            my $ass = Koha::Authority::Subfields->find(
171
            my $ass = Koha::Authority::Subfields->find(
183
                {
172
                {
Lines 193-199 if ($op eq 'add_form') { Link Here
193
                mandatory        => $mandatory,
182
                mandatory        => $mandatory,
194
                kohafield        => $kohafield,
183
                kohafield        => $kohafield,
195
                tab              => $tab,
184
                tab              => $tab,
196
                seealso          => $seealso,
197
                authorised_value => $authorised_value,
185
                authorised_value => $authorised_value,
198
                frameworkcode    => $frameworkcode,
186
                frameworkcode    => $frameworkcode,
199
                value_builder    => $value_builder,
187
                value_builder    => $value_builder,
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/subfields-structure-form.inc (+263 lines)
Line 0 Link Here
1
[% BLOCK setsubfield %][% FILTER collapse %]
2
    [% IF ( loo.tagsubfield ) %]
3
        [% SET subfield = loo.tagsubfield %]
4
    [% ELSE %]
5
        [% SET subfield = loo.subfieldcode %]
6
    [% END %]
7
[% END %][% END %]
8
9
<div id="subfieldtabs" class="toptabs numbered">
10
    <ul class="nav nav-tabs" role="tablist">
11
        [% FOREACH loo IN loop %]
12
            [% PROCESS setsubfield %]
13
            <li id="tab_subfield_[%- PROCESS outputsubfield subfieldanchor = subfield -%]" class="tab-item" role="presentation">
14
                [% IF ( loo.new_subfield ) %]
15
                    <a href="#sub[%- PROCESS outputsubfield subfieldanchor = subfield -%]field"  aria-controls="sub[%- PROCESS outputsubfield subfieldanchor = subfield -%]field" role="tab" data-toggle="tab" title="[% loo.liblibrarian | html_entity %]">New</a>
16
                [% ELSE %]
17
                    <a href="#sub[%- PROCESS outputsubfield subfieldanchor = subfield -%]field"  aria-controls="sub[%- PROCESS outputsubfield subfieldanchor = subfield -%]field" role="tab" data-toggle="tab" title="[% loo.liblibrarian | html_entity %]">
18
                        [% subfield | html %]
19
                    </a>
20
                [% END %]
21
            </li>
22
        [% END %]
23
    </ul>
24
25
    <div class="tab-content">
26
27
        [% FOREACH loo IN loop %]
28
            [% PROCESS setsubfield %]
29
            <div class="constraints tab-pane" role="tabpanel" id="sub[%- PROCESS outputsubfield subfieldanchor = subfield -%]field">
30
                <input type="hidden" name="tab_id" value="[% loo.row | html %]" />
31
                <div id="basic[%- PROCESS outputsubfield subfieldanchor = subfield -%]field" class="constraints">
32
                    <fieldset class="rows">
33
                        <legend>Basic constraints</legend>
34
                        <ol>
35
                            [% IF ( subfield == 0 || subfield ) %]
36
                                <li>
37
                                    <span class="label">Subfield code:</span>
38
                                    [% subfield | html %]
39
                                    <input type="hidden" name="tagsubfield" value="[% subfield | html %]" />
40
                                </li>
41
                            [% ELSE %]
42
                                <li>
43
                                    <label for="tagsubfield[% loo.row | html %]">Subfield code:</label>
44
                                    <input type="text" id="tagsubfield[% loo.row | html %]" name="tagsubfield" value="[% subfield | html %]" />
45
                                </li>
46
                            [% END %]
47
                            <li>
48
                                <label for="liblibrarian[% loo.row | html %]">Text for librarian: </label>
49
                                <input id="liblibrarian[% loo.row | html %]" type="text" name="liblibrarian_[% loo.row | html %]" value="[% loo.liblibrarian | html_entity %]" size="40" maxlength="80" />
50
                            </li>
51
                            <li>
52
                                <label for="libopac_[% loo.row | html %]">Text for OPAC: </label>
53
                                <input type="text" id="libopac_[% loo.row | html %]" name="libopac_[% loo.row | html %]" value="[% loo.libopac | html_entity %]" size="40" maxlength="80" />
54
                            </li>
55
                            <li>
56
                                <label for="repeatable[% loo.row | html %]">Repeatable: </label>
57
                                [% IF loo.repeatable %]
58
                                    <input type="checkbox" id="repeatable[% loo.row | html %]" name="repeatable_[% loo.row | html %]" checked="checked" value="1" />
59
                                [% ELSE %]
60
                                    <input type="checkbox" id="repeatable[% loo.row | html %]" name="repeatable_[% loo.row | html %]" value="1" />
61
                                [% END %]
62
                            </li>
63
                            <li>
64
                                <label for="mandatory[% loo.row | html %]">Mandatory: </label>
65
                                [% IF loo.mandatory %]
66
                                    <input type="checkbox" id="mandatory[% loo.row | html %]" name="mandatory_[% loo.row | html %]" checked="checked" value="1" />
67
                                [% ELSE %]
68
                                    <input type="checkbox" id="mandatory[% loo.row | html %]" name="mandatory_[% loo.row | html %]" value="1" />
69
                                [% END %]
70
                            </li>
71
                            [% IF ( biblioframework ) %]
72
                                <li>
73
                                    <label for="important[% loo.row | html %]">Important: </label>
74
                                    [% IF loo.important %]
75
                                        <input type="checkbox" id="important[% loo.row | html %]" name="important_[% loo.row | html %]" checked="checked" value="1" />
76
                                    [% ELSE %]
77
                                        <input type="checkbox" id="important[% loo.row | html %]" name="important_[% loo.row | html %]" value="1" />
78
                                    [% END %]
79
                                </li>
80
                            [% END %]
81
                            <li>
82
                                <label for="tab[% loo.row | html %]">Managed in tab: </label>
83
                                <select name="tab_[% loo.row | html %]" id="tab[% loo.row | html %]">
84
                                    [%- IF ( loo.tab ==  -1 ) -%]
85
                                        <option value="-1" selected="selected">ignore</option>
86
                                    [%- ELSE -%]
87
                                        <option value="-1">ignore</option>
88
                                    [%- END -%]
89
                                    [%- FOREACH t IN [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] -%]
90
                                        [%- IF ( loo.tab ==  t ) -%]
91
                                            <option value="[%- t | html -%]" selected="selected">[%- t | html -%]</option>
92
                                        [%- ELSE -%]
93
                                            <option value="[%- t | html -%]">[%- t | html -%]</option>
94
                                        [%- END -%]
95
                                    [%- END -%]
96
                                    [%- IF ( biblioframework ) %]
97
                                        [% SET tabten = t("Items (10)") %]
98
                                    [% ELSE %]
99
                                        [% SET tabten = "10" %]
100
                                    [% END %]
101
                                    [%- IF ( loo.tab ==  10 ) -%]
102
                                        <option value="10" selected="selected">[% tabten | html %]</option>
103
                                    [%- ELSE -%]
104
                                        <option value="10">[% tabten | html %]</option>
105
                                    [%- END -%]
106
                                </select>
107
                                <div class="hint"><i class="fa fa-warning"></i> <span>Ignore means that the subfield does not display in the record editor and that its value, if any, is deleted from the record</span></div>
108
                            </li>
109
                        </ol>
110
                    </fieldset><!-- /.rows -->
111
                </div> <!-- /#basic[%- PROCESS outputsubfield subfieldanchor = subfieldcode -%] -->
112
113
                <div id="advanced[%- PROCESS outputsubfield subfieldanchor = subfield -%]" class="constraints">
114
                    <fieldset class="rows">
115
                        <legend>Advanced constraints</legend>
116
                        <ol>
117
                            <li>
118
                                <label for="defaultvalue[% loo.row | html %]">Default value:</label>
119
                                <input type="text" name="defaultvalue_[% loo.row | html %]" id="defaultvalue[% loo.row | html %]" value="[% loo.defaultvalue | html %]" />
120
                            </li>
121
                            [% IF ( biblioframework ) %]
122
                                <li>
123
                                    <label for="maxlength[% loo.row | html %]">Max length:</label>
124
                                    <input type="text" id="maxlength[% loo.row | html %]" name="maxlength_[% loo.row | html %]" value="[% loo.maxlength | html %]" size="4" />
125
                                </li>
126
                            [% END %]
127
                            <li>
128
                                <label for="hidden[% loo.row | html %]">Visibility:</label>
129
                                [% IF ( biblioframework ) %]
130
                                    [% IF loo.hidden_protected %]
131
                                        <input type="hidden" id="hidden-[% loo.row | html %]" name="hidden_[% loo.row | html %]" value="[% loo.hidden | html %]" data-koha-protected="1" />
132
                                    [% ELSE %]
133
                                        <input type="hidden" id="hidden-[% loo.row | html %]" name="hidden_[% loo.row | html %]" value="[% loo.hidden | html %]" />
134
                                    [% END %]
135
                                    <input type="checkbox" id="hidden_opac_[% loo.row | html %]" class="inclusive_[% loo.row | html %]" name="hidden_opac_[% loo.row | html %]"/>
136
                                    <label for="hidden_opac_[% loo.row | html %]" style="float: none;">OPAC</label>
137
                                    <input type="checkbox" id="hidden_intranet_[% loo.row | html %]" class="inclusive_[% loo.row | html %]" name="hidden_intranet_[% loo.row | html %]"/>
138
                                    <label for="hidden_intranet_[% loo.row | html %]" style="float: none;">Staff interface</label>
139
                                    <input type="checkbox" id="hidden_editor_[% loo.row | html %]" class="inclusive_[% loo.row | html %]" name="hidden_editor_[% loo.row | html %]"/>
140
                                    <label for="hidden_editor_[% loo.row | html %]" style="float: none;">Editor</label>
141
                                    <input type="checkbox" id="hidden_collapsed_[% loo.row | html %]" class="inclusive_[% loo.row | html %]" name="hidden_collapsed_[% loo.row | html %]"/>
142
                                    <label for="hidden_collapsed_[% loo.row | html %]" style="float: none;">Collapsed</label>
143
                                    <input type="checkbox" id="hidden_flagged_[% loo.row | html %]" name="flagged_[% loo.row | html %]"/>
144
                                    <label for="hidden_flagged_[% loo.row | html %]" style="float: none;">Flagged</label>
145
                                [% ELSE %]
146
                                    <select name="hidden_[% loo.row | html %]" id="hidden_[% loo.row | html %]">
147
                                        [%- IF ( loo.hidden ==  0 ) -%]
148
                                            <option value= "0" selected="selected">Show all</option>
149
                                            <option value="1">Hide all</option>
150
                                        [%- ELSE -%]
151
                                            [%# All other non-zero values mean: Hide %]
152
                                            <option value= "0">Show all</option>
153
                                            <option value="1" selected="selected">Hide all</option>
154
                                        [%- END -%]
155
                                    </select>
156
                                [% END %]
157
                            </li>
158
                            <li>
159
                                <label for="isurl[% loo.row | html %]">Is a URL:</label>
160
                                [% IF loo.isurl %]
161
                                    <input type="checkbox" id="isurl[% loo.row | html %]" name="isurl_[% loo.row | html %]" checked="checked" value="1" />
162
                                [% ELSE %]
163
                                    <input type="checkbox" id="isurl[% loo.row | html %]" name="isurl_[% loo.row | html %]" value="1" />
164
                                [% END %]
165
                                <span class="hint">If checked, it means that the subfield is a URL and can be clicked</span>
166
                            </li>
167
                            [% IF ( biblioframework ) %]
168
                                <li>
169
                                    <label for="link[% loo.row | html %]">Link:</label>
170
                                    <input type="text" id="link[% loo.row | html %]" name="link_[% loo.row | html %]" value="[% loo.link | html %]" size="10" maxlength="80" />
171
                                    <div class="hint">An index name, e.g. title or Local-Number</div>
172
                                </li>
173
                            [% END %]
174
                            [% UNLESS ( biblioframework ) %]
175
                                <li>
176
                                    <label for="kohafield[% loo.row | html %]">Koha link:</label>
177
                                    <select name="kohafield_[% loo.row | html %]" id="kohafield[% loo.row | html %]">
178
                                    [%- FOREACH value IN loo.kohafields %]
179
                                        [% IF ( value == loo.kohafield  && value.length>0 ) -%]
180
                                            <option value="[% value | html %]" selected="selected">[% value | html %]</option>
181
                                        [%- ELSIF ( value == loo.kohafield ) -%]
182
                                            <option value="[% value | html %]" selected="selected">&nbsp;</option>
183
                                        [%- ELSIF ( value.length==0 ) -%]
184
                                            <option value="[% value | html %]">&nbsp;</option>
185
                                        [%- ELSE -%]
186
                                            <option value="[% value | html %]">[% value | html %]</option>
187
                                        [%- END -%]
188
                                    [%- END %]
189
                                    </select>
190
                                </li>
191
                            [% END %]
192
                        </ol>
193
                        [% IF ( biblioframework ) %]
194
                            <input type="hidden" name="kohafield_[% loo.row | html %]" value="[% loo.kohafield | html %]"/>
195
                        [% END %]
196
                    </fieldset>
197
                </div> <!-- /#advanced[%- PROCESS outputsubfield subfieldanchor = subfieldcode -%] -->
198
199
                <div id="oth[%- PROCESS outputsubfield subfieldanchor = subfield -%]" class="constraints">
200
                    <fieldset class="rows">
201
                        <legend>Other options (choose one)</legend>
202
                        <ol>
203
                            <li>
204
                                <label for="authorised_value[% loo.row | html %]">Authorized value:</label>
205
                                <select name="authorised_value_[% loo.row | html %]" id="authorised_value[% loo.row | html %]">
206
                                    <option value=""></option>
207
                                    [% FOREACH value IN loo.authorised_values %]
208
                                        [% IF ( value == loo.authorised_value ) %]
209
                                            <option value="[% value | html %]" selected="selected">[% value | html %]</option>
210
                                        [% ELSE %]
211
                                            <option value="[% value | html %]">[% value | html %]</option>
212
                                        [% END %]
213
                                    [% END %]
214
                                </select>
215
                            </li>
216
                            <li>
217
                                [% IF ( biblioframework ) %]
218
                                    <label for="authtypecode[% loo.row | html %]">Thesaurus:</label>
219
                                    <select name="authtypecode_[% loo.row | html %]" id="authtypecode[% loo.row | html %]">
220
                                        [% FOREACH value IN loo.authtypes %]
221
                                            [% IF ( value == loo.authtypecode ) %]
222
                                                <option value="[% value | html %]" selected="selected">[% value | html %]</option>
223
                                            [% ELSE %]
224
                                                <option value="[% value | html %]">[% value | html %]</option>
225
                                            [% END %]
226
                                        [% END %]
227
                                    </select>
228
                                [% ELSE %]
229
                                    <label for="frameworkcode[% loo.row | html %]">Thesaurus:</label>
230
                                    <select name="frameworkcode" id="frameworkcode[% loo.row | html %]">
231
                                        [%- FOREACH value IN loo.frameworkcodes %]
232
                                            [% IF ( value == loo.frameworkcode && value.length>0 ) -%]
233
                                                <option value="[% value | html %]" selected="selected">[% value | html %]</option>
234
                                            [%- ELSIF ( value == loo.frameworkcode ) -%]
235
                                                <option value="[% value | html %]" selected="selected">&nbsp;</option>
236
                                            [%- ELSIF ( value.length==0 ) -%]
237
                                                <option value="[% value | html %]">&nbsp;</option>
238
                                            [%- ELSE -%]
239
                                                <option value="[% value | html %]">[% value | html %]</option>
240
                                            [%- END -%]
241
                                        [%- END %]
242
                                    </select>
243
                                [% END %]
244
                            </li>
245
                            <li>
246
                                <label for="value_builder[% loo.row | html %]">Plugin:</label>
247
                                <select name="value_builder_[% loo.row | html %]" id="value_builder[% loo.row | html %]">
248
                                    [% FOREACH value IN loo.value_builders %]
249
                                        [% IF ( value == loo.value_builder ) %]
250
                                            <option value="[% value | html %]" selected="selected">[% value | html %]</option>
251
                                        [% ELSE %]
252
                                            <option value="[% value | html %]">[% value | html %]</option>
253
                                        [% END %]
254
                                    [% END %]
255
                                </select>
256
                            </li>
257
                        </ol>
258
                    </fieldset> <!-- /.rows -->
259
                </div> <!-- /#oth[%- PROCESS outputsubfield subfieldanchor = subfieldcode -%] -->
260
            </div><!-- /constraints -->
261
        [% END # /FOREACH loo %]
262
    </div> <!-- /.tab-content -->
263
</div><!-- /subfieldtabs -->
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_subfields_structure.tt (-178 / +2 lines)
Lines 89-95 Link Here
89
        <input type="hidden" name="op" value="add_validate" />
89
        <input type="hidden" name="op" value="add_validate" />
90
        <input type="hidden" name="tagfield" value="[% tagfield | html %]" />
90
        <input type="hidden" name="tagfield" value="[% tagfield | html %]" />
91
        <input type="hidden" name="authtypecode" value="[% authtypecode | html %]" />
91
        <input type="hidden" name="authtypecode" value="[% authtypecode | html %]" />
92
        <fieldset class="action"><input type="submit" class="btn btn-primary" 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>
93
92
94
        [% BLOCK outputsubfield %][% FILTER collapse %]
93
        [% BLOCK outputsubfield %][% FILTER collapse %]
95
            [% SWITCH ( subfieldanchor ) %]
94
            [% SWITCH ( subfieldanchor ) %]
Lines 102-285 Link Here
102
            [% END %]
101
            [% END %]
103
        [% END %][% END %]
102
        [% END %][% END %]
104
103
105
        <div id="subfieldtabs" class="toptabs numbered">
104
        [% INCLUDE "subfields-structure-form.inc" %]
106
            <ul class="nav nav-tabs" role="tablist">
107
                [% FOREACH loo IN loop %]
108
                    <li role="presentation" id="tab_subfield_[%- PROCESS outputsubfield subfieldanchor = loo.tagsubfield -%]">
109
                        [% IF ( loo.new_subfield ) %]
110
                            <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>
111
                        [% ELSE %]
112
                            <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>
113
                        [% END %]
114
                    </li>
115
                [% END %]
116
            </ul>
117
            <div class="tab-content">
118
                [% FOREACH loo IN loop %]
119
                    <div role="tabpanel" class="tab-pane" id="sub[%- PROCESS outputsubfield subfieldanchor = loo.tagsubfield -%]field">
120
                        <fieldset class="rows"><ol>
121
105
122
                            [% IF ( loo.new_subfield ) %]
106
        <fieldset class="action"><input type="submit" class="btn btn-primary" 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>
123
                                <li>
124
                                    <label for="tagsubfieldinput[% loo.row | html %]">Subfield code: </label>
125
                                    <input type="text" name="tagsubfield" value="[% loo.tagsubfield | html %]" size="1" id="tagsubfield" maxlength="1" />
126
                                </li>
127
                            [% ELSE %]
128
                                <li>
129
                                    <input type="hidden" name="tagsubfield" value="[% loo.tagsubfield | html %]" />
130
                                </li>
131
                            [% END %]
132
                            <li>
133
                                <label for="repeatable[% loo.row | html %]">Repeatable: </label>
134
                                [% IF loo.repeatable %]
135
                                    <input type="checkbox" id="repeatable[% loo.row | html %]" name="repeatable[% loo.row | html %]" checked="checked" value="1" />
136
                                [% ELSE %]
137
                                    <input type="checkbox" id="repeatable[% loo.row | html %]" name="repeatable[% loo.row | html %]" value="1" />
138
                                [% END %]
139
                            </li>
140
                            <li>
141
                                <label for="mandatory[% loo.row | html %]">Mandatory: </label>
142
                                [% IF loo.mandatory %]
143
                                    <input type="checkbox" id="mandatory[% loo.row | html %]" name="mandatory[% loo.row | html %]" checked="checked" value="1" />
144
                                [% ELSE %]
145
                                    <input type="checkbox" id="mandatory[% loo.row | html %]" name="mandatory[% loo.row | html %]" value="1" />
146
                                [% END %]
147
                            </li>
148
                            <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>
149
                            <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>
150
                            <li><label for="tab[% loo.row | html %]">Managed in tab: </label>
151
                                <select name="tab" id="tab[% loo.row | html %]">
152
                                    [%- IF ( loo.tab ==  -1 ) -%]
153
                                    <option value="-1" selected="selected">ignore</option>
154
                                    [%- ELSE -%]
155
                                    <option value="-1">ignore</option>
156
                                    [%- END -%]
157
                                [%- FOREACH t IN [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'] -%]
158
                                    [%- IF ( loo.tab ==  t && t.length>0 ) -%]
159
                                    <option value="[%- t | html -%]" selected="selected">[%- t | html -%]</option>
160
                                    [%- ELSIF ( loo.tab ==  t ) -%]
161
                                    <option value="[%- t | html -%]" selected="selected">&nbsp;</option>
162
                                    [%- ELSE -%]
163
                                    <option value="[%- t | html -%]">[%- t | html -%]</option>
164
                                    [%- END -%]
165
                                [%- END -%]
166
                                </select>
167
                                <div class="hint"><i class="fa fa-warning"></i> <span>Ignore means that the subfield does not display in the record editor and that its value, if any, is deleted from the record</span></div>
168
                            </li>
169
                            <li>
170
                                <fieldset>
171
                                    <legend>Display</legend>
172
                                    <ol>
173
                                        <li><label for="ohidden[% loo.row | html %]">Select to display or not:</label>
174
                                            <select name="ohidden" id="ohidden[% loo.row | html %]">
175
                                                [%- IF ( loo.hidden ==  0 ) -%]
176
                                                <option value= "0" selected="selected">Show all</option>
177
                                                <option value="1">Hide all</option>
178
                                                [%- ELSE -%]
179
                                                [%# All other non-zero values mean: Hide %]
180
                                                <option value= "0">Show all</option>
181
                                                <option value="1" selected="selected">Hide all</option>
182
                                                [%- END -%]
183
                                            </select>
184
                                        </li>
185
                                    </ol>
186
                                </fieldset>
187
                            </li>
188
                            <li>
189
                                <fieldset class="rows">
190
                                    <legend>Advanced constraints:</legend>
191
                                    <ol>
192
                                        <li>
193
                                            <label for="isurl[% loo.row | html %]">Is a URL:</label>
194
                                            [% IF loo.isurl %]
195
                                                <input type="checkbox" id="isurl[% loo.row | html %]" name="isurl[% loo.row | html %]" checked="checked" value="1" />
196
                                            [% ELSE %]
197
                                                <input type="checkbox" id="isurl[% loo.row | html %]" name="isurl[% loo.row | html %]" value="1" />
198
                                            [% END %]
199
                                            <span class="hint">If checked, it means that the subfield is a URL and can be clicked.</span>
200
                                        </li>
201
                                        <li>
202
                                            <label for="defaultvalue[% loo.row | html %]">Default value:</label>
203
                                            <input type="text" name="defaultvalue" id="defaultvalue[% loo.row | html %]" value="[% loo.defaultvalue | html %]" />
204
                                        </li>
205
                                    </ol>
206
                                </fieldset>
207
                            </li>
208
                            <li>
209
                                <fieldset><legend>Help input</legend>
210
                                    <ol>
211
                                        <li>
212
                                            <label for="kohafield[% loo.row | html %]">Koha field:</label>
213
                                            <select name="kohafield" id="kohafield[% loo.row | html %]">
214
                                            [%- FOREACH value IN loo.kohafields %]
215
                                                [% IF ( value == loo.kohafield  && value.length>0 ) -%]
216
                                                <option value="[% value | html %]" selected="selected">[% value | html %]</option>
217
                                                [%- ELSIF ( value == loo.kohafield ) -%]
218
                                                <option value="[% value | html %]" selected="selected">&nbsp;</option>
219
                                                [%- ELSIF ( value.length==0 ) -%]
220
                                                <option value="[% value | html %]">&nbsp;</option>
221
                                                [%- ELSE -%]
222
                                                <option value="[% value | html %]">[% value | html %]</option>
223
                                                [%- END -%]
224
                                            [%- END %]
225
                                            </select>
226
                                        </li>
227
                                        <li>
228
                                            <label for="authorised_value[% loo.row | html %]">Authorized value:</label>
229
                                            <select name="authorised_value" id="authorised_value[% loo.row | html %]">
230
                                            [%- FOREACH value IN loo.authorised_values %]
231
                                                [% IF ( value == loo.authorised_value && value.length>0 ) -%]
232
                                                <option value="[% value | html %]" selected="selected">[% value | html %]</option>
233
                                                [%- ELSIF ( value == loo.authorised_value ) -%]
234
                                                <option value="[% value | html %]" selected>&nbsp;</option>
235
                                                [%- ELSIF ( value.length==0 ) -%]
236
                                                <option value="[% value | html %]">&nbsp;</option>
237
                                                [%- ELSE -%]
238
                                                <option value="[% value | html %]">[% value | html %]</option>
239
                                                [%- END -%]
240
                                            [%- END %]
241
                                            </select>
242
                                        </li>
243
                                        <li>
244
                                            <label for="frameworkcode[% loo.row | html %]">Thesaurus:</label>
245
                                            <select name="frameworkcode" id="frameworkcode[% loo.row | html %]">
246
                                            [%- FOREACH value IN loo.frameworkcodes %]
247
                                                [% IF ( value == loo.frameworkcode && value.length>0 ) -%]
248
                                                <option value="[% value | html %]" selected="selected">[% value | html %]</option>
249
                                                [%- ELSIF ( value == loo.frameworkcode ) -%]
250
                                                <option value="[% value | html %]" selected="selected">&nbsp;</option>
251
                                                [%- ELSIF ( value.length==0 ) -%]
252
                                                <option value="[% value | html %]">&nbsp;</option>
253
                                                [%- ELSE -%]
254
                                                <option value="[% value | html %]">[% value | html %]</option>
255
                                                [%- END -%]
256
                                            [%- END %]
257
                                            </select>
258
                                        </li>
259
                                        <li>
260
                                            <label for="value_builder[% loo.row | html %]">Plugin:</label>
261
                                            <select name="value_builder" id="value_builder[% loo.row | html %]">
262
                                            [%- FOREACH value IN loo.value_builders %]
263
                                                [% IF ( value == loo.value_builder && value.length>0 ) -%]
264
                                                <option value="[% value | html %]" selected="selected">[% value | html %]</option>
265
                                                [%- ELSIF ( value == loo.value_builder ) -%]
266
                                                <option value="[% value | html %]" selected="selected">&nbsp;</option>
267
                                                [%- ELSIF ( value.length==0 ) -%]
268
                                                <option value="[% value | html %]">&nbsp;</option>
269
                                                [%- ELSE -%]
270
                                                <option value="[% value | html %]">[% value | html %]</option>
271
                                                [%- END -%]
272
                                            [%- END %]
273
                                            </select>
274
                                        </li>
275
                                    </ol>
276
                                </fieldset>
277
                            </li>
278
                        </ol></fieldset><br class="clear" />
279
                    </div>
280
                [% END %]
281
            </div> <!-- /.tab-content -->
282
        </div>
283
    </form>
107
    </form>
284
[% END %]
108
[% END %]
285
109
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc_subfields_structure.tt (-206 / +1 lines)
Lines 138-348 Link Here
138
                                [% END %]
138
                                [% END %]
139
                            [% END %][% END %]
139
                            [% END %][% END %]
140
140
141
                            <div id="subfieldtabs" class="toptabs numbered">
141
                            [% INCLUDE "subfields-structure-form.inc" biblioframework = 1 %]
142
                                 <ul class="nav nav-tabs" role="tablist">
143
                                    [% FOREACH loo IN loop %]
144
                                        <li id="tab_subfield_[%- PROCESS outputsubfield subfieldanchor = loo.subfieldcode -%]" class="tab-item" role="presentation">
145
                                            [% IF ( loo.new_subfield ) %]
146
                                                <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>
147
                                            [% ELSE %]
148
                                                <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 %]">
149
                                                    [% loo.subfieldcode | html %]
150
                                                </a>
151
                                            [% END %]
152
                                        </li>
153
                                    [% END %]
154
                                </ul>
155
156
                                <div class="tab-content">
157
158
                                    [% FOREACH loo IN loop %]
159
                                        <div class="constraints tab-pane" role="tabpanel" id="sub[%- PROCESS outputsubfield subfieldanchor = loo.subfieldcode -%]field">
160
                                            <input type="hidden" name="tab_id" value="[% loo.row | html %]" />
161
                                            <div id="basic[%- PROCESS outputsubfield subfieldanchor = loo.subfieldcode -%]" class="contraints">
162
                                                <fieldset class="rows">
163
                                                    <legend>Basic constraints</legend>
164
                                                    <ol>
165
                                                        [% IF ( loo.subfieldcode == 0 || loo.subfieldcode ) %]
166
                                                            <li>
167
                                                                <span class="label">Subfield code:</span>
168
                                                                [% loo.subfieldcode | html %]
169
                                                                <input type="hidden" id="tagsubfield[% loo.row | html %]" name="tagsubfield" value="[% loo.subfieldcode | html %]" />
170
                                                            </li>
171
                                                        [% ELSE %]
172
                                                            <li>
173
                                                                <label for="tagsubfield[% loo.row | html %]">Subfield code:</label>
174
                                                                    <input type="text" id="tagsubfield[% loo.row | html %]" name="tagsubfield" value="[% loo.subfieldcode | html %]" />
175
                                                                </li>
176
                                                        [% END %]
177
                                                        <li>
178
                                                            <label for="liblibrarian[% loo.row | html %]">Text for librarian: </label>
179
                                                            <input id="liblibrarian[% loo.row | html %]" type="text" name="liblibrarian_[% loo.row | html %]" value="[% loo.liblibrarian | html_entity %]" size="40" maxlength="80" />
180
                                                        </li>
181
                                                        <li>
182
                                                            <label for="libopac[% loo.row | html %]">Text for OPAC: </label>
183
                                                            <input type="text" id="libopac[% loo.row | html %]" name="libopac_[% loo.row | html %]" value="[% loo.libopac | html_entity %]" size="40" maxlength="80" />
184
                                                        </li>
185
                                                        <li>
186
                                                            <label for="repeatable[% loo.row | html %]">Repeatable: </label>
187
                                                            [% IF loo.repeatable %]
188
                                                                <input type="checkbox" id="repeatable[% loo.row | html %]" name="repeatable_[% loo.row | html %]" checked="checked" value="1" />
189
                                                            [% ELSE %]
190
                                                                <input type="checkbox" id="repeatable[% loo.row | html %]" name="repeatable_[% loo.row | html %]" value="1" />
191
                                                            [% END %]
192
                                                        </li>
193
                                                        <li>
194
                                                            <label for="mandatory[% loo.row | html %]">Mandatory: </label>
195
                                                            [% IF loo.mandatory %]
196
                                                                <input type="checkbox" id="mandatory[% loo.row | html %]" name="mandatory_[% loo.row | html %]" checked="checked" value="1" />
197
                                                            [% ELSE %]
198
                                                                <input type="checkbox" id="mandatory[% loo.row | html %]" name="mandatory_[% loo.row | html %]" value="1" />
199
                                                            [% END %]
200
                                                        </li>
201
                                                        <li>
202
                                                            <label for="important[% loo.row | html %]">Important: </label>
203
                                                            [% IF loo.important %]
204
                                                                <input type="checkbox" id="important[% loo.row | html %]" name="important_[% loo.row | html %]" checked="checked" value="1" />
205
                                                            [% ELSE %]
206
                                                                <input type="checkbox" id="important[% loo.row | html %]" name="important_[% loo.row | html %]" value="1" />
207
                                                            [% END %]
208
                                                        </li>
209
                                                        <li><label for="tab[% loo.row | html %]">Managed in tab: </label>
210
                                                            <select name="tab_[% loo.row | html %]" tabindex="" id="tab[% loo.row | html %]">
211
                                                            [%- IF ( loo.tab ==  -1 ) -%]
212
                                                                <option value="-1" selected="selected">ignore</option>
213
                                                            [%- ELSE -%]
214
                                                                <option value="-1">ignore</option>
215
                                                            [%- END -%]
216
                                                            [%- FOREACH t IN [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] -%]
217
                                                                [%- IF ( loo.tab ==  t ) -%]
218
                                                                <option value="[%- t | html -%]" selected="selected">[%- t | html -%]</option>
219
                                                                [%- ELSE -%]
220
                                                                <option value="[%- t | html -%]">[%- t | html -%]</option>
221
                                                                [%- END -%]
222
                                                            [%- END -%]
223
                                                            [%- IF ( loo.tab ==  10 ) -%]
224
                                                                <option value="10" selected="selected">items (10)</option>
225
                                                            [%- ELSE -%]
226
                                                                <option value="10">items (10)</option>
227
                                                            [%- END -%]
228
                                                            </select>
229
                                                            <div class="hint"><i class="fa fa-warning"></i> <span>Ignore means that the subfield does not display in the record editor and that its value, if any, is deleted from the record</span></div>
230
                                                        </li>
231
                                                    </ol>
232
                                                </fieldset> <!-- /.rows -->
233
                                            </div> <!-- /#basic[%- PROCESS outputsubfield subfieldanchor = subfieldcode -%] -->
234
235
                                            <div id="advanced[%- PROCESS outputsubfield subfieldanchor = loo.subfieldcode -%]" class="contraints">
236
                                                <fieldset class="rows">
237
                                                    <legend>Advanced constraints</legend>
238
                                                    <ol>
239
                                                        <li>
240
                                                            <label for="defaultvalue[% loo.row | html %]">Default value:</label>
241
                                                            <input type="text" name="defaultvalue_[% loo.row | html %]" id="defaultvalue[% loo.row | html %]" value="[% loo.defaultvalue | html %]" />
242
                                                        </li>
243
                                                        <li>
244
                                                            <label for="maxlength[% loo.row | html %]">Max length:</label>
245
                                                            <input type="text" id="maxlength[% loo.row | html %]" name="maxlength_[% loo.row | html %]" value="[% loo.maxlength | html %]" size="4" />
246
                                                        </li>
247
                                                        <li>
248
                                                            [% IF loo.hidden_protected %]
249
                                                                <input type="hidden" id="hidden-[% loo.row | html %]" name="hidden_[% loo.row | html %]" value="[% loo.hidden | html %]" data-koha-protected="1" />
250
                                                            [% ELSE %]
251
                                                                <input type="hidden" id="hidden-[% loo.row | html %]" name="hidden_[% loo.row | html %]" value="[% loo.hidden | html %]" />
252
                                                            [% END %]
253
                                                            <label for="hidden[% loo.row | html %]">Visibility: </label>
254
                                                            <input type="checkbox" id="hidden_opac_[% loo.row | html %]" class="inclusive_[% loo.row | html %]" name="hidden_opac_[% loo.row | html %]"/>
255
                                                            <label for="hidden_opac_[% loo.row | html %]" style="float: none;">OPAC</label>
256
                                                            <input type="checkbox" id="hidden_intranet_[% loo.row | html %]" class="inclusive_[% loo.row | html %]" name="hidden_intranet_[% loo.row | html %]"/>
257
                                                            <label for="hidden_intranet_[% loo.row | html %]" style="float: none;">Staff interface</label>
258
                                                            <input type="checkbox" id="hidden_editor_[% loo.row | html %]" class="inclusive_[% loo.row | html %]" name="hidden_editor_[% loo.row | html %]"/>
259
                                                            <label for="hidden_editor_[% loo.row | html %]" style="float: none;">Editor</label>
260
                                                            <input type="checkbox" id="hidden_collapsed_[% loo.row | html %]" class="inclusive_[% loo.row | html %]" name="hidden_collapsed_[% loo.row | html %]"/>
261
                                                            <label for="hidden_collapsed_[% loo.row | html %]" style="float: none;">Collapsed</label>
262
                                                            <input type="checkbox" id="hidden_flagged_[% loo.row | html %]" name="flagged_[% loo.row | html %]"/>
263
                                                            <label for="hidden_flagged_[% loo.row | html %]" style="float: none;">Flagged</label>
264
                                                        </li>
265
                                                        <li>
266
                                                            <label for="isurl[% loo.row | html %]">Is a URL:</label>
267
                                                            [% IF loo.isurl %]
268
                                                                <input type="checkbox" id="isurl[% loo.row | html %]" name="isurl_[% loo.row | html %]" checked="checked" value="1" />
269
                                                            [% ELSE %]
270
                                                                <input type="checkbox" id="isurl[% loo.row | html %]" name="isurl_[% loo.row | html %]" value="1" />
271
                                                            [% END %]
272
                                                            <span class="hint">If checked, it means that the subfield is a URL and can be clicked</span>
273
                                                        </li>
274
                                                        <li>
275
                                                            <label for="link[% loo.row | html %]">Link:</label>
276
                                                            <input type="text" id="link[% loo.row | html %]" name="link_[% loo.row | html %]" value="[% loo.link | html %]" size="10" maxlength="80" />
277
                                                            <div class="hint">An index name, e.g. title or Local-Number</div>
278
                                                        </li>
279
                                                        <li>
280
                                                            <label for="kohafield[% loo.row | html %]">Koha link:</label>
281
                                                            <!-- This select should be DISABLED; value is submitted by the following hidden input -->
282
                                                            <select name="kohafield_[% loo.row | html %]" id="kohafield[% loo.row | html %]" disabled>
283
                                                            [% FOREACH value IN loo.kohafields %]
284
                                                            [% IF ( value == loo.kohafield ) %]
285
                                                                <option value="[% value | html %]" selected="selected">[% value | html %]</option>
286
                                                            [% ELSE %]
287
                                                                <option value="[% value | html %]">[% value | html %]</option>
288
                                                            [% END %]
289
                                                            [% END %]
290
                                                            </select>
291
                                                            <!-- Do NOT remove this next hidden input! We need it to save kohafield. -->
292
                                                            <input type="hidden" name="kohafield_[% loo.row | html %]" value="[% loo.kohafield | html %]"/>
293
                                                        </li>
294
                                                    </ol>
295
                                                </fieldset> <!-- /.rows -->
296
                                            </div> <!-- /#advanced[%- PROCESS outputsubfield subfieldanchor = subfieldcode -%] -->
297
298
                                            <div id="oth[%- PROCESS outputsubfield subfieldanchor = loo.subfieldcode -%]" class="constraints">
299
                                                <fieldset class="rows">
300
                                                    <legend>Other options (choose one)</legend>
301
                                                    <ol>
302
                                                        <li>
303
                                                            <label for="authorised_value[% loo.row | html %]">Authorized value:</label>
304
                                                            <select name="authorised_value_[% loo.row | html %]" id="authorised_value[% loo.row | html %]">
305
                                                            <option value=""></option>
306
                                                            [% FOREACH value IN loo.authorised_values %]
307
                                                                [% IF ( value == loo.authorised_value ) %]
308
                                                                    <option value="[% value | html %]" selected="selected">[% value | html %]</option>
309
                                                                [% ELSE %]
310
                                                                    <option value="[% value | html %]">[% value | html %]</option>
311
                                                                [% END %]
312
                                                            [% END %]
313
                                                            </select>
314
                                                        </li>
315
                                                        <li>
316
                                                            <label for="authtypecode[% loo.row | html %]">Thesaurus:</label>
317
                                                            <select name="authtypecode_[% loo.row | html %]" id="authtypecode[% loo.row | html %]">
318
                                                            [% FOREACH value IN loo.authtypes %]
319
                                                                [% IF ( value == loo.authtypecode ) %]
320
                                                                    <option value="[% value | html %]" selected="selected">[% value | html %]</option>
321
                                                                [% ELSE %]
322
                                                                    <option value="[% value | html %]">[% value | html %]</option>
323
                                                                [% END %]
324
                                                            [% END %]
325
                                                            </select>
326
                                                        </li>
327
                                                        <li>
328
                                                            <label for="value_builder[% loo.row | html %]">Plugin:</label>
329
                                                            <select name="value_builder_[% loo.row | html %]" id="value_builder[% loo.row | html %]">
330
                                                            [% FOREACH value IN loo.value_builders %]
331
                                                                [% IF ( value == loo.value_builder ) %]
332
                                                                    <option value="[% value | html %]" selected="selected">[% value | html %]</option>
333
                                                                [% ELSE %]
334
                                                                    <option value="[% value | html %]">[% value | html %]</option>
335
                                                                [% END %]
336
                                                            [% END %]
337
                                                            </select>
338
                                                        </li>
339
                                                    </ol>
340
                                                </fieldset> <!-- /.rows -->
341
                                            </div> <!-- /#oth[%- PROCESS outputsubfield subfieldanchor = loo.subfieldcode -%] -->
342
                                        </div><!-- /constraints -->
343
                                    [% END # /FOREACH loo %]
344
                                </div> <!-- /.tab-content -->
345
                            </div><!-- /subfieldtabs -->
346
142
347
                            <fieldset class="action">
143
                            <fieldset class="action">
348
                                <input type="submit" class="btn btn-primary" value="Save changes" /> <a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=[% tagfield  | uri %]&amp;frameworkcode=[% frameworkcode | uri %]" class="cancel">Cancel</a>
144
                                <input type="submit" class="btn btn-primary" value="Save changes" /> <a href="/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=[% tagfield  | uri %]&amp;frameworkcode=[% frameworkcode | uri %]" class="cancel">Cancel</a>
349
- 

Return to bug 33177