Refactored code to comply with PSR-*
Signed-off-by: Gergely POLONKAI <polesz@w00d5t0ck.info>
This commit is contained in:
@@ -12,21 +12,28 @@ use KekRozsak\FrontBundle\Entity\Article;
|
||||
|
||||
class ArticleController extends Controller
|
||||
{
|
||||
/**
|
||||
* @Route("/cikk/{slug}", name="KekRozsakFrontBundle_articleView")
|
||||
* @Template()
|
||||
* @ParamConverter("article")
|
||||
*
|
||||
* @param KekRozsak\FrontBundle\Entity\Article $article
|
||||
*/
|
||||
public function viewAction(Article $article)
|
||||
{
|
||||
$scontext = $this->get('security.context');
|
||||
if ((!is_object($scontext->getToken()) || !is_object($scontext->getToken()->getUser())) && !$article->isPublic())
|
||||
throw new AccessDeniedException('A cikk megtekintéséhez be kell jelentkezned!');
|
||||
/**
|
||||
* @Route("/cikk/{slug}", name="KekRozsakFrontBundle_articleView")
|
||||
* @Template()
|
||||
* @ParamConverter("article")
|
||||
*
|
||||
* @param KekRozsak\FrontBundle\Entity\Article $article
|
||||
*/
|
||||
public function viewAction(Article $article)
|
||||
{
|
||||
$scontext = $this->get('security.context');
|
||||
if (
|
||||
(
|
||||
!is_object($scontext->getToken())
|
||||
|| !is_object($scontext->getToken()->getUser())
|
||||
)
|
||||
&& !$article->isPublic()
|
||||
) {
|
||||
throw new AccessDeniedException('A cikk megtekintéséhez be kell jelentkezned!');
|
||||
}
|
||||
|
||||
return array(
|
||||
'article' => $article,
|
||||
);
|
||||
}
|
||||
return array(
|
||||
'article' => $article,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -13,123 +13,126 @@ use KekRozsak\FrontBundle\Entity\BookCopy;
|
||||
|
||||
class BookController extends Controller
|
||||
{
|
||||
/**
|
||||
* @Route("/konyvtar", name="KekRozsakFrontBundle_bookList")
|
||||
* @Template()
|
||||
*/
|
||||
public function listAction()
|
||||
{
|
||||
$query = $this->getDoctrine()->getEntityManager()->createQuery('SELECT b FROM KekRozsakFrontBundle:Book b ORDER BY b.author ASC, b.title ASC, b.year ASC');
|
||||
/**
|
||||
* @Route("/konyvtar", name="KekRozsakFrontBundle_bookList")
|
||||
* @Template()
|
||||
*/
|
||||
public function listAction()
|
||||
{
|
||||
$query = $this->getDoctrine()->getEntityManager()->createQuery('SELECT b FROM KekRozsakFrontBundle:Book b ORDER BY b.author ASC, b.title ASC, b.year ASC');
|
||||
|
||||
$books = $query->getResult();
|
||||
$books = $query->getResult();
|
||||
|
||||
return array(
|
||||
'books' => $books,
|
||||
);
|
||||
}
|
||||
return array(
|
||||
'books' => $books,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/konyvadat/{id}/ajax.{_format}", name="KekRozsakFrontBundle_bookAjaxData", defaults={"_format": "html"}, options={"expose": true})
|
||||
* @Template()
|
||||
* @ParamConverter("book")
|
||||
*/
|
||||
public function ajaxDataAction(Book $book)
|
||||
{
|
||||
return array(
|
||||
'book' => $book,
|
||||
);
|
||||
}
|
||||
/**
|
||||
* @Route("/konyvadat/{id}/ajax.{_format}", name="KekRozsakFrontBundle_bookAjaxData", defaults={"_format": "html"}, options={"expose": true})
|
||||
* @Template()
|
||||
* @ParamConverter("book")
|
||||
*/
|
||||
public function ajaxDataAction(Book $book)
|
||||
{
|
||||
return array(
|
||||
'book' => $book,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/konyv/torles/{id}", name="KekRozsakFrontBundle_bookDeleteCopy", requirements={"id": "\d+"}, options={"expose": true})
|
||||
* @ParamConverter("book")
|
||||
*/
|
||||
public function ajaxDeleteBookAction(Book $book)
|
||||
{
|
||||
$copies = $book->getUsersCopies($this->get('security.context')->getToken()->getUser());
|
||||
$em = $this->getDoctrine()->getEntityManager();
|
||||
$copies->forAll(function($key, $copy) use ($book, $em) {
|
||||
$book->removeCopy($copy);
|
||||
$em->remove($copy);
|
||||
});
|
||||
$em->persist($book);
|
||||
$em->flush();
|
||||
/**
|
||||
* @Route("/konyv/torles/{id}", name="KekRozsakFrontBundle_bookDeleteCopy", requirements={"id": "\d+"}, options={"expose": true})
|
||||
* @ParamConverter("book")
|
||||
*/
|
||||
public function ajaxDeleteBookAction(Book $book)
|
||||
{
|
||||
$copies = $book->getUsersCopies($this->get('security.context')->getToken()->getUser());
|
||||
$em = $this->getDoctrine()->getEntityManager();
|
||||
$copies->forAll(function($key, $copy) use ($book, $em)
|
||||
{
|
||||
$book->removeCopy($copy);
|
||||
$em->remove($copy);
|
||||
});
|
||||
$em->persist($book);
|
||||
$em->flush();
|
||||
|
||||
return new Response();
|
||||
}
|
||||
return new Response();
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/konyv/ujpeldany/{id}", name="KekRozsakFrontBundle_bookAddCopy", requirements={"id": "\d+"}, options={"expose": true})
|
||||
* @ParamConverter("book")
|
||||
*/
|
||||
public function ajaxAddBookAction(Book $book)
|
||||
{
|
||||
$user = $this->get('security.context')->getToken()->getUser();
|
||||
$copies = $book->getUsersCopies($user);
|
||||
if ($copies->count() == 0)
|
||||
{
|
||||
$copy = new BookCopy($book, $user);
|
||||
$em = $this->getDoctrine()->getEntityManager();
|
||||
$em->persist($copy);
|
||||
$em->flush();
|
||||
}
|
||||
/**
|
||||
* @Route("/konyv/ujpeldany/{id}", name="KekRozsakFrontBundle_bookAddCopy", requirements={"id": "\d+"}, options={"expose": true})
|
||||
* @ParamConverter("book")
|
||||
*/
|
||||
public function ajaxAddCopyAction(Book $book)
|
||||
{
|
||||
$user = $this->get('security.context')->getToken()->getUser();
|
||||
$copies = $book->getUsersCopies($user);
|
||||
if ($copies->count() == 0) {
|
||||
$copy = new BookCopy($book, $user);
|
||||
$em = $this->getDoctrine()->getEntityManager();
|
||||
$em->persist($copy);
|
||||
$em->flush();
|
||||
}
|
||||
|
||||
return new Response();
|
||||
}
|
||||
return new Response();
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/konyv/kolcsonozheto/{id}/{newValue}", name="KekRozsakFrontBundle_bookSetCopyBorrowable", requirements={"id": "\d+"}, options={"expose": true})
|
||||
* @ParamConverter("book")
|
||||
*/
|
||||
public function ajaxSetBookCopyBorrowableAction(Book $book, $newValue)
|
||||
{
|
||||
$user = $this->get('security.context')->getToken()->getUser();
|
||||
$copies = $book->getUsersCopies($user);
|
||||
$em = $this->getDoctrine()->getEntityManager();
|
||||
$copies->forAll(function($key, $copy) use ($em, $newValue) {
|
||||
$copy->setBorrowable($newValue);
|
||||
$em->persist($copy);
|
||||
});
|
||||
$em->flush();
|
||||
return new Response();
|
||||
}
|
||||
/**
|
||||
* @Route("/konyv/kolcsonozheto/{id}/{newValue}", name="KekRozsakFrontBundle_bookSetCopyBorrowable", requirements={"id": "\d+"}, options={"expose": true})
|
||||
* @ParamConverter("book")
|
||||
*/
|
||||
public function ajaxSetBookCopyBorrowableAction(Book $book, $newValue)
|
||||
{
|
||||
$user = $this->get('security.context')->getToken()->getUser();
|
||||
$copies = $book->getUsersCopies($user);
|
||||
$em = $this->getDoctrine()->getEntityManager();
|
||||
$copies->forAll(function($key, $copy) use ($em, $newValue)
|
||||
{
|
||||
$copy->setBorrowable($newValue);
|
||||
$em->persist($copy);
|
||||
});
|
||||
$em->flush();
|
||||
|
||||
/**
|
||||
* @Route("/konyv/megveheto/{id}/{newValue}", name="KekRozsakFrontBundle_bookSetCopyForSale", requirements={"id": "\d+"}, options={"expose": true})
|
||||
* @ParamConverter("book")
|
||||
*/
|
||||
public function ajaxSetBookCopyForSaleAction(Book $book, $newValue)
|
||||
{
|
||||
$user = $this->get('security.context')->getToken()->getUser();
|
||||
$copies = $book->getUsersCopies($user);
|
||||
$em = $this->getDoctrine()->getEntityManager();
|
||||
$copies->forAll(function($key, $copy) use ($em, $newValue) {
|
||||
$copy->setBuyable($newValue);
|
||||
$em->persist($copy);
|
||||
});
|
||||
$em->flush();
|
||||
return new Response();
|
||||
}
|
||||
return new Response();
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/konyv/szeretnek/{id}/{wantToBuy}", name="KekRozsakFrontBundle_bookWantOne", requirements={"id": "\d+"}, options={"expose": true})
|
||||
* @ParamConverter("book")
|
||||
*/
|
||||
public function ajaxWantABookAction(Book $book, $wantToBuy)
|
||||
{
|
||||
$user = $this->get('security.context')->getToken()->getUser();
|
||||
if ($wantToBuy)
|
||||
{
|
||||
$book->addWouldBuy($user);
|
||||
}
|
||||
else
|
||||
{
|
||||
$book->addWouldBorrow($user);
|
||||
}
|
||||
$em = $this->getDoctrine()->getEntityManager();
|
||||
$em->persist($book);
|
||||
$em->flush();
|
||||
return new Response();
|
||||
}
|
||||
/**
|
||||
* @Route("/konyv/megveheto/{id}/{newValue}", name="KekRozsakFrontBundle_bookSetCopyForSale", requirements={"id": "\d+"}, options={"expose": true})
|
||||
* @ParamConverter("book")
|
||||
*/
|
||||
public function ajaxSetBookCopyForSaleAction(Book $book, $newValue)
|
||||
{
|
||||
$user = $this->get('security.context')->getToken()->getUser();
|
||||
$copies = $book->getUsersCopies($user);
|
||||
$em = $this->getDoctrine()->getEntityManager();
|
||||
$copies->forAll(function($key, $copy) use ($em, $newValue)
|
||||
{
|
||||
$copy->setBuyable($newValue);
|
||||
$em->persist($copy);
|
||||
});
|
||||
$em->flush();
|
||||
|
||||
return new Response();
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/konyv/szeretnek/{id}/{wantToBuy}", name="KekRozsakFrontBundle_bookWantOne", requirements={"id": "\d+"}, options={"expose": true})
|
||||
* @ParamConverter("book")
|
||||
*/
|
||||
public function ajaxWantABookAction(Book $book, $wantToBuy)
|
||||
{
|
||||
$user = $this->get('security.context')->getToken()->getUser();
|
||||
|
||||
if ($wantToBuy) {
|
||||
$book->addWouldBuy($user);
|
||||
} else {
|
||||
$book->addWouldBorrow($user);
|
||||
}
|
||||
|
||||
$em = $this->getDoctrine()->getEntityManager();
|
||||
$em->persist($book);
|
||||
$em->flush();
|
||||
|
||||
return new Response();
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -15,50 +15,58 @@ use KekRozsak\SecurityBundle\Form\Type\UserType;
|
||||
|
||||
class DefaultController extends Controller
|
||||
{
|
||||
/**
|
||||
* @Route("/", name="KekRozsakFrontBundle_homepage")
|
||||
*/
|
||||
public function homepageAction()
|
||||
{
|
||||
$mainPageArticle = $this->getDoctrine()->getRepository('KekRozsakFrontBundle:Article')->findOneBy(array('mainPage' => true), true, array('createdAt', 'DESC'), 1);
|
||||
if (!$mainPageArticle)
|
||||
throw $this->createNotFoundException('A keresett cikk nem létezik!');
|
||||
/**
|
||||
* @Route("/", name="KekRozsakFrontBundle_homepage")
|
||||
*/
|
||||
public function homepageAction()
|
||||
{
|
||||
$mainPageArticle = $this
|
||||
->getDoctrine()
|
||||
->getRepository('KekRozsakFrontBundle:Article')
|
||||
->findOneBy(
|
||||
array('mainPage' => true),
|
||||
true,
|
||||
array('createdAt', 'DESC'),
|
||||
1
|
||||
);
|
||||
if (!$mainPageArticle) {
|
||||
throw $this->createNotFoundException('A keresett cikk nem létezik!');
|
||||
}
|
||||
|
||||
return $this->forward('KekRozsakFrontBundle:Article:view', array('slug' => $mainPageArticle->getSlug()));
|
||||
}
|
||||
return $this->forward('KekRozsakFrontBundle:Article:view', array('slug' => $mainPageArticle->getSlug()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/profil", name="KekRozsakFrontBundle_profile_edit")
|
||||
* @Template("KekRozsakFrontBundle:Default:userprofile.html.twig")
|
||||
*/
|
||||
public function profileEditAction()
|
||||
{
|
||||
$user = $this->get('security.context')->getToken()->getUser();
|
||||
/**
|
||||
* @Route("/profil", name="KekRozsakFrontBundle_profile_edit")
|
||||
* @Template("KekRozsakFrontBundle:Default:userprofile.html.twig")
|
||||
*/
|
||||
public function profileEditAction()
|
||||
{
|
||||
$user = $this->get('security.context')->getToken()->getUser();
|
||||
|
||||
$oldPassword = $user->getPassword();
|
||||
$form = $this->createForm(new UserType(), $user);
|
||||
$saveSuccess = false;
|
||||
$request = $this->getRequest();
|
||||
$oldPassword = $user->getPassword();
|
||||
$form = $this->createForm(new UserType(), $user);
|
||||
$saveSuccess = false;
|
||||
$request = $this->getRequest();
|
||||
|
||||
if ($request->getMethod() == 'POST')
|
||||
{
|
||||
$form->bind($request);
|
||||
if ($form->isValid())
|
||||
{
|
||||
if ($user->getPassword() == '')
|
||||
$user->setPassword($oldPassword);
|
||||
else
|
||||
$user->setPassword($this->get('security.encoder_factory')->getEncoder($user)->encodePassword($user->getPassword(), $user->getSalt()));
|
||||
if ($request->getMethod() == 'POST') {
|
||||
$form->bind($request);
|
||||
if ($form->isValid()) {
|
||||
if ($user->getPassword() == '') {
|
||||
$user->setPassword($oldPassword);
|
||||
} else {
|
||||
$user->setPassword($this->get('security.encoder_factory')->getEncoder($user)->encodePassword($user->getPassword(), $user->getSalt()));
|
||||
}
|
||||
|
||||
$em = $this->getDoctrine()->getEntityManager();
|
||||
$em->persist($user);
|
||||
$em->flush();
|
||||
}
|
||||
}
|
||||
$em = $this->getDoctrine()->getEntityManager();
|
||||
$em->persist($user);
|
||||
$em->flush();
|
||||
}
|
||||
}
|
||||
|
||||
return array(
|
||||
'form' => $form->createView(),
|
||||
'saveSuccess' => $saveSuccess,
|
||||
);
|
||||
}
|
||||
return array(
|
||||
'form' => $form->createView(),
|
||||
'saveSuccess' => $saveSuccess,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -13,93 +13,101 @@ use KekRozsak\FrontBundle\Extensions\Slugifier;
|
||||
|
||||
class DocumentController extends Controller
|
||||
{
|
||||
/**
|
||||
* @Route("/dokumentum/{slug}.{_format}", name="KekRozsakFrontBundle_documentView", defaults={"_format": "html"}, requirements={"_format": "html|pdf"})
|
||||
* @Template()
|
||||
* @ParamConverter("document")
|
||||
*/
|
||||
public function viewAction(Document $document, $_format)
|
||||
{
|
||||
$templateParams = array(
|
||||
'document' => $document,
|
||||
);
|
||||
/**
|
||||
* @Route("/dokumentum/{slug}.{_format}", name="KekRozsakFrontBundle_documentView", defaults={"_format": "html"}, requirements={"_format": "html|pdf"})
|
||||
* @Template()
|
||||
* @ParamConverter("document")
|
||||
*/
|
||||
public function viewAction(Document $document, $_format)
|
||||
{
|
||||
$templateParams = array(
|
||||
'document' => $document,
|
||||
);
|
||||
|
||||
if ($_format == 'pdf')
|
||||
{
|
||||
$html = $this->renderView('KekRozsakFrontBundle:Document:pdfView.html.twig', $templateParams);
|
||||
return $this->get('io_tcpdf')->quick_pdf($html);
|
||||
}
|
||||
if ($_format == 'pdf') {
|
||||
$html = $this->renderView(
|
||||
'KekRozsakFrontBundle:Document:pdfView.html.twig',
|
||||
$templateParams
|
||||
);
|
||||
return $this->get('io_tcpdf')->quick_pdf($html);
|
||||
}
|
||||
|
||||
return $templateParams;
|
||||
}
|
||||
return $templateParams;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/dokumentumok/uj/", name="KekRozsakFrontBundle_documentCreate")
|
||||
* @Template()
|
||||
*/
|
||||
public function createAction()
|
||||
{
|
||||
$document = new Document();
|
||||
$document->setSlug('n-a');
|
||||
$form = $this->createForm(new DocumentType(), $document);
|
||||
$request = $this->getRequest();
|
||||
/**
|
||||
* @Route("/dokumentumok/uj/", name="KekRozsakFrontBundle_documentCreate")
|
||||
* @Template()
|
||||
*/
|
||||
public function createAction()
|
||||
{
|
||||
$document = new Document();
|
||||
$document->setSlug('n-a');
|
||||
$form = $this->createForm(new DocumentType(), $document);
|
||||
$request = $this->getRequest();
|
||||
|
||||
if ($request->getMethod() == 'POST')
|
||||
{
|
||||
$form->bind($request);
|
||||
if ($request->getMethod() == 'POST') {
|
||||
$form->bind($request);
|
||||
|
||||
if ($form->isValid())
|
||||
{
|
||||
/* TODO: move these lines into life cycle events */
|
||||
$slugifier = new Slugifier();
|
||||
$document->setSlug($slugifier->slugify($document->getTitle()));
|
||||
$document->setCreatedAt(new \DateTime('now'));
|
||||
$document->setCreatedBy($this->get('security.context')->getToken()->getUser());
|
||||
if ($form->isValid()) {
|
||||
// TODO: move these lines into life cycle events
|
||||
$slugifier = new Slugifier();
|
||||
$document->setSlug($slugifier->slugify($document->getTitle()));
|
||||
$document->setCreatedAt(new \DateTime('now'));
|
||||
$document->setCreatedBy($this->get('security.context')->getToken()->getUser());
|
||||
|
||||
$em = $this->getDoctrine()->getEntityManager();
|
||||
$em->persist($document);
|
||||
$em->flush();
|
||||
$em = $this->getDoctrine()->getEntityManager();
|
||||
$em->persist($document);
|
||||
$em->flush();
|
||||
|
||||
return $this->redirect($this->generateUrl('KekRozsakFrontBundle_documentView', array('slug' => $document->getSlug())));
|
||||
}
|
||||
}
|
||||
return $this->redirect(
|
||||
$this->generateUrl(
|
||||
'KekRozsakFrontBundle_documentView',
|
||||
array('slug' => $document->getSlug())
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return array(
|
||||
'form' => $form->createView(),
|
||||
);
|
||||
}
|
||||
return array(
|
||||
'form' => $form->createView(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/dokumentum/{slug}/szerkesztes", name="KekRozsakFrontBundle_documentEdit")
|
||||
* @Template()
|
||||
* @ParamConverter("document")
|
||||
*/
|
||||
public function editAction(Document $document)
|
||||
{
|
||||
$form = $this->createForm(new DocumentType(), $document);
|
||||
$request = $this->getRequest();
|
||||
/**
|
||||
* @Route("/dokumentum/{slug}/szerkesztes", name="KekRozsakFrontBundle_documentEdit")
|
||||
* @Template()
|
||||
* @ParamConverter("document")
|
||||
*/
|
||||
public function editAction(Document $document)
|
||||
{
|
||||
$form = $this->createForm(new DocumentType(), $document);
|
||||
$request = $this->getRequest();
|
||||
|
||||
if ($request->getMethod() == 'POST')
|
||||
{
|
||||
$form->bind($request);
|
||||
if ($form->isValid())
|
||||
{
|
||||
/* TODO: move these lines into life cycle events */
|
||||
$slugifier = new Slugifier();
|
||||
$document->setSlug($slugifier->slugify($document->getTitle()));
|
||||
// TODO: add updatedAt, updatedBy, updateReason, etc.
|
||||
if ($request->getMethod() == 'POST') {
|
||||
$form->bind($request);
|
||||
if ($form->isValid()) {
|
||||
// TODO: move these lines into life cycle events
|
||||
$slugifier = new Slugifier();
|
||||
$document->setSlug($slugifier->slugify($document->getTitle()));
|
||||
// TODO: add updatedAt, updatedBy, updateReason, etc.
|
||||
|
||||
$em = $this->getDoctrine()->getEntityManager();
|
||||
$em->persist($document);
|
||||
$em->flush();
|
||||
$em = $this->getDoctrine()->getEntityManager();
|
||||
$em->persist($document);
|
||||
$em->flush();
|
||||
|
||||
return $this->redirect($this->generateUrl('KekRozsakFrontBundle_documentView', array('slug' => $document->getSlug())));
|
||||
}
|
||||
}
|
||||
return $this->redirect(
|
||||
$this->generateUrl(
|
||||
'KekRozsakFrontBundle_documentView',
|
||||
array('slug' => $document->getSlug())
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return array(
|
||||
'document' => $document,
|
||||
'form' => $form->createView(),
|
||||
);
|
||||
}
|
||||
return array(
|
||||
'document' => $document,
|
||||
'form' => $form->createView(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -12,89 +12,91 @@ use KekRozsak\FrontBundle\Entity\Event;
|
||||
|
||||
class EventController extends Controller
|
||||
{
|
||||
/**
|
||||
* @Route("/esesmeny/{startDate}/{eventSlug}", name="KekRozsakFrontBundle_eventView")
|
||||
* @Template()
|
||||
* @ParamConverter("event", class="KekRozsakFrontBundle:Event", options={"mapping"={"eventSlug" = "slug", "startDate"="startDate"}})
|
||||
* @ParamConverter("startDate", class="DateTime", options={"format"="Y-m-d"})
|
||||
*/
|
||||
public function viewAction(\DateTime $startDate, Event $event)
|
||||
{
|
||||
if ($event->getGroup() !== null)
|
||||
{
|
||||
if (!$event->getGroup()->isMember($this->get('security.context')->getToken()->getUser()))
|
||||
throw new AccessDeniedException('Ehhez az eseményhez nem csatlakozhatsz, mivel a csoportjának nem vagy tagja.');
|
||||
}
|
||||
|
||||
return array(
|
||||
'event' => $event,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/esemeny/{startDate}/{eventSlug}/csatlakozas", name="KekRozsakFrontBundle_eventJoin")
|
||||
* @Template()
|
||||
* @ParamConverter("event", class="KekRozsakFrontBundle:Event", options={"mapping"={"eventSlug": "slug", "startDate": "startDate"}})
|
||||
* @ParamConverter("startDate", class="DateTime", options={"format"="Y-m-d"})
|
||||
*/
|
||||
public function joinAction(\DateTime $startDate, Event $event)
|
||||
{
|
||||
if ($event->getGroup() !== null)
|
||||
{
|
||||
if (!$event->getGroup()->isMember($this->get('security.context')->getToken()->getUser()))
|
||||
throw new AccessDeniedException('Ehhez az eseményhez nem csatlakozhatsz, mivel a csoportjának nem vagy tagja.');
|
||||
}
|
||||
|
||||
$event->addAttendee($this->get('security.context')->getToken()->getUser());
|
||||
|
||||
$em = $this->getDoctrine()->getEntityManager();
|
||||
$em->persist($event);
|
||||
$em->flush();
|
||||
|
||||
return $this->redirect($this->generateUrl('KekRozsakFrontBundle_eventView', array(
|
||||
'eventDate' => $eventDate,
|
||||
'eventSlug' => $eventSlug,
|
||||
)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/esemenyek/{date}", name="KekRozsakFrontBundle_eventList", defaults={"date": null})
|
||||
* @Template()
|
||||
*/
|
||||
public function listAction($date = null)
|
||||
{
|
||||
$realDate = null;
|
||||
|
||||
if ($date === null) {
|
||||
$query = $this->getDoctrine()->getEntityManager()->createQuery('SELECT e FROM KekRozsakFrontBundle:Event e WHERE e.cancelled = FALSE AND (e.startDate >= :day OR (e.startDate <= :day AND e.endDate >= :day))');
|
||||
$query->setParameter('day', new \DateTime('now'), \Doctrine\DBAL\Types\Type::DATE);
|
||||
} else {
|
||||
$realDate = \DateTime::createFromFormat('Y-m-d', $date);
|
||||
$query = $this->getDoctrine()->getEntityManager()->createQuery('SELECT e FROM KekRozsakFrontBundle:Event e WHERE e.cancelled = FALSE AND ((e.startDate < :day AND e.endDate >= :day) OR e.startDate = :day)');
|
||||
$query->setParameter('day', $realDate, \Doctrine\DBAL\Types\Type::DATE);
|
||||
/**
|
||||
* @Route("/esesmeny/{startDate}/{eventSlug}", name="KekRozsakFrontBundle_eventView")
|
||||
* @Template()
|
||||
* @ParamConverter("event", class="KekRozsakFrontBundle:Event", options={"mapping"={"eventSlug" = "slug", "startDate"="startDate"}})
|
||||
* @ParamConverter("startDate", class="DateTime", options={"format"="Y-m-d"})
|
||||
*/
|
||||
public function viewAction(\DateTime $startDate, Event $event)
|
||||
{
|
||||
if ($event->getGroup() !== null) {
|
||||
if (!$event->getGroup()->isMember($this->get('security.context')->getToken()->getUser())) {
|
||||
throw new AccessDeniedException('Ehhez az eseményhez nem csatlakozhatsz, mivel a csoportjának nem vagy tagja.');
|
||||
}
|
||||
$events = $query->getResult();
|
||||
}
|
||||
|
||||
return array(
|
||||
'day' => $realDate,
|
||||
'events' => $events,
|
||||
);
|
||||
}
|
||||
return array(
|
||||
'event' => $event,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/esemenyek/{date}/ajax-lista.{_format}", name="KekRozsakFrontBundle_eventAjaxList", requirements={"_format": "html"})
|
||||
* @Template()
|
||||
* @ParamConverter("date", options={"format": "Y-m-d"})
|
||||
*/
|
||||
public function ajaxListAction(\DateTime $date)
|
||||
{
|
||||
$query = $this->getDoctrine()->getEntityManager()->createQuery('SELECT e FROM KekRozsakFrontBundle:Event e WHERE e.cancelled = FALSE AND ((e.startDate < :day AND e.endDate >= :day) OR e.startDate = :day)');
|
||||
$query->setParameter('day', $date, \Doctrine\DBAL\Types\Type::DATE);
|
||||
$events = $query->getResult();
|
||||
/**
|
||||
* @Route("/esemeny/{startDate}/{eventSlug}/csatlakozas", name="KekRozsakFrontBundle_eventJoin")
|
||||
* @Template()
|
||||
* @ParamConverter("event", class="KekRozsakFrontBundle:Event", options={"mapping"={"eventSlug": "slug", "startDate": "startDate"}})
|
||||
* @ParamConverter("startDate", class="DateTime", options={"format"="Y-m-d"})
|
||||
*/
|
||||
public function joinAction(\DateTime $startDate, Event $event)
|
||||
{
|
||||
$user = $this->get('security.context')->getToken()->getUser();
|
||||
|
||||
return array(
|
||||
'day' => $date,
|
||||
'events' => $events,
|
||||
);
|
||||
}
|
||||
if ($event->getGroup() !== null) {
|
||||
if (!$event->getGroup()->isMember($user)) {
|
||||
throw new AccessDeniedException('Ehhez az eseményhez nem csatlakozhatsz, mivel a csoportjának nem vagy tagja.');
|
||||
}
|
||||
}
|
||||
|
||||
$event->addAttendee($user);
|
||||
|
||||
$em = $this->getDoctrine()->getEntityManager();
|
||||
$em->persist($event);
|
||||
$em->flush();
|
||||
|
||||
return $this->redirect($this->generateUrl('KekRozsakFrontBundle_eventView', array(
|
||||
'eventDate' => $eventDate,
|
||||
'eventSlug' => $eventSlug,
|
||||
)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/esemenyek/{date}", name="KekRozsakFrontBundle_eventList", defaults={"date": null})
|
||||
* @Template()
|
||||
*/
|
||||
public function listAction($date = null)
|
||||
{
|
||||
$realDate = null;
|
||||
|
||||
if ($date === null) {
|
||||
$query = $this->getDoctrine()->getEntityManager()->createQuery('SELECT e FROM KekRozsakFrontBundle:Event e WHERE e.cancelled = FALSE AND (e.startDate >= :day OR (e.startDate <= :day AND e.endDate >= :day))');
|
||||
$query->setParameter('day', new \DateTime('now'), \Doctrine\DBAL\Types\Type::DATE);
|
||||
} else {
|
||||
$realDate = \DateTime::createFromFormat('Y-m-d', $date);
|
||||
$query = $this->getDoctrine()->getEntityManager()->createQuery('SELECT e FROM KekRozsakFrontBundle:Event e WHERE e.cancelled = FALSE AND ((e.startDate < :day AND e.endDate >= :day) OR e.startDate = :day)');
|
||||
$query->setParameter('day', $realDate, \Doctrine\DBAL\Types\Type::DATE);
|
||||
}
|
||||
$events = $query->getResult();
|
||||
|
||||
return array(
|
||||
'day' => $realDate,
|
||||
'events' => $events,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/esemenyek/{date}/ajax-lista.{_format}", name="KekRozsakFrontBundle_eventAjaxList", requirements={"_format": "html"})
|
||||
* @Template()
|
||||
* @ParamConverter("date", options={"format": "Y-m-d"})
|
||||
*/
|
||||
public function ajaxListAction(\DateTime $date)
|
||||
{
|
||||
$query = $this->getDoctrine()->getEntityManager()->createQuery('SELECT e FROM KekRozsakFrontBundle:Event e WHERE e.cancelled = FALSE AND ((e.startDate < :day AND e.endDate >= :day) OR e.startDate = :day)');
|
||||
$query->setParameter('day', $date, \Doctrine\DBAL\Types\Type::DATE);
|
||||
$events = $query->getResult();
|
||||
|
||||
return array(
|
||||
'day' => $date,
|
||||
'events' => $events,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -17,77 +17,90 @@ use KekRozsak\FrontBundle\Form\Type\ForumPostType;
|
||||
*/
|
||||
class ForumController extends Controller
|
||||
{
|
||||
/**
|
||||
* @Route("", name="KekRozsakFrontBundle_forumTopicGroupList")
|
||||
* @Template()
|
||||
*/
|
||||
public function topicGroupListAction()
|
||||
{
|
||||
$groupRepo = $this->getDoctrine()->getRepository('KekRozsakFrontBundle:ForumTopicGroup');
|
||||
/**
|
||||
* @Route("", name="KekRozsakFrontBundle_forumTopicGroupList")
|
||||
* @Template()
|
||||
*/
|
||||
public function topicGroupListAction()
|
||||
{
|
||||
$groupRepo = $this->getDoctrine()->getRepository('KekRozsakFrontBundle:ForumTopicGroup');
|
||||
|
||||
// TODO: ORDER the topic list by last post date
|
||||
$topicGroups = $groupRepo->findAll();
|
||||
// TODO: ORDER the topic list by last post date
|
||||
$topicGroups = $groupRepo->findAll();
|
||||
|
||||
return array(
|
||||
'topicGroups' => $topicGroups,
|
||||
);
|
||||
}
|
||||
return array(
|
||||
'topicGroups' => $topicGroups,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/{slug}", name="KekRozsakFrontBundle_forumTopicList")
|
||||
* @Template()
|
||||
* @ParamConverter("topicGroup")
|
||||
*/
|
||||
public function topicListAction(ForumTopicgRoup $topicGroup)
|
||||
{
|
||||
return array(
|
||||
'topicGroup' => $topicGroup,
|
||||
);
|
||||
}
|
||||
/**
|
||||
* @Route("/{slug}", name="KekRozsakFrontBundle_forumTopicList")
|
||||
* @Template()
|
||||
* @ParamConverter("topicGroup")
|
||||
*/
|
||||
public function topicListAction(ForumTopicgRoup $topicGroup)
|
||||
{
|
||||
return array(
|
||||
'topicGroup' => $topicGroup,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/{topicGroupSlug}/{topicSlug}", name="KekRozsakFrontBundle_forumPostList")
|
||||
* @Template()
|
||||
* @ParamConverter("topic", options={"mapping"={"topicGroup"="topicGroup", "topicSlug"="slug"}})
|
||||
* @ParamConverter("topicGroup", options={"mapping"={"topicGroupSlug"="slug"}})
|
||||
*/
|
||||
public function postListAction(ForumTopicGroup $topicGroup, ForumTopic $topic)
|
||||
{
|
||||
// Get the list of posts in the requested topic
|
||||
$postRepo = $this->getDoctrine()->getRepository('KekRozsakFrontBundle:ForumPost');
|
||||
$posts = $postRepo->findBy(array('topic' => $topic), array('createdAt' => 'DESC') /* TODO: , limit, offset */);
|
||||
/**
|
||||
* @Route("/{topicGroupSlug}/{topicSlug}", name="KekRozsakFrontBundle_forumPostList")
|
||||
* @Template()
|
||||
* @ParamConverter("topic", options={"mapping"={"topicGroup"="topicGroup", "topicSlug"="slug"}})
|
||||
* @ParamConverter("topicGroup", options={"mapping"={"topicGroupSlug"="slug"}})
|
||||
*/
|
||||
public function postListAction(ForumTopicGroup $topicGroup, ForumTopic $topic)
|
||||
{
|
||||
// Get the list of posts in the requested topic
|
||||
$postRepo = $this->getDoctrine()->getRepository('KekRozsakFrontBundle:ForumPost');
|
||||
$posts = $postRepo->findBy(
|
||||
array('topic' => $topic),
|
||||
array('createdAt' => 'DESC')
|
||||
/* TODO: , limit, offset */
|
||||
);
|
||||
|
||||
// Create an empty post object for posting
|
||||
$post = new ForumPost();
|
||||
$form = $this->createForm(new ForumPostType($topicGroup->getId(), $topic->getId()), $post);
|
||||
// Create an empty post object for posting
|
||||
$post = new ForumPost();
|
||||
$form = $this->createForm(
|
||||
new ForumPostType(
|
||||
$topicGroup->getId(),
|
||||
$topic->getId()
|
||||
),
|
||||
$post
|
||||
);
|
||||
|
||||
$request = $this->getRequest();
|
||||
if ($request->getMethod() == 'POST')
|
||||
{
|
||||
$form->bind($request);
|
||||
if ($form->isValid())
|
||||
{
|
||||
$post->setCreatedAt(new \DateTime('now'));
|
||||
$post->setCreatedBy($this->get('security.context')->getToken()->getUser());
|
||||
$post->setTopic($topic);
|
||||
$request = $this->getRequest();
|
||||
if ($request->getMethod() == 'POST') {
|
||||
$form->bind($request);
|
||||
if ($form->isValid()) {
|
||||
$post->setCreatedAt(new \DateTime('now'));
|
||||
$post->setCreatedBy($this->get('security.context')->getToken()->getUser());
|
||||
$post->setTopic($topic);
|
||||
|
||||
$em = $this->getDoctrine()->getEntityManager();
|
||||
$em->persist($post);
|
||||
$em->persist($topic);
|
||||
$em->flush();
|
||||
$em = $this->getDoctrine()->getEntityManager();
|
||||
$em->persist($post);
|
||||
$em->persist($topic);
|
||||
$em->flush();
|
||||
|
||||
return $this->redirect($this->generateUrl('KekRozsakFrontBundle_forumPostList', array(
|
||||
return $this->redirect(
|
||||
$this->generateUrl(
|
||||
'KekRozsakFrontBundle_forumPostList',
|
||||
array(
|
||||
'topicGroupSlug' => $topicGroup->getSlug(),
|
||||
'topicSlug' => $topic->getSlug(),
|
||||
)));
|
||||
}
|
||||
}
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return array(
|
||||
'topicGroup' => $topicGroup,
|
||||
'topic' => $topic,
|
||||
'posts' => $posts,
|
||||
'form' => $form->createView(),
|
||||
);
|
||||
}
|
||||
return array(
|
||||
'topicGroup' => $topicGroup,
|
||||
'topic' => $topic,
|
||||
'posts' => $posts,
|
||||
'form' => $form->createView(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -16,151 +16,147 @@ use KekRozsak\FrontBundle\Extensions\Slugifier;
|
||||
|
||||
class GroupController extends Controller
|
||||
{
|
||||
/**
|
||||
* @Route("/csoportok", name="KekRozsakFrontBundle_groupList")
|
||||
* @Template()
|
||||
*/
|
||||
public function listAction()
|
||||
{
|
||||
$groupRepo = $this->getDoctrine()->getRepository('KekRozsakFrontBundle:Group');
|
||||
$groups = $groupRepo->findAll(array('name' => 'ASC'));
|
||||
/**
|
||||
* @Route("/csoportok", name="KekRozsakFrontBundle_groupList")
|
||||
* @Template()
|
||||
*/
|
||||
public function listAction()
|
||||
{
|
||||
$groupRepo = $this
|
||||
->getDoctrine()
|
||||
->getRepository('KekRozsakFrontBundle:Group');
|
||||
$groups = $groupRepo->findAll(array('name' => 'ASC'));
|
||||
|
||||
return array(
|
||||
'groups' => $groups,
|
||||
);
|
||||
}
|
||||
return array(
|
||||
'groups' => $groups,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/csoport/{slug}", name="KekRozsakFrontBundle_groupView")
|
||||
* @Template()
|
||||
* @ParamConverter("group")
|
||||
*/
|
||||
public function viewAction(Group $group)
|
||||
{
|
||||
return array(
|
||||
'group' => $group,
|
||||
);
|
||||
}
|
||||
/**
|
||||
* @Route("/csoport/{slug}", name="KekRozsakFrontBundle_groupView")
|
||||
* @Template()
|
||||
* @ParamConverter("group")
|
||||
*/
|
||||
public function viewAction(Group $group)
|
||||
{
|
||||
return array(
|
||||
'group' => $group,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/csoport/{slug}/tagok", name="KekRozsakFrontBundle_groupMembers")
|
||||
* @Template()
|
||||
* @ParamConverter("group")
|
||||
*/
|
||||
public function membersAction(Group $group)
|
||||
{
|
||||
return array(
|
||||
'group' => $group,
|
||||
);
|
||||
}
|
||||
/**
|
||||
* @Route("/csoport/{slug}/tagok", name="KekRozsakFrontBundle_groupMembers")
|
||||
* @Template()
|
||||
* @ParamConverter("group")
|
||||
*/
|
||||
public function membersAction(Group $group)
|
||||
{
|
||||
return array(
|
||||
'group' => $group,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/csoport/{slug}/dokumentumok", name="KekRozsakFrontBundle_groupDocuments")
|
||||
* @Template()
|
||||
* @ParamConverter("group")
|
||||
*/
|
||||
public function documentsAction(Group $group)
|
||||
{
|
||||
return array(
|
||||
'group' => $group,
|
||||
);
|
||||
}
|
||||
/**
|
||||
* @Route("/csoport/{slug}/dokumentumok", name="KekRozsakFrontBundle_groupDocuments")
|
||||
* @Template()
|
||||
* @ParamConverter("group")
|
||||
*/
|
||||
public function documentsAction(Group $group)
|
||||
{
|
||||
return array(
|
||||
'group' => $group,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/csoport/{slug}/belepes", name="KekRozsakFrontBundle_groupJoin")
|
||||
* @Template()
|
||||
* @ParamConverter("group")
|
||||
*/
|
||||
public function joinAction(Group $group)
|
||||
{
|
||||
$user = $this->get('security.context')->getToken()->getUser();
|
||||
/**
|
||||
* @Route("/csoport/{slug}/belepes", name="KekRozsakFrontBundle_groupJoin")
|
||||
* @Template()
|
||||
* @ParamConverter("group")
|
||||
*/
|
||||
public function joinAction(Group $group)
|
||||
{
|
||||
$user = $this->get('security.context')->getToken()->getUser();
|
||||
|
||||
if ($group->isMember($user))
|
||||
{
|
||||
return $this->redirect($this->generateUrl('KekRozsakFrontBundle_groupView', array('slug' => $group->getSlug())));
|
||||
}
|
||||
if ($group->isMember($user)) {
|
||||
return $this->redirect($this->generateUrl('KekRozsakFrontBundle_groupView', array('slug' => $group->getSlug())));
|
||||
}
|
||||
|
||||
if ($group->isRequested($user))
|
||||
{
|
||||
return array(
|
||||
'isRequested' => true,
|
||||
'needApproval' => false,
|
||||
'group' => $group,
|
||||
);
|
||||
}
|
||||
if ($group->isRequested($user)) {
|
||||
return array(
|
||||
'isRequested' => true,
|
||||
'needApproval' => false,
|
||||
'group' => $group,
|
||||
);
|
||||
}
|
||||
|
||||
$membership = new UserGroupMembership($user, $group);
|
||||
$membership->setUser($user);
|
||||
$membership->setGroup($group);
|
||||
$membership->setMembershipRequestedAt(new \DateTime('now'));
|
||||
if ($group->isOpen())
|
||||
{
|
||||
$membership->setMembershipAcceptedAt(new \DateTime('now'));
|
||||
}
|
||||
$membership = new UserGroupMembership($user, $group);
|
||||
$membership->setUser($user);
|
||||
$membership->setGroup($group);
|
||||
$membership->setMembershipRequestedAt(new \DateTime('now'));
|
||||
if ($group->isOpen()) {
|
||||
$membership->setMembershipAcceptedAt(new \DateTime('now'));
|
||||
}
|
||||
|
||||
$em = $this->getDoctrine()->getEntityManager();
|
||||
$em->persist($membership);
|
||||
$em->flush();
|
||||
$em = $this->getDoctrine()->getEntityManager();
|
||||
$em->persist($membership);
|
||||
$em->flush();
|
||||
|
||||
if ($group->isOpen())
|
||||
{
|
||||
return $this->redirect($this->generateUrl('KekRozsakFrontBundle_groupView', array('slug' => $group->getSlug())));
|
||||
}
|
||||
else
|
||||
{
|
||||
$message = \Swift_Message::newInstance()
|
||||
->setSubject('Új jelentkező a csoportodban (' . $group->getName() . '): ' . $user->getDisplayName())
|
||||
// TODO: Make this a config parameter!
|
||||
->setFrom('info@blueroses.hu')
|
||||
->setTo($group->getLeader()->getEmail())
|
||||
->setBody($this->renderView('KekRozsakFrontBundle:Email:groupJoinRequest.txt.twig', array('user' => $user, 'group' => $group)));
|
||||
$this->get('mailer')->send($message);
|
||||
if ($group->isOpen()) {
|
||||
return $this->redirect($this->generateUrl('KekRozsakFrontBundle_groupView', array('slug' => $group->getSlug())));
|
||||
} else {
|
||||
$message = \Swift_Message::newInstance()
|
||||
->setSubject('Új jelentkező a csoportodban (' . $group->getName() . '): ' . $user->getDisplayName())
|
||||
// TODO: Make this a config parameter!
|
||||
->setFrom('info@blueroses.hu')
|
||||
->setTo($group->getLeader()->getEmail())
|
||||
->setBody($this->renderView('KekRozsakFrontBundle:Email:groupJoinRequest.txt.twig', array('user' => $user, 'group' => $group)));
|
||||
$this->get('mailer')->send($message);
|
||||
|
||||
return array(
|
||||
'isRequested' => false,
|
||||
'needApproval' => true,
|
||||
'group' => $group,
|
||||
);
|
||||
}
|
||||
}
|
||||
return array(
|
||||
'isRequested' => false,
|
||||
'needApproval' => true,
|
||||
'group' => $group,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/csoportok/uj", name="KekRozsakFrontBundle_groupCreate")
|
||||
* @Template()
|
||||
*/
|
||||
public function createAction()
|
||||
{
|
||||
$group = new Group();
|
||||
$form = $this->createForm(new GroupType(), $group);
|
||||
$request = $this->getRequest();
|
||||
/**
|
||||
* @Route("/csoportok/uj", name="KekRozsakFrontBundle_groupCreate")
|
||||
* @Template()
|
||||
*/
|
||||
public function createAction()
|
||||
{
|
||||
$group = new Group();
|
||||
$form = $this->createForm(new GroupType(), $group);
|
||||
$request = $this->getRequest();
|
||||
|
||||
if ($request->getMethod() == 'POST')
|
||||
{
|
||||
$form->bind($request);
|
||||
if ($form->isValid())
|
||||
{
|
||||
$slugifier = new Slugifier();
|
||||
$user = $this->get('security.context')->getToken()->getUser();
|
||||
if ($request->getMethod() == 'POST') {
|
||||
$form->bind($request);
|
||||
if ($form->isValid()) {
|
||||
$slugifier = new Slugifier();
|
||||
$user = $this->get('security.context')->getToken()->getUser();
|
||||
|
||||
$group->setCreatedBy($user);
|
||||
$group->setSlug($slugifier->slugify($group->getName()));
|
||||
$group->setCreatedAt(new \DateTime('now'));
|
||||
$group->setOpen(true);
|
||||
$group->setCreatedBy($user);
|
||||
$group->setSlug($slugifier->slugify($group->getName()));
|
||||
$group->setCreatedAt(new \DateTime('now'));
|
||||
$group->setOpen(true);
|
||||
|
||||
$em = $this->getDoctrine()->getEntityManager();
|
||||
$em->persist($group);
|
||||
$em->flush();
|
||||
$em = $this->getDoctrine()->getEntityManager();
|
||||
$em->persist($group);
|
||||
$em->flush();
|
||||
|
||||
$membership = new UserGroupMembership($user, $group);
|
||||
$em->persist($membership);
|
||||
$em->flush();
|
||||
$membership = new UserGroupMembership($user, $group);
|
||||
$em->persist($membership);
|
||||
$em->flush();
|
||||
|
||||
return $this->redirect($this->generateUrl('KekRozsakFrontBundle_groupList'));
|
||||
}
|
||||
}
|
||||
return $this->redirect(
|
||||
$this->generateUrl('KekRozsakFrontBundle_groupList')
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return array(
|
||||
'form' => $form->createView(),
|
||||
);
|
||||
}
|
||||
return array(
|
||||
'form' => $form->createView(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user