Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
CitationGridHandler.inc.php
1 <?php
2 
16 import('lib.pkp.classes.controllers.grid.citation.PKPCitationGridHandler');
17 
18 // import validation classes
19 import('classes.handler.validation.HandlerValidatorJournal');
20 import('lib.pkp.classes.handler.validation.HandlerValidatorRoles');
21 
22 class CitationGridHandler extends PKPCitationGridHandler {
26  function CitationGridHandler() {
27  parent::PKPCitationGridHandler();
28  $this->addRoleAssignment(
29  array(ROLE_ID_MANAGER, ROLE_ID_SERIES_EDITOR),
30  array('fetchGrid', 'addCitation', 'editCitation', 'updateRawCitation',
31  'checkCitation', 'updateCitation', 'deleteCitation', 'exportCitations',
32  'fetchCitationFormErrorsAndComparison', 'sendAuthorQuery'));
33  }
34 
35 
36  //
37  // Implement template methods from PKPHandler
38  //
42  function authorize($request, &$args, $roleAssignments) {
43  // Make sure the user can edit the submission in the request.
44  import('classes.security.authorization.OjsSubmissionAccessPolicy');
45  $this->addPolicy(new OjsSubmissionAccessPolicy($request, $args, $roleAssignments, 'assocId'));
46  return parent::authorize($request, $args, $roleAssignments);
47  }
48 
52  function initialize($request, $args) {
53  // Associate the citation editor with the authorized article.
54  $this->setAssocType(ASSOC_TYPE_SUBMISSION);
55  $article = $this->getAuthorizedContextObject(ASSOC_TYPE_SUBMISSION);
56  assert(is_a($article, 'Submission'));
57  $this->setAssocObject($submission);
58 
59  parent::initialize($request, $args);
60  }
61 
62  //
63  // Override methods from PKPCitationGridHandler
64  //
68  function exportCitations($args, $request) {
69  $dispatcher = $this->getDispatcher();
70  $articleMetadataUrl = $dispatcher->url($request, ROUTE_PAGE, null, 'editor', 'viewMetadata', $this->getAssocId());
71  $noCitationsFoundMessage = __("submission.citations.editor.pleaseImportCitationsFirst", array('articleMetadataUrl' => $articleMetadataUrl));
72  return parent::exportCitations($args, $request, $noCitationsFoundMessage);
73  }
74 }
addPolicy($authorizationPolicy, $addToTop=false)
authorize($request, &$args, $roleAssignments)
addRoleAssignment($roleIds, $operations)
Handle OJS specific parts of citation grid requests.
exportCitations($args, $request)
& getAuthorizedContextObject($assocType)