From e92e972c5a2849d0b55caa0be410ea4df4c065ee Mon Sep 17 00:00:00 2001 From: afornerot Date: Thu, 17 Sep 2020 15:30:01 +0200 Subject: [PATCH] =?UTF-8?q?motivation=20sur=20la=20fiche=20user=20+=20repo?= =?UTF-8?q?rt=20motivation/autres=20de=20inscription=20=C3=A0=20user=20(re?= =?UTF-8?q?f=20#177)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/RegistrationController.php | 2 ++ .../src/Cadoles/CoreBundle/Entity/User.php | 29 +++++++++++++++++++ .../src/Cadoles/CoreBundle/Form/UserType.php | 9 ++++++ .../Resources/views/User/edit.html.twig | 10 +++++++ 4 files changed, 50 insertions(+) diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/RegistrationController.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/RegistrationController.php index 1a5f4862..35a7852e 100755 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/RegistrationController.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Controller/RegistrationController.php @@ -508,9 +508,11 @@ class RegistrationController extends Controller $user->setSalt($data[0]->getSalt()); $user->setPasswordDirect($data[0]->getPassword()); $user->setVisible($data[0]->getVisible()); + $user->setMotivation($data[0]->getMotivation()); $user->setNiveau01($data[0]->getNiveau01()); $user->setSiren($data[0]->getNiveau01()->getSiren()); + $user->setNiveau01other($data[0]->getNiveau01other()); $user->setNiveau02($data[0]->getNiveau02()); if($data[0]->getNiveau02()!==null) $user->setSiret($data[0]->getNiveau02()->getSiret()); diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Entity/User.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Entity/User.php index e802e8b8..6d01d7e6 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Entity/User.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Entity/User.php @@ -178,6 +178,11 @@ class User implements UserInterface, \Serializable */ private $niveau01other; + /** + * @ORM\Column(name="description", type="text", nullable=true) + */ + private $motivation; + /** * @ORM\ManyToOne(targetEntity="Country", inversedBy="users") * @ORM\JoinColumn(nullable=true) @@ -1923,4 +1928,28 @@ class User implements UserInterface, \Serializable { return $this->alertreaders; } + + /** + * Set motivation + * + * @param string $motivation + * + * @return User + */ + public function setMotivation($motivation) + { + $this->motivation = $motivation; + + return $this; + } + + /** + * Get motivation + * + * @return string + */ + public function getMotivation() + { + return $this->motivation; + } } diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Form/UserType.php b/src/ninegate-1.0/src/Cadoles/CoreBundle/Form/UserType.php index e78e5052..53f840c6 100644 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Form/UserType.php +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Form/UserType.php @@ -388,6 +388,15 @@ class UserType extends AbstractType "disabled" => true, ]); } + + $builder->add('motivation', + TextareaType::class, array( + "label" => "Motivation", + "required" => false, + "disabled" => ($options["mode"]=="delete"?true:false), + "attr" => array("class" => "form-control", "style" => "margin-bottom:15px; height: 90px") + ) + ); # Avatar $builder->add('avatar',HiddenType::class, array("empty_data" => "noavatar.png")); diff --git a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/User/edit.html.twig b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/User/edit.html.twig index 78714d0a..c7f078d4 100755 --- a/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/User/edit.html.twig +++ b/src/ninegate-1.0/src/Cadoles/CoreBundle/Resources/views/User/edit.html.twig @@ -106,6 +106,16 @@ +
+
+ Motivations +
+ +
+ {{ form_row(form.motivation) }} +
+
+
Organisation