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

(-)a/admin/preferences.pl (+1 lines)
Lines 68-73 sub _get_chunk { Link Here
68
    if( $options{'type'} && $options{'type'} eq 'modalselect' ){
68
    if( $options{'type'} && $options{'type'} eq 'modalselect' ){
69
        $chunk->{'source'} = $options{'source'};
69
        $chunk->{'source'} = $options{'source'};
70
        $chunk->{'exclusions'} = $options{'exclusions'} // "";
70
        $chunk->{'exclusions'} = $options{'exclusions'} // "";
71
        $chunk->{'inclusions'} = $options{'inclusions'} // "";
71
        $chunk->{'type'} = 'modalselect';
72
        $chunk->{'type'} = 'modalselect';
72
    }
73
    }
73
74
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt (-1 / +1 lines)
Lines 112-118 Link Here
112
                        [% END %]
112
                        [% END %]
113
                    </select>
113
                    </select>
114
                    [% ELSIF ( CHUNK.type_modalselect ) %]
114
                    [% ELSIF ( CHUNK.type_modalselect ) %]
115
                        <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-exclusions="[% CHUNK.exclusions | html %]" readonly="readonly" value="[% CHUNK.value | html %]"/>
115
                        <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-exclusions="[% CHUNK.exclusions | html %]" data-inclusions="[% CHUNK.inclusions | html %]" readonly="readonly" value="[% CHUNK.value | html %]"/>
116
                    [% ELSIF ( CHUNK.type_multiple ) %]
116
                    [% ELSIF ( CHUNK.type_multiple ) %]
117
                    <select name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]" class="preference preference-[% CHUNK.class or "choice" | html %]" multiple="multiple">
117
                    <select name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]" class="preference preference-[% CHUNK.class or "choice" | html %]" multiple="multiple">
118
                        [% 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 %]
118
                        [% 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 / +7 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 pref_name = this.id.replace(/pref_/, '');
230
        var pref_name = this.id.replace(/pref_/, '');
230
        var pref_value = this.value;
231
        var pref_value = this.value;
231
        var prefs = pref_value.split("|");
232
        var prefs = pref_value.split("|");
Lines 244-253 $( document ).ready( function () { Link Here
244
                    style = "disabled";
245
                    style = "disabled";
245
                    disabled = ' disabled="disabled" ';
246
                    disabled = ' disabled="disabled" ';
246
                    checked  = "";
247
                    checked  = "";
248
                }
249
                else if( inclusions.indexOf( val ) >= 0 ){
250
                    style = "disabled";
251
                    disabled = ' disabled="disabled" ';
252
                    checked  = ' checked="checked" ';
247
                } else {
253
                } else {
248
                    style = "";
254
                    style = "";
249
                    disabled = "";
255
                    disabled = "";
250
                }
256
                }
257
251
                items.push('<label class="' + style +'"><input class="dbcolumn_selection" type="checkbox" id="' + key + '"' + checked + disabled + ' name="pref" value="' + val + '" /> ' + key + '</label>');
258
                items.push('<label class="' + style +'"><input class="dbcolumn_selection" type="checkbox" id="' + key + '"' + checked + disabled + ' name="pref" value="' + val + '" /> ' + key + '</label>');
252
            });
259
            });
253
            $("<div/>", {
260
            $("<div/>", {
254
- 

Return to bug 27634