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

controllers/grid/files/fileSignoff/AuthorSignoffFilesGridCellProvider.inc.php

00001 <?php
00002 
00015 import('lib.pkp.classes.controllers.grid.GridCellProvider');
00016 
00017 class AuthorSignoffFilesGridCellProvider extends GridCellProvider {
00018    /* @var Monograph */
00019    var $_monograph;
00020 
00021    /* @var int */
00022    var $_stageId;
00023 
00027    function AuthorSignoffFilesGridCellProvider(&$monograph, $stageId) {
00028       $this->_monograph =& $monograph;
00029       $this->_stageId = $stageId;
00030       parent::GridCellProvider();
00031    }
00032 
00037    function &getMonograph() {
00038       return $this->_monograph;
00039    }
00040 
00045    function getStageId() {
00046       return $this->_stageId;
00047    }
00048 
00054    function &getSignoff(&$row) {
00055       $rowData =& $row->getData();
00056       assert(is_a($rowData['signoff'], 'Signoff'));
00057       return $rowData['signoff'];
00058    }
00059 
00065    function &getSubmissionFile(&$row) {
00066       $rowData =& $row->getData();
00067       assert(is_a($rowData['submissionFile'], 'MonographFile'));
00068       return $rowData['submissionFile'];
00069    }
00070 
00078    function getCellActions(&$request, &$row, &$column, $position = GRID_ACTION_POSITION_DEFAULT) {
00079       if ($column->getId() == 'response') {
00080          $signoff =& $this->getSignoff($row);
00081          $monograph =& $this->getMonograph();
00082          if (!$signoff->getDateCompleted()) {
00083             import('controllers.api.signoff.linkAction.AddSignoffFileLinkAction');
00084             $addFileAction = new AddSignoffFileLinkAction(
00085                         $request, $monograph->getId(),
00086                         $this->getStageId(), $signoff->getSymbolic(), $signoff->getId(),
00087                         __('submission.upload.signoff'), __('submission.upload.signoff')
00088                         );
00089             // FIXME: This is not ideal.
00090             $addFileAction->_title = null;
00091             return array($addFileAction);
00092          }
00093 
00094          import('controllers.informationCenter.linkAction.SignoffNotesLinkAction');
00095          return array(new SignoffNotesLinkAction($request, $signoff, $monograph->getId(), $this->getStageId()));
00096       }
00097 
00098       return parent::getCellActions($request, $row, $column, $position);
00099    }
00100 }
00101 
00102 ?>

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