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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref (-1 / +1 lines)
Lines 4-10 Administration: Link Here
4
        -
4
        -
5
            - "Email address for the administrator of Koha: "
5
            - "Email address for the administrator of Koha: "
6
            - pref: KohaAdminEmailAddress
6
            - pref: KohaAdminEmailAddress
7
              class: email
7
              class: email-with-display-name
8
            - "(This is the default From: address for emails unless there is one for the particular library, and is referred to when an internal error occurs.)"
8
            - "(This is the default From: address for emails unless there is one for the particular library, and is referred to when an internal error occurs.)"
9
        -
9
        -
10
            - "Email address to be set as the replyto in emails: "
10
            - "Email address to be set as the replyto in emails: "
(-)a/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js (-1 / +22 lines)
Lines 365-376 $(".prefs-tab form").each(function () { Link Here
365
    });
365
    });
366
});
366
});
367
367
368
jQuery.validator.addMethod(
369
    "email_with_display_name",
370
    function (value, element) {
371
        // Regex source
372
        // https://web.archive.org/web/20251229171626/https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input/email#basic_validation
373
        // modified to accept "Display Name <user@host>"
374
        return (
375
            this.optional(element) ||
376
            /^(?:\w+\s+<[\w.!#$%&'*+/=?^`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*>)$|^(?:[\w.!#$%&'*+/=?^`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)$/.test(
377
                value
378
            )
379
        );
380
    },
381
    __("Please enter a valid email address (display name allowed).")
382
);
383
368
$(".preference-email").each(function () {
384
$(".preference-email").each(function () {
369
    $(this).rules("add", {
385
    $(this).rules("add", {
370
        email: true,
386
        email: true,
371
    });
387
    });
372
});
388
});
373
389
390
$(".preference-email-with-display-name").each(function () {
391
    $(this).rules("add", {
392
        email_with_display_name: true,
393
    });
394
});
395
374
$(".modalselect").on("click", function () {
396
$(".modalselect").on("click", function () {
375
    var datasource = $(this).data("source");
397
    var datasource = $(this).data("source");
376
    var exclusions = $(this).data("exclusions").split("|");
398
    var exclusions = $(this).data("exclusions").split("|");
377
- 

Return to bug 15349