Koha/koha-tmpl/intranet-tmpl/prog/en/includes/validator-strings.inc
Kyle M Hall a0e61d8c3e Bug 22594: Validate SMS messaging numbers using the E.164 format
Many SMS messaging services reject numbers that do not conform to the E.164 international public telecommunication
numbering plan.

We already tell patrons on the OPAC "Please enter numbers only. (123) 456-7890 would be entered as 1234567890."
but we do not enforce this. We should be validating the patron's SMS number on both the staff side and the patron
self-service for updating the SMS number.

Test plan:
1) Apply this patch
2) Enable SMS message ( you can set to Email to enable )
3) Test entering and updating SMS numbers on the OPAC and staff
   interfaces.
4) Note you can only enter a 1 to 14 digit number with an optional + sign
   at the beginning ( used to indicate the number includes a country calling code )

Signed-off-by: Liz Rea <wizzyrea@gmail.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-04-12 02:23:54 +00:00

24 lines
1.2 KiB
C++

<script type="text/javascript">
//<![CDATA[
$(document).ready(function(){
jQuery.extend(jQuery.validator.messages, {
required: _("This field is required."),
remote: _("Please fix this field."),
email: _("Please enter a valid email address."),
url: _("Please enter a valid URL."),
date: _("Please enter a valid date."),
dateISO: _("Please enter a valid date (ISO)."),
number: _("Please enter a valid number."),
digits: _("Please enter only digits."),
equalTo: _("Please enter the same value again."),
maxlength: $.validator.format(_("Please enter no more than {0} characters.")),
minlength: $.validator.format(_("Please enter at least {0} characters.")),
rangelength: $.validator.format(_("Please enter a value between {0} and {1} characters long.")),
range: $.validator.format(_("Please enter a value between {0} and {1}.")),
max: $.validator.format(_("Please enter a value less than or equal to {0}.")),
min: $.validator.format(_("Please enter a value greater than or equal to {0}.")),
phone: $.validator.format(_("Please enter a valid phone number."))
});
});
//]]>
</script>