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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt (+1 lines)
Lines 211-216 Link Here
211
        var MSG_LOADING = _( "Loading..." );
211
        var MSG_LOADING = _( "Loading..." );
212
        var MSG_ALL_VALUE_WARN = _("Note: _ALL_ value will override all other values");
212
        var MSG_ALL_VALUE_WARN = _("Note: _ALL_ value will override all other values");
213
        var MSG_UPD_LOC_FORMAT_WARN = _("The following values are not formatted correctly:");
213
        var MSG_UPD_LOC_FORMAT_WARN = _("The following values are not formatted correctly:");
214
        var MSG_INVALID = _( "Error: presence of invalid data prevent saving. Please make the corrections and try again." );
214
    </script>
215
    </script>
215
    [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %]
216
    [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %]
216
    [% Asset.js("js/ajax.js") | $raw %]
217
    [% Asset.js("js/ajax.js") | $raw %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js (-1 / +24 lines)
Lines 3-8 Link Here
3
3
4
KOHA.Preferences = {
4
KOHA.Preferences = {
5
    Save: function ( form ) {
5
    Save: function ( form ) {
6
        if ( ! $(form).valid() ) {
7
            humanMsg.displayAlert( MSG_INVALID );
8
            return;
9
        }
10
6
        modified_prefs = $( form ).find( '.modified' );
11
        modified_prefs = $( form ).find( '.modified' );
7
        // $.serialize removes empty value, we need to keep them.
12
        // $.serialize removes empty value, we need to keep them.
8
        // If a multiple select has all its entries unselected
13
        // If a multiple select has all its entries unselected
Lines 181-184 $( document ).ready( function () { Link Here
181
        if ( alert_text.length )  alert(alert_text);
186
        if ( alert_text.length )  alert(alert_text);
182
    });
187
    });
183
188
189
    $(".prefs-tab form").each(function () {
190
        $(this).validate({
191
            rules: { },
192
            errorPlacement: function(error, element) {
193
                var placement = $(element).parent();
194
                if (placement) {
195
                    $(placement).append(error)
196
                } else {
197
                    error.insertAfter(element);
198
                }
199
            }
200
        });
201
    });
202
203
    $(".preference-email").each(function() {
204
        $(this).rules("add", {
205
            email: true
206
        });
207
    });
184
} );
208
} );
185
- 

Return to bug 8000