| @@ 483-492 (lines=10) @@ | ||
| 480 | $form = $this->getServiceLocator()->get('playgroundgame_sharemail_form'); |
|
| 481 | $form->setAttribute('method', 'post'); |
|
| 482 | ||
| 483 | if ($this->getRequest()->isPost()) { |
|
| 484 | $data = $this->getRequest()->getPost()->toArray(); |
|
| 485 | $form->setData($data); |
|
| 486 | if ($form->isValid()) { |
|
| 487 | $result = $this->getGameService()->sendShareMail($data, $this->game, $this->user, $lastEntry); |
|
| 488 | if ($result) { |
|
| 489 | $statusMail = true; |
|
| 490 | } |
|
| 491 | } |
|
| 492 | } |
|
| 493 | ||
| 494 | // buildView must be before sendMail because it adds the game template path to the templateStack |
|
| 495 | $viewModel = $this->buildView($this->game); |
|
| @@ 348-357 (lines=10) @@ | ||
| 345 | $form = $this->getServiceLocator()->get('playgroundgame_sharemail_form'); |
|
| 346 | $form->setAttribute('method', 'post'); |
|
| 347 | ||
| 348 | if ($this->getRequest()->isPost()) { |
|
| 349 | $data = $this->getRequest()->getPost()->toArray(); |
|
| 350 | $form->setData($data); |
|
| 351 | if ($form->isValid()) { |
|
| 352 | $result = $this->getGameService()->sendShareMail($data, $this->game, $user, $lastEntry); |
|
| 353 | if ($result) { |
|
| 354 | $statusMail = true; |
|
| 355 | } |
|
| 356 | } |
|
| 357 | } |
|
| 358 | ||
| 359 | // Je recherche le post associé à entry + status == 0. Si non trouvé, je redirige vers home du jeu. |
|
| 360 | $post = $this->getGameService()->getPostVotePostMapper()->findOneBy(array('entry' => $lastEntry)); |
|
| @@ 692-701 (lines=10) @@ | ||
| 689 | $form = $this->getServiceLocator()->get('playgroundgame_sharemail_form'); |
|
| 690 | $form->setAttribute('method', 'post'); |
|
| 691 | ||
| 692 | if ($this->getRequest()->isPost()) { |
|
| 693 | $data = $this->getRequest()->getPost()->toArray(); |
|
| 694 | $form->setData($data); |
|
| 695 | if ($form->isValid()) { |
|
| 696 | $result = $this->getGameService()->sendShareMail($data, $this->game, $user, $lastEntry); |
|
| 697 | if ($result) { |
|
| 698 | $statusMail = true; |
|
| 699 | } |
|
| 700 | } |
|
| 701 | } |
|
| 702 | ||
| 703 | $viewModel = $this->buildView($this->game); |
|
| 704 | ||