本文整理汇总了PHP中SectionEditorAction::selectCopyeditor方法的典型用法代码示例。如果您正苦于以下问题:PHP SectionEditorAction::selectCopyeditor方法的具体用法?PHP SectionEditorAction::selectCopyeditor怎么用?PHP SectionEditorAction::selectCopyeditor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SectionEditorAction
的用法示例。
在下文中一共展示了SectionEditorAction::selectCopyeditor方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: selectCopyeditor
function selectCopyeditor($args)
{
$articleId = isset($args[0]) ? (int) $args[0] : 0;
list($journal, $submission) = SubmissionEditHandler::validate($articleId, SECTION_EDITOR_ACCESS_EDIT);
$roleDao =& DAORegistry::getDAO('RoleDAO');
if (isset($args[1]) && $args[1] != null && $roleDao->roleExists($journal->getJournalId(), $args[1], ROLE_ID_COPYEDITOR)) {
SectionEditorAction::selectCopyeditor($submission, $args[1]);
Request::redirect(null, null, 'submissionEditing', $articleId);
} else {
parent::setupTemplate(true, $articleId, 'editing');
$sectionEditorSubmissionDao =& DAORegistry::getDAO('SectionEditorSubmissionDAO');
$searchType = null;
$searchMatch = null;
$search = $searchQuery = Request::getUserVar('search');
$searchInitial = Request::getUserVar('searchInitial');
if (isset($search)) {
$searchType = Request::getUserVar('searchField');
$searchMatch = Request::getUserVar('searchMatch');
} else {
if (isset($searchInitial)) {
$searchInitial = String::strtoupper($searchInitial);
$searchType = USER_FIELD_INITIAL;
$search = $searchInitial;
}
}
$copyeditors = $roleDao->getUsersByRoleId(ROLE_ID_COPYEDITOR, $journal->getJournalId(), $searchType, $search, $searchMatch);
$copyeditorStatistics = $sectionEditorSubmissionDao->getCopyeditorStatistics($journal->getJournalId());
$templateMgr =& TemplateManager::getManager();
$templateMgr->assign('searchField', $searchType);
$templateMgr->assign('searchMatch', $searchMatch);
$templateMgr->assign('search', $searchQuery);
$templateMgr->assign('searchInitial', Request::getUserVar('searchInitial'));
$templateMgr->assign_by_ref('users', $copyeditors);
$templateMgr->assign('currentUser', $submission->getCopyeditorId());
$templateMgr->assign_by_ref('statistics', $copyeditorStatistics);
$templateMgr->assign('pageSubTitle', 'editor.article.selectCopyeditor');
$templateMgr->assign('pageTitle', 'user.role.copyeditors');
$templateMgr->assign('actionHandler', 'selectCopyeditor');
$templateMgr->assign('fieldOptions', array(USER_FIELD_FIRSTNAME => 'user.firstName', USER_FIELD_LASTNAME => 'user.lastName', USER_FIELD_USERNAME => 'user.username', USER_FIELD_EMAIL => 'user.email'));
$templateMgr->assign('articleId', $args[0]);
$templateMgr->assign('helpTopicId', 'journal.roles.copyeditor');
$templateMgr->assign('alphaList', explode(' ', Locale::translate('common.alphaList')));
$templateMgr->display('sectionEditor/selectUser.tpl');
}
}
示例2: selectCopyeditor
/**
* Select a copyeditor.
* @param $args array
* @param $request PKPRequest
*/
function selectCopyeditor($args, $request)
{
$articleId = (int) array_shift($args);
$userId = (int) array_shift($args);
$this->validate($articleId, SECTION_EDITOR_ACCESS_EDIT);
$journal =& $request->getJournal();
$submission =& $this->submission;
$roleDao =& DAORegistry::getDAO('RoleDAO');
if ($roleDao->userHasRole($journal->getId(), $userId, ROLE_ID_COPYEDITOR)) {
SectionEditorAction::selectCopyeditor($submission, $userId, $request);
$request->redirect(null, null, 'submissionEditing', $articleId);
} else {
$this->setupTemplate(true, $articleId, 'editing');
$sectionEditorSubmissionDao =& DAORegistry::getDAO('SectionEditorSubmissionDAO');
$searchType = null;
$searchMatch = null;
$search = $searchQuery = $request->getUserVar('search');
$searchInitial = $request->getUserVar('searchInitial');
if (!empty($search)) {
$searchType = $request->getUserVar('searchField');
$searchMatch = $request->getUserVar('searchMatch');
} elseif (!empty($searchInitial)) {
$searchInitial = String::strtoupper($searchInitial);
$searchType = USER_FIELD_INITIAL;
$search = $searchInitial;
}
$copyeditors = $roleDao->getUsersByRoleId(ROLE_ID_COPYEDITOR, $journal->getId(), $searchType, $search, $searchMatch);
$copyeditorStatistics = $sectionEditorSubmissionDao->getCopyeditorStatistics($journal->getId());
$templateMgr =& TemplateManager::getManager();
$templateMgr->assign('searchField', $searchType);
$templateMgr->assign('searchMatch', $searchMatch);
$templateMgr->assign('search', $searchQuery);
$templateMgr->assign('searchInitial', $request->getUserVar('searchInitial'));
$templateMgr->assign_by_ref('users', $copyeditors);
$templateMgr->assign('currentUser', $submission->getUserBySignoffType('SIGNOFF_COPYEDITING_INITIAL'));
$templateMgr->assign_by_ref('statistics', $copyeditorStatistics);
$templateMgr->assign('pageSubTitle', 'editor.article.selectCopyeditor');
$templateMgr->assign('pageTitle', 'user.role.copyeditors');
$templateMgr->assign('actionHandler', 'selectCopyeditor');
$templateMgr->assign('fieldOptions', array(USER_FIELD_FIRSTNAME => 'user.firstName', USER_FIELD_LASTNAME => 'user.lastName', USER_FIELD_USERNAME => 'user.username', USER_FIELD_EMAIL => 'user.email'));
$templateMgr->assign('articleId', $articleId);
$templateMgr->assign('helpTopicId', 'journal.roles.copyeditor');
$templateMgr->assign('alphaList', explode(' ', __('common.alphaList')));
$templateMgr->display('sectionEditor/selectUser.tpl');
}
}