Commit 35cadfa4 authored by Côme Chilliet's avatar Côme Chilliet
Browse files

🚑 fix(PhoneNumberAttribute) Use pattern instead of method to validate phone numbers

So that the pattern is also set in the HTML input

issue #5910
parent d4ae271b
......@@ -108,11 +108,15 @@ class phoneSelectDialog extends GenericDialog
/*! \brief This class allow to handle easily an LDAP attribute that contains a phone number
*/
class PhoneNumberAttribute extends TestValidateAttribute
class PhoneNumberAttribute extends StringAttribute
{
protected $trim = TRUE;
protected $testFunc = 'is_phone_nr';
protected $inputType = 'tel';
function __construct ($label, $description, $ldapName, $required = FALSE, $defaultValue = '', $acl = '', $regexp = '/^[\/0-9 ()+*-]+$/', $example = NULL)
  • 🔽 Remove this method "__construct" to simply inherit it. 📘

Please register or sign in to reply
{
parent::__construct($label, $description, $ldapName, $required, $defaultValue, $acl, $regexp, $example);
}
}
/*! \brief Displays a text field and a button to select the phone from object list
......
  • SonarQube analysis reported 1 issue

    • 🔽 1 minor

    Watch the comments in this conversation to review them.

Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment