Skip to content

Commit

Permalink
*5557* Fixed automatic series editor assignment in SubmissionSubmitForm
Browse files Browse the repository at this point in the history
  • Loading branch information
mcrider committed Sep 3, 2010
1 parent 1c87d58 commit d838885
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions classes/submission/form/submit/SubmissionSubmitForm.inc.php
Expand Up @@ -79,23 +79,17 @@ function display() {
* @return array of series editors
*/
function assignEditors(&$monograph) {
/* FIXME #5557: Assign users as per permission spec:
- A user group that has been checked in the settings for a given
workflow stage will automatically appear at the top of the stage for new
submissions, awaiting assignment to a user in that group.
- If there is only one user assigned to a given user group then that
user will be preassigned by default.
*/

$seriesId = $monograph->getSeriesId();
$press =& Request::getPress();

$seriesEditorsDao =& DAORegistry::getDAO('SeriesEditorsDAO');
$signoffDao =& DAORegistry::getDAO('SignoffDAO');
$userGroupDao =& DAORegistry::getDAO('UserGroupDAO');
$seriesEditors =& $seriesEditorsDao->getEditorsBySeriesId($press->getId(), $seriesId);

$seriesEditorUserGroup = $userGroupDao->getDefaultByRoleId($press->getId(), ROLE_ID_SERIES_EDITOR);
foreach ($seriesEditors as $seriesEditorEntry) {
$signoffDao->build('SIGNOFF_STAGE', ASSOC_TYPE_MONOGRAPH, $monograph->getId(), WORKFLOW_STAGE_ID_SUBMISSION, $seriesEditorEntry['user']->getId(), ROLE_ID_SERIES_EDITOR);
$signoffDao->build('SIGNOFF_STAGE', ASSOC_TYPE_MONOGRAPH, $monograph->getId(), WORKFLOW_STAGE_ID_SUBMISSION, $seriesEditorEntry['user']->getId(), $seriesEditorUserGroup->getId());
}

return $seriesEditors;
Expand Down

0 comments on commit d838885

Please sign in to comment.