00001 <?php
00002
00017 import('lib.pkp.classes.controllers.grid.GridHandler');
00018 import('controllers.grid.files.fileSignoff.AuthorSignoffFilesGridRow');
00019
00020 class AuthorSignoffFilesGridHandler extends GridHandler {
00021
00026 function AuthorSignoffFilesGridHandler($stageId, $symbolic) {
00027 import('controllers.grid.files.fileSignoff.AuthorSignoffFilesGridDataProvider');
00028 parent::GridHandler(new AuthorSignoffFilesGridDataProvider($symbolic, $stageId));
00029
00030 $this->addRoleAssignment(
00031 array(ROLE_ID_AUTHOR),
00032 array('fetchGrid', 'fetchRow', 'signOffFiles')
00033 );
00034 }
00035
00036
00037
00042 function getStageId() {
00043 $dataProvider =& $this->getDataProvider();
00044 return $dataProvider->getStageId();
00045 }
00046
00047
00048
00049
00053 function initialize(&$request) {
00054 parent::initialize($request);
00055
00056 AppLocale::requireComponents(
00057 LOCALE_COMPONENT_PKP_COMMON,
00058 LOCALE_COMPONENT_APPLICATION_COMMON,
00059 LOCALE_COMPONENT_PKP_SUBMISSION,
00060 LOCALE_COMPONENT_OMP_SUBMISSION
00061 );
00062
00063 $user =& $request->getUser();
00064
00065 $gridDataProvider =& $this->getDataProvider();
00066 $gridDataProvider->setUserId($user->getId());
00067
00068 $addSignoffFileLinkAction = $gridDataProvider->getAddSignoffFile($request);
00069 if ($addSignoffFileLinkAction) {
00070 $this->addAction($addSignoffFileLinkAction);
00071 }
00072
00073
00074 import('controllers.grid.files.FileNameGridColumn');
00075 $this->addColumn(new FileNameGridColumn(true, $this->getStageId()));
00076
00077 import('controllers.grid.files.fileSignoff.AuthorSignoffFilesGridCellProvider');
00078 $monograph =& $this->getAuthorizedContextObject(ASSOC_TYPE_MONOGRAPH);
00079 $cellProvider = new AuthorSignoffFilesGridCellProvider($monograph, $this->getStageId());
00080
00081
00082 $this->addColumn(
00083 new GridColumn(
00084 'response',
00085 'submission.response',
00086 null,
00087 'controllers/grid/gridCell.tpl',
00088 $cellProvider,
00089 array('alignment' => COLUMN_ALIGNMENT_LEFT))
00090 );
00091 }
00092
00093
00094
00095
00099 function &getRowInstance() {
00100 $row = new AuthorSignoffFilesGridRow($this->getStageId());
00101 return $row;
00102 }
00103 }
00104
00105 ?>