本文整理汇总了PHP中String::strtoupper方法的典型用法代码示例。如果您正苦于以下问题:PHP String::strtoupper方法的具体用法?PHP String::strtoupper怎么用?PHP String::strtoupper使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类String
的用法示例。
在下文中一共展示了String::strtoupper方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: selectSubscriber
/**
* Display a list of users from which to choose a subscriber/subscription contact.
*/
function selectSubscriber($args = array(), $institutional = false)
{
$templateMgr =& TemplateManager::getManager();
if ($institutional) {
$pageTitle = 'manager.subscriptions.selectContact';
$redirect = 'institutional';
} else {
$pageTitle = 'manager.subscriptions.selectUser';
$redirect = 'individual';
}
$userDao =& DAORegistry::getDAO('UserDAO');
$searchType = null;
$searchMatch = null;
$search = $searchQuery = Request::getUserVar('search');
$searchInitial = Request::getUserVar('searchInitial');
if (!empty($search)) {
$searchType = Request::getUserVar('searchField');
$searchMatch = Request::getUserVar('searchMatch');
} else {
if (isset($searchInitial)) {
$searchInitial = String::strtoupper($searchInitial);
$searchType = USER_FIELD_INITIAL;
$search = $searchInitial;
}
}
$rangeInfo = Handler::getRangeInfo('users');
$users =& $userDao->getUsersByField($searchType, $searchMatch, $search, true, $rangeInfo);
$templateMgr->assign('searchField', $searchType);
$templateMgr->assign('searchMatch', $searchMatch);
$templateMgr->assign('search', $searchQuery);
$templateMgr->assign('searchInitial', Request::getUserVar('searchInitial'));
import('classes.security.Validation');
$templateMgr->assign('isJournalManager', Validation::isJournalManager());
$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_by_ref('users', $users);
$templateMgr->assign('helpTopicId', 'journal.managementPages.subscriptions');
$templateMgr->assign('subscriptionId', Request::getUserVar('subscriptionId'));
$templateMgr->assign('pageTitle', $pageTitle);
$templateMgr->assign('redirect', $redirect);
$templateMgr->assign('alphaList', explode(' ', __('common.alphaList')));
$templateMgr->display('subscription/users.tpl');
}
示例2: mergeUsers
//.........这里部分代码省略.........
unset($layoutEditorSubmission);
}
$monographEmailLogDao =& DAORegistry::getDAO('MonographEmailLogDAO');
$monographEmailLogDao->changeUser($oldUserId, $newUserId);
$monographEventLogDao =& DAORegistry::getDAO('MonographEventLogDAO');
$monographEventLogDao->changeUser($oldUserId, $newUserId);
$monographCommentDao =& DAORegistry::getDAO('MonographCommentDAO');
foreach ($monographCommentDao->getMonographCommentsByUserId($oldUserId) as $monographComment) {
$monographComment->setAuthorId($newUserId);
$monographCommentDao->updateMonographComment($monographComment);
unset($monographComment);
}
$accessKeyDao =& DAORegistry::getDAO('AccessKeyDAO');
$accessKeyDao->transferAccessKeys($oldUserId, $newUserId);
// Delete the old user and associated info.
$sessionDao =& DAORegistry::getDAO('SessionDAO');
$sessionDao->deleteSessionsByUserId($oldUserId);
$temporaryFileDao =& DAORegistry::getDAO('TemporaryFileDAO');
$temporaryFileDao->deleteTemporaryFilesByUserId($oldUserId);
$notificationStatusDao =& DAORegistry::getDAO('NotificationStatusDAO');
$notificationStatusDao->deleteNotificationStatusByUserId($oldUserId);
$userSettingsDao =& DAORegistry::getDAO('UserSettingsDAO');
$userSettingsDao->deleteSettings($oldUserId);
$groupMembershipDao =& DAORegistry::getDAO('GroupMembershipDAO');
$groupMembershipDao->deleteMembershipByUserId($oldUserId);
$seriesEditorsDao =& DAORegistry::getDAO('SeriesEditorsDAO');
$seriesEditorsDao->deleteEditorsByUserId($oldUserId);
// Transfer old user's roles
$userGroups =& $userGroupDao->getByUserId($oldUserId);
while (!$userGroups->eof()) {
$userGroup =& $userGroups->next();
if (!$userGroupDao->userInGroup($userGroup->getContextId(), $newUserId, $userGroup->getId())) {
$userGroupDao->assignUserToGroup($newUserId, $userGroup->getId());
}
unset($userGroup);
}
$userGroupDao->deleteAssignmentsByUserId($oldUserId);
$userDao->deleteUserById($oldUserId);
Request::redirect(null, 'admin', 'mergeUsers');
}
if (!empty($oldUserId)) {
// Get the old username for the confirm prompt.
$oldUser =& $userDao->getUser($oldUserId);
$templateMgr->assign('oldUsername', $oldUser->getUsername());
unset($oldUser);
}
// The administrator must select one or both IDs.
if (Request::getUserVar('roleSymbolic') != null) {
$roleSymbolic = Request::getUserVar('roleSymbolic');
} else {
$roleSymbolic = isset($args[0]) ? $args[0] : 'all';
}
if ($roleSymbolic != 'all' && String::regexp_match_get('/^(\\w+)s$/', $roleSymbolic, $matches)) {
$roleId = $roleDao->getRoleIdFromPath($matches[1]);
if ($roleId == null) {
Request::redirect(null, null, null, 'all');
}
$roleName = $roleDao->getRoleName($roleId, true);
} else {
$roleId = 0;
$roleName = 'admin.mergeUsers.allUsers';
}
$searchType = null;
$searchMatch = null;
$search = Request::getUserVar('search');
$searchInitial = Request::getUserVar('searchInitial');
if (!empty($search)) {
$searchType = Request::getUserVar('searchField');
$searchMatch = Request::getUserVar('searchMatch');
} else {
if (!empty($searchInitial)) {
$searchInitial = String::strtoupper($searchInitial);
$searchType = USER_FIELD_INITIAL;
$search = $searchInitial;
}
}
$rangeInfo = Handler::getRangeInfo('users');
if ($roleId) {
$users =& $roleDao->getUsersByRoleId($roleId, null, $searchType, $search, $searchMatch, $rangeInfo);
$templateMgr->assign('roleId', $roleId);
} else {
$users =& $userDao->getUsersByField($searchType, $searchMatch, $search, true, $rangeInfo);
}
$templateMgr->assign('currentUrl', Request::url(null, null, 'mergeUsers'));
$templateMgr->assign('helpTopicId', 'site.administrativeFunctions');
$templateMgr->assign('roleName', $roleName);
$templateMgr->assign_by_ref('users', $users);
$templateMgr->assign_by_ref('thisUser', Request::getUser());
$templateMgr->assign('isReviewer', $roleId == ROLE_ID_REVIEWER);
$templateMgr->assign('searchField', $searchType);
$templateMgr->assign('searchMatch', $searchMatch);
$templateMgr->assign('search', $search);
$templateMgr->assign('searchInitial', Request::getUserVar('searchInitial'));
$templateMgr->assign('fieldOptions', array(USER_FIELD_FIRSTNAME => 'user.firstName', USER_FIELD_LASTNAME => 'user.lastName', USER_FIELD_USERNAME => 'user.username', USER_FIELD_EMAIL => 'user.email', USER_FIELD_INTERESTS => 'user.interests'));
$templateMgr->assign('alphaList', explode(' ', Locale::translate('common.alphaList')));
$templateMgr->assign('oldUserId', $oldUserId);
$templateMgr->assign('rolePath', $roleDao->getRolePath($roleId));
$templateMgr->assign('roleSymbolic', $roleSymbolic);
$templateMgr->display('admin/selectMergeUser.tpl');
}
示例3: testStrtoupper
function testStrtoupper()
{
$string = '!"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~';
$result = String::strtoupper($string);
$expected = '!"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~';
$this->assertEqual($result, $expected);
$string = 'à';
$result = String::strtoupper($string);
$expected = 'À';
$this->assertEqual($result, $expected);
$string = 'á';
$result = String::strtoupper($string);
$expected = 'Á';
$this->assertEqual($result, $expected);
$string = 'â';
$result = String::strtoupper($string);
$expected = 'Â';
$this->assertEqual($result, $expected);
$string = 'ã';
$result = String::strtoupper($string);
$expected = 'Ã';
$this->assertEqual($result, $expected);
$string = 'ä';
$result = String::strtoupper($string);
$expected = 'Ä';
$this->assertEqual($result, $expected);
$string = 'å';
$result = String::strtoupper($string);
$expected = 'Å';
$this->assertEqual($result, $expected);
$string = 'æ';
$result = String::strtoupper($string);
$expected = 'Æ';
$this->assertEqual($result, $expected);
$string = 'ç';
$result = String::strtoupper($string);
$expected = 'Ç';
$this->assertEqual($result, $expected);
$string = 'è';
$result = String::strtoupper($string);
$expected = 'È';
$this->assertEqual($result, $expected);
$string = 'é';
$result = String::strtoupper($string);
$expected = 'É';
$this->assertEqual($result, $expected);
$string = 'ê';
$result = String::strtoupper($string);
$expected = 'Ê';
$this->assertEqual($result, $expected);
$string = 'ë';
$result = String::strtoupper($string);
$expected = 'Ë';
$this->assertEqual($result, $expected);
$string = 'ì';
$result = String::strtoupper($string);
$expected = 'Ì';
$this->assertEqual($result, $expected);
$string = 'í';
$result = String::strtoupper($string);
$expected = 'Í';
$this->assertEqual($result, $expected);
$string = 'î';
$result = String::strtoupper($string);
$expected = 'Î';
$this->assertEqual($result, $expected);
$string = 'ï';
$result = String::strtoupper($string);
$expected = 'Ï';
$this->assertEqual($result, $expected);
$string = 'ð';
$result = String::strtoupper($string);
$expected = 'Ð';
$this->assertEqual($result, $expected);
$string = 'ñ';
$result = String::strtoupper($string);
$expected = 'Ñ';
$this->assertEqual($result, $expected);
$string = 'ò';
$result = String::strtoupper($string);
$expected = 'Ò';
$this->assertEqual($result, $expected);
$string = 'ó';
$result = String::strtoupper($string);
$expected = 'Ó';
$this->assertEqual($result, $expected);
$string = 'ô';
$result = String::strtoupper($string);
$expected = 'Ô';
$this->assertEqual($result, $expected);
$string = 'õ';
$result = String::strtoupper($string);
$expected = 'Õ';
$this->assertEqual($result, $expected);
$string = 'ö';
$result = String::strtoupper($string);
$expected = 'Ö';
$this->assertEqual($result, $expected);
$string = 'ø';
$result = String::strtoupper($string);
//.........这里部分代码省略.........
示例4: enrollSearch
/**
* Search for users to enroll as reviewers.
*/
function enrollSearch($args, $request)
{
$paperId = (int) array_shift($args);
$this->validate($request, $paperId, TRACK_DIRECTOR_ACCESS_REVIEW);
Locale::requireComponents(array(LOCALE_COMPONENT_PKP_MANAGER));
// manager.people.enrollment, manager.people.enroll
$conference =& $request->getConference();
$schedConf =& $request->getSchedConf();
$submission =& $this->submission;
$roleDao =& DAORegistry::getDAO('RoleDAO');
$roleId = $roleDao->getRoleIdFromPath('reviewer');
$user =& $request->getUser();
$templateMgr =& TemplateManager::getManager();
$this->setupTemplate($request, true);
$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;
}
$rangeInfo = Handler::getRangeInfo('users', array((string) $searchType, (string) $searchMatch, (string) $search));
// Paper ID intentionally omitted
$userDao =& DAORegistry::getDAO('UserDAO');
while (true) {
$users =& $userDao->getUsersByField($searchType, $searchMatch, $search, false, $rangeInfo);
if ($users->isInBounds()) {
break;
}
unset($rangeInfo);
$rangeInfo =& $users->getLastPageRangeInfo();
unset($users);
}
$templateMgr->assign('searchField', $searchType);
$templateMgr->assign('searchMatch', $searchMatch);
$templateMgr->assign('search', $searchQuery);
$templateMgr->assign('searchInitial', $request->getUserVar('searchInitial'));
$templateMgr->assign('paperId', $paperId);
$templateMgr->assign('fieldOptions', array(USER_FIELD_INTERESTS => 'user.interests', USER_FIELD_FIRSTNAME => 'user.firstName', USER_FIELD_LASTNAME => 'user.lastName', USER_FIELD_USERNAME => 'user.username', USER_FIELD_EMAIL => 'user.email'));
$templateMgr->assign('roleId', $roleId);
$templateMgr->assign_by_ref('users', $users);
$templateMgr->assign('alphaList', explode(' ', Locale::translate('common.alphaList')));
$templateMgr->assign('helpTopicId', 'conference.roles.index');
$templateMgr->display('trackDirector/searchUsers.tpl');
}
示例5: 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');
}
}
示例6: mergeUsers
/**
* Allow the Site Administrator to merge user accounts.
*/
function mergeUsers($args)
{
$this->validate();
$this->setupTemplate(true);
$roleDao =& DAORegistry::getDAO('RoleDAO');
$userDao =& DAORegistry::getDAO('UserDAO');
$templateMgr =& TemplateManager::getManager();
$oldUserIds = (array) Request::getUserVar('oldUserIds');
$newUserId = Request::getUserVar('newUserId');
if (!empty($oldUserIds) && !empty($newUserId)) {
import('user.UserAction');
foreach ($oldUserIds as $oldUserId) {
UserAction::mergeUsers($oldUserId, $newUserId);
}
Request::redirect(null, null, 'admin', 'mergeUsers');
}
// The administrator must select one or both IDs.
if (Request::getUserVar('roleSymbolic') != null) {
$roleSymbolic = Request::getUserVar('roleSymbolic');
} else {
$roleSymbolic = isset($args[0]) ? $args[0] : 'all';
}
if ($roleSymbolic != 'all' && String::regexp_match_get('/^(\\w+)s$/', $roleSymbolic, $matches)) {
$roleId = $roleDao->getRoleIdFromPath($matches[1]);
if ($roleId == null) {
Request::redirect(null, null, null, null, 'all');
}
$roleName = $roleDao->getRoleName($roleId, true);
} else {
$roleId = 0;
$roleName = 'admin.mergeUsers.allUsers';
}
$searchType = null;
$searchMatch = null;
$search = 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;
}
$rangeInfo =& Handler::getRangeInfo('users', array($roleId, (string) $search, (string) $searchMatch, (string) $searchType));
if ($roleId) {
while (true) {
$users =& $roleDao->getUsersByRoleId($roleId, null, null, $searchType, $search, $searchMatch, $rangeInfo);
if ($users->isInBounds()) {
break;
}
unset($rangeInfo);
$rangeInfo =& $users->getLastPageRangeInfo();
unset($users);
}
$templateMgr->assign('roleId', $roleId);
} else {
while (true) {
$users =& $userDao->getUsersByField($searchType, $searchMatch, $search, true, $rangeInfo);
if ($users->isInBounds()) {
break;
}
unset($rangeInfo);
$rangeInfo =& $users->getLastPageRangeInfo();
unset($users);
}
}
$templateMgr->assign('currentUrl', Request::url(null, null, 'admin', 'mergeUsers'));
$templateMgr->assign('helpTopicId', 'site.administrativeFunctions');
$templateMgr->assign('roleName', $roleName);
$templateMgr->assign_by_ref('users', $users);
$templateMgr->assign_by_ref('thisUser', Request::getUser());
$templateMgr->assign('isReviewer', $roleId == ROLE_ID_REVIEWER);
$templateMgr->assign('searchField', $searchType);
$templateMgr->assign('searchMatch', $searchMatch);
$templateMgr->assign('search', $search);
$templateMgr->assign('searchInitial', Request::getUserVar('searchInitial'));
if ($roleId == ROLE_ID_REVIEWER) {
$reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
$templateMgr->assign('rateReviewerOnQuality', $conference->getSetting('rateReviewerOnQuality'));
$templateMgr->assign('qualityRatings', $conference->getSetting('rateReviewerOnQuality') ? $reviewAssignmentDao->getAverageQualityRatings($conference->getId()) : null);
}
$templateMgr->assign('fieldOptions', array(USER_FIELD_FIRSTNAME => 'user.firstName', USER_FIELD_LASTNAME => 'user.lastName', USER_FIELD_USERNAME => 'user.username', USER_FIELD_EMAIL => 'user.email', USER_FIELD_INTERESTS => 'user.interests'));
$templateMgr->assign('alphaList', explode(' ', Locale::translate('common.alphaList')));
$templateMgr->assign('oldUserIds', $oldUserIds);
$templateMgr->assign('rolePath', $roleDao->getRolePath($roleId));
$templateMgr->assign('roleSymbolic', $roleSymbolic);
$templateMgr->display('admin/selectMergeUser.tpl');
}
示例7: enrollSearch
/**
* Search for users to enroll as reviewers.
* Last modified: EL on February 16th 2013
* Enroll only enrollable users (no reviewers, secretaries,
* administrators or coordinators)
* Originally comming from SubmissionEditHandler
* (just doing the redirection after the enrollment)
* Which is not anymore the case
*/
function enrollSearch($args)
{
$sectionId = isset($args[0]) ? (int) $args[0] : 0;
Locale::requireComponents(array(LOCALE_COMPONENT_PKP_MANAGER));
// manager.people.enrollment, manager.people.enroll
$journal =& Request::getJournal();
// For security purposes
$thisUser =& Request::getUser();
if ($thisUser->getSecretaryCommitteeId() == $sectionId) {
$roleDao =& DAORegistry::getDAO('RoleDAO');
$roleId = $roleDao->getRoleIdFromPath('reviewer');
$rangeInfo = Handler::getRangeInfo('users');
$templateMgr =& TemplateManager::getManager();
$this->setupTemplate(2);
$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;
}
$sort = Request::getUserVar('sort');
$sort = isset($sort) ? $sort : 'name';
$sortDirection = Request::getUserVar('sortDirection');
$userDao =& DAORegistry::getDAO('UserDAO');
$users =& $userDao->getEnrollableUsers($journal->getId(), $searchType, $searchMatch, $search, false, $rangeInfo, $sort, $sortDirection);
$sectionDao =& DAORegistry::getDAO('SectionDAO');
$erc =& $sectionDao->getSection($sectionId);
$templateMgr->assign('ercAbbrev', $erc->getLocalizedAbbrev());
$templateMgr->assign('searchField', $searchType);
$templateMgr->assign('searchMatch', $searchMatch);
$templateMgr->assign('search', $searchQuery);
$templateMgr->assign('searchInitial', Request::getUserVar('searchInitial'));
$templateMgr->assign('sort', $sort);
$templateMgr->assign('sortDirection', $sortDirection);
$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('sectionId', $sectionId);
$templateMgr->assign('roleId', $roleId);
$templateMgr->assign_by_ref('users', $users);
$templateMgr->assign('alphaList', explode(' ', Locale::translate('common.alphaList')));
$templateMgr->assign('helpTopicId', 'journal.roles.index');
$templateMgr->display('sectionEditor/searchUsers.tpl');
} else {
Request::redirect(null, 'user');
}
}
示例8: selectBookForReviewAuthor
/**
* Display a list of authors from which to choose a book reviewer.
*/
function selectBookForReviewAuthor($args = array(), &$request)
{
$this->setupTemplate(true);
$journal =& $request->getJournal();
$journalId = $journal->getId();
$bfrPlugin =& PluginRegistry::getPlugin('generic', BOOKS_FOR_REVIEW_PLUGIN_NAME);
$bookId = (int) $args[0];
$returnPage = $request->getUserVar('returnPage') == null ? null : $request->getUserVar('returnPage');
if ($returnPage != null) {
$validPages =& $this->getValidReturnPages();
if (!in_array($returnPage, $validPages)) {
$returnPage = null;
}
}
$bfrDao =& DAORegistry::getDAO('BookForReviewDAO');
// Ensure book for review is for this journal
if ($bfrDao->getBookForReviewJournalId($bookId) != $journalId) {
$request->redirect(null, 'editor', 'booksForReview', $returnPage);
}
$templateMgr =& TemplateManager::getManager();
$roleDao =& DAORegistry::getDAO('RoleDAO');
$searchType = null;
$searchMatch = null;
$search = $searchQuery = $request->getUserVar('search');
$searchInitial = $request->getUserVar('searchInitial');
if (!empty($search)) {
$searchType = $request->getUserVar('searchField');
$searchMatch = $request->getUserVar('searchMatch');
} else {
if (isset($searchInitial)) {
$searchInitial = String::strtoupper($searchInitial);
$searchType = USER_FIELD_INITIAL;
$search = $searchInitial;
}
}
$rangeInfo = Handler::getRangeInfo('users');
$users =& $roleDao->getUsersByRoleId(ROLE_ID_AUTHOR, $journalId, $searchType, $search, $searchMatch, $rangeInfo);
$templateMgr->assign('searchField', $searchType);
$templateMgr->assign('searchMatch', $searchMatch);
$templateMgr->assign('search', $searchQuery);
$templateMgr->assign('searchInitial', $request->getUserVar('searchInitial'));
import('classes.security.Validation');
$templateMgr->assign('isJournalManager', Validation::isJournalManager());
$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_by_ref('users', $users);
$templateMgr->assign('helpTopicId', 'journal.roles.author');
$templateMgr->assign('bookId', $bookId);
$templateMgr->assign('returnPage', $returnPage);
$templateMgr->assign('alphaList', explode(' ', __('common.alphaList')));
$templateMgr->display($bfrPlugin->getTemplatePath() . 'editor' . '/' . 'authors.tpl');
}
示例9: testStrtoupperWhenAllIsUpperCaseShouldReturnAllUpper
public function testStrtoupperWhenAllIsUpperCaseShouldReturnAllUpper()
{
$expected = "DAFITI";
$actual = String::strtoupper("DAFITI");
$this->assertEquals($expected, $actual);
}
示例10: enrollSearch
/**
* Search for users to enroll in a specific role.
* @param $args array first parameter is the selected role ID
*/
function enrollSearch($args, &$request)
{
$this->validate();
$roleDao = DAORegistry::getDAO('RoleDAO');
$userDao = DAORegistry::getDAO('UserDAO');
$roleId = (int) (isset($args[0]) ? $args[0] : $request->getUserVar('roleId'));
$templateMgr =& TemplateManager::getManager($request);
$this->setupTemplate($request, true);
$searchType = null;
$searchMatch = null;
$search = $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;
}
}
$sort = $request->getUserVar('sort');
$sort = isset($sort) ? $sort : 'name';
$sortDirection = $request->getUserVar('sortDirection');
$rangeInfo = $this->getRangeInfo($request, 'users');
$users = $userDao->getUsersByField($searchType, $searchMatch, $search, true, $rangeInfo, $sort, $sortDirection);
$templateMgr->assign('searchField', $searchType);
$templateMgr->assign('searchMatch', $searchMatch);
$templateMgr->assign('search', $search);
$templateMgr->assign('searchInitial', $request->getUserVar('searchInitial'));
$templateMgr->assign('roleId', $roleId);
$templateMgr->assign('roleName', $roleDao->getRoleName($roleId));
$fieldOptions = array(USER_FIELD_FIRSTNAME => 'user.firstName', USER_FIELD_LASTNAME => 'user.lastName', USER_FIELD_USERNAME => 'user.username', USER_FIELD_EMAIL => 'user.email');
$templateMgr->assign('fieldOptions', $fieldOptions);
$templateMgr->assign_by_ref('users', $users);
$templateMgr->assign_by_ref('thisUser', $request->getUser());
$templateMgr->assign('alphaList', explode(' ', __('common.alphaList')));
$templateMgr->assign('sort', $sort);
$templateMgr->assign('sortDirection', $sortDirection);
$templateMgr->display('admin/people/searchUsers.tpl');
}
示例11: selectSubscriber
/**
* Display a list of users from which to choose a subscriber.
*/
function selectSubscriber()
{
SubscriptionManagerHandler::validate();
$templateMgr =& TemplateManager::getManager();
SubscriptionManagerHandler::setupTemplate();
$templateMgr->append('pageHierarchy', array(Request::url(null, 'manager', 'subscriptions'), 'manager.subscriptions'));
$userDao =& DAORegistry::getDAO('UserDAO');
$searchType = null;
$searchMatch = null;
$search = $searchQuery = Request::getUserVar('search');
$searchInitial = Request::getUserVar('searchInitial');
if (!empty($search)) {
$searchType = Request::getUserVar('searchField');
$searchMatch = Request::getUserVar('searchMatch');
} else {
if (isset($searchInitial)) {
$searchInitial = String::strtoupper($searchInitial);
$searchType = USER_FIELD_INITIAL;
$search = $searchInitial;
}
}
$rangeInfo = Handler::getRangeInfo('users');
$users =& $userDao->getUsersByField($searchType, $searchMatch, $search, true, $rangeInfo);
$templateMgr->assign('searchField', $searchType);
$templateMgr->assign('searchMatch', $searchMatch);
$templateMgr->assign('search', $searchQuery);
$templateMgr->assign('searchInitial', Request::getUserVar('searchInitial'));
$templateMgr->assign('isJournalManager', false);
$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_by_ref('users', $users);
$templateMgr->assign('helpTopicId', 'journal.managementPages.subscriptions');
$templateMgr->assign('subscriptionId', Request::getUserVar('subscriptionId'));
$templateMgr->assign('alphaList', explode(' ', Locale::translate('common.alphaList')));
$templateMgr->display('subscription/users.tpl');
}
示例12: mergeUsers
//.........这里部分代码省略.........
$articleCommentDao =& DAORegistry::getDAO('ArticleCommentDAO');
foreach ($articleCommentDao->getArticleCommentsByUserId($oldUserId) as $articleComment) {
$articleComment->setAuthorId($newUserId);
$articleCommentDao->updateArticleComment($articleComment);
unset($articleComment);
}
$accessKeyDao =& DAORegistry::getDAO('AccessKeyDAO');
$accessKeyDao->transferAccessKeys($oldUserId, $newUserId);
// Delete the old user and associated info.
$sessionDao =& DAORegistry::getDAO('SessionDAO');
$sessionDao->deleteSessionsByUserId($oldUserId);
$subscriptionDao =& DAORegistry::getDAO('SubscriptionDAO');
$subscriptionDao->deleteSubscriptionsByUserId($oldUserId);
$temporaryFileDao =& DAORegistry::getDAO('TemporaryFileDAO');
$temporaryFileDao->deleteTemporaryFilesByUserId($oldUserId);
$notificationStatusDao =& DAORegistry::getDAO('NotificationStatusDAO');
$notificationStatusDao->deleteNotificationStatusByUserId($oldUserId);
$userSettingsDao =& DAORegistry::getDAO('UserSettingsDAO');
$userSettingsDao->deleteSettings($oldUserId);
$groupMembershipDao =& DAORegistry::getDAO('GroupMembershipDAO');
$groupMembershipDao->deleteMembershipByUserId($oldUserId);
$sectionEditorsDao =& DAORegistry::getDAO('SectionEditorsDAO');
$sectionEditorsDao->deleteEditorsByUserId($oldUserId);
// Transfer old user's roles
$roles =& $roleDao->getRolesByUserId($oldUserId);
foreach ($roles as $role) {
if (!$roleDao->roleExists($role->getJournalId(), $newUserId, $role->getRoleId())) {
$role->setUserId($newUserId);
$roleDao->insertRole($role);
}
}
$roleDao->deleteRoleByUserId($oldUserId);
$userDao->deleteUserById($oldUserId);
Request::redirect(null, 'manager');
}
if (!empty($oldUserId)) {
// Get the old username for the confirm prompt.
$oldUser =& $userDao->getUser($oldUserId);
$templateMgr->assign('oldUsername', $oldUser->getUsername());
unset($oldUser);
}
// The manager must select one or both IDs.
if (Request::getUserVar('roleSymbolic') != null) {
$roleSymbolic = Request::getUserVar('roleSymbolic');
} else {
$roleSymbolic = isset($args[0]) ? $args[0] : 'all';
}
if ($roleSymbolic != 'all' && String::regexp_match_get('/^(\\w+)s$/', $roleSymbolic, $matches)) {
$roleId = $roleDao->getRoleIdFromPath($matches[1]);
if ($roleId == null) {
Request::redirect(null, null, null, 'all');
}
$roleName = $roleDao->getRoleName($roleId, true);
} else {
$roleId = 0;
$roleName = 'manager.people.allUsers';
}
$searchType = null;
$searchMatch = null;
$search = 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;
}
}
$rangeInfo = Handler::getRangeInfo('users');
if ($roleId) {
$users =& $roleDao->getUsersByRoleId($roleId, $journalId, $searchType, $search, $searchMatch, $rangeInfo);
$templateMgr->assign('roleId', $roleId);
} else {
$users =& $roleDao->getUsersByJournalId($journalId, $searchType, $search, $searchMatch, $rangeInfo);
}
$templateMgr->assign('currentUrl', Request::url(null, null, 'people', 'all'));
$templateMgr->assign('helpTopicId', 'journal.managementPages.mergeUsers');
$templateMgr->assign('roleName', $roleName);
$templateMgr->assign_by_ref('users', $users);
$templateMgr->assign_by_ref('thisUser', Request::getUser());
$templateMgr->assign('isReviewer', $roleId == ROLE_ID_REVIEWER);
$templateMgr->assign('searchField', $searchType);
$templateMgr->assign('searchMatch', $searchMatch);
$templateMgr->assign('search', $search);
$templateMgr->assign('searchInitial', Request::getUserVar('searchInitial'));
if ($roleId == ROLE_ID_REVIEWER) {
$reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
$templateMgr->assign('rateReviewerOnQuality', $journal->getSetting('rateReviewerOnQuality'));
$templateMgr->assign('qualityRatings', $journal->getSetting('rateReviewerOnQuality') ? $reviewAssignmentDao->getAverageQualityRatings($journalId) : null);
}
$templateMgr->assign('fieldOptions', array(USER_FIELD_FIRSTNAME => 'user.firstName', USER_FIELD_LASTNAME => 'user.lastName', USER_FIELD_USERNAME => 'user.username', USER_FIELD_EMAIL => 'user.email', USER_FIELD_INTERESTS => 'user.interests'));
$templateMgr->assign('alphaList', explode(' ', Locale::translate('common.alphaList')));
$templateMgr->assign('oldUserId', $oldUserId);
$templateMgr->assign('rolePath', $roleDao->getRolePath($roleId));
$templateMgr->assign('roleSymbolic', $roleSymbolic);
$templateMgr->display('manager/people/selectMergeUser.tpl');
}
示例13: selectObjectForReviewAuthor
/**
* Display a list of authors from which to choose an object reviewer.
* @param $args array
* @param $request PKPRequest
*/
function selectObjectForReviewAuthor($args, &$request)
{
$objectId = array_shift($args);
$journal =& $request->getJournal();
$journalId = $journal->getId();
if (!$this->_ensureObjectExists($objectId, $journalId)) {
$request->redirect(null, 'editor', 'objectsForReview');
}
// Search
$searchField = null;
$searchMatch = null;
$search = $request->getUserVar('search');
$searchInitial = $request->getUserVar('searchInitial');
if (!empty($search)) {
$searchField = $request->getUserVar('searchField');
$searchMatch = $request->getUserVar('searchMatch');
} else {
if (isset($searchInitial)) {
$searchInitial = String::strtoupper($searchInitial);
$searchField = USER_FIELD_INITIAL;
$search = $searchInitial;
}
}
$fieldOptions = array(USER_FIELD_FIRSTNAME => 'user.firstName', USER_FIELD_LASTNAME => 'user.lastName', USER_FIELD_USERNAME => 'user.username', USER_FIELD_EMAIL => 'user.email');
// Get all and those authors assigned to this object
$rangeInfo = Handler::getRangeInfo('users');
$roleDao =& DAORegistry::getDAO('RoleDAO');
$users =& $roleDao->getUsersByRoleId(ROLE_ID_AUTHOR, $journalId, $searchField, $search, $searchMatch, $rangeInfo);
$ofrAssignmentDao =& DAORegistry::getDAO('ObjectForReviewAssignmentDAO');
$usersAssigned = $ofrAssignmentDao->getUserIds($objectId);
$this->setupTemplate($request, true);
$templateMgr =& TemplateManager::getManager($request);
$templateMgr->assign('objectId', $objectId);
$templateMgr->assign('searchField', $searchField);
$templateMgr->assign('searchMatch', $searchMatch);
$templateMgr->assign('search', $search);
$templateMgr->assign('searchInitial', $searchInitial);
$templateMgr->assign('searchFieldOptions', $fieldOptions);
$templateMgr->assign('alphaList', explode(' ', __('common.alphaList')));
$templateMgr->assign_by_ref('users', $users);
$templateMgr->assign_by_ref('usersAssigned', $usersAssigned);
import('classes.security.Validation');
$templateMgr->assign('isJournalManager', Validation::isJournalManager());
$ofrPlugin =& $this->_getObjectsForReviewPlugin();
$templateMgr->display($ofrPlugin->getTemplatePath() . 'editor' . '/' . 'authors.tpl');
}
示例14: _translateSearchPhrase
/**
* Translate query keywords.
* @param $searchPhrase string
* @return The translated search phrase.
*/
function _translateSearchPhrase($searchPhrase, $backwards = false)
{
static $queryKeywords;
if (is_null($queryKeywords)) {
// Query keywords.
$queryKeywords = array(String::strtoupper(__('search.operator.not')) => 'NOT', String::strtoupper(__('search.operator.and')) => 'AND', String::strtoupper(__('search.operator.or')) => 'OR');
}
if ($backwards) {
$translationTable = array_flip($queryKeywords);
} else {
$translationTable = $queryKeywords;
}
// Translate the search phrase.
foreach ($translationTable as $translateFrom => $translateTo) {
$searchPhrase = String::regexp_replace("/(^|\\s){$translateFrom}(\\s|\$)/i", "\\1{$translateTo}\\2", $searchPhrase);
}
return $searchPhrase;
}
示例15: 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');
}
}