addRoleAssignment( array(ROLE_ID_EDITOR, ROLE_ID_SECTION_EDITOR), array('fetchGrid', 'addCitation', 'editCitation', 'updateRawCitation', 'checkCitation', 'updateCitation', 'deleteCitation', 'exportCitations', 'fetchCitationFormErrorsAndComparison', 'sendAuthorQuery')); } // // Implement template methods from PKPHandler // /** * @see PKPHandler::authorize() */ function authorize(&$request, &$args, $roleAssignments) { // Make sure the user can edit the submission in the request. import('classes.security.authorization.OjsSubmissionAccessPolicy'); $this->addPolicy(new OjsSubmissionAccessPolicy($request, $args, $roleAssignments, 'assocId')); return parent::authorize($request, $args, $roleAssignments); } /** * @see PKPHandler::initialize() */ function initialize(&$request, $args) { // Associate the citation editor with the authorized article. $this->setAssocType(ASSOC_TYPE_ARTICLE); $article =& $this->getAuthorizedContextObject(ASSOC_TYPE_ARTICLE); assert(is_a($article, 'Article')); $this->setAssocObject($article); parent::initialize($request, $args); } // // Override methods from PKPCitationGridHandler // /** * @see PKPCitationGridHandler::exportCitations() */ function exportCitations($args, &$request) { $dispatcher =& $this->getDispatcher(); $articleMetadataUrl = $dispatcher->url($request, ROUTE_PAGE, null, 'editor', 'viewMetadata', $this->getAssocId()); $noCitationsFoundMessage = __("submission.citations.editor.pleaseImportCitationsFirst", array('articleMetadataUrl' => $articleMetadataUrl)); return parent::exportCitations($args, $request, $noCitationsFoundMessage); } }