Gestion international
This commit is contained in:
parent
03f6d2aa2c
commit
3692f98a90
|
@ -8,8 +8,8 @@
|
||||||
*/
|
*/
|
||||||
public static function parsePhone($number)
|
public static function parsePhone($number)
|
||||||
{
|
{
|
||||||
$number = preg_replace('#[^0-9+]#', '', $number);
|
$number = preg_replace('#[^-0-9+]#', '', $number);
|
||||||
if (preg_match('#^(0|\+33)[1-9][0-9]{8}$#', $number))
|
if (preg_match('#^(0|\+[1-9]{1,3}|\+1\-[0-9]{3})[1-9][0-9]{8}$#', $number))
|
||||||
{
|
{
|
||||||
return $number;
|
return $number;
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,7 @@
|
||||||
<label>Numéro de téléphone du contact</label>
|
<label>Numéro de téléphone du contact</label>
|
||||||
<div class="form-group input-group">
|
<div class="form-group input-group">
|
||||||
<span class="input-group-addon"><span class="fa fa-phone"></span></span>
|
<span class="input-group-addon"><span class="fa fa-phone"></span></span>
|
||||||
<input name="phone" class="form-control" type="text" placeholder="Numéro du contact" pattern="((0[1-9])|(\+33( )?[0-9]))( ?)([0-9] ?){8}" required>
|
<input name="phone" class="form-control" type="text" placeholder="Numéro du contact" pattern="(0|\+[1-9]{1,3}|\+1\-[0-9]{3})[1-9][0-9]{8}" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<a class="btn btn-danger" href="<?php echo $this->generateUrl('contacts'); ?>">Annuler</a>
|
<a class="btn btn-danger" href="<?php echo $this->generateUrl('contacts'); ?>">Annuler</a>
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
<label>Numéro de téléphone du contact</label>
|
<label>Numéro de téléphone du contact</label>
|
||||||
<div class="form-group input-group">
|
<div class="form-group input-group">
|
||||||
<span class="input-group-addon"><span class="fa fa-phone"></span></span>
|
<span class="input-group-addon"><span class="fa fa-phone"></span></span>
|
||||||
<input name="contacts[<?php secho($contact['id']); ?>][phone]" class="form-control" type="text" placeholder="Numéro du contact" pattern="((0[1-9])|(\+33( )?[0-9]))( ?)([0-9] ?){8}" required value="<?php secho($contact['number']); ?>">
|
<input name="contacts[<?php secho($contact['id']); ?>][phone]" class="form-control" type="text" placeholder="Numéro du contact" pattern="(0|\+[1-9]{1,3}|\+1\-[0-9]{3})[1-9][0-9]{8}" required value="<?php secho($contact['number']); ?>">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<hr/>
|
<hr/>
|
||||||
|
|
Loading…
Reference in New Issue