Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
ProofFilesListbuilderHandler.inc.php
1 <?php
2 
16 import('lib.pkp.controllers.listbuilder.files.FilesListbuilderHandler');
17 
23  // Get access to the monograph file constants.
24  import('classes.monograph.MonographFile');
25  parent::FilesListbuilderHandler(SUBMISSION_FILE_PROOF);
26  }
27 
28 
29  //
30  // Implement template methods from PKPHandler
31  //
35  function authorize($request, &$args, $roleAssignments) {
36  import('classes.security.authorization.internal.PublicationFormatRequiredPolicy');
37  $this->addPolicy(new PublicationFormatRequiredPolicy($request, $args));
38  return parent::authorize($request, $args, $roleAssignments, WORKFLOW_STAGE_ID_PRODUCTION);
39  }
40 
41 
46  function initialize($request) {
47  parent::initialize($request);
48  AppLocale::requireComponents(LOCALE_COMPONENT_APP_EDITOR);
49  $this->setTitle('editor.monograph.selectProofreadingFiles');
50  }
51 
52  //
53  // Implement methods from FilesListbuilderHandler
54  //
58  function getOptions() {
59  import('classes.monograph.MonographFile');
60  $monograph = $this->getAuthorizedContextObject(ASSOC_TYPE_MONOGRAPH);
61  $publicationFormat = $this->getAuthorizedContextObject(ASSOC_TYPE_PUBLICATION_FORMAT);
62 
63  $submissionFileDao = DAORegistry::getDAO('SubmissionFileDAO'); /* @var $submissionFileDao SubmissionFileDAO */
64  $monographFiles = $submissionFileDao->getLatestRevisionsByAssocId(
65  ASSOC_TYPE_PUBLICATION_FORMAT, $publicationFormat->getId(),
66  $monograph->getId(), $this->getFileStage()
67  );
68 
69  return parent::getOptions($monographFiles);
70  }
71 
75  function getRequestArgs() {
76  $publicationFormat = $this->getAuthorizedContextObject(ASSOC_TYPE_PUBLICATION_FORMAT);
77  $args = parent::getRequestArgs();
78  $args['publicationFormatId'] = $publicationFormat->getId();
79  return $args;
80  }
81 }
82 
83 ?>
static & getDAO($name, $dbconn=null)
addPolicy($authorizationPolicy, $addToTop=false)
Class for selecting files to add a user to for copyediting.
Policy that ensures that the request contains a valid publication format.
static requireComponents()
authorize($request, &$args, $roleAssignments)
Base class for selecting files to add a user to.
& getAuthorizedContextObject($assocType)