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

(-)a/admin/preferences.pl (-39 / +39 lines)
Lines 18-23 Link Here
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
19
19
20
use Modern::Perl;
20
use Modern::Perl;
21
use Data::Dumper;
21
22
22
use CGI qw ( -utf8 );
23
use CGI qw ( -utf8 );
23
use C4::Auth;
24
use C4::Auth;
Lines 57-77 sub GetTab { Link Here
57
}
58
}
58
59
59
sub _get_chunk {
60
sub _get_chunk {
60
   my ( $value, %options ) = @_;
61
    my ( $value, %options ) = @_;
61
62
62
   my $name = $options{'pref'};
63
    my $name = $options{'pref'};
63
   my $chunk = { name => $name, value => $value, type => $options{'type'} || 'input', class => $options{'class'} };
64
    my $chunk = { name => $name, value => $value, type => $options{'type'} || 'input', class => $options{'class'} };
64
65
65
   if ( $options{'class'} && $options{'class'} eq 'password' ) {
66
    if ( $options{'class'} && $options{'class'} eq 'password' ) {
66
       $chunk->{'input_type'} = 'password';
67
        $chunk->{'input_type'} = 'password';
67
   } elsif ( $options{'class'} && $options{'class'} eq 'date' ) {
68
    } elsif ( $options{'class'} && $options{'class'} eq 'date' ) {
68
       $chunk->{'dateinput'} = 1;
69
        $chunk->{'dateinput'} = 1;
69
   } elsif ( $options{'type'} && ( $options{'type'} eq 'opac-languages' || $options{'type'} eq 'staff-languages' ) ) {
70
    } elsif ( $options{'type'} && ( $options{'type'} eq 'opac-languages' || $options{'type'} eq 'staff-languages' ) ) {
70
       my $current_languages = { map { +$_, 1 } split( /\s*,\s*/, $value ) };
71
        my $current_languages = { map { +$_, 1 } split( /\s*,\s*/, $value ) };
71
72
72
       my $theme;
73
        my $theme;
73
       my $interface;
74
        my $interface;
74
       if ( $options{'type'} eq 'opac-languages' ) {
75
        if ( $options{'type'} eq 'opac-languages' ) {
75
            # this is the OPAC
76
            # this is the OPAC
76
            $interface = 'opac';
77
            $interface = 'opac';
77
            $theme     = C4::Context->preference('opacthemes');
78
            $theme     = C4::Context->preference('opacthemes');
Lines 80-86 sub _get_chunk { Link Here
80
            $interface = 'intranet';
81
            $interface = 'intranet';
81
            $theme     = C4::Context->preference('template');
82
            $theme     = C4::Context->preference('template');
82
        }
83
        }
83
        $chunk->{'languages'} = getTranslatedLanguages( $interface, $theme, $lang, $current_languages );
84
        $chunk->{'languages'} = getTranslatedLanguages( $interface, $theme, undef, $current_languages );
84
        $chunk->{'type'} = 'languages';
85
        $chunk->{'type'} = 'languages';
85
    } elsif ( $options{ 'choices' } ) {
86
    } elsif ( $options{ 'choices' } ) {
86
        if ( $options{'choices'} && ref( $options{ 'choices' } ) eq '' ) {
87
        if ( $options{'choices'} && ref( $options{ 'choices' } ) eq '' ) {
Lines 99-130 sub _get_chunk { Link Here
99
        $value ||= 0;
100
        $value ||= 0;
100
101
101
        $chunk->{'type'} = 'select';
102
        $chunk->{'type'} = 'select';
102
       $chunk->{'CHOICES'} = [
103
        $chunk->{'CHOICES'} = [
103
           sort { $a->{'text'} cmp $b->{'text'} }
104
            sort { $a->{'text'} cmp $b->{'text'} }
104
           map { { text => $options{'choices'}->{$_}, value => $_, selected => ( $_ eq $value || ( $_ eq '' && ( $value eq '0' || !$value ) ) ) } }
105
            map { { text => $options{'choices'}->{$_}, value => $_, selected => ( $_ eq $value || ( $_ eq '' && ( $value eq '0' || !$value ) ) ) } }
105
           keys %{ $options{'choices'} }
106
            keys %{ $options{'choices'} }
106
       ];
107
        ];
107
   } elsif ( $options{'multiple'} ) {
108
    } elsif ( $options{'multiple'} ) {
108
       my @values;
109
        my @values;
109
       @values = split /,/, $value if defined($value);
110
        @values = split /,/, $value if defined($value);
110
       $chunk->{type}    = 'multiple';
111
        $chunk->{type}    = 'multiple';
111
       $chunk->{CHOICES} = [
112
        $chunk->{CHOICES} = [
112
           sort { $a->{'text'} cmp $b->{'text'} }
113
            sort { $a->{'text'} cmp $b->{'text'} }
113
             map {
114
              map {
114
               my $option_value = $_;
115
                my $option_value = $_;
115
               {
116
                {
116
                   text     => $options{multiple}->{$option_value},
117
                    text     => $options{multiple}->{$option_value},
117
                   value    => $option_value,
118
                    value    => $option_value,
118
                   selected => (grep /^$option_value$/, @values) ? 1 : 0,
119
                    selected => (grep /^$option_value$/, @values) ? 1 : 0,
119
               }
120
                }
120
             }
121
              }
121
             keys %{ $options{multiple} }
122
              keys %{ $options{multiple} }
122
       ];
123
        ];
123
   }
124
    }
124
125
125
    $chunk->{ 'type_' . $chunk->{'type'} } = 1;
126
    $chunk->{ 'type_' . $chunk->{'type'} } = 1;
126
127
127
   return $chunk;
128
    return $chunk;
128
}
129
}
129
130
130
sub TransformPrefsToHTML {
131
sub TransformPrefsToHTML {
Lines 149-154 sub TransformPrefsToHTML { Link Here
149
        }
150
        }
150
151
151
        foreach my $line ( @{ $tab->{ $group } } ) {
152
        foreach my $line ( @{ $tab->{ $group } } ) {
153
            warn Dumper($line);
152
            my @chunks;
154
            my @chunks;
153
            my @names;
155
            my @names;
154
156
Lines 164-171 sub TransformPrefsToHTML { Link Here
164
                        } else {
166
                        } else {
165
                            $value = $row->{'value'};
167
                            $value = $row->{'value'};
166
                        }
168
                        }
167
                        my $source = "preferences";
169
                        my $chunk = _get_chunk( $value, %$piece );
168
                        my $chunk = _get_chunk( $value, $source, %$piece );
169
170
170
                        # No highlighting of inputs yet, but would be useful
171
                        # No highlighting of inputs yet, but would be useful
171
                        $chunk->{'highlighted'} = 1 if ( $searchfield && $name =~ /^$searchfield$/i );
172
                        $chunk->{'highlighted'} = 1 if ( $searchfield && $name =~ /^$searchfield$/i );
Lines 225-231 sub SearchPrefs { Link Here
225
    my ( $input, $searchfield ) = @_;
226
    my ( $input, $searchfield ) = @_;
226
    my @tabs;
227
    my @tabs;
227
228
228
    warn $input, $searchfield;
229
    my %tab_files = _get_pref_files( $input );
229
    my %tab_files = _get_pref_files( $input );
230
    our @terms = split( /\s+/, $searchfield );
230
    our @terms = split( /\s+/, $searchfield );
231
231
(-)a/installer/featurereleasetool.pl (-20 / +60 lines)
Lines 106-135 my @prefsloop; Link Here
106
my @lines = split /\n/, $file;
106
my @lines = split /\n/, $file;
107
foreach my $line (@lines) {
107
foreach my $line (@lines) {
108
    my $query = qq|
108
    my $query = qq|
109
       SELECT variable, value, options, display_choices, explanation, type from systempreferences WHERE version= ? |;
109
       SELECT variable, value, options, explanation, type from systempreferences WHERE version= ? |;
110
    my $sth = $dbh->prepare($query);
110
    my $sth = $dbh->prepare($query);
111
    $sth->execute($line);
111
    $sth->execute($line);
112
    while (my ($variable, $value, $options, $display_choices, $explanation, $type) = $sth->fetchrow) {
112
113
        if ($options) {
113
    while (my ($variable, $value, $options, $explanation, $type) = $sth->fetchrow) {
114
            push @prefsloop, {
114
        my $chunk = { name => $variable, value => $value, options => $options, explanation => $explanation, type => $type || 'input' };
115
                variable => $variable,
115
        if ( $chunk->{'name'} eq 'opaclanguages' || $chunk->{'name'} eq 'language' ) ) {
116
                value    => $value,
116
            my $current_languages = { map { +$_, 1 } split( /\s*,\s*/, $value ) };
117
                options  => $options,
117
118
                explanation => $explanation,
118
            my $theme;
119
                type     => $type,
119
            my $interface;
120
                display_choices  => $display_choices,
120
            if ( $chunk{'name'} eq 'opaclanguages' ) {
121
            };
121
                # this is the OPAC
122
        } else {
122
                $interface = 'opac';
123
            push @prefsloop, {
123
                $theme     = C4::Context->preference('opacthemes');
124
                variable => $variable,
124
            } else {
125
                value    => $value,
125
                # this is the staff client
126
                explanation => $explanation,
126
                $interface = 'intranet';
127
                type     => $type,
127
                $theme     = C4::Context->preference('template');
128
                display_choices  => $display_choices,
128
            }
129
            };
129
            $chunk->{'languages'} = getTranslatedLanguages( $interface, $theme, undef, $current_languages );
130
            $chunk->{'type'} = 'languages';
131
        } elsif ( $chunk->{'type'} eq 'Choice' ) {
132
            if ( $chunk->{'name'} eq 'DefaultClassificationSource' ) {
133
                    my $sources = GetClassSources();
134
                    $chunk->{'options'} = { map { $_ => $sources->{$_}->{'description'} } keys %$sources };
135
                } elsif ( $chunk->{'name'} eq 'opacthemes' ) {
136
                    $chunk->{'options'} = { map { $_ => $_ } getallthemes( 'opac' ) }
137
                } elsif ( $chunk->{'name'} eq 'template' ) {
138
                    $chunk->{'choices'} = { map { $_ => $_ } getallthemes( 'intranet' ) }
139
                } else {
140
                    die 'Unrecognized source of preference values: ' . $options{'choices'};
141
                }
142
143
            $value ||= 0;
144
145
            $chunk->{'type'} = 'select';
146
            $chunk->{'CHOICES'} = [
147
                sort { $a->{'text'} cmp $b->{'text'} }
148
                map { { text => $chunk->{'options'}->{$_}, value => $_, selected => ( $_ eq $value || ( $_ eq '' && ( $value eq '0' || !$value ) ) ) } }
149
                keys %{ $chunk{'options'} }
150
            ];
151
        } elsif ( $chunk->{'type'} eq 'multiple' ) {
152
            my @values;
153
            @values = split /,/, $value if defined($value);
154
            $chunk->{CHOICES} = [
155
                sort { $a->{'text'} cmp $b->{'text'} }
156
                map {
157
                    my $option_value = $_;
158
                    {
159
                       #FIXME: text     => $options{multiple}->{$option_value},
160
                        value    => $option_value,
161
                        selected => (grep /^$option_value$/, @values) ? 1 : 0,
162
                    }
163
                }
164
                #FIXME: keys %{ $options{multiple} }
165
            ];
130
        }
166
        }
167
168
        $chunk->{ 'type_' . $chunk->{'type'} } = 1;
169
170
        push @prefsloop, $chunk;
131
    }
171
    }
132
};
172
}
133
173
134
$template->param( prefs => \@prefsloop, submitted_form => $op );
174
$template->param( prefs => \@prefsloop, submitted_form => $op );
135
175
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/prefs-rows.inc (+74 lines)
Line 0 Link Here
1
[% IF ( pref.type_text ) %]
2
    [% pref.contents | $raw %]
3
[% ELSIF ( pref.type_input ) %]
4
    [% IF ( pref.input_type ) %]
5
        <input type="[% pref.input_type | html %]" name="pref_[% pref.name | html %]" id="pref_[% pref.name | html %]" class="preference preference-[% pref.class or "short" | html %]" value="[% pref.value | html %]" autocomplete="off"/> [% IF ( pref.dateinput ) %]<span class="hint">[% INCLUDE 'date-format.inc' %]</span>[% END %]
6
    [% ELSE %]
7
        <input type="text" name="pref_[% pref.name | html %]" id="pref_[% pref.name | html %]" class="preference preference-[% pref.class or "short" | html %]" value="[% pref.value | html %]" autocomplete="off"/> [% IF ( pref.dateinput ) %]<span class="hint">[% INCLUDE 'date-format.inc' %]</span>[% END %]
8
    [% END %]
9
[% ELSIF ( pref.type_select ) %]
10
    <select name="pref_[% pref.name | html %]" id="pref_[% pref.name | html %]" class="preference preference-[% pref.class or "choice" | html %]">
11
        [% FOREACH choice IN pref.CHOICES.sort('value') %]
12
            [% IF ( choice.selected ) %]
13
                <option value="[% choice.value | html %]" selected="selected">
14
            [% ELSE %]
15
                <option value="[% choice.value | html %]">
16
            [% END %]
17
            [% choice.text | html %]</option>
18
        [% END %]
19
    </select>
20
[% ELSIF ( pref.type_multiple ) %]
21
    <select name="pref_[% pref.name | html %]" id="pref_[% pref.name | html %]" class="preference preference-[% pref.class or "choice" | html %]" multiple="multiple">
22
        [% FOREACH choice IN pref.CHOICES %]
23
            [% IF ( choice.selected ) %]
24
                <option value="[% choice.value | html %]" selected="selected">
25
            [% ELSE %]
26
                <option value="[% choice.value | html %]">
27
            [% END %]
28
            [% choice.text | html %]</option>
29
        [% END %]
30
    </select>
31
[% ELSIF ( pref.type_textarea ) || ( pref.type_htmlarea )%]
32
    [% IF ( pref.type_htmlarea ) && ( Koha.Preference('UseWYSIWYGinSystemPreferences') ) %]
33
        <textarea name="pref_[% pref.name | html %]" id="pref_[% pref.name | html %]" class="preference preference-[% pref.class or "short" | html %] mce" rows="20" cols="60">[% pref.value | html %]</textarea>
34
    [% ELSE %]
35
        <a class="expand-textarea" style="display: none" href="#">Click to Edit</a><textarea name="pref_[% pref.name | html %]" id="pref_[% pref.name | html %]" class="preference preference-[% pref.class or "short" | html %]" rows="10" cols="40">[% pref.value | html %]</textarea><a class="collapse-textarea" style="display:none" href="#">Click to collapse</br></a>
36
    [% END %]
37
[% ELSIF ( pref.type_languages ) %]
38
    <ul class="sortable">
39
        [% FOREACH language IN pref.languages %]
40
            [% IF ( language.plural ) %]
41
                <li>
42
                    [% IF ( language.native_description ) %]
43
                        [% language.native_description | html %]
44
                    [% ELSE %]
45
                        [% language.rfc4646_subtag | html %]
46
                    [% END %]
47
                    [% IF language.sublanguages_loop.size > 0 %]
48
                        <ul>
49
                            [% FOREACH sublanguages_loo IN language.sublanguages_loop %]
50
                                <li>
51
                                    <label for="pref_[% pref.name | html %]_[% sublanguages_loo.rfc4646_subtag | html %]">[% sublanguages_loo.native_description | html %] [% sublanguages_loo.script_description | html %] [% sublanguages_loo.region_description | html %] [% sublanguages_loo.variant_description | html %]([% sublanguages_loo.rfc4646_subtag | html %])</label>
52
                                    [% IF ( sublanguages_loo.enabled ) %]
53
                                        <input value="[% sublanguages_loo.rfc4646_subtag | html %]" name="pref_[% pref.name | html %]" id="pref_[% pref.name | html %]_[% sublanguages_loo.rfc4646_subtag | html %]" type="checkbox" checked="checked" class="preference preference-checkbox"/>
54
                                    [% ELSE %]
55
                                        <input value="[% sublanguages_loo.rfc4646_subtag | html %]" name="pref_[% pref.name | html %]" id="pref_[% pref.name | html %]_[% sublanguages_loo.rfc4646_subtag | html %]" type="checkbox" class="preference preference-checkbox"/>
56
                                    [% END %]
57
                                </li>
58
                            [% END # FOREACH sublanguages %]
59
                        </ul>
60
                    [% END %]
61
                </li>
62
            [% ELSE %]
63
                <li>
64
                    <label for="pref_[% pref.name | html %]_[% language.rfc4646_subtag | html %]">[% language.native_description | html %] ([% language.rfc4646_subtag | html %])</label>
65
                    [% IF ( language.group_enabled ) %]
66
                        <input value="[% language.rfc4646_subtag | html %]" name="pref_[% pref.name | html %]" id="pref_[% pref.name | html %]_[% language.rfc4646_subtag | html %]" type="checkbox" checked="checked" class="preference preference-checkbox"/>
67
                    [% ELSE %]
68
                        <input value="[% language.rfc4646_subtag | html %]" name="pref_[% pref.name | html %]" id="pref_[% pref.name | html %]_[% language.rfc4646_subtag | html %]" type="checkbox" class="preference preference-checkbox"/>
69
                    [% END %]
70
                </li>
71
            [% END # IF language.plural %]
72
        [% END # FOREACH language %]
73
    </ul> <!-- / ul.sortable -->
74
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt (-67 / +2 lines)
Lines 74-146 Link Here
74
                    </code>
74
                    </code>
75
                </td>
75
                </td>
76
                <td><div>
76
                <td><div>
77
                    [% FOREACH CHUNK IN LINE.CHUNKS %]
77
                    [% FOREACH pref IN LINE.CHUNKS %]
78
                    [% IF ( CHUNK.type_text ) %]
78
                        [% INCLUDE 'prefs-rows.inc' %]
79
                    [% CHUNK.contents | $raw %]
80
                    [% ELSIF ( CHUNK.type_input ) %]
81
                    <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 %]
82
                    [% ELSIF ( CHUNK.type_select ) %]
83
                    <select name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]" class="preference preference-[% CHUNK.class or "choice" | html %]">
84
                        [% FOREACH CHOICE IN CHUNK.CHOICES.sort('value') %]
85
                        [% IF ( CHOICE.selected ) %]
86
                        <option value="[% CHOICE.value | html %]" selected="selected">
87
                        [% ELSE %]
88
                        <option value="[% CHOICE.value | html %]">
89
                        [% END %]
90
                            [% CHOICE.text | html %]
91
                        </option>
92
                        [% END %]
93
                    </select>
94
                    [% ELSIF ( CHUNK.type_multiple ) %]
95
                    <select name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]" class="preference preference-[% CHUNK.class or "choice" | html %]" multiple="multiple">
96
                        [% FOREACH CHOICE IN CHUNK.CHOICES %][% IF ( CHOICE.selected ) %]<option value="[% CHOICE.value | html %]" selected="selected">[% ELSE %]<option value="[% CHOICE.value | html %]">[% END %][% CHOICE.text | html %]</option>[% END %]
97
                    </select>
98
                    [% ELSIF ( CHUNK.type_textarea ) || ( CHUNK.type_htmlarea )%]
99
                        [% IF ( CHUNK.type_htmlarea ) && ( Koha.Preference('UseWYSIWYGinSystemPreferences') ) %]
100
                        <textarea name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]" class="preference preference-[% CHUNK.class or "short" | html %] mce" rows="20" cols="60">[% CHUNK.value | html %]</textarea>
101
                        [% ELSE %]
102
                        <a class="expand-textarea" style="display: none" href="#">Click to Edit</a>
103
                        <textarea name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]" class="preference preference-[% CHUNK.class or "short" | html %]" rows="10" cols="40">[% CHUNK.value | html %]</textarea>
104
                        <a class="collapse-textarea" style="display:none" href="#">Click to collapse</br></a>
105
                        [% END %]
106
                    [% ELSIF ( CHUNK.type_languages ) %]
107
                        <ul class="sortable">
108
                            [% FOREACH language IN CHUNK.languages %]
109
                                [% IF ( language.plural ) %]
110
                                    <li>
111
                                        [% IF ( language.native_description ) %]
112
                                            [% language.native_description | html %]
113
                                        [% ELSE %]
114
                                            [% language.rfc4646_subtag | html %]
115
                                        [% END %]
116
                                        [% IF language.sublanguages_loop.size > 0 %]
117
                                            <ul>
118
                                                [% FOREACH sublanguages_loo IN language.sublanguages_loop %]
119
                                                    <li>
120
                                                        <label for="pref_[% CHUNK.name | html %]_[% sublanguages_loo.rfc4646_subtag | html %]">[% sublanguages_loo.native_description | html %] [% sublanguages_loo.script_description | html %] [% sublanguages_loo.region_description | html %] [% sublanguages_loo.variant_description | html %]([% sublanguages_loo.rfc4646_subtag | html %])</label>
121
                                                        [% IF ( sublanguages_loo.enabled ) %]
122
                                                            <input value="[% sublanguages_loo.rfc4646_subtag | html %]" name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]_[% sublanguages_loo.rfc4646_subtag | html %]" type="checkbox" checked="checked" class="preference preference-checkbox"/>
123
                                                        [% ELSE %]
124
                                                            <input value="[% sublanguages_loo.rfc4646_subtag | html %]" name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]_[% sublanguages_loo.rfc4646_subtag | html %]" type="checkbox" class="preference preference-checkbox"/>
125
                                                        [% END %]
126
                                                    </li>
127
                                                [% END # FOREACH sublanguages %]
128
                                            </ul>
129
                                        [% END %]
130
                                    </li>
131
                                [% ELSE %]
132
                                    <li>
133
                                        <label for="pref_[% CHUNK.name | html %]_[% language.rfc4646_subtag | html %]">[% language.native_description | html %] ([% language.rfc4646_subtag | html %])</label>
134
                                        [% IF ( language.group_enabled ) %]
135
                                            <input value="[% language.rfc4646_subtag | html %]" name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]_[% language.rfc4646_subtag | html %]" type="checkbox" checked="checked" class="preference preference-checkbox"/>
136
                                        [% ELSE %]
137
                                            <input value="[% language.rfc4646_subtag | html %]" name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]_[% language.rfc4646_subtag | html %]" type="checkbox" class="preference preference-checkbox"/>
138
                                        [% END %]
139
                                    </li>
140
                                [% END # IF language.plural %]
141
                            [% END # FOREACH language %]
142
                        </ul> <!-- / ul.sortable -->
143
                    [% END %]
144
                    [% END %]
79
                    [% END %]
145
                </div></td>
80
                </div></td>
146
            </tr>
81
            </tr>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/featurereleasetool.tt (-61 / +5 lines)
Lines 87-164 td, th { Link Here
87
            <div id="installer-step3" class="installer-main col-sm-8 col-sm-offset-2 col-md-8 col-md-offset-2">
87
            <div id="installer-step3" class="installer-main col-sm-8 col-sm-offset-2 col-md-8 col-md-offset-2">
88
                <h1 id="logo"><a href="#">Koha</a></h1>
88
                <h1 id="logo"><a href="#">Koha</a></h1>
89
                <div class="tab">
89
                <div class="tab">
90
                    <button onclick="openInfoTab(event, 'syspref')"> New Syspref information</button>
90
                    <button onclick="openInfoTab(event, 'syspref')">New system preferences</button>
91
                    <button class="tablinks" onclick="openInfoTab(event, 'releasenotes')"> Release notes</button>
91
                    <button class="tablinks" onclick="openInfoTab(event, 'releasenotes')">Release notes</button>
92
                </div>
92
                </div>
93
93
94
                <div id="syspref" class="content">
94
                <div id="syspref" class="content">
95
                    <h2>New sysprefs added to Koha since Koha [% dbversion %]</h2>
95
                    <h2>New system preferences added to Koha since Koha [% dbversion %]</h2>
96
                    <div class="prefs-tab">
96
                    <div class="prefs-tab">
97
                    <p> The system preferences listed below were all installed in the update from Koha [% dbversion %] to Koha [% kohaversion %]. The default values of each of the system preferences are displayed for you to review and modify and submit by selecting the 'Save all preferences' button </p>
97
                    <p> The system preferences listed below were all installed in the update from Koha [% dbversion %] to Koha [% kohaversion %]. The default values of each of the system preferences are displayed for you to review and modify and submit by selecting the 'Save all preferences' button </p>
98
                            <form name="featurereleaseform" action="/cgi-bin/koha/installer/featurereleasetool.pl?dbversion=[%dbversion%]&kohaversion=[%kohaversion%]" method="post">
98
                            <form name="featurereleaseform" action="/cgi-bin/koha/installer/featurereleasetool.pl?dbversion=[% dbversion %]&kohaversion=[% kohaversion %]" method="post">
99
                                <input type="hidden" name="op" value="save" />
99
                                <input type="hidden" name="op" value="save" />
100
                                    <table id="releasetoolpreftable">
100
                                    <table id="releasetoolpreftable">
101
                                        <tr>
101
                                        <tr>
102
                                            <th class="preftitle">Preference</th>
102
                                            <th class="preftitle">Preference</th>
103
                                            <th class="preftitle"> Description</th>
104
                                            <th class="preftitle">Value</th>
103
                                            <th class="preftitle">Value</th>
105
                                        </tr>
104
                                        </tr>
106
                                        [% FOREACH pref IN prefs %]
105
                                        [% FOREACH pref IN prefs %]
107
                                        <tr>
106
                                            [% INCLUDE 'prefs-rows.inc' %]
108
                                            <td>
109
                                                    <input type="hidden" name="pref_[% pref.variable %]" id="pref_[% pref.variable %]" value="[% pref.variable %]"/>
110
                                                    [% pref.variable %]
111
                                            </td>
112
                                            <td>
113
                                                    [% pref.explanation %]
114
                                            </td>
115
                                            <td>
116
                                                [% IF (pref.value != '') %]
117
                                                    [% IF (pref.type == "Integer") || (pref.type == "integer" ) || (pref.type == "Free") %]
118
                                                        <input type="text" class="pref_text_input" name="pref_[% pref.variable %]" value="[% pref.value %]">
119
                                                    [% ELSIF (pref.type == "Choice") %]
120
                                                        <select name="pref_[% pref.variable %]" class="pref_choice_input">
121
                                                            [% option_value = pref.options.split("\\|") %]
122
                                                            [% option_text = pref.display_choices.split("\\|") %]
123
                                                            [% IF pref.value == option_value.0 %]
124
                                                                <option value="[% option_value.0 %]" selected="selected">[% option_text.0 %] </option>
125
                                                                <option value="[% option_value.1 %]">[% option_text.1 %] </option>
126
                                                                <option value="[% option_value.2 %]">[% option_text.2 %] </option>
127
                                                                <option value="[% option_value.3 %]">[% option_text.3 %] </option>
128
                                                            [% ELSIF pref.value == option_value.1 %]
129
                                                                <option value="[% option_value.0 %]">[% option_text.0 %] </option>
130
                                                                <option value="[% option_value.1 %]" selected="selected">[% option_text.1 %] </option>
131
                                                                <option value="[% option_value.2 %]">[% option_text.2 %] </option>
132
                                                                <option value="[% option_value.3 %]">[% option_text.3 %] </option>
133
                                                            [% ELSIF pref.value == option_value.2 %]
134
                                                                <option value="[% option_value.0 %]">[% option_text.0 %] </option>
135
                                                                <option value="[% option_value.1 %]">[% option_text.1 %] </option>
136
                                                                <option value="[% option_value.2 %]" selected="selected">[% option_text.2 %] </option>
137
                                                                <option value="[% option_value.3 %]">[% option_text.3 %] </option>
138
                                                            [% ELSIF pref.value == option_value.3 %]
139
                                                                <option value="[% option_value.0 %]">[% option_text.0 %] </option>
140
                                                                <option value="[% option_value.1 %]">[% option_text.1 %] </option>
141
                                                                <option value="[% option_value.2 %]">[% option_text.2 %] </option>
142
                                                                <option value="[% option_value.3 %]" selected="selected">[% option_text.3 %] </option>
143
                                                            [% END %]
144
                                                        </select>
145
                                                    [% ELSIF (pref.type == "YesNo") %]
146
                                                        <select id="pref_[% pref.variable %]" class="pref_binary_input" name="pref_[% pref.variable %]">
147
                                                            [% option_text = pref.display_choices.split("\\|") %]
148
                                                            [% IF pref.value == 1 %]
149
                                                                <option value=1 selected="selected"> [% IF option_text %] [% option_text.1 %] [% ELSE %] Yes [% END %]</option>
150
                                                                <option value=0> [% IF option_text %] [% option_text.0 %] [% ELSE %] No [% END %] </option>
151
                                                            [% ELSE %]
152
                                                                <option value=0 selected="selected"> [% IF option_text %] [% option_text.0 %] [% ELSE %] No [% END %]</option>
153
                                                                <option value=1> [% IF option_text %] [% option_text.1 %] [% ELSE %] Yes [% END %]</option>
154
                                                            [% END %]
155
                                                        </select>
156
                                                    [% END %]
157
                                                [% ELSE %]
158
                                                    No default value
159
                                                [% END %]
160
                                            </td>
161
                                        </tr>
162
                                        [% END %]
107
                                        [% END %]
163
                                    </table>
108
                                    </table>
164
                                    [% IF !(submitted_form) %]
109
                                    [% IF !(submitted_form) %]
165
- 

Return to bug 18645