From: Terran McCanna Date: Mon, 10 Dec 2018 19:17:42 +0000 (-0500) Subject: PINES Customization: Alert when no hold notification options X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=5aa0a9a80d79336909e625e5833201c0b197c674;p=working%2FEvergreen.git PINES Customization: Alert when no hold notification options Present an alert if no notification options are selected in both the OPAC and web staff client. Signed-off-by: Terran McCanna --- diff --git a/Open-ILS/web/js/ui/default/opac/holds-validation.js b/Open-ILS/web/js/ui/default/opac/holds-validation.js index 688d5dad93..27308c1fbf 100644 --- a/Open-ILS/web/js/ui/default/opac/holds-validation.js +++ b/Open-ILS/web/js/ui/default/opac/holds-validation.js @@ -22,10 +22,15 @@ function validateMethodSelections (alertMethodCboxes) { var inputNames = { e: "email_address", ph: "phone_notify", sms: "sms_notify", carrier: "sms_carrier"}; resetBackgrounds(inputNames); + //PINES variable: + var anyCheckbox = 0; + //Array.from(alertMethodCboxes).forEach(function(cbox){ for (var i = 0; i < alertMethodCboxes.length; i++){ var cbox = alertMethodCboxes[i]; if (cbox.checked && !cbox.disabled) { + //PINES check + anyCheckbox = anyCheckbox + 1; switch(cbox.id){ case "email_notify_checkbox": needsEmail = true; @@ -57,7 +62,9 @@ function validateMethodSelections (alertMethodCboxes) { } var isFormOK = emailOK && phoneOK && smsOK; - return { isValid: isFormOK, culpritNames : culprits }; + //PINES customization + //return { isValid: isFormOK, culpritNames : culprits }; + return { isValid: isFormOK, culpritNames : culprits, anyCheckbox : anyCheckbox }; } function confirmMultipleHolds() {