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

controllers/grid/files/FileSignoffGridColumn.inc.php

00001 <?php
00002 
00015 import('lib.pkp.classes.controllers.grid.GridColumn');
00016 
00017 class FileSignoffGridColumn extends GridColumn {
00018 
00020    var $_signoffUserGroup;
00021 
00022 
00028    function FileSignoffGridColumn(&$signoffUserGroup) {
00029       // Configure the column.
00030       import('lib.pkp.classes.controllers.grid.ColumnBasedGridCellProvider');
00031       $cellProvider = new ColumnBasedGridCellProvider();
00032       parent::GridColumn(
00033          'signoff-'.$signoffUserGroup->getId(),
00034          null,
00035          $signoffUserGroup->getLocalizedAbbrev(),
00036          'controllers/grid/common/cell/statusCell.tpl',
00037          $cellProvider
00038       );
00039    }
00040 
00041 
00042    //
00043    // Getters and Setters
00044    //
00049    function &getsignoffUserGroup() {
00050       return $this->_signoffUserGroup;
00051    }
00052 
00053 
00054    //
00055    // Public methods
00056    //
00063    function getTemplateVarsFromRow($row) {
00064       // Retrieve the monograph file.
00065       $monographFile =& $row->getData(); /* @var $monographFile MonographFile */
00066       assert(is_a($monographFile, 'MonographFile'));
00067 
00068       // By default we return an empty cell.
00069       $templateVars = array('status' => '');
00070 
00071       // Find out whether the uploader of the current file
00072       // belongs to the user group displayed in this column.
00073       $signoffUserGroup =& $this->getsignoffUserGroup();
00074       if ($signoffUserGroup->getId() == $monographFile->getUserGroupId()) {
00075          // Show that this column's user group is the uploading
00076          // user group.
00077          $templateVars = array('status' => 'uploaded');
00078       }
00079 
00080       return $templateVars;
00081    }
00082 }
00083 
00084 ?>

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