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

(-)a/admin/preferences.pl (-5 / +10 lines)
Lines 64-74 sub _get_chunk { Link Here
64
    if( $options{'syntax'} ){
64
    if( $options{'syntax'} ){
65
        $chunk->{'syntax'} = $options{'syntax'};
65
        $chunk->{'syntax'} = $options{'syntax'};
66
    }
66
    }
67
67
    if( $options{'type'} ) {
68
    if( $options{'type'} && $options{'type'} eq 'modalselect' ){
68
        if( $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->{'type'} = 'modalselect';
71
            $chunk->{'type'} = 'modalselect';
72
        } elsif( $options{'type'} eq 'modaljs' ){
73
            $chunk->{'type'} = 'modaljs';
74
            $chunk->{'initiator'} = $options{'initiator'};
75
            $chunk->{'processor'} = $options{'processor'};
76
        }
72
    }
77
    }
73
78
74
    if ( $options{'class'} && $options{'class'} eq 'password' ) {
79
    if ( $options{'class'} && $options{'class'} eq 'password' ) {
(-)a/koha-tmpl/intranet-tmpl/prog/css/preferences.css (-3 / +6 lines)
Lines 2-8 Link Here
2
.preference-multi,
2
.preference-multi,
3
.preference-long,
3
.preference-long,
4
.preference-file,
4
.preference-file,
5
.preference-modalselect {
5
.preference-modalselect,
6
.preference-modaljs {
6
    width: 20em;
7
    width: 20em;
7
}
8
}
8
9
Lines 14-24 Link Here
14
    width: 5em;
15
    width: 5em;
15
}
16
}
16
17
17
input[type="text"].modalselect {
18
input[type="text"].modalselect,
19
input[type="text"].modaljs {
18
    cursor: pointer;
20
    cursor: pointer;
19
}
21
}
20
22
21
input[type="text"].modalselect:hover {
23
input[type="text"].modalselect:hover,
24
input[type="text"].modaljs:hover {
22
    background-color: #FFC;
25
    background-color: #FFC;
23
}
26
}
24
27
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt (+2 lines)
Lines 113-118 Link Here
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 %]" readonly="readonly" value="[% CHUNK.value | html %]"/>
116
                    [% ELSIF ( CHUNK.type_modaljs ) %]
117
                        <input type="text" name="pref_[% CHUNK.name | html %]" data-initiator="[% CHUNK.initiator | html %]" data-processor="[% CHUNK.processor %]" id="pref_[% CHUNK.name | html %]" class="modaljs preference preference-[% CHUNK.type | html %]" readonly="readonly" value="[% CHUNK.value | html %]"/>
116
                    [% ELSIF ( CHUNK.type_multiple ) %]
118
                    [% 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">
119
                    <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 %]
120
                        [% 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 / +4 lines)
Lines 260-265 $( document ).ready( function () { Link Here
260
        $("#prefModal").modal("show");
260
        $("#prefModal").modal("show");
261
    });
261
    });
262
262
263
    $(".modaljs").on("click", function () {
264
        console.log('modaljs clicked');
265
    });
266
263
    $("#saveModalPrefs").on("click", function(){
267
    $("#saveModalPrefs").on("click", function(){
264
        var formfieldid = $("#" + $(this).data("target") );
268
        var formfieldid = $("#" + $(this).data("target") );
265
        var prefs = [];
269
        var prefs = [];
266
- 

Return to bug 27378