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

(-)a/admin/preferences.pl (+1 lines)
Lines 67-72 sub _get_chunk { Link Here
67
67
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->{'type'} = 'modalselect';
71
        $chunk->{'type'} = 'modalselect';
71
    }
72
    }
72
73
(-)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 %]" 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 %]" 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/en/modules/admin/preferences/patrons.pref (+1 lines)
Lines 197-202 Patrons: Link Here
197
         - pref: BorrowerUnwantedField
197
         - pref: BorrowerUnwantedField
198
           type: modalselect
198
           type: modalselect
199
           source: borrowers
199
           source: borrowers
200
           exclusions: branchcode
200
     -
201
     -
201
         - "Borrowers can have the following titles:"
202
         - "Borrowers can have the following titles:"
202
         - pref: BorrowersTitles
203
         - pref: BorrowersTitles
(-)a/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js (-2 / +8 lines)
Lines 225-230 $( document ).ready( function () { Link Here
225
225
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 pref_name = this.id.replace(/pref_/, '');
229
        var pref_name = this.id.replace(/pref_/, '');
229
        var pref_value = this.value;
230
        var pref_value = this.value;
230
        var prefs = pref_value.split("|");
231
        var prefs = pref_value.split("|");
Lines 238-244 $( document ).ready( function () { Link Here
238
                } else {
239
                } else {
239
                    checked = "";
240
                    checked = "";
240
                }
241
                }
241
                items.push('<label><input class="dbcolumn_selection" type="checkbox" id="' + key + '"' + checked + ' name="pref" value="' + val + '" /> ' + key + '</label>');
242
                if( exclusions.indexOf( val ) >= 0 ){
243
                    disabled = ' disabled="disabled" ';
244
                    checked  = "";
245
                } else {
246
                    disabled = "";
247
                }
248
                items.push('<label><input class="dbcolumn_selection" type="checkbox" id="' + key + '"' + checked + disabled + ' name="pref" value="' + val + '" /> ' + key + '</label>');
242
            });
249
            });
243
            $("<div/>", {
250
            $("<div/>", {
244
                "class": "columns-2",
251
                "class": "columns-2",
245
- 

Return to bug 17364