public function editAction(Request $request)
{
$journal = $this->get('ojs.journal_service')->getSelectedJournal();
if (!$this->isGranted('EDIT', $journal, 'submissionSettings')) {
throw new AccessDeniedException("You are not authorized for edit this journal's section!");
}
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('OjsJournalBundle:SubmissionSetting')->findOneBy([]);
if (!$entity) {
$entity = $this->createSubmissionSetting($journal);
}
$editForm = $this->createEditForm($entity);
$editForm->handleRequest($request);
if ($editForm->isValid() && $request->getMethod() == 'PUT') {
$em->flush();
$this->successFlashBag('successful.update');
}
return $this->render('OjsJournalBundle:SubmissionSetting:edit.html.twig', array('entity' => $entity, 'form' => $editForm->createView()));
}