public function newAction()
{
$journal = $this->get('ojs.journal_service')->getSelectedJournal();
$this->throw404IfNotFound($journal);
if (!$this->isGranted('CREATE', $journal, 'articles')) {
throw new AccessDeniedException("You not authorized for this page!");
}
$entity = new Article();
$form = $this->createCreateForm($entity, $journal);
$em = $this->getDoctrine()->getManager();
$submissionSetting = $em->getRepository('OjsJournalBundle:SubmissionSetting')->findOneBy([]);
$abstractTemplates = [];
if ($submissionSetting) {
/** @var SubmissionSettingTranslation $translation */
foreach ($submissionSetting->getTranslations() as $translation) {
$abstractTemplates[$translation->getLocale()] = $translation->getSubmissionAbstractTemplate();
}
}
$data = ['entity' => $entity, 'form' => $form->createView(), 'abstractTemplates' => $abstractTemplates, 'dispatch' => true];
return $this->render('OjsJournalBundle:Article:new.html.twig', $data);
}