/** * Lists all Institution entities. * */ public function institutionIndexAction() { $data = array(); $source = new Entity('OjsJournalBundle:Institution', 'application'); $tableAlias = $source->getTableAlias(); $source->manipulateQuery(function (QueryBuilder $query) use($tableAlias) { $query->andWhere($tableAlias . ".status = :status")->setParameter('status', 0); return $query; }); $source->addHint(Query::HINT_CUSTOM_OUTPUT_WALKER, 'Gedmo\\Translatable\\Query\\TreeWalker\\TranslationWalker'); $grid = $this->get('grid')->setSource($source); $gridAction = $this->get('grid_action'); $grid->getColumn('status')->manipulateRenderCell(function ($value, $row, $router) { return $this->get('translator')->trans(CommonParams::institutionStatus($row->getField('status'))); }); $rowAction = array(); $rowAction[] = $gridAction->editAction('ojs_admin_application_institution_edit', 'id'); $rowAction[] = $gridAction->showAction('ojs_admin_application_institution_show', 'id'); $rowAction[] = $gridAction->deleteAction('ojs_admin_application_institution_delete', 'id'); $actionColumn = new ActionsColumn("actions", 'actions'); $actionColumn->setRowActions($rowAction); $grid->addColumn($actionColumn); $data['grid'] = $grid; return $grid->getGridResponse('OjsAdminBundle:AdminApplication:institution.html.twig', $data); }
/** * @param FormBuilderInterface $builder * @param array $options */ public function buildForm(FormBuilderInterface $builder, array $options) { $builder->add('translations', 'a2lix_translations_gedmo', ['translatable_class' => 'Ojs\\JournalBundle\\Entity\\Journal', 'fields' => ['title' => ['label' => 'title'], 'subtitle' => ['locale_options' => ['tr' => ['display' => false], 'en' => ['display' => false], 'fr' => ['display' => false]]]], 'error_bubbling' => true])->add('titleAbbr', 'text', ['label' => 'titleabbr', 'error_bubbling' => true])->add('titleTransliterated', 'text', ['label' => 'titleTransliterated', 'error_bubbling' => true])->add('institution', null, ['label' => 'institution', 'attr' => ['class' => 'select2-element validate[required]'], 'error_bubbling' => true])->add('mandatoryLang', 'entity', ['label' => 'Mandatory Lang', 'class' => 'Ojs\\JournalBundle\\Entity\\Lang', 'attr' => ['class' => 'select2-element '], 'error_bubbling' => true])->add('languages', 'entity', array('label' => 'Supported Languages', 'class' => 'Ojs\\JournalBundle\\Entity\\Lang', 'property' => 'name', 'multiple' => true, 'expanded' => false, 'required' => false, 'attr' => ['class' => 'select2-element validate[required]'], 'error_bubbling' => true))->add('subjects', 'entity', ['label' => 'subjects', 'class' => 'Ojs\\JournalBundle\\Entity\\Subject', 'property' => 'subject', 'multiple' => true, 'attr' => ['class' => 'select2-element'], 'error_bubbling' => true]); $builder->add('subtitle', 'hidden', ['label' => 'subtitle'])->add('path', 'hidden', ['label' => 'journal.path', 'error_bubbling' => true])->add('domain', 'hidden', ['label' => 'journal.domain', 'error_bubbling' => true])->add('issn', 'text', array('label' => 'ISSN', 'attr' => array('class' => 'maskissn'), 'error_bubbling' => true))->add('eissn', 'text', array('label' => 'eISSN', 'attr' => array('class' => 'maskissn'), 'error_bubbling' => true))->add('firstPublishDate', 'collot_datetime', array('label' => 'journal.firstPublishDate', 'date_format' => 'dd-MM-yyyy', 'pickerOptions' => ['format' => 'dd-mm-yyyy', 'startView' => 'month', 'minView' => 'month', 'todayBtn' => 'true', 'todayHighlight' => 'true', 'autoclose' => 'true'], 'error_bubbling' => true))->add('domain')->add('period', 'text', ['label' => 'journal.period', 'error_bubbling' => true])->add('googleAnalyticsId', 'text', ['label' => 'journal.google.analytics.id', 'error_bubbling' => true])->add('url', 'text', ['label' => 'url'])->add('country', 'entity', ['label' => 'country', 'class' => 'Ojs\\LocationBundle\\Entity\\Country', 'attr' => ['class' => 'select2-element '], 'error_bubbling' => true])->add('footer_text', 'textarea', ['label' => 'footer_text', 'attr' => ['class' => 'wysihtml5 '], 'error_bubbling' => true])->add('published', 'checkbox', ['label' => 'published', 'error_bubbling' => true])->add('printed', 'checkbox', ['label' => 'printed', 'error_bubbling' => true])->add('status', 'choice', ['label' => 'status', 'choices' => CommonParams::getStatusTexts(), 'error_bubbling' => true])->add('image', 'hidden')->add('header', 'hidden')->add('logo', 'hidden')->add('slug', 'text', ['label' => 'journal.slug', 'error_bubbling' => true])->add('tags', 'tags')->add('description', 'textarea', ['label' => 'description', 'error_bubbling' => true, 'attr' => ['class' => 'validate[required]']])->add('theme', 'entity', array('label' => 'theme', 'class' => 'Ojs\\JournalBundle\\Entity\\Theme', 'property' => 'title', 'multiple' => false, 'expanded' => false, 'required' => false, 'query_builder' => function (EntityRepository $er) { return $er->createQueryBuilder('t')->where('t.isPublic IS NULL OR t.isPublic = TRUE'); }, 'error_bubbling' => true)); }
/** * @param FormBuilderInterface $builder * @param array $options */ public function buildForm(FormBuilderInterface $builder, array $options) { /** @var Journal $journal */ $journal = $options['journal']; $builder->add('translations', 'a2lix_translations_gedmo', ['translatable_class' => 'Ojs\\JournalBundle\\Entity\\Article', 'fields' => ['title' => ['field_type' => 'text'], 'titleTransliterated' => [], 'subtitle' => [], 'subjects' => [], 'keywords' => ['label' => 'keywords', 'field_type' => 'tags'], 'abstract' => ['required' => false, 'attr' => array('class' => ' form-control wysihtml5'), 'field_type' => 'textarea']]])->add('issue', 'entity', array('label' => 'issue', 'class' => 'Ojs\\JournalBundle\\Entity\\Issue', 'required' => false, 'attr' => array('class' => ' form-control select2-element'), 'query_builder' => function (EntityRepository $er) use($journal) { $qb = $er->createQueryBuilder('i'); $qb->where('i.journal = :journal')->setParameter('journal', $journal); return $qb; }))->add('status', 'choice', array('label' => 'status', 'attr' => array('class' => ' form-control'), 'choices' => CommonParams::statusText()))->add('doi', 'text', array('label' => 'doi', 'required' => false, 'attr' => array('class' => ' form-control')))->add('otherId', 'text', array('label' => 'otherid', 'required' => false, 'attr' => array('class' => ' form-control')))->add('isAnonymous', 'radio', array('label' => 'isAnonymous', 'required' => false))->add('pubdate', 'collot_datetime', array('label' => 'pubdate', 'date_format' => 'dd-MM-yyyy', 'pickerOptions' => ['format' => 'dd-mm-yyyy', 'startView' => 'month', 'minView' => 'month', 'todayBtn' => 'true', 'todayHighlight' => 'true', 'autoclose' => 'true']))->add('pubdateSeason', 'text', array('label' => 'Pubdateseason', 'required' => false, 'attr' => array('class' => ' form-control')))->add('part', 'text', array('label' => 'part', 'required' => false, 'attr' => array('class' => ' form-control')))->add('firstPage', 'integer', array('label' => 'first_page', 'required' => false, 'attr' => array('class' => ' form-control')))->add('lastPage', 'integer', array('label' => 'last_page', 'required' => false, 'attr' => array('class' => ' form-control')))->add('uri', 'text', array('label' => 'url', 'required' => false, 'attr' => array('class' => ' form-control')))->add('abstractTransliterated', 'textarea', array('label' => 'abstractTransliterated', 'required' => false, 'attr' => array('class' => ' form-control')))->add('articleType', 'entity', array('label' => 'article.type', 'class' => 'Ojs\\JournalBundle\\Entity\\ArticleTypes', 'required' => false))->add('orderNum', 'integer', array('label' => 'order', 'required' => false))->add('submissionDate', 'collot_datetime', array('label' => 'submissionDate', 'date_format' => 'dd-MM-yyyy', 'pickerOptions' => ['format' => 'dd-mm-yyyy', 'startView' => 'month', 'minView' => 'month', 'todayBtn' => 'true', 'todayHighlight' => 'true', 'autoclose' => 'true']))->add('header', 'hidden')->add('tags', 'tags'); }
/** * Returns status text string from given status integer value * @param integer $arg * @return string */ public function statusText($arg) { $texts = CommonParams::getStatusTexts(); return isset($texts[$arg]) ? $this->translator->trans($texts[$arg]) : null; }