[04/09/2024] Installation du module ForcePhone pour rendre le téléphone obligatoire à la création du compte.
This commit is contained in:
78
local/modules/ForcePhone/Form/ConfigForm.php
Normal file
78
local/modules/ForcePhone/Form/ConfigForm.php
Normal file
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* This file is part of the Thelia package. */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : dev@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* For the full copyright and license information, please view the LICENSE.txt */
|
||||
/* file that was distributed with this source code. */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace ForcePhone\Form;
|
||||
|
||||
use ForcePhone\ForcePhone;
|
||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||
use Thelia\Form\BaseForm;
|
||||
|
||||
class ConfigForm extends BaseForm
|
||||
{
|
||||
protected function buildForm()
|
||||
{
|
||||
$this->formBuilder
|
||||
->add(
|
||||
'force_phone',
|
||||
'checkbox',
|
||||
[
|
||||
'required' => false,
|
||||
'label' => $this->translator->trans('Home phone number', [], ForcePhone::DOMAIN_NAME),
|
||||
'label_attr' => [
|
||||
'for' => 'force_phone',
|
||||
]
|
||||
]
|
||||
)
|
||||
->add(
|
||||
'force_cellphone',
|
||||
'checkbox',
|
||||
[
|
||||
'required' => false,
|
||||
'label' => $this->translator->trans('Mobile phone number', [], ForcePhone::DOMAIN_NAME),
|
||||
'label_attr' => [
|
||||
'for' => 'force_cellphone',
|
||||
]
|
||||
]
|
||||
)
|
||||
->add(
|
||||
'force_one',
|
||||
'checkbox',
|
||||
[
|
||||
'required' => false,
|
||||
'label' => $this->translator->trans('At least one phone number', [], ForcePhone::DOMAIN_NAME),
|
||||
'label_attr' => [
|
||||
'for' => 'force_one',
|
||||
]
|
||||
]
|
||||
)
|
||||
->add(
|
||||
'validate_format',
|
||||
'checkbox',
|
||||
[
|
||||
'required' => false,
|
||||
'label' => $this->translator->trans('Check phone numbers format', [], ForcePhone::DOMAIN_NAME),
|
||||
'label_attr' => [
|
||||
'for' => 'validate_format',
|
||||
]
|
||||
]
|
||||
)
|
||||
;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string the name of you form. This name must be unique
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return 'forcephone_config';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user