00001 <?php
00002
00015
00016 import('controllers.grid.submissions.SubmissionsListGridHandler');
00017 import('controllers.grid.submissions.SubmissionsListGridRow');
00018
00019
00020 define('FILTER_EDITOR_ALL', 0);
00021 define('FILTER_EDITOR_ME', 1);
00022
00023 class AssignedSubmissionsListGridHandler extends SubmissionsListGridHandler {
00027 function AssignedSubmissionsListGridHandler() {
00028 parent::GridHandler();
00029 $this->addRoleAssignment(
00030 array(ROLE_ID_SITE_ADMIN, ROLE_ID_PRESS_MANAGER, ROLE_ID_SERIES_EDITOR, ROLE_ID_REVIEWER, ROLE_ID_PRESS_ASSISTANT),
00031 array('fetchGrid')
00032 );
00033 }
00034
00035
00036
00037
00038
00042 function initialize(&$request) {
00043 parent::initialize($request);
00044
00045
00046 $this->setTitle('common.queue.long.myAssigned');
00047 }
00048
00049
00050
00051
00052
00056 function getSubmissions(&$request, $userId) {
00057 $monographDao =& DAORegistry::getDAO('MonographDAO');
00058 $userGroupDao =& DAORegistry::getDAO('UserGroupDAO');
00059 $signoffDao =& DAORegistry::getDAO('SignoffDAO');
00060 $stageAssignmentDao =& DAORegistry::getDAO('StageAssignmentDAO');
00061 $authorDao =& DAORegistry::getDAO('AuthorDAO');
00062
00063
00064 $signoffs =& $signoffDao->getByUserId($userId);
00065
00066 $authorUserGroupIds = $userGroupDao->getUserGroupIdsByRoleId(ROLE_ID_AUTHOR);
00067
00068 $data = array();
00069
00070
00071 $stageAssignments =& $stageAssignmentDao->getByUserId($userId);
00072 while($stageAssignment =& $stageAssignments->next()) {
00073 $monograph =& $monographDao->getById($stageAssignment->getSubmissionId());
00074 if ($monograph->getDateSubmitted() == null) { continue; };
00075
00076 if ($monograph->getDatePublished() != null) { continue; }
00077
00078
00079 if ($userId == $monograph->getUserId()) { continue; };
00080
00081 $monographId = $monograph->getId();
00082 $data[$monographId] = $monograph;
00083 unset($monograph, $stageAssignment, $authors);
00084 }
00085
00086 while($signoff =& $signoffs->next()) {
00087
00088
00089 if( $signoff->getAssocType() == ASSOC_TYPE_MONOGRAPH &&
00090 !in_array($signoff->getUserGroupId(), $authorUserGroupIds)) {
00091 $monograph =& $monographDao->getById($signoff->getAssocId());
00092 $monographId = $monograph->getId();
00093 $data[$monographId] = $monograph;
00094 unset($monograph);
00095 }
00096 unset($signoff);
00097 }
00098
00099
00100 $reviewerSubmissionDao =& DAORegistry::getDAO('ReviewerSubmissionDAO');
00101 $reviewerSubmissions = $reviewerSubmissionDao->getReviewerSubmissionsByReviewerId($userId);
00102 while($reviewerSubmission =& $reviewerSubmissions->next()) {
00103 $monographId = $reviewerSubmission->getId();
00104 if (!isset($data[$monographId])) {
00105
00106
00107
00108 $data[$monographId] = $reviewerSubmission;
00109 }
00110 unset($reviewerSubmission);
00111 }
00112
00113 return $data;
00114 }
00115
00116
00117
00118
00119
00124 function &getRowInstance() {
00125 $row = new SubmissionsListGridRow();
00126 return $row;
00127 }
00128 }
00129
00130 ?>