本文整理匯總了PHP中ProofreaderAction::selectProofreader方法的典型用法代碼示例。如果您正苦於以下問題:PHP ProofreaderAction::selectProofreader方法的具體用法?PHP ProofreaderAction::selectProofreader怎麽用?PHP ProofreaderAction::selectProofreader使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ProofreaderAction
的用法示例。
在下文中一共展示了ProofreaderAction::selectProofreader方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: selectProofreader
/**
* Select Proofreader.
* @param $args array ($articleId, $userId)
*/
function selectProofreader($args)
{
$articleId = isset($args[0]) ? (int) $args[0] : 0;
$userId = isset($args[1]) ? (int) $args[1] : 0;
list($journal, $submission) = SubmissionEditHandler::validate($articleId, SECTION_EDITOR_ACCESS_EDIT);
$roleDao =& DAORegistry::getDAO('RoleDAO');
if ($userId && $articleId && $roleDao->roleExists($journal->getJournalId(), $userId, ROLE_ID_PROOFREADER)) {
import('submission.proofreader.ProofreaderAction');
ProofreaderAction::selectProofreader($userId, $submission);
Request::redirect(null, null, 'submissionEditing', $articleId);
} else {
parent::setupTemplate(true, $articleId, 'editing');
$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;
}
}
$proofreaders = $roleDao->getUsersByRoleId(ROLE_ID_PROOFREADER, $journal->getJournalId(), $searchType, $search, $searchMatch);
$sectionEditorSubmissionDao =& DAORegistry::getDAO('SectionEditorSubmissionDAO');
$proofreaderStatistics = $sectionEditorSubmissionDao->getProofreaderStatistics($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', $proofreaders);
$proofAssignment =& $submission->getProofAssignment();
if ($proofAssignment) {
$templateMgr->assign('currentUser', $proofAssignment->getProofreaderId());
}
$templateMgr->assign('statistics', $proofreaderStatistics);
$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('pageSubTitle', 'editor.article.selectProofreader');
$templateMgr->assign('pageTitle', 'user.role.proofreaders');
$templateMgr->assign('actionHandler', 'selectProofreader');
$templateMgr->assign('helpTopicId', 'journal.roles.proofreader');
$templateMgr->display('sectionEditor/selectUser.tpl');
}
}
示例2: selectProofreader
/**
* Select Proofreader.
* @param $args array ($articleId, $userId)
* @param $request PKPRequest
*/
function selectProofreader($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');
$signoffDao =& DAORegistry::getDAO('SignoffDAO');
if ($userId && $articleId && $roleDao->userHasRole($journal->getId(), $userId, ROLE_ID_PROOFREADER)) {
import('classes.submission.proofreader.ProofreaderAction');
ProofreaderAction::selectProofreader($userId, $submission, $request);
$request->redirect(null, null, 'submissionEditing', $articleId);
} else {
$this->setupTemplate(true, $articleId, 'editing');
$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;
}
$proofreaders = $roleDao->getUsersByRoleId(ROLE_ID_PROOFREADER, $journal->getId(), $searchType, $search, $searchMatch);
$sectionEditorSubmissionDao =& DAORegistry::getDAO('SectionEditorSubmissionDAO');
$proofreaderStatistics = $sectionEditorSubmissionDao->getProofreaderStatistics($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', $proofreaders);
$proofSignoff = $signoffDao->getBySymbolic('SIGNOFF_PROOFREADING_PROOFREADER', ASSOC_TYPE_ARTICLE, $articleId);
if ($proofSignoff) {
$templateMgr->assign('currentUser', $proofSignoff->getUserId());
}
$templateMgr->assign('statistics', $proofreaderStatistics);
$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('pageSubTitle', 'editor.article.selectProofreader');
$templateMgr->assign('pageTitle', 'user.role.proofreaders');
$templateMgr->assign('actionHandler', 'selectProofreader');
$templateMgr->assign('helpTopicId', 'journal.roles.proofreader');
$templateMgr->display('sectionEditor/selectUser.tpl');
}
}