diff --git a/app/classes/Framadate/Collect_mail.php b/app/classes/Framadate/CollectMail.php similarity index 91% rename from app/classes/Framadate/Collect_mail.php rename to app/classes/Framadate/CollectMail.php index 8abc12e..155bee4 100644 --- a/app/classes/Framadate/Collect_mail.php +++ b/app/classes/Framadate/CollectMail.php @@ -20,16 +20,14 @@ namespace Framadate; /** - * Class Collect_mail + * Class CollectMail * * Is used to specify the poll's edition permissions. * @TODO : wait to use the SplEnum * * @package Framadate */ -class Collect_mail { // extends SplEnum - const __default = self::NO_COLLECT; - +class CollectMail { // extends SplEnum const NO_COLLECT = 0; const COLLECT = 1; const COLLECT_REQUIRED = 2; diff --git a/app/classes/Framadate/Form.php b/app/classes/Framadate/Form.php index a277eca..2f62012 100644 --- a/app/classes/Framadate/Form.php +++ b/app/classes/Framadate/Form.php @@ -84,7 +84,7 @@ class Form /** * Tells if voters email addresses are collected or not. - * @var \Framadate\Collect_mail + * @var \Framadate\CollectMail */ public $collect_users_mail; @@ -93,9 +93,10 @@ class Form */ private $choices; - public function __construct(){ + public function __construct() + { $this->editable = Editable::EDITABLE_BY_ALL; - $this->collect_users_mail = Collect_mail::NO_COLLECT; + $this->collect_users_mail = CollectMail::NO_COLLECT; $this->clearChoices(); } diff --git a/app/classes/Framadate/Services/InputService.php b/app/classes/Framadate/Services/InputService.php index a3e10d4..81dfe25 100644 --- a/app/classes/Framadate/Services/InputService.php +++ b/app/classes/Framadate/Services/InputService.php @@ -69,23 +69,23 @@ class InputService { public function filterMail($mail) { /////////////////////////////////////////////////////////////////////////////////////// // formatting - + $mail = trim($mail); - + /////////////////////////////////////////////////////////////////////////////////////// // e-mail validation - + $resultat = FALSE; - + $validator = new EmailValidator(); - + if ($validator->isValid($mail, new RFCValidation())) { $resultat = $mail; } - + /////////////////////////////////////////////////////////////////////////////////////// // return - + return $resultat; } @@ -115,8 +115,8 @@ class InputService { return filter_var($editable, FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => EDITABLE_CHOICE_REGEX]]); } - public function filterCollect_mail($collect_mail) { - return filter_var($collect_mail, FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => COLLECT_MAIL_CHOICE_REGEX]]); + public function filterCollectMail($collectMail) { + return filter_var($collectMail, FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => COLLECT_MAIL_CHOICE_REGEX]]); } public function filterComment($comment) { diff --git a/create_poll.php b/create_poll.php index 5b7597a..7b1c0a9 100644 --- a/create_poll.php +++ b/create_poll.php @@ -58,7 +58,6 @@ if ($goToStep2) { $use_ValueMax = isset($_POST['use_ValueMax']) ? $inputService->filterBoolean($_POST['use_ValueMax']) : false; $ValueMax = $use_ValueMax === true ? $inputService->filterValueMax($_POST['ValueMax']) : null; - $collect_users_mail = isset($_POST['collect_users_mail']) ? $inputService->filterBoolean($_POST['collect_users_mail']) : false; $use_customized_url = isset($_POST['use_customized_url']) ? $inputService->filterBoolean($_POST['use_customized_url']) : false; $customized_url = $use_customized_url === true ? $inputService->filterId($_POST['customized_url']) : null; $name = $inputService->filterName($_POST['name']); @@ -69,7 +68,7 @@ if ($goToStep2) { $receiveNewComments = isset($_POST['receiveNewComments']) ? $inputService->filterBoolean($_POST['receiveNewComments']) : false; $hidden = isset($_POST['hidden']) ? $inputService->filterBoolean($_POST['hidden']) : false; $use_password = filter_input(INPUT_POST, 'use_password', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => BOOLEAN_REGEX]]); - $collect_users_mail = $inputService->filterCollect_mail($_POST['collect_users_mail']); + $collect_users_mail = $inputService->filterCollectMail($_POST['collect_users_mail']); $use_password = filter_input(INPUT_POST, 'use_password', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => BOOLEAN_REGEX]]); $password = isset($_POST['password']) ? $_POST['password'] : null; $password_repeat = isset($_POST['password_repeat']) ? $_POST['password_repeat'] : null; diff --git a/tpl/create_poll.tpl b/tpl/create_poll.tpl index 19afac0..05efe44 100644 --- a/tpl/create_poll.tpl +++ b/tpl/create_poll.tpl @@ -325,7 +325,7 @@ - + {* Collect users email *}
diff --git a/tpl/part/poll_info.tpl b/tpl/part/poll_info.tpl index 09defaf..3de7245 100644 --- a/tpl/part/poll_info.tpl +++ b/tpl/part/poll_info.tpl @@ -233,19 +233,19 @@
{$txt|html}
- +