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

(-)a/admin/preferences.pl (-6 / +11 lines)
Lines 58-69 sub _get_chunk { Link Here
58
    if( $options{'syntax'} ){
58
    if( $options{'syntax'} ){
59
        $chunk->{'syntax'} = $options{'syntax'};
59
        $chunk->{'syntax'} = $options{'syntax'};
60
    }
60
    }
61
61
    if( $options{'type'} ) {
62
    if( $options{'type'} && $options{'type'} eq 'modalselect' ){
62
        if( $options{'type'} eq 'modalselect' ){
63
        $chunk->{'source'} = $options{'source'};
63
            $chunk->{'source'} = $options{'source'};
64
        $chunk->{'exclusions'} = $options{'exclusions'} // "";
64
            $chunk->{'exclusions'} = $options{'exclusions'} // "";
65
        $chunk->{'required'} = $options{'required'} // "";
65
            $chunk->{'required'} = $options{'required'} // "";
66
        $chunk->{'type'} = 'modalselect';
66
            $chunk->{'type'} = 'modalselect';
67
        } elsif( $options{'type'} eq 'modaljs' ){
68
            $chunk->{'type'} = 'modaljs';
69
            $chunk->{'initiator'} = $options{'initiator'};
70
            $chunk->{'processor'} = $options{'processor'};
71
        }
67
    }
72
    }
68
73
69
    if ( $options{'class'} && $options{'class'} eq 'password' ) {
74
    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 268-273 $( document ).ready( function () { Link Here
268
        $("#prefModal").modal("show");
268
        $("#prefModal").modal("show");
269
    });
269
    });
270
270
271
    $(".modaljs").on("click", function () {
272
        console.log('modaljs clicked');
273
    });
274
271
    $("#saveModalPrefs").on("click", function(){
275
    $("#saveModalPrefs").on("click", function(){
272
        var formfieldid = $("#" + $(this).data("target") );
276
        var formfieldid = $("#" + $(this).data("target") );
273
        var prefs = [];
277
        var prefs = [];
274
- 

Return to bug 27378