本文整理汇总了PHP中Handler::getRangeInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP Handler::getRangeInfo方法的具体用法?PHP Handler::getRangeInfo怎么用?PHP Handler::getRangeInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Handler
的用法示例。
在下文中一共展示了Handler::getRangeInfo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
/**
* Display reviewer index page.
*/
function index($args)
{
$this->validate();
$this->setupTemplate();
$schedConf =& Request::getSchedConf();
$user =& Request::getUser();
$reviewerSubmissionDao =& DAORegistry::getDAO('ReviewerSubmissionDAO');
$rangeInfo = Handler::getRangeInfo('submissions');
$page = isset($args[0]) ? $args[0] : '';
switch ($page) {
case 'completed':
$active = false;
break;
default:
$page = 'active';
$active = true;
}
$submissions = $reviewerSubmissionDao->getReviewerSubmissionsByReviewerId($user->getId(), $schedConf->getId(), $active, $rangeInfo);
$templateMgr =& TemplateManager::getManager();
$templateMgr->assign('reviewerRecommendationOptions', ReviewAssignment::getReviewerRecommendationOptions());
$templateMgr->assign('pageToDisplay', $page);
$templateMgr->assign_by_ref('submissions', $submissions);
$templateMgr->assign_by_ref('schedConf', $schedConf);
import('submission.reviewAssignment.ReviewAssignment');
$templateMgr->assign_by_ref('reviewerRecommendationOptions', ReviewAssignment::getReviewerRecommendationOptions());
$templateMgr->assign('helpTopicId', 'editorial.reviewersRole.submissions');
$templateMgr->display('reviewer/index.tpl');
}
示例2: conferenceEventLogType
/**
* View conference event log by record type.
*/
function conferenceEventLogType($args)
{
$assocType = isset($args[1]) ? (int) $args[0] : null;
$assocId = isset($args[2]) ? (int) $args[1] : null;
$this->validate();
$this->setupTemplate(true);
$conference =& Request::getConference();
$rangeInfo =& Handler::getRangeInfo('eventLogEntries', array($assocType, $assocId));
$logDao =& DAORegistry::getDAO('ConferenceEventLogDAO');
while (true) {
$eventLogEntries =& $logDao->getConferenceLogEntriesByAssoc($conference->getId(), null, $assocType, $assocId, $rangeInfo);
if ($eventLogEntries->isInBounds()) {
break;
}
unset($rangeInfo);
$rangeInfo =& $eventLogEntries->getLastPageRangeInfo();
unset($eventLogEntries);
}
$templateMgr =& TemplateManager::getManager();
$templateMgr->assign('showBackLink', true);
$templateMgr->assign('isDirector', Validation::isDirector());
$templateMgr->assign_by_ref('conference', $conference);
$templateMgr->assign_by_ref('eventLogEntries', $eventLogEntries);
$templateMgr->display('manager/conferenceEventLog.tpl');
}
示例3: index
/**
* Display reviewer index page.
*/
function index($args)
{
ReviewerHandler::validate();
ReviewerHandler::setupTemplate();
$journal =& Request::getJournal();
$user =& Request::getUser();
$reviewerSubmissionDao =& DAORegistry::getDAO('ReviewerSubmissionDAO');
$rangeInfo = Handler::getRangeInfo('submissions');
$page = isset($args[0]) ? $args[0] : '';
switch ($page) {
case 'completed':
$active = false;
break;
default:
$page = 'active';
$active = true;
}
$submissions = $reviewerSubmissionDao->getReviewerSubmissionsByReviewerId($user->getUserId(), $journal->getJournalId(), $active, $rangeInfo);
$templateMgr =& TemplateManager::getManager();
$templateMgr->assign('reviewerRecommendationOptions', ReviewAssignment::getReviewerRecommendationOptions());
$templateMgr->assign('pageToDisplay', $page);
$templateMgr->assign_by_ref('submissions', $submissions);
import('submission.reviewAssignment.ReviewAssignment');
$templateMgr->assign_by_ref('reviewerRecommendationOptions', ReviewAssignment::getReviewerRecommendationOptions());
import('issue.IssueAction');
$issueAction =& new IssueAction();
$templateMgr->register_function('print_issue_id', array($issueAction, 'smartyPrintIssueId'));
$templateMgr->assign('helpTopicId', 'editorial.reviewersRole.submissions');
$templateMgr->display('reviewer/index.tpl');
}
示例4: index
/**
* Display help table of contents.
* @param $args array
* @param $request Request
*/
function index($args, &$request)
{
$this->validate();
$this->setupTemplate();
$templateMgr =& TemplateManager::getManager();
$router =& $request->getRouter();
$user = $request->getUser();
if (isset($user)) {
$userId = $user->getId();
$templateMgr->assign('isUserLoggedIn', true);
} else {
$userId = 0;
$templateMgr->assign('emailUrl', $router->url($request, null, 'notification', 'subscribeMailList'));
$templateMgr->assign('isUserLoggedIn', false);
}
$context =& $request->getContext();
$contextId = isset($context) ? $context->getId() : null;
$notificationManager = new NotificationManager();
$notificationDao =& DAORegistry::getDAO('NotificationDAO');
$rangeInfo =& Handler::getRangeInfo('notifications');
// Construct the formatted notification string to display in the template
$formattedNotifications = $notificationManager->getFormattedNotificationsForUser($request, $userId, NOTIFICATION_LEVEL_NORMAL, $contextId, $rangeInfo);
// Get the same notifications used for the string so we can paginate
$notifications = $notificationDao->getByUserId($userId, NOTIFICATION_LEVEL_NORMAL, null, $contextId, $rangeInfo);
$notificationDao =& DAORegistry::getDAO('NotificationDAO');
$templateMgr->assign('formattedNotifications', $formattedNotifications);
$templateMgr->assign('notifications', $notifications);
$templateMgr->assign('unread', $notificationDao->getNotificationCount(false, $userId, $contextId));
$templateMgr->assign('read', $notificationDao->getNotificationCount(true, $userId, $contextId));
$templateMgr->assign('url', $router->url($request, null, 'notification', 'settings'));
$templateMgr->display('notification/index.tpl');
}
示例5: index
/**
* Display section editor index page.
*/
function index($args)
{
SectionEditorHandler::validate();
SectionEditorHandler::setupTemplate();
$journal =& Request::getJournal();
$user =& Request::getUser();
$rangeInfo = Handler::getRangeInfo('submissions');
// Get the user's search conditions, if any
$searchField = Request::getUserVar('searchField');
$dateSearchField = Request::getUserVar('dateSearchField');
$searchMatch = Request::getUserVar('searchMatch');
$search = Request::getUserVar('search');
$fromDate = Request::getUserDateVar('dateFrom', 1, 1);
if ($fromDate !== null) {
$fromDate = date('Y-m-d H:i:s', $fromDate);
}
$toDate = Request::getUserDateVar('dateTo', 32, 12, null, 23, 59, 59);
if ($toDate !== null) {
$toDate = date('Y-m-d H:i:s', $toDate);
}
$sectionDao =& DAORegistry::getDAO('SectionDAO');
$sectionEditorSubmissionDao =& DAORegistry::getDAO('SectionEditorSubmissionDAO');
$page = isset($args[0]) ? $args[0] : '';
$sections =& $sectionDao->getSectionTitles($journal->getJournalId());
switch ($page) {
case 'submissionsInEditing':
$functionName = 'getSectionEditorSubmissionsInEditing';
$helpTopicId = 'editorial.sectionEditorsRole.submissions.inEditing';
break;
case 'submissionsArchives':
$functionName = 'getSectionEditorSubmissionsArchives';
$helpTopicId = 'editorial.sectionEditorsRole.submissions.archives';
break;
default:
$page = 'submissionsInReview';
$functionName = 'getSectionEditorSubmissionsInReview';
$helpTopicId = 'editorial.sectionEditorsRole.submissions.inReview';
}
$submissions =& $sectionEditorSubmissionDao->{$functionName}($user->getUserId(), $journal->getJournalId(), Request::getUserVar('section'), $searchField, $searchMatch, $search, $dateSearchField, $fromDate, $toDate, $rangeInfo);
$templateMgr =& TemplateManager::getManager();
$templateMgr->assign('helpTopicId', $helpTopicId);
$templateMgr->assign('sectionOptions', array(0 => Locale::Translate('editor.allSections')) + $sections);
$templateMgr->assign_by_ref('submissions', $submissions);
$templateMgr->assign('section', Request::getUserVar('section'));
$templateMgr->assign('pageToDisplay', $page);
$templateMgr->assign('sectionEditor', $user->getFullName());
// Set search parameters
$duplicateParameters = array('searchField', 'searchMatch', 'search', 'dateFromMonth', 'dateFromDay', 'dateFromYear', 'dateToMonth', 'dateToDay', 'dateToYear', 'dateSearchField');
foreach ($duplicateParameters as $param) {
$templateMgr->assign($param, Request::getUserVar($param));
}
$templateMgr->assign('dateFrom', $fromDate);
$templateMgr->assign('dateTo', $toDate);
$templateMgr->assign('fieldOptions', array(SUBMISSION_FIELD_TITLE => 'article.title', SUBMISSION_FIELD_AUTHOR => 'user.role.author', SUBMISSION_FIELD_EDITOR => 'user.role.editor'));
$templateMgr->assign('dateFieldOptions', array(SUBMISSION_FIELD_DATE_SUBMITTED => 'submissions.submitted', SUBMISSION_FIELD_DATE_COPYEDIT_COMPLETE => 'submissions.copyeditComplete', SUBMISSION_FIELD_DATE_LAYOUT_COMPLETE => 'submissions.layoutComplete', SUBMISSION_FIELD_DATE_PROOFREADING_COMPLETE => 'submissions.proofreadingComplete'));
import('issue.IssueAction');
$issueAction =& new IssueAction();
$templateMgr->register_function('print_issue_id', array($issueAction, 'smartyPrintIssueId'));
$templateMgr->display('sectionEditor/index.tpl');
}
示例6: searches
function searches($args)
{
$this->validate();
$journal = Request::getJournal();
$rtDao =& DAORegistry::getDAO('RTDAO');
$rangeInfo = Handler::getRangeInfo('searches');
$versionId = isset($args[0]) ? $args[0] : 0;
$version =& $rtDao->getVersion($versionId, $journal->getId());
$contextId = isset($args[1]) ? $args[1] : 0;
$context =& $rtDao->getContext($contextId);
if ($context && $version && $context->getVersionId() == $version->getVersionId()) {
$this->setupTemplate(true, $version, $context);
$templateMgr =& TemplateManager::getManager();
$templateMgr->addJavaScript('lib/pkp/js/jquery.tablednd_0_5.js');
$templateMgr->addJavaScript('lib/pkp/js/tablednd.js');
$templateMgr->assign_by_ref('version', $version);
$templateMgr->assign_by_ref('context', $context);
import('lib.pkp.classes.core.ArrayItemIterator');
$templateMgr->assign_by_ref('searches', new ArrayItemIterator($context->getSearches(), $rangeInfo->getPage(), $rangeInfo->getCount()));
$templateMgr->assign('helpTopicId', 'journal.managementPages.readingTools.contexts');
$templateMgr->display('rtadmin/searches.tpl');
} else {
Request::redirect(null, null, 'versions');
}
}
示例7: emails
/**
* Display a list of the emails within the current conference.
*/
function emails()
{
$this->validate();
$this->setupTemplate(true);
$conference =& Request::getConference();
$rangeInfo = Handler::getRangeInfo('emails', array());
$emailTemplateDao =& DAORegistry::getDAO('EmailTemplateDAO');
$emailTemplatesArray =& $emailTemplateDao->getEmailTemplates(Locale::getLocale(), $conference->getId());
import('core.ArrayItemIterator');
if ($rangeInfo && $rangeInfo->isValid()) {
while (true) {
$emailTemplates = new ArrayItemIterator($emailTemplatesArray, $rangeInfo->getPage(), $rangeInfo->getCount());
if ($emailTemplates->isInBounds()) {
break;
}
unset($rangeInfo);
$rangeInfo =& $emailTemplates->getLastPageRangeInfo();
unset($emailTemplates);
}
} else {
$emailTemplates = new ArrayItemIterator($emailTemplatesArray);
}
$templateMgr =& TemplateManager::getManager();
// The bread crumbs depends on whether we're doing scheduled conference or conference
// management. FIXME: this is going to be a common situation, and this isn't
// an elegant way of testing for it.
if (Request::getRequestedPage() === 'manager') {
$templateMgr->assign('pageHierarchy', array(array(Request::url(null, 'index', 'manager'), 'manager.conferenceSiteManagement')));
} else {
$templateMgr->assign('pageHierarchy', array(array(Request::url(null, null, 'manager'), 'manager.schedConfManagement')));
}
$templateMgr->assign_by_ref('emailTemplates', $emailTemplates);
$templateMgr->assign('helpTopicId', 'conference.generalManagement.emails');
$templateMgr->display('manager/emails/emails.tpl');
}
示例8: browseLog
function browseLog()
{
list($plugin) = CounterHandler::validate();
CounterHandler::setupTemplate(true);
$journal =& Request::getJournal();
$rangeInfo = Handler::getRangeInfo('entries');
$logEntryDao =& DAORegistry::getDAO('LogEntryDAO');
$log =& $logEntryDao->parse();
// Map session IDs to something more readable
$sessions = array();
$userNum = 0;
foreach ($log as $entry) {
if (!isset($sessions[$entry->getUser()])) {
$sessions[$entry->getUser()] = Locale::translate('plugins.generic.counter.sessionNumber', array('sessionNumber' => ++$userNum));
}
}
if ($rangeInfo->isValid()) {
$page = $rangeInfo->getPage();
$count = $rangeInfo->getCount();
} else {
$page = 1;
$count = min(count($log), $journal->getSetting('itemsPerPage'));
}
$logIterator =& new ArrayItemIterator($log, $page, $count);
$templateManager =& TemplateManager::getManager();
$templateManager->assign_by_ref('entries', $logIterator);
$templateManager->assign('sessions', $sessions);
$templateManager->display($plugin->getTemplatePath() . 'browser.tpl');
}
示例9: backIssues
/**
* Displays the listings of back (published) issues
*/
function backIssues($args, $request)
{
$this->validate();
$this->setupTemplate(EDITOR_SECTION_ISSUES);
$journal =& $request->getJournal();
$issueDao =& DAORegistry::getDAO('IssueDAO');
$rangeInfo = Handler::getRangeInfo('issues');
$templateMgr =& TemplateManager::getManager();
$templateMgr->addJavaScript('lib/pkp/js/lib/jquery/plugins/jquery.tablednd.js');
$templateMgr->addJavaScript('lib/pkp/js/functions/tablednd.js');
$templateMgr->assign_by_ref('issues', $issueDao->getPublishedIssues($journal->getId(), $rangeInfo));
$allIssuesIterator = $issueDao->getPublishedIssues($journal->getId());
$issueMap = array();
while ($issue =& $allIssuesIterator->next()) {
$issueMap[$issue->getId()] = $issue->getIssueIdentification();
unset($issue);
}
$templateMgr->assign('allIssues', $issueMap);
$templateMgr->assign('rangeInfo', $rangeInfo);
$currentIssue =& $issueDao->getCurrentIssue($journal->getId());
$currentIssueId = $currentIssue ? $currentIssue->getId() : null;
$templateMgr->assign('currentIssueId', $currentIssueId);
$templateMgr->assign('helpTopicId', 'publishing.index');
$templateMgr->assign('usesCustomOrdering', $issueDao->customIssueOrderingExists($journal->getId()));
$templateMgr->display('editor/issues/backIssues.tpl');
}
示例10: index
/**
* Display proofreader index page.
*/
function index($args)
{
$this->validate();
$this->setupTemplate();
$journal =& Request::getJournal();
$user =& Request::getUser();
$proofreaderSubmissionDao =& DAORegistry::getDAO('ProofreaderSubmissionDAO');
// Get the user's search conditions, if any
$searchField = Request::getUserVar('searchField');
$dateSearchField = Request::getUserVar('dateSearchField');
$searchMatch = Request::getUserVar('searchMatch');
$search = Request::getUserVar('search');
$fromDate = Request::getUserDateVar('dateFrom', 1, 1);
if ($fromDate !== null) {
$fromDate = date('Y-m-d H:i:s', $fromDate);
}
$toDate = Request::getUserDateVar('dateTo', 32, 12, null, 23, 59, 59);
if ($toDate !== null) {
$toDate = date('Y-m-d H:i:s', $toDate);
}
$rangeInfo = Handler::getRangeInfo('submissions');
$page = isset($args[0]) ? $args[0] : '';
switch ($page) {
case 'completed':
$active = false;
break;
default:
$page = 'active';
$active = true;
}
$sort = Request::getUserVar('sort');
$sort = isset($sort) ? $sort : 'title';
$sortDirection = Request::getUserVar('sortDirection');
$countryField = Request::getUserVar('countryField');
$submissions = $proofreaderSubmissionDao->getSubmissions($user->getId(), $journal->getId(), $searchField, $searchMatch, $search, $dateSearchField, $fromDate, $toDate, $countryField, $active, $rangeInfo, $sort, $sortDirection);
$templateMgr =& TemplateManager::getManager();
$templateMgr->assign('pageToDisplay', $page);
$templateMgr->assign_by_ref('submissions', $submissions);
// Set search parameters
$duplicateParameters = array('searchField', 'searchMatch', 'search', 'dateFromMonth', 'dateFromDay', 'dateFromYear', 'dateToMonth', 'dateToDay', 'dateToYear', 'dateSearchField');
foreach ($duplicateParameters as $param) {
$templateMgr->assign($param, Request::getUserVar($param));
}
$templateMgr->assign('dateFrom', $fromDate);
$templateMgr->assign('dateTo', $toDate);
$templateMgr->assign('fieldOptions', array(SUBMISSION_FIELD_TITLE => 'article.title', SUBMISSION_FIELD_AUTHOR => 'user.role.author', SUBMISSION_FIELD_EDITOR => 'user.role.editor'));
$templateMgr->assign('dateFieldOptions', array(SUBMISSION_FIELD_DATE_SUBMITTED => 'submissions.submitted', SUBMISSION_FIELD_DATE_COPYEDIT_COMPLETE => 'submissions.copyeditComplete', SUBMISSION_FIELD_DATE_LAYOUT_COMPLETE => 'submissions.layoutComplete', SUBMISSION_FIELD_DATE_PROOFREADING_COMPLETE => 'submissions.proofreadingComplete'));
$extraFieldDao =& DAORegistry::getDAO('ExtraFieldDAO');
$countries =& $extraFieldDao->getExtraFieldsList(EXTRA_FIELD_GEO_AREA);
$templateMgr->assign_by_ref('countries', $countries);
import('classes.issue.IssueAction');
$issueAction = new IssueAction();
$templateMgr->register_function('print_issue_id', array($issueAction, 'smartyPrintIssueId'));
$templateMgr->assign('helpTopicId', 'editorial.proofreadersRole.submissions');
$templateMgr->assign('sort', $sort);
$templateMgr->assign('sortDirection', $sortDirection);
// Added by igm 9/24/11
$templateMgr->assign('countryField', $countryField);
$templateMgr->display('proofreader/index.tpl');
}
示例11: display
function display(&$args, $request)
{
$templateMgr =& TemplateManager::getManager();
parent::display($args, $request);
$issueDao =& DAORegistry::getDAO('IssueDAO');
$publishedArticleDao =& DAORegistry::getDAO('PublishedArticleDAO');
$articleGalleyDao =& DAORegistry::getDAO('ArticleGalleyDAO');
$journal =& Request::getJournal();
switch (array_shift($args)) {
case 'exportGalley':
$articleId = array_shift($args);
$galleyId = array_shift($args);
$article =& $publishedArticleDao->getPublishedArticleByArticleId($articleId);
$galley =& $articleGalleyDao->getGalley($galleyId, $articleId);
if ($article && $galley && ($issue =& $issueDao->getIssueById($article->getIssueId(), $journal->getId()))) {
$this->exportArticle($journal, $issue, $article, $galley);
break;
}
default:
// Display a list of articles for export
$this->setBreadcrumbs();
AppLocale::requireComponents(LOCALE_COMPONENT_PKP_SUBMISSION);
$publishedArticleDao =& DAORegistry::getDAO('PublishedArticleDAO');
$rangeInfo = Handler::getRangeInfo('articles');
$articleIds = $publishedArticleDao->getPublishedArticleIdsAlphabetizedByJournal($journal->getId(), false);
$totalArticles = count($articleIds);
$articleIds = array_slice($articleIds, $rangeInfo->getCount() * ($rangeInfo->getPage() - 1), $rangeInfo->getCount());
import('lib.pkp.classes.core.VirtualArrayIterator');
$iterator = new VirtualArrayIterator(ArticleSearch::formatResults($articleIds), $totalArticles, $rangeInfo->getPage(), $rangeInfo->getCount());
$templateMgr->assign_by_ref('articles', $iterator);
$templateMgr->display($this->getTemplatePath() . 'index.tpl');
break;
}
}
示例12: meetings
function meetings($args)
{
$this->validate(0, true);
$this->setupTemplate(false);
$journal =& Request::getJournal();
$user =& Request::getUser();
$meetingDao =& DAORegistry::getDAO('MeetingDAO');
$meetingSectionDecisionDao =& DAORegistry::getDAO('MeetingSectionDecisionDAO');
$sectionDecisionDao =& DAORegistry::getDAO('SectionDecisionDAO');
$sort = Request::getUserVar('sort');
$sort = isset($sort) ? $sort : 'id';
$sortDirection = Request::getUserVar('sortDirection');
$rangeInfo = Handler::getRangeInfo('meetings');
$fromDate = Request::getUserDateVar('dateFrom', 1, 1);
if ($fromDate != null) {
$fromDate = date('Y-m-d H:i:s', $fromDate);
}
$toDate = Request::getUserDateVar('dateTo', 32, 12, null, 23, 59, 59);
if ($toDate != null) {
$toDate = date('Y-m-d H:i:s', $toDate);
}
$status = Request::getUserVar('status');
$minutesStatus = Request::getUserVar('minutesStatus');
$meetings = $meetingDao->getMeetingsOfSection($user->getSecretaryCommitteeId(), $sort, $rangeInfo, $sortDirection, $status, $minutesStatus, $fromDate, $toDate);
$meetingsArray = $meetings->toArray();
$map = array();
foreach ($meetingsArray as $meeting) {
$mSectiondecisions = $meetingSectionDecisionDao->getMeetingSectionDecisionsByMeetingId($meeting->getId());
$secionDecisions = array();
foreach ($mSectiondecisions as $mSectiondecision) {
$sectionDecision = $sectionDecisionDao->getSectionDecision($mSectiondecision->getSectionDecisionId());
array_push($secionDecisions, $sectionDecision);
}
$map[$meeting->getId()] = $secionDecisions;
}
$meetings = $meetingDao->getMeetingsOfSection($user->getSecretaryCommitteeId(), $sort, $rangeInfo, $sortDirection, $status, $minutesStatus, $fromDate, $toDate);
$templateMgr =& TemplateManager::getManager();
$templateMgr->assign_by_ref('meetings', $meetings);
$templateMgr->assign_by_ref('secionDecisions', $secionDecisions);
$templateMgr->assign_by_ref('map', $map);
$templateMgr->assign('rangeInfo', count($meetings));
$templateMgr->assign('sort', $sort);
$templateMgr->assign('sortDirection', $sortDirection);
//$templateMgr->assign('pageToDisplay', $page);
$templateMgr->assign('sectionEditor', $user->getFullName());
$templateMgr->assign('baseUrl', Config::getVar('general', "base_url"));
$templateMgr->assign('dateFrom', $fromDate);
$templateMgr->assign('dateTo', $toDate);
$templateMgr->assign('status', $status);
$templateMgr->assign('minutesStatus', $minutesStatus);
$templateMgr->assign('ercId', $user->getSecretaryCommitteeId());
// Set search parameters
$duplicateParameters = array('dateFromMonth', 'dateFromDay', 'dateFromYear', 'dateToMonth', 'dateToDay', 'dateToYear', 'status', 'minutesStatus');
foreach ($duplicateParameters as $param) {
$templateMgr->assign($param, Request::getUserVar($param));
}
$templateMgr->display('sectionEditor/meetings/meetings.tpl');
}
示例13: index
/**
* Display reviewer index page.
*/
function index($args)
{
$this->validate();
$this->setupTemplate();
$journal =& Request::getJournal();
//%CBP% redirect or set var as appropriate
$CBPPlatformDao =& DAORegistry::getDAO('CBPPlatformDAO');
$workshop = $CBPPlatformDao->getWorkshop($journal->getJournalId());
if ($workshop != "structured") {
$workshop = 1;
}
if ($workshop == 1) {
Request::redirect(Request::getRequestedJournalPath(), 'user');
}
$user =& Request::getUser();
$reviewerSubmissionDao =& DAORegistry::getDAO('ReviewerSubmissionDAO');
$rangeInfo = Handler::getRangeInfo('submissions');
$page = isset($args[0]) ? $args[0] : '';
switch ($page) {
case 'completed':
$active = false;
break;
default:
$page = 'active';
$active = true;
}
$sort = Request::getUserVar('sort');
$sort = isset($sort) ? $sort : 'title';
$sortDirection = Request::getUserVar('sortDirection');
if ($sort == 'decision') {
$submissions = $reviewerSubmissionDao->getReviewerSubmissionsByReviewerId($user->getId(), $journal->getId(), $active, $rangeInfo);
// Sort all submissions by status, which is too complex to do in the DB
$submissionsArray = $submissions->toArray();
$compare = create_function('$s1, $s2', 'return strcmp($s1->getMostRecentDecision(), $s2->getMostRecentDecision());');
usort($submissionsArray, $compare);
if ($sortDirection == SORT_DIRECTION_DESC) {
$submissionsArray = array_reverse($submissionsArray);
}
// Convert submission array back to an ItemIterator class
import('lib.pkp.classes.core.ArrayItemIterator');
$submissions =& ArrayItemIterator::fromRangeInfo($submissionsArray, $rangeInfo);
} else {
$submissions = $reviewerSubmissionDao->getReviewerSubmissionsByReviewerId($user->getId(), $journal->getId(), $active, $rangeInfo, $sort, $sortDirection);
}
$templateMgr =& TemplateManager::getManager();
$templateMgr->assign('reviewerRecommendationOptions', ReviewAssignment::getReviewerRecommendationOptions());
$templateMgr->assign('pageToDisplay', $page);
$templateMgr->assign_by_ref('submissions', $submissions);
import('classes.submission.reviewAssignment.ReviewAssignment');
$templateMgr->assign_by_ref('reviewerRecommendationOptions', ReviewAssignment::getReviewerRecommendationOptions());
import('classes.issue.IssueAction');
$issueAction = new IssueAction();
$templateMgr->register_function('print_issue_id', array($issueAction, 'smartyPrintIssueId'));
$templateMgr->assign('helpTopicId', 'editorial.reviewersRole.submissions');
$templateMgr->assign('sort', $sort);
$templateMgr->assign('sortDirection', $sortDirection);
$templateMgr->display('reviewer/index.tpl');
}
示例14: initData
/**
* Initialize form data from current group group.
*/
function initData()
{
$conferenceId = $this->conferenceId;
$plugin =& $this->plugin;
$staticPagesDAO =& DAORegistry::getDAO('StaticPagesDAO');
$rangeInfo =& Handler::getRangeInfo('staticPages');
$staticPages = $staticPagesDAO->getStaticPagesByConferenceId($conferenceId);
$this->setData('staticPages', $staticPages);
}
示例15: editLocaleFile
function editLocaleFile($args)
{
list($plugin) = CustomLocaleHandler::validate();
CustomLocaleHandler::setupTemplate($plugin, true);
$locale = array_shift($args);
if (!Locale::isLocaleValid($locale)) {
$path = array($plugin->getCategory(), $plugin->getName(), 'index');
Request::redirect(null, null, null, $path);
}
$filename = urldecode(urldecode(array_shift($args)));
if (!CustomLocaleAction::isLocaleFile($locale, $filename)) {
$path = array($plugin->getCategory(), $plugin->getName(), 'edit', $locale);
Request::redirect(null, null, null, $path);
}
$templateMgr =& TemplateManager::getManager();
import('file.FileManager');
import('file.EditableLocaleFile');
$journal = Request::getJournal();
$journalId = $journal->getJournalId();
$publicFilesDir = Config::getVar('files', 'public_files_dir');
$customLocaleDir = $publicFilesDir . DIRECTORY_SEPARATOR . 'journals' . DIRECTORY_SEPARATOR . $journalId . DIRECTORY_SEPARATOR . CUSTOM_LOCALE_DIR;
$customLocalePath = $customLocaleDir . DIRECTORY_SEPARATOR . $locale . DIRECTORY_SEPARATOR . $filename;
if (FileManager::fileExists($customLocalePath)) {
$localeContents = EditableLocaleFile::load($customLocalePath);
} else {
$localeContents = null;
}
$referenceLocaleContents = EditableLocaleFile::load($filename);
$referenceLocaleContentsRangeInfo = Handler::getRangeInfo('referenceLocaleContents');
// Handle a search, if one was executed.
$searchKey = Request::getUserVar('searchKey');
$found = false;
$index = 0;
$pageIndex = 0;
if (!empty($searchKey)) {
foreach ($referenceLocaleContents as $key => $value) {
if ($index % $referenceLocaleContentsRangeInfo->getCount() == 0) {
$pageIndex++;
}
if ($key == $searchKey) {
$found = true;
break;
}
$index++;
}
}
if ($found) {
$referenceLocaleContentsRangeInfo->setPage($pageIndex);
$templateMgr->assign('searchKey', $searchKey);
}
$templateMgr->assign('filename', $filename);
$templateMgr->assign('locale', $locale);
import('core.ArrayItemIterator');
$templateMgr->assign_by_ref('referenceLocaleContents', new ArrayItemIterator($referenceLocaleContents, $referenceLocaleContentsRangeInfo->getPage(), $referenceLocaleContentsRangeInfo->getCount()));
$templateMgr->assign('localeContents', $localeContents);
$templateMgr->display($plugin->getTemplatePath() . 'localeFile.tpl');
}