本文整理汇总了PHP中Request::getSchedConf方法的典型用法代码示例。如果您正苦于以下问题:PHP Request::getSchedConf方法的具体用法?PHP Request::getSchedConf怎么用?PHP Request::getSchedConf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Request
的用法示例。
在下文中一共展示了Request::getSchedConf方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: define
/**
* Used by subclasses to validate access keys when they are allowed.
* @param $userId int The user this key refers to
* @param $reviewId int The ID of the review this key refers to
* @param $newKey string The new key name, if one was supplied; otherwise, the existing one (if it exists) is used
* @return object Valid user object if the key was valid; otherwise NULL.
*/
function &validateAccessKey($userId, $reviewId, $newKey = null)
{
$schedConf =& Request::getSchedConf();
if (!$schedConf || !$schedConf->getSetting('reviewerAccessKeysEnabled')) {
$accessKey = false;
return $accessKey;
}
define('REVIEWER_ACCESS_KEY_SESSION_VAR', 'ReviewerAccessKey');
import('security.AccessKeyManager');
$accessKeyManager = new AccessKeyManager();
$session =& Request::getSession();
// Check to see if a new access key is being used.
if (!empty($newKey)) {
if (Validation::isLoggedIn()) {
Validation::logout();
}
$keyHash = $accessKeyManager->generateKeyHash($newKey);
$session->setSessionVar(REVIEWER_ACCESS_KEY_SESSION_VAR, $keyHash);
} else {
$keyHash = $session->getSessionVar(REVIEWER_ACCESS_KEY_SESSION_VAR);
}
// Now that we've gotten the key hash (if one exists), validate it.
$accessKey =& $accessKeyManager->validateKey('ReviewerContext', $userId, $keyHash, $reviewId);
if ($accessKey) {
$userDao =& DAORegistry::getDAO('UserDAO');
$user =& $userDao->getUser($accessKey->getUserId(), false);
return $user;
}
// No valid access key -- return NULL.
return $accessKey;
}
示例2: execute
/**
* Save group group.
*/
function execute()
{
$groupDao =& DAORegistry::getDAO('GroupDAO');
$conference =& Request::getConference();
$schedConf =& Request::getSchedConf();
if (!isset($this->group)) {
$this->group = new Group();
}
$this->group->setAssocType(ASSOC_TYPE_SCHED_CONF);
$this->group->setAssocId($schedConf->getId());
$this->group->setTitle($this->getData('title'), null);
// Localized
$this->group->setPublishEmail($this->getData('publishEmail'));
// Eventually this will be a general Groups feature; for now,
// we're just using it to display conference team entries in About.
$this->group->setAboutDisplayed(true);
// Update or insert group group
if ($this->group->getId() != null) {
$groupDao->updateObject($this->group);
} else {
$this->group->setSequence(REALLY_BIG_NUMBER);
$groupDao->insertGroup($this->group);
// Re-order the groups so the new one is at the end of the list.
$groupDao->resequenceGroups($this->group->getAssocType(), $this->group->getAssocId());
}
}
示例3: display
function display(&$args)
{
$conference =& Request::getConference();
$schedConf =& Request::getSchedConf();
Locale::requireComponents(array(LOCALE_COMPONENT_APPLICATION_COMMON, LOCALE_COMPONENT_PKP_SUBMISSION, LOCALE_COMPONENT_PKP_USER, LOCALE_COMPONENT_OCS_MANAGER));
$this->import('PaperFormSettings');
$form = new PaperFormSettings($this, $conference->getId());
if (Request::getUserVar('GenerateReport')) {
$ReportHandlerDAO =& DAORegistry::getDAO('MultiPaperReportDAO');
$iterator =& $ReportHandlerDAO->getPaperReport($conference->getId(), $schedConf->getId());
$form->readInputData();
if ($form->validate()) {
$form->execute();
$custom_Class = $form->getData('reportClass');
if (class_exists($custom_Class)) {
$Report = new $custom_Class($iterator, $this);
$Report->makeReport();
Request::redirect(null, null, 'manager', 'plugin');
} else {
echo Locale::translate('plugins.reports.MultiGeneratorPaperReport.classNotFound');
$form->display();
}
} else {
$this->setBreadCrumbs(true);
$form->makeOptions();
$form->display();
}
} else {
$this->setBreadCrumbs(true);
$form->initData();
$form->display();
}
}
示例4: handle
/**
* Handle incoming requests/notifications
*/
function handle($args)
{
$conference =& Request::getConference();
$schedConf =& Request::getSchedConf();
$templateMgr =& TemplateManager::getManager();
$user =& Request::getUser();
$op = isset($args[0]) ? $args[0] : null;
$queuedPaymentId = isset($args[1]) ? (int) $args[1] : 0;
import('payment.ocs.OCSPaymentManager');
$ocsPaymentManager =& OCSPaymentManager::getManager();
$queuedPayment =& $ocsPaymentManager->getQueuedPayment($queuedPaymentId);
// if the queued payment doesn't exist, redirect away from payments
if (!$queuedPayment) {
Request::redirect(null, null, null, 'index');
}
switch ($op) {
case 'notify':
import('mail.MailTemplate');
Locale::requireComponents(array(LOCALE_COMPONENT_APPLICATION_COMMON));
$contactName = $schedConf->getSetting('registrationName');
$contactEmail = $schedConf->getSetting('registrationEmail');
$mail = new MailTemplate('MANUAL_PAYMENT_NOTIFICATION');
$mail->setFrom($contactEmail, $contactName);
$mail->addRecipient($contactEmail, $contactName);
$mail->assignParams(array('schedConfName' => $schedConf->getFullTitle(), 'userFullName' => $user ? $user->getFullName() : '(' . Locale::translate('common.none') . ')', 'userName' => $user ? $user->getUsername() : '(' . Locale::translate('common.none') . ')', 'itemName' => $queuedPayment->getName(), 'itemCost' => $queuedPayment->getAmount(), 'itemCurrencyCode' => $queuedPayment->getCurrencyCode()));
$mail->send();
$templateMgr->assign(array('currentUrl' => Request::url(null, null, null, 'payment', 'plugin', array('notify', $queuedPaymentId)), 'pageTitle' => 'plugins.paymethod.manual.paymentNotification', 'message' => 'plugins.paymethod.manual.notificationSent', 'backLink' => $queuedPayment->getRequestUrl(), 'backLinkLabel' => 'common.continue'));
$templateMgr->display('common/message.tpl');
exit;
break;
}
parent::handle($args);
// Don't know what to do with it
}
示例5: saveProgramSettings
/**
* Save changes to program settings.
*/
function saveProgramSettings()
{
$this->validate();
$this->setupTemplate(true);
$schedConf =& Request::getSchedConf();
if (!$schedConf) {
Request::redirect(null, null, 'index');
}
import('classes.manager.form.ProgramSettingsForm');
$settingsForm = new ProgramSettingsForm();
$settingsForm->readInputData();
$formLocale = $settingsForm->getFormLocale();
$programTitle = Request::getUserVar('programFileTitle');
$editData = false;
if (Request::getUserVar('uploadProgramFile')) {
if (!$settingsForm->uploadProgram('programFile', $formLocale)) {
$settingsForm->addError('programFile', Locale::translate('common.uploadFailed'));
}
$editData = true;
} elseif (Request::getUserVar('deleteProgramFile')) {
$settingsForm->deleteProgram('programFile', $formLocale);
$editData = true;
}
if (!$editData && $settingsForm->validate()) {
$settingsForm->execute();
$templateMgr =& TemplateManager::getManager();
$templateMgr->assign(array('currentUrl' => Request::url(null, null, null, 'program'), 'pageTitle' => 'schedConf.program', 'message' => 'common.changesSaved', 'backLink' => Request::url(null, null, Request::getRequestedPage()), 'backLinkLabel' => 'manager.conferenceSiteManagement'));
$templateMgr->display('common/message.tpl');
} else {
$settingsForm->display();
}
}
示例6: isValid
/**
* Check if field value is valid.
* Value is valid if it is empty and optional or validated by user-supplied function.
* @return boolean
*/
function isValid()
{
// Get conference ID from request
$conference =& Request::getConference();
$conferenceId = $conference ? $conference->getId() : 0;
// Get scheduled conference ID from request
$schedConf =& Request::getSchedConf();
$schedConfId = $schedConf ? $schedConf->getId() : 0;
$user = Request::getUser();
if (!$user) {
return false;
}
$roleDao =& DAORegistry::getDAO('RoleDAO');
$returner = true;
foreach ($this->roles as $roleId) {
if ($roleId == ROLE_ID_SITE_ADMIN) {
$exists = $roleDao->roleExists(0, 0, $user->getId(), $roleId);
} elseif ($roleId == ROLE_ID_CONFERENCE_MANAGER) {
$exists = $roleDao->roleExists($conferenceId, 0, $user->getId(), $roleId);
} else {
$exists = $roleDao->roleExists($conferenceId, $schedConfId, $user->getId(), $roleId);
}
if (!$this->all && $exists) {
return true;
}
$returner = $returner && $exists;
}
return $returner;
}
示例7: execute
/**
* Save modified settings.
*/
function execute()
{
$schedConf =& Request::getSchedConf();
$settingsDao =& DAORegistry::getDAO('SchedConfSettingsDAO');
foreach ($this->_data as $name => $value) {
$settingsDao->updateSetting($schedConf->getId(), $name, $value, $this->settings[$name], true);
}
}
示例8: AuthorSubmitStep4Form
/**
* Constructor.
*/
function AuthorSubmitStep4Form($paper)
{
parent::AuthorSubmitForm($paper, 4);
$schedConf =& Request::getSchedConf();
if (!$schedConf->getSetting('acceptSupplementaryReviewMaterials')) {
// If supplementary files are not allowed, redirect.
Request::redirect(null, null, null, null, '5');
}
}
示例9: isValid
/**
* Check if field value is valid.
* Value is valid if it is empty and optional or validated by user-supplied function.
* @return boolean
*/
function isValid()
{
$conference =& Request::getConference();
$schedConf =& Request::getSchedConf();
if (!$conference || !$schedConf) {
return false;
}
return true;
}
示例10: getManagementVerbs
/**
* Display verbs for the management interface.
*/
function getManagementVerbs()
{
$schedConf =& Request::getSchedConf();
if ($schedConf) {
return array(array('reports', Locale::translate('manager.statistics.reports')));
} else {
return array();
}
}
示例11: execute
/**
* Save building.
*/
function execute()
{
$schedConf =& Request::getSchedConf();
$schedConf->updateSetting('mergeSchedules', $this->getData('mergeSchedules'), 'bool');
$schedConf->updateSetting('showEndTime', $this->getData('showEndTime'), 'bool');
$schedConf->updateSetting('showAuthors', $this->getData('showAuthors'), 'bool');
$schedConf->updateSetting('hideNav', $this->getData('hideNav'), 'bool');
$schedConf->updateSetting('hideLocations', $this->getData('hideLocations'), 'bool');
$schedConf->updateSetting('layoutType', $this->getData('layoutType'), 'int');
}
示例12: execute
/**
* Save modified settings.
*/
function execute()
{
$schedConf =& Request::getSchedConf();
$settingsDao = DAORegistry::getDAO('SchedConfSettingsDAO');
foreach ($this->_data as $name => $value) {
if (isset($this->settings[$name])) {
$isLocalized = in_array($name, $this->getLocaleFieldNames());
$settingsDao->updateSetting($schedConf->getId(), $name, $value, $this->settings[$name], $isLocalized);
}
}
}
示例13: display
function display(&$args)
{
$conference =& Request::getConference();
$schedConf =& Request::getSchedConf();
Locale::requireComponents(array(LOCALE_COMPONENT_APPLICATION_COMMON, LOCALE_COMPONENT_PKP_USER, LOCALE_COMPONENT_PKP_SUBMISSION, LOCALE_COMPONENT_OCS_MANAGER));
header('content-type: text/comma-separated-values');
header('content-disposition: attachment; filename=reviews-' . date('Ymd') . '.csv');
$reviewReportDao =& DAORegistry::getDAO('ReviewReportDAO');
list($commentsIterator, $reviewsIterator) = $reviewReportDao->getReviewReport($schedConf->getId());
$comments = array();
while ($row =& $commentsIterator->next()) {
if (isset($comments[$row['paper_id']][$row['author_id']])) {
$comments[$row['paper_id']][$row['author_id']] .= "; " . $row['comments'];
} else {
$comments[$row['paper_id']][$row['author_id']] = $row['comments'];
}
}
$yesnoMessages = array(0 => Locale::translate('common.no'), 1 => Locale::translate('common.yes'));
import('classes.schedConf.SchedConf');
$reviewTypes = array(REVIEW_MODE_ABSTRACTS_ALONE => Locale::translate('manager.schedConfSetup.submissions.abstractsAlone'), REVIEW_MODE_BOTH_SEQUENTIAL => Locale::translate('manager.schedConfSetup.submissions.bothSequential'), REVIEW_MODE_PRESENTATIONS_ALONE => Locale::translate('manager.schedConfSetup.submissions.presentationsAlone'), REVIEW_MODE_BOTH_SIMULTANEOUS => Locale::translate('manager.schedConfSetup.submissions.bothTogether'));
import('classes.submission.reviewAssignment.ReviewAssignment');
$recommendations = ReviewAssignment::getReviewerRecommendationOptions();
$columns = array('reviewRound' => Locale::translate('submissions.reviewType'), 'paper' => Locale::translate('paper.papers'), 'paperid' => Locale::translate('paper.submissionId'), 'reviewerid' => Locale::translate('plugins.reports.reviews.reviewerId'), 'reviewer' => Locale::translate('plugins.reports.reviews.reviewer'), 'firstname' => Locale::translate('user.firstName'), 'middlename' => Locale::translate('user.middleName'), 'lastname' => Locale::translate('user.lastName'), 'dateassigned' => Locale::translate('plugins.reports.reviews.dateAssigned'), 'datenotified' => Locale::translate('plugins.reports.reviews.dateNotified'), 'dateconfirmed' => Locale::translate('plugins.reports.reviews.dateConfirmed'), 'datecompleted' => Locale::translate('plugins.reports.reviews.dateCompleted'), 'datereminded' => Locale::translate('plugins.reports.reviews.dateReminded'), 'declined' => Locale::translate('submissions.declined'), 'cancelled' => Locale::translate('common.cancelled'), 'recommendation' => Locale::translate('reviewer.paper.recommendation'), 'comments' => Locale::translate('comments.commentsOnPaper'));
$yesNoArray = array('declined', 'cancelled');
$fp = fopen('php://output', 'wt');
String::fputcsv($fp, array_values($columns));
while ($row =& $reviewsIterator->next()) {
foreach ($columns as $index => $junk) {
if (in_array($index, array('declined', 'cancelled'))) {
$yesNoIndex = $row[$index];
if (is_string($yesNoIndex)) {
// Accomodate Postgres boolean casting
$yesNoIndex = $yesNoIndex == "f" ? 0 : 1;
}
$columns[$index] = $yesnoMessages[$yesNoIndex];
} elseif ($index == 'reviewRound') {
$columns[$index] = $reviewTypes[$row[$index]];
} elseif ($index == "recommendation") {
$columns[$index] = !isset($row[$index]) ? Locale::translate('common.none') : Locale::translate($recommendations[$row[$index]]);
} elseif ($index == "comments") {
if (isset($comments[$row['paperid']][$row['reviewerid']])) {
$columns[$index] = html_entity_decode(strip_tags($comments[$row['paperid']][$row['reviewerid']]));
} else {
$columns[$index] = "";
}
} else {
$columns[$index] = $row[$index];
}
}
String::fputcsv($fp, $columns);
unset($row);
}
fclose($fp);
}
示例14: assignParams
function assignParams($paramArray = array())
{
$paper =& $this->paper;
$conference = isset($this->conference) ? $this->conference : Request::getConference();
$schedConf = isset($this->schedConf) ? $this->schedConf : Request::getSchedConf();
$paramArray['paperTitle'] = strip_tags($paper->getLocalizedTitle());
$paramArray['conferenceName'] = strip_tags($conference->getConferenceTitle());
$paramArray['schedConfName'] = strip_tags($schedConf->getSchedConfTitle());
$paramArray['trackName'] = strip_tags($paper->getTrackTitle());
$paramArray['paperAbstract'] = strip_tags($paper->getLocalizedAbstract());
$paramArray['authorString'] = strip_tags($paper->getAuthorString());
parent::assignParams($paramArray);
}
示例15:
function &getPaymentPlugin()
{
$schedConf =& Request::getSchedConf();
$paymentMethodPluginName = $schedConf->getSetting('paymentMethodPluginName');
$paymentMethodPlugin = null;
if (!empty($paymentMethodPluginName)) {
$plugins =& PluginRegistry::loadCategory('paymethod');
if (isset($plugins[$paymentMethodPluginName])) {
$paymentMethodPlugin =& $plugins[$paymentMethodPluginName];
}
}
return $paymentMethodPlugin;
}