• Main Page
  • Modules
  • Classes
  • Files
  • File List

pages/workflow/PublicationFormatHandler.inc.php

00001 <?php
00002 
00015 import('classes.handler.Handler');
00016 
00017 // import UI base classes
00018 import('lib.pkp.classes.linkAction.LinkAction');
00019 import('lib.pkp.classes.linkAction.request.AjaxModal');
00020 
00021 class PublicationFormatHandler extends Handler {
00025    function PublicationFormatHandler() {
00026       parent::Handler();
00027 
00028       $this->addRoleAssignment(
00029          array(ROLE_ID_SERIES_EDITOR, ROLE_ID_PRESS_MANAGER, ROLE_ID_PRESS_ASSISTANT),
00030          array('fetchPublicationFormat')
00031       );
00032    }
00033 
00034 
00035    //
00036    // Implement template methods from PKPHandler
00037    //
00041    function authorize(&$request, $args, $roleAssignments) {
00042       // Get the publication Format Policy
00043       import('classes.security.authorization.internal.PublicationFormatRequiredPolicy');
00044       $publicationFormatPolicy = new PublicationFormatRequiredPolicy($request, $args);
00045 
00046       // Get the workflow stage policy
00047       import('classes.security.authorization.OmpWorkflowStageAccessPolicy');
00048       $stagePolicy = new OmpWorkflowStageAccessPolicy($request, $args, $roleAssignments, 'monographId', WORKFLOW_STAGE_ID_PRODUCTION);
00049 
00050       // Add the Publication Format policy to the stage policy.
00051       $stagePolicy->addPolicy($publicationFormatPolicy);
00052 
00053       // Add the augmented policy to the handler.
00054       $this->addPolicy($stagePolicy);
00055       return parent::authorize($request, $args, $roleAssignments);
00056    }
00057 
00061    function initialize(&$request, $args) {
00062       $this->setupTemplate();
00063    }
00064 
00069    function setupTemplate() {
00070       parent::setupTemplate();
00071       AppLocale::requireComponents(LOCALE_COMPONENT_PKP_SUBMISSION, LOCALE_COMPONENT_OMP_SUBMISSION, LOCALE_COMPONENT_OMP_EDITOR);
00072 
00073       $templateMgr =& TemplateManager::getManager();
00074 
00075       $monograph =& $this->getAuthorizedContextObject(ASSOC_TYPE_MONOGRAPH);
00076       $stageId = $this->getAuthorizedContextObject(ASSOC_TYPE_WORKFLOW_STAGE);
00077       $publicationFormat =& $this->getAuthorizedContextObject(ASSOC_TYPE_PUBLICATION_FORMAT);
00078 
00079       // Assign the authorized monograph.
00080       $templateMgr->assign_by_ref('monograph', $monograph);
00081       $templateMgr->assign('stageId', $stageId);
00082       $templateMgr->assign_by_ref('publicationFormat', $publicationFormat);
00083    }
00084 
00085 
00086    //
00087    // Public operations
00088    //
00094    function fetchPublicationFormat($args, $request) {
00095       // Fetch the template
00096       $templateMgr =& TemplateManager::getManager();
00097       return $templateMgr->fetchJson('workflow/publicationFormat.tpl');
00098    }
00099 }
00100 
00101 ?>

Generated on Mon Sep 17 2012 13:58:56 for Open Monograph Press by  doxygen 1.7.1