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

(-)a/admin/preferences.pl (-1 / +7 lines)
Lines 179-184 sub TransformPrefsToHTML { Link Here
179
        foreach my $line ( @{ $tab->{ $group } } ) {
179
        foreach my $line ( @{ $tab->{ $group } } ) {
180
            my @chunks;
180
            my @chunks;
181
            my @names;
181
            my @names;
182
            my @warnings;
182
183
183
            foreach my $piece ( @$line ) {
184
            foreach my $piece ( @$line ) {
184
                if ( ref ( $piece ) eq 'HASH' ) {
185
                if ( ref ( $piece ) eq 'HASH' ) {
Lines 197-202 sub TransformPrefsToHTML { Link Here
197
                        # No highlighting of inputs yet, but would be useful
198
                        # No highlighting of inputs yet, but would be useful
198
                        $chunk->{'highlighted'} = 1 if ( $searchfield && $name =~ /^$searchfield$/i );
199
                        $chunk->{'highlighted'} = 1 if ( $searchfield && $name =~ /^$searchfield$/i );
199
200
201
                        if ( $name eq 'Pseudonymization' && ! C4::Context->config('bcrypt_settings')) {
202
                            push @warnings, 'bcrypt_config_not_set';
203
                            $chunk->{disabled} = 1 unless $value; # Let disable if enabled
204
                        }
200
                        push @chunks, $chunk;
205
                        push @chunks, $chunk;
201
206
202
                        my $name_entry = { name => $name };
207
                        my $name_entry = { name => $name };
Lines 208-213 sub TransformPrefsToHTML { Link Here
208
                            }
213
                            }
209
                        }
214
                        }
210
                        $name_entry->{'overridden'} = 1 if ( any { $name eq $_ } @override_syspref_names );
215
                        $name_entry->{'overridden'} = 1 if ( any { $name eq $_ } @override_syspref_names );
216
211
                        push @names, $name_entry;
217
                        push @names, $name_entry;
212
                    } else {
218
                    } else {
213
                        push @chunks, $piece;
219
                        push @chunks, $piece;
Lines 225-231 sub TransformPrefsToHTML { Link Here
225
                    push @chunks, { type_text => 1, contents => $piece };
231
                    push @chunks, { type_text => 1, contents => $piece };
226
                }
232
                }
227
            }
233
            }
228
            push @lines, { CHUNKS => \@chunks, NAMES => \@names, is_group_title => 0 };
234
            push @lines, { CHUNKS => \@chunks, NAMES => \@names, WARNINGS => \@warnings, is_group_title => 0 };
229
        }
235
        }
230
    }
236
    }
231
237
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt (-2 / +15 lines)
Lines 114-120 Link Here
114
                            <input type="[%IF CHUNK.input_type %][% CHUNK.input_type | html %][% ELSE %]text[% END %]" name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]" class="preference preference-[% CHUNK.class or "short" | html %]" value="[% CHUNK.value | html %]" autocomplete="off" /> [% IF ( CHUNK.dateinput ) %]<span class="hint">[% INCLUDE 'date-format.inc' %]</span>[% END %]
114
                            <input type="[%IF CHUNK.input_type %][% CHUNK.input_type | html %][% ELSE %]text[% END %]" name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]" class="preference preference-[% CHUNK.class or "short" | html %]" value="[% CHUNK.value | html %]" autocomplete="off" /> [% IF ( CHUNK.dateinput ) %]<span class="hint">[% INCLUDE 'date-format.inc' %]</span>[% END %]
115
                        [% END %]
115
                        [% END %]
116
                    [% ELSIF ( CHUNK.type_select ) %]
116
                    [% ELSIF ( CHUNK.type_select ) %]
117
                    <select name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]" class="preference preference-[% CHUNK.class or "choice" | html %]">
117
                        [% IF CHUNK.disabled %]
118
                        <select name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]" disabled="disabled" class="preference preference-[% CHUNK.class or "choice" | html %]">
119
                        [% ELSE %]
120
                        <select name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]" class="preference preference-[% CHUNK.class or "choice" | html %]">
121
                        [% END %]
118
                        [% FOREACH CHOICE IN CHUNK.CHOICES.sort('value') %]
122
                        [% FOREACH CHOICE IN CHUNK.CHOICES.sort('value') %]
119
                        [% IF ( CHOICE.selected ) %]
123
                        [% IF ( CHOICE.selected ) %]
120
                        <option value="[% CHOICE.value | html %]" selected="selected">
124
                        <option value="[% CHOICE.value | html %]" selected="selected">
Lines 178-183 Link Here
178
                        </ul> <!-- / ul.sortable -->
182
                        </ul> <!-- / ul.sortable -->
179
                    [% END %]
183
                    [% END %]
180
                    [% END %]
184
                    [% END %]
185
                    [% IF LINE.WARNINGS.size %]
186
                        [% FOR w IN LINE.WARNINGS %]
187
                            <div class="dialog alert">
188
                                [% SWITCH w %]
189
                                [% CASE "bcrypt_config_not_set" %]Pseudonymization must only be turned on if the 'bcrypt_settings' configuration entry exists and is correctly filled in the Koha configuration file.
190
                                [% CASE %]Unknown warning "[% w | html %]"
191
                                [% END %]
192
                            </div>
193
                        [% END %]
194
                    [% END %]
181
                </div></td>
195
                </div></td>
182
            </tr>
196
            </tr>
183
            [% IF ( loop.last ) %]</tbody></table>[% END %]
197
            [% IF ( loop.last ) %]</tbody></table>[% END %]
184
- 

Return to bug 28912