diff --git a/core/lib/Thelia/Config/Resources/config.xml b/core/lib/Thelia/Config/Resources/config.xml index 43e48f6e4..8f5a78b59 100755 --- a/core/lib/Thelia/Config/Resources/config.xml +++ b/core/lib/Thelia/Config/Resources/config.xml @@ -102,6 +102,8 @@
+ + diff --git a/core/lib/Thelia/Form/ProfileModificationForm.php b/core/lib/Thelia/Form/ProfileModificationForm.php new file mode 100644 index 000000000..94ce1fba9 --- /dev/null +++ b/core/lib/Thelia/Form/ProfileModificationForm.php @@ -0,0 +1,91 @@ +. */ +/* */ +/*************************************************************************************/ + +namespace Thelia\Form; + +use Symfony\Component\Validator\Constraints; +use Thelia\Core\Translation\Translator; +use Thelia\Model\ConfigQuery; + +/** + * Class ProfileModification + * @package Thelia\Form + * @author Manuel Raynaud + */ +class ProfileModificationForm extends BaseForm +{ + + + protected function buildForm() + { + + $this->formBuilder + ->add("firstname", "text", array( + "constraints" => array( + new Constraints\NotBlank() + ), + "label" => Translator::getInstance()->trans("First Name"), + "label_attr" => array( + "for" => "firstname" + ) + )) + ->add("lastname", "text", array( + "constraints" => array( + new Constraints\NotBlank() + ), + "label" => Translator::getInstance()->trans("Last Name"), + "label_attr" => array( + "for" => "lastname" + ) + )) + ->add("password", "password", array( + "constraints" => array( + new Constraints\NotBlank(), + new Constraints\Length(array("min" => ConfigQuery::read("password.length", 4))) + ), + "label" => Translator::getInstance()->trans("Password"), + "label_attr" => array( + "for" => "password" + ) + )) + ->add("password_confirm", "password", array( + "constraints" => array( + new Constraints\NotBlank(), + new Constraints\Length(array("min" => ConfigQuery::read("password.length", 4))), + new Constraints\Callback(array("methods" => array( + array($this, "verifyPasswordField") + ))) + ), + "label" => "Password confirmation", + "label_attr" => array( + "for" => "password_confirmation" + ) + )) + ; + } + + public function getName() + { + return "thelia_profile_modification"; + } +} diff --git a/templates/admin/default/profile-edit.html b/templates/admin/default/profile-edit.html index e69de29bb..19b6c4c2d 100644 --- a/templates/admin/default/profile-edit.html +++ b/templates/admin/default/profile-edit.html @@ -0,0 +1,80 @@ +{extends file="admin-layout.tpl"} + +{block name="page-title"}{intl l='Edit profile'}{/block} + +{block name="check-permissions"}admin.profile.edit{/block} + +{block name="main-content"} +
+ +
+ + + +
+
+ +
+ {intl l="Edit profile $NAME"} +
+ +
+ {form name="thelia.admin.profile.modification"} + + + {form_hidden_fields form=$form} + + {form_field form=$form field='success_url'} + + {/form_field} + + {if $form_error}
{$form_error_message}
{/if} + + {form_field form=$form field='firstname'} +
+ + +
+ {/form_field} + + {form_field form=$form field='lastname'} +
+ + +
+ {/form_field} + + {form_field form=$form field='password'} +
+ + +
+ {/form_field} + + {form_field form=$form field='password_confirm'} +
+ + +
+ {/form_field} + +
+ +
+ + {/form} +
+ +
+ +
+ +
+
+{/block} \ No newline at end of file