/** * @copydoc GridHandler::initialize() */ function initialize($request) { $this->assocId = (int) $request->getRouter()->getContext($request)->getId(); $this->assocType = ASSOC_TYPE_PRESS; parent::initialize($request); import('controllers.modals.submissionMetadata.linkAction.MonographlessCatalogEntryLinkAction'); $catalogEntryAction = new MonographlessCatalogEntryLinkAction($request); $this->addAction($catalogEntryAction); }
/** * @copydoc GridHandler::initialize() */ function initialize($request) { $this->assocId = (int) $request->getUserVar('categoryId'); if (!$this->assocId) { // No specific category in request, get the press first one, if any. $pressId = $request->getRouter()->getContext($request)->getId(); $categoryFactory = DAORegistry::getDAO('CategoryDAO')->getByPressId($pressId); $category = $categoryFactory->next(); if ($category) { $this->assocId = $category->getId(); } } $this->assocType = ASSOC_TYPE_CATEGORY; parent::initialize($request); $userRoles = (array) $this->getAuthorizedContextObject(ASSOC_TYPE_USER_ROLES); if (array_intersect(array(ROLE_ID_MANAGER), $userRoles)) { import('lib.pkp.classes.linkAction.LinkAction'); import('lib.pkp.classes.linkAction.request.AjaxModal'); $dispatcher = $request->getDispatcher(); $manageCategoriesLinkAction = new LinkAction('manageCategories', new AjaxModal($dispatcher->url($request, ROUTE_PAGE, null, 'management', 'categories'), __('catalog.manage.manageCategories'), 'modal_manage', true), __('catalog.manage.manageCategories'), 'manage'); $this->addAction($manageCategoriesLinkAction); } }