From 5aa0a9a80d79336909e625e5833201c0b197c674 Mon Sep 17 00:00:00 2001 From: Terran McCanna Date: Mon, 10 Dec 2018 14:17:42 -0500 Subject: [PATCH] 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 --- Open-ILS/web/js/ui/default/opac/holds-validation.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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() { -- 2.11.0