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

(-)a/admin/auth_subfields_structure.pl (-21 / +11 lines)
Lines 23-28 use C4::Output; Link Here
23
use C4::Auth;
23
use C4::Auth;
24
use CGI;
24
use CGI;
25
use C4::Context;
25
use C4::Context;
26
use C4::Koha;
26
27
27
28
28
sub string_search  {
29
sub string_search  {
Lines 91-115 if ($op eq 'add_form') { Link Here
91
		push @kohafields, "auth_header.".$field;
92
		push @kohafields, "auth_header.".$field;
92
	}
93
	}
93
	
94
	
94
	# build authorised value list
95
        # build authorised value list
95
	$sth2 = $dbh->prepare("select distinct category from authorised_values");
96
        my $authorised_values = C4::Koha::GetAuthorisedValueCategories;
96
	$sth2->execute;
97
        unshift @$authorised_values, '';
97
	my @authorised_values;
98
        push @$authorised_values, 'branches';
98
	push @authorised_values,"";
99
        push @$authorised_values, 'itemtypes';
99
	while ((my $category) = $sth2->fetchrow_array) {
100
100
		push @authorised_values, $category;
101
        # build thesaurus categories list
101
	}
102
        my @authtypes = (sort keys getauthtypes);
102
	push (@authorised_values,"branches");
103
	push (@authorised_values,"itemtypes");
104
    
105
    # build thesaurus categories list
106
    $sth2 = $dbh->prepare("select authtypecode from auth_types");
107
    $sth2->execute;
108
    my @authtypes;
109
    push @authtypes, "";
110
    while ( ( my $authtypecode ) = $sth2->fetchrow_array ) {
111
        push @authtypes, $authtypecode;
112
    }
113
103
114
	# build value_builder list
104
	# build value_builder list
115
	my @value_builder=('');
105
	my @value_builder=('');
Lines 160-166 if ($op eq 'add_form') { Link Here
160
                    };
150
                    };
161
        $row_data{authorised_value} = {
151
        $row_data{authorised_value} = {
162
                    id      => "authorised_value$i",
152
                    id      => "authorised_value$i",
163
                    values  => \@authorised_values,
153
                    values  => $authorised_values,
164
                    default => $data->{'authorised_value'},
154
                    default => $data->{'authorised_value'},
165
        };
155
        };
166
        $row_data{frameworkcode} = {
156
        $row_data{frameworkcode} = {
Lines 239-245 if ($op eq 'add_form') { Link Here
239
                    };
229
                    };
240
        $row_data{authorised_value} = {
230
        $row_data{authorised_value} = {
241
                    id      => "authorised_value",
231
                    id      => "authorised_value",
242
                    values  => \@authorised_values,
232
                    values  => $authorised_values,
243
                    default => "",
233
                    default => "",
244
        };
234
        };
245
        $row_data{frameworkcode} = {
235
        $row_data{frameworkcode} = {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_subfields_structure.tt (-23 / +32 lines)
Lines 89-103 function displayMoreConstraint(numlayer){ Link Here
89
                <li><label for="liblibrarian[% loo.row %]">Text for librarian: </label><input id="liblibrarian[% loo.row %]" type="text" name="liblibrarian" value="[% loo.liblibrarian %]" size="40" maxlength="80" /></li>
89
                <li><label for="liblibrarian[% loo.row %]">Text for librarian: </label><input id="liblibrarian[% loo.row %]" type="text" name="liblibrarian" value="[% loo.liblibrarian %]" size="40" maxlength="80" /></li>
90
                <li><label for="libopac[% loo.row %]">Text for OPAC: </label><input type="text" id="libopac[% loo.row %]" name="libopac" value="[% loo.libopac %]" size="40" maxlength="80" /></li>
90
                <li><label for="libopac[% loo.row %]">Text for OPAC: </label><input type="text" id="libopac[% loo.row %]" name="libopac" value="[% loo.libopac %]" size="40" maxlength="80" /></li>
91
                <li><label for="tab[% loo.row %]">Managed in tab: </label>
91
                <li><label for="tab[% loo.row %]">Managed in tab: </label>
92
                    <select name="tab" tabindex="" size="1" id="[% loo.tab.id %]">
92
                    <select name="tab" size="1" id="[% loo.tab.id %]">
93
                        [%- IF ( loo.tab.default ==  -1 ) -%]
93
                        [%- IF ( loo.tab.default ==  -1 ) -%]
94
                        <option value="-1" selected="selected">ignore</option>
94
                        <option value="-1" selected="selected">ignore</option>
95
                        [%- ELSE -%]
95
                        [%- ELSE -%]
96
                        <option value="-1">ignore</option>
96
                        <option value="-1">ignore</option>
97
                        [%- END -%]
97
                        [%- END -%]
98
                    [%- FOREACH t IN [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'] -%]
98
                    [%- FOREACH t IN [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'] -%]
99
                        [%- IF ( loo.tab.default ==  t ) -%]
99
                        [%- IF ( loo.tab.default ==  t && t.length>0 ) -%]
100
                        <option value="[%- t -%]" selected="selected">[%- t -%]</option>
100
                        <option value="[%- t -%]" selected="selected">[%- t -%]</option>
101
                        [%- ELSIF ( loo.tab.default ==  t ) -%]
102
                        <option value="[%- t -%]" selected="selected">&nbsp;</option>
101
                        [%- ELSE -%]
103
                        [%- ELSE -%]
102
                        <option value="[%- t -%]">[%- t -%]</option>
104
                        <option value="[%- t -%]">[%- t -%]</option>
103
                        [%- END -%]
105
                        [%- END -%]
Lines 144-192 function displayMoreConstraint(numlayer){ Link Here
144
                            <li>
146
                            <li>
145
                                <label for="kohafield[% loo.row %]">Koha field:</label>
147
                                <label for="kohafield[% loo.row %]">Koha field:</label>
146
                                <select name="kohafield" id="[% loo.kohafield.id %]" size="1">
148
                                <select name="kohafield" id="[% loo.kohafield.id %]" size="1">
147
                                [% FOREACH value IN loo.kohafield.values %]
149
                                [%- FOREACH value IN loo.kohafield.values %]
148
                                    [% IF ( value == loo.kohafield.default ) %]
150
                                    [% IF ( value == loo.kohafield.default  && value.length>0 ) -%]
149
                                    <option value="[% value %]" selected>[% value %]</option>
151
                                    <option value="[% value %]" selected>[% value %]</option>
150
                                    [% ELSE %]
152
                                    [%- ELSIF ( value == loo.kohafield.default ) -%]
153
                                    <option value="[% value %]" selected>&nbsp;</option>
154
                                    [%- ELSE -%]
151
                                    <option value="[% value %]">[% value %]</option>
155
                                    <option value="[% value %]">[% value %]</option>
152
                                    [% END %]
156
                                    [%- END -%]
153
                                [% END %]
157
                                [%- END %]
154
                                </select>
158
                                </select>
155
                            </li>
159
                            </li>
156
                            <li>
160
                            <li>
157
                                <label for="authorised_value[% loo.row %]">Authorized value:</label>
161
                                <label for="authorised_value[% loo.row %]">Authorized value:</label>
158
                                <select name="authorised_value" id="[% loo.authorised_value.id %]" size="1">
162
                                <select name="authorised_value" id="[% loo.authorised_value.id %]" size="1">
159
                                [% FOREACH value IN loo.authorised_value.values %]
163
                                [%- FOREACH value IN loo.authorised_value.values %]
160
                                    [% IF ( value == loo.authorised_value.default ) %]
164
                                    [% IF ( value == loo.authorised_value.default && value.length>0 ) -%]
161
                                    <option value="[% value %]" selected>[% value %]</option>
165
                                    <option value="[% value %]" selected>[% value %]</option>
162
                                    [% ELSE %]
166
                                    [%- ELSIF ( value == loo.authorised_value.default ) -%]
167
                                    <option value="[% value %]" selected>&nbsp;</option>
168
                                    [%- ELSE -%]
163
                                    <option value="[% value %]">[% value %]</option>
169
                                    <option value="[% value %]">[% value %]</option>
164
                                    [% END %]
170
                                    [%- END -%]
165
                                [% END %]
171
                                [%- END %]
166
                                </select>
172
                                </select>
167
                            </li>
173
                            </li>
168
                            <li>
174
                            <li>
169
                                <label for="frameworkcode[% loo.row %]">Thesaurus:</label>
175
                                <label for="frameworkcode[% loo.row %]">Thesaurus:</label>
170
                                <select name="frameworkcode" id="[% loo.frameworkcode.id %]" size="1">
176
                                <select name="frameworkcode" id="[% loo.frameworkcode.id %]" size="1">
171
                                [% FOREACH value IN loo.frameworkcode.values %]
177
                                [%- FOREACH value IN loo.frameworkcode.values %]
172
                                    [% IF ( value == loo.frameworkcode.default ) %]
178
                                    [% IF ( value == loo.frameworkcode.default && value.length>0 ) -%]
173
                                    <option value="[% value %]" selected>[% value %]</option>
179
                                    <option value="[% value %]" selected>[% value %]</option>
174
                                    [% ELSE %]
180
                                    [%- ELSIF ( value == loo.frameworkcode.default ) -%]
181
                                    <option value="[% value %]" selected>&nbsp;</option>
182
                                    [%- ELSE -%]
175
                                    <option value="[% value %]">[% value %]</option>
183
                                    <option value="[% value %]">[% value %]</option>
176
                                    [% END %]
184
                                    [%- END -%]
177
                                [% END %]
185
                                [%- END %]
178
                                </select>
186
                                </select>
179
                            </li>
187
                            </li>
180
                            <li>
188
                            <li>
181
                                <label for="value_builder[% loo.row %]">Plugin:</label>
189
                                <label for="value_builder[% loo.row %]">Plugin:</label>
182
                                <select name="value_builder" id="[% loo.value_builder.id %]" size="1">
190
                                <select name="value_builder" id="[% loo.value_builder.id %]" size="1">
183
                                [% FOREACH value IN loo.value_builder.values %]
191
                                [%- FOREACH value IN loo.value_builder.values %]
184
                                    [% IF ( value == loo.value_builder.default ) %]
192
                                    [% IF ( value == loo.value_builder.default && value.length>0 ) -%]
185
                                    <option value="[% value %]" selected>[% value %]</option>
193
                                    <option value="[% value %]" selected>[% value %]</option>
186
                                    [% ELSE %]
194
                                    [%- ELSIF ( value == loo.value_builder.default ) -%]
195
                                    <option value="[% value %]" selected>&nbsp;</option>
196
                                    [%- ELSE -%]
187
                                    <option value="[% value %]">[% value %]</option>
197
                                    <option value="[% value %]">[% value %]</option>
188
                                    [% END %]
198
                                    [%- END -%]
189
                                [% END %]
199
                                [%- END %]
190
                                </select>
200
                                </select>
191
                            </li>
201
                            </li>
192
                        </ol>
202
                        </ol>
193
- 

Return to bug 12091