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

(-)a/admin/preferences.pl (-6 / +11 lines)
Lines 59-70 sub _get_chunk { Link Here
59
    if( $options{'syntax'} ){
59
    if( $options{'syntax'} ){
60
        $chunk->{'syntax'} = $options{'syntax'};
60
        $chunk->{'syntax'} = $options{'syntax'};
61
    }
61
    }
62
62
    if( $options{'type'} ) {
63
    if( $options{'type'} && $options{'type'} eq 'modalselect' ){
63
        if( $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->{'required'} = $options{'required'} // "";
66
            $chunk->{'required'} = $options{'required'} // "";
67
        $chunk->{'type'} = 'modalselect';
67
            $chunk->{'type'} = 'modalselect';
68
        } elsif( $options{'type'} eq 'modaljs' ){
69
            $chunk->{'type'} = 'modaljs';
70
            $chunk->{'initiator'} = $options{'initiator'};
71
            $chunk->{'processor'} = $options{'processor'};
72
        }
68
    }
73
    }
69
74
70
    if ( $options{'class'} && $options{'class'} eq 'password' ) {
75
    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 131-136 Link Here
131
                    </select>
131
                    </select>
132
                    [% ELSIF ( CHUNK.type_modalselect ) %]
132
                    [% ELSIF ( CHUNK.type_modalselect ) %]
133
                        <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 %]"/>
133
                        <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 %]"/>
134
                    [% ELSIF ( CHUNK.type_modaljs ) %]
135
                        <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 %]"/>
134
                    [% ELSIF ( CHUNK.type_multiple ) %]
136
                    [% ELSIF ( CHUNK.type_multiple ) %]
135
                    <select name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]" class="preference preference-[% CHUNK.class or "choice" | html %]" multiple="multiple">
137
                    <select name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]" class="preference preference-[% CHUNK.class or "choice" | html %]" multiple="multiple">
136
                        [% 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 %]
138
                        [% 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 266-271 $( document ).ready( function () { Link Here
266
        $("#prefModal").modal("show");
266
        $("#prefModal").modal("show");
267
    });
267
    });
268
268
269
    $(".modaljs").on("click", function () {
270
        console.log('modaljs clicked');
271
    });
272
269
    $("#saveModalPrefs").on("click", function(){
273
    $("#saveModalPrefs").on("click", function(){
270
        var formfieldid = $("#" + $(this).data("target") );
274
        var formfieldid = $("#" + $(this).data("target") );
271
        var prefs = [];
275
        var prefs = [];
272
- 

Return to bug 27378