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

(-)a/admin/preferences.pl (+1 lines)
Lines 63-68 sub _get_chunk { Link Here
63
    if( $options{'type'} && $options{'type'} eq 'modalselect' ){
63
    if( $options{'type'} && $options{'type'} eq 'modalselect' ){
64
        $chunk->{'source'} = $options{'source'};
64
        $chunk->{'source'} = $options{'source'};
65
        $chunk->{'exclusions'} = $options{'exclusions'} // "";
65
        $chunk->{'exclusions'} = $options{'exclusions'} // "";
66
        $chunk->{'inclusions'} = $options{'inclusions'} // "";
66
        $chunk->{'required'} = $options{'required'} // "";
67
        $chunk->{'required'} = $options{'required'} // "";
67
        $chunk->{'type'} = 'modalselect';
68
        $chunk->{'type'} = 'modalselect';
68
    }
69
    }
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt (-1 / +1 lines)
Lines 129-135 Link Here
129
                        [% END %]
129
                        [% END %]
130
                    </select>
130
                    </select>
131
                    [% ELSIF ( CHUNK.type_modalselect ) %]
131
                    [% ELSIF ( CHUNK.type_modalselect ) %]
132
                        <input type="text" name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]" class="modalselect preference preference-[% CHUNK.type | html %]" data-source="[% CHUNK.source | html %]" data-required="[% CHUNK.required | html %]" data-exclusions="[% CHUNK.exclusions | html %]" readonly="readonly" value="[% CHUNK.value | html %]"/>
132
                        <input type="text" name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]" class="modalselect preference preference-[% CHUNK.type | html %]" data-source="[% CHUNK.source | html %]" data-required="[% CHUNK.required | html %]" data-exclusions="[% CHUNK.exclusions | html %]" data-inclusions="[% CHUNK.inclusions | html %]" readonly="readonly" value="[% CHUNK.value | html %]"/>
133
                    [% ELSIF ( CHUNK.type_multiple ) %]
133
                    [% ELSIF ( CHUNK.type_multiple ) %]
134
                    <select name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]" class="preference preference-[% CHUNK.class or "choice" | html %]" multiple="multiple">
134
                    <select name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]" class="preference preference-[% CHUNK.class or "choice" | html %]" multiple="multiple">
135
                        [% 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 %]
135
                        [% 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 %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js (-1 / +6 lines)
Lines 226-231 $( document ).ready( function () { Link Here
226
    $(".modalselect").on("click", function(){
226
    $(".modalselect").on("click", function(){
227
        var datasource = $(this).data("source");
227
        var datasource = $(this).data("source");
228
        var exclusions = $(this).data("exclusions").split('|');
228
        var exclusions = $(this).data("exclusions").split('|');
229
        var inclusions = $(this).data("inclusions").split('|');
229
        var required = $(this).data("required").split('|');
230
        var required = $(this).data("required").split('|');
230
        var pref_name = this.id.replace(/pref_/, '');
231
        var pref_name = this.id.replace(/pref_/, '');
231
        var pref_value = this.value;
232
        var pref_value = this.value;
Lines 250-259 $( document ).ready( function () { Link Here
250
                style = "disabled";
251
                style = "disabled";
251
                disabled = ' disabled="disabled" ';
252
                disabled = ' disabled="disabled" ';
252
                checked  = "";
253
                checked  = "";
254
            } else if( inclusions.indexOf( key ) >= 0 ){
255
                style = "disabled";
256
                disabled = ' disabled="disabled" ';
257
                checked  = ' checked="checked" ';
253
            } else {
258
            } else {
254
                style = "";
259
                style = "";
255
                disabled = "";
260
                disabled = "";
256
            }
261
            }
262
257
            items.push('<label class="' + style +'"><input class="dbcolumn_selection" type="checkbox" id="' + key + '"' + checked + disabled + ' name="pref" value="' + key + '" /> ' + data[key]+ ' (' + key + ')</label>');
263
            items.push('<label class="' + style +'"><input class="dbcolumn_selection" type="checkbox" id="' + key + '"' + checked + disabled + ' name="pref" value="' + key + '" /> ' + data[key]+ ' (' + key + ')</label>');
258
        });
264
        });
259
        $("<div/>", {
265
        $("<div/>", {
260
- 

Return to bug 27634