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

(-)a/admin/preferences.pl (-5 / +10 lines)
Lines 63-73 sub _get_chunk { Link Here
63
    if( $options{'syntax'} ){
63
    if( $options{'syntax'} ){
64
        $chunk->{'syntax'} = $options{'syntax'};
64
        $chunk->{'syntax'} = $options{'syntax'};
65
    }
65
    }
66
66
    if( $options{'type'} ) {
67
    if( $options{'type'} && $options{'type'} eq 'modalselect' ){
67
        if( $options{'type'} eq 'modalselect' ){
68
        $chunk->{'source'} = $options{'source'};
68
            $chunk->{'source'} = $options{'source'};
69
        $chunk->{'exclusions'} = $options{'exclusions'} // "";
69
            $chunk->{'exclusions'} = $options{'exclusions'} // "";
70
        $chunk->{'type'} = 'modalselect';
70
            $chunk->{'type'} = 'modalselect';
71
        } elsif( $options{'type'} eq 'modaljs' ){
72
            $chunk->{'type'} = 'modaljs';
73
            $chunk->{'initiator'} = $options{'initiator'};
74
            $chunk->{'processor'} = $options{'processor'};
75
        }
71
    }
76
    }
72
77
73
    if ( $options{'class'} && $options{'class'} eq 'password' ) {
78
    if ( $options{'class'} && $options{'class'} eq 'password' ) {
(-)a/koha-tmpl/intranet-tmpl/prog/css/preferences.css (-3 / +6 lines)
Lines 3-9 Link Here
3
.preference-multi,
3
.preference-multi,
4
.preference-long,
4
.preference-long,
5
.preference-file,
5
.preference-file,
6
.preference-modalselect {
6
.preference-modalselect,
7
.preference-modaljs {
7
    width: 20em;
8
    width: 20em;
8
}
9
}
9
10
Lines 15-25 Link Here
15
    width: 5em;
16
    width: 5em;
16
}
17
}
17
18
18
input[type="text"].modalselect {
19
input[type="text"].modalselect,
20
input[type="text"].modaljs {
19
    cursor: pointer;
21
    cursor: pointer;
20
}
22
}
21
23
22
input[type="text"].modalselect:hover {
24
input[type="text"].modalselect:hover,
25
input[type="text"].modaljs:hover {
23
    background-color: #FFC;
26
    background-color: #FFC;
24
}
27
}
25
28
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt (+2 lines)
Lines 127-132 Link Here
127
                    </select>
127
                    </select>
128
                    [% ELSIF ( CHUNK.type_modalselect ) %]
128
                    [% ELSIF ( CHUNK.type_modalselect ) %]
129
                        <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 %]"/>
129
                        <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 %]"/>
130
                    [% ELSIF ( CHUNK.type_modaljs ) %]
131
                        <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 %]"/>
130
                    [% ELSIF ( CHUNK.type_multiple ) %]
132
                    [% ELSIF ( CHUNK.type_multiple ) %]
131
                    <select name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]" class="preference preference-[% CHUNK.class or "choice" | html %]" multiple="multiple">
133
                    <select name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]" class="preference preference-[% CHUNK.class or "choice" | html %]" multiple="multiple">
132
                        [% 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 %]
134
                        [% 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