/** * Display the form. */ function display() { $conference =& Request::getConference(); $reviewFormDao =& DAORegistry::getDAO('ReviewFormDAO'); $reviewForm =& $reviewFormDao->getReviewForm($this->reviewFormId, $conference->getId()); $reviewFormElementDao =& DAORegistry::getDAO('ReviewFormElementDAO'); $reviewFormElements =& $reviewFormElementDao->getReviewFormElements($this->reviewFormId); $reviewFormResponseDao =& DAORegistry::getDAO('ReviewFormResponseDAO'); $reviewFormResponses =& $reviewFormResponseDao->getReviewReviewFormResponseValues($this->reviewId); $reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO'); $reviewAssignment = $reviewAssignmentDao->getReviewAssignmentById($this->reviewId); $editorPreview = Request::getRequestedPage() != 'reviewer'; if (!$editorPreview) { ReviewerHandler::setupTemplate(true, $reviewAssignment->getPaperId(), $this->reviewId); } $templateMgr =& TemplateManager::getManager(); $templateMgr->assign('pageTitle', 'submission.reviewFormResponse'); $templateMgr->assign_by_ref('reviewForm', $reviewForm); $templateMgr->assign('reviewFormElements', $reviewFormElements); $templateMgr->assign('reviewFormResponses', $reviewFormResponses); $templateMgr->assign('reviewId', $this->reviewId); $templateMgr->assign('paperId', $reviewAssignment->getPaperId()); $templateMgr->assign('isLocked', isset($reviewAssignment) && $reviewAssignment->getDateCompleted() != null); $templateMgr->assign('editorPreview', $editorPreview); parent::display(); }
/** * Save modified settings. */ function execute() { $conference =& Request::getConference(); $settingsDao =& DAORegistry::getDAO('ConferenceSettingsDAO'); // Verify additional locales foreach (array('supportedLocales', 'supportedFormLocales') as $name) { ${$name} = array(); foreach ($this->getData($name) as $locale) { if (Locale::isLocaleValid($locale) && in_array($locale, $this->availableLocales)) { array_push(${$name}, $locale); } } } $primaryLocale = $this->getData('primaryLocale'); // Make sure at least the primary locale is chosen as available if ($primaryLocale != null && !empty($primaryLocale)) { foreach (array('supportedLocales', 'supportedFormLocales') as $name) { if (!in_array($primaryLocale, ${$name})) { array_push(${$name}, $primaryLocale); } } } $this->setData('supportedLocales', $supportedLocales); $this->setData('supportedFormLocales', $supportedFormLocales); foreach ($this->_data as $name => $value) { if (!in_array($name, array_keys($this->settings))) { continue; } $settingsDao->updateSetting($conference->getId(), $name, $value, $this->settings[$name]); } $conferenceDao =& DAORegistry::getDAO('ConferenceDAO'); $conference->setPrimaryLocale($this->getData('primaryLocale')); $conferenceDao->updateConference($conference); }
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(); } }
/** * 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; }
function saveSettings() { $this->validate(); $conference = Request::getConference(); if ($conference) { $rtDao =& DAORegistry::getDAO('RTDAO'); $rt = $rtDao->getConferenceRTByConference($conference); if (Request::getUserVar('version') == '') { $rt->setVersion(null); } else { $rt->setVersion(Request::getUserVar('version')); } $rt->setEnabled(Request::getUserVar('enabled') == true); $rt->setAbstract(Request::getUserVar('abstract') == true); $rt->setCaptureCite(Request::getUserVar('captureCite') == true); $rt->setViewMetadata(Request::getUserVar('viewMetadata') == true); $rt->setSupplementaryFiles(Request::getUserVar('supplementaryFiles') == true); $rt->setPrinterFriendly(Request::getUserVar('printerFriendly') == true); $rt->setAuthorBio(Request::getUserVar('authorBio') == true); $rt->setDefineTerms(Request::getUserVar('defineTerms') == true); $rt->setAddComment(Request::getUserVar('addComment') == true); $rt->setEmailAuthor(Request::getUserVar('emailAuthor') == true); $rt->setEmailOthers(Request::getUserVar('emailOthers') == true); $rt->setFindingReferences(Request::getUserVar('findingReferences') == true); $rtDao->updateConferenceRT($rt); } Request::redirect(null, null, Request::getRequestedPage()); }
/** * Save review form. */ function execute() { $conference =& Request::getConference(); $conferenceId = $conference->getId(); $reviewFormDao =& DAORegistry::getDAO('ReviewFormDAO'); if ($this->reviewFormId != null) { $reviewForm =& $reviewFormDao->getReviewForm($this->reviewFormId, ASSOC_TYPE_CONFERENCE, $conferenceId); } if (!isset($reviewForm)) { $reviewForm = $reviewFormDao->newDataObject(); $reviewForm->setAssocType(ASSOC_TYPE_CONFERENCE); $reviewForm->setAssocId($conferenceId); $reviewForm->setActive(0); $reviewForm->setSequence(REALLY_BIG_NUMBER); } $reviewForm->setTitle($this->getData('title'), null); // Localized $reviewForm->setDescription($this->getData('description'), null); // Localized if ($reviewForm->getId() != null) { $reviewFormDao->updateObject($reviewForm); $reviewFormId = $reviewForm->getId(); } else { $reviewFormId = $reviewFormDao->insertObject($reviewForm); $reviewFormDao->resequenceReviewForms(ASSOC_TYPE_CONFERENCE, $conferenceId); } }
/** * 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 }
/** * 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()); } }
/** * Display the form. */ function display() { $conference =& Request::getConference(); // Ensure upload file settings are reloaded when the form is displayed. $templateMgr =& TemplateManager::getManager(); $templateMgr->assign(array('homeHeaderTitleImage' => $conference->getSetting('homeHeaderTitleImage'), 'homeHeaderLogoImage' => $conference->getSetting('homeHeaderLogoImage'), 'pageHeaderTitleImage' => $conference->getSetting('pageHeaderTitleImage'), 'pageHeaderLogoImage' => $conference->getSetting('pageHeaderLogoImage'), 'conferenceFavicon' => $conference->getSetting('conferenceFavicon'))); parent::display(); }
function Handler() { parent::PKPHandler(); $conference =& Request::getConference(); $page = Request::getRequestedPage(); if ($conference && $conference->getSetting('restrictSiteAccess')) { $this->addCheck(new HandlerValidatorCustom($this, true, null, null, create_function('$page', 'if (!Validation::isLoggedIn() && !in_array($page, Handler::getLoginExemptions())) return false; else return true;'), array($page))); } }
function setEnabled($enabled) { $conference =& Request::getConference(); if ($conference) { $this->updateSetting($conference->getId(), 0, 'enabled', $enabled ? true : false); return true; } return false; }
/** * @see OAI#OAI */ function ConferenceOAI($config) { parent::OAI($config); $this->site =& Request::getSite(); $this->conference =& Request::getConference(); $this->conferenceId = isset($this->conference) ? $this->conference->getId() : null; $this->dao =& DAORegistry::getDAO('OAIDAO'); $this->dao->setOAI($this); }
/** * 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; }
/** * Get the HTML contents for this block. * @param $templateMgr object * @return $string */ function getContents(&$templateMgr) { $conference =& Request::getConference(); if (!$conference) { return ''; } $templateMgr->assign('forReaders', $conference->getLocalizedSetting('readerInformation')); $templateMgr->assign('forAuthors', $conference->getLocalizedSetting('authorInformation')); return parent::getContents($templateMgr); }
/** * Display the form. */ function display() { $templateMgr =& TemplateManager::getManager(); $conference =& Request::getConference(); $schedConfDao =& DAORegistry::getDAO('SchedConfDAO'); $schedConfTitles =& $schedConfDao->getSchedConfTitles($conference->getId()); $templateMgr->assign_by_ref('schedConfTitles', $schedConfTitles); $templateMgr->assign(array('homepageImage' => $conference->getSetting('homepageImage'))); parent::display(); }
/** * inserts a new paper note into notes table * @param PaperNote object * @return Paper Note Id int */ function insertPaperNote(&$paperNote) { if (Config::getVar('debug', 'deprecation_warnings')) { trigger_error('Deprecated function'); } $paperNote->setAssocType(ASSOC_TYPE_PAPER); $conference =& Request::getConference(); $paperNote->setContextId($conference->getId()); return $this->insertObject($paperNote); }
/** * Validate the form */ function validate() { $conference =& Request::getConference(); $suppFileDao = DAORegistry::getDAO('SuppFileDAO'); $publicSuppFileId = $this->getData('publicSuppFileId'); if ($publicSuppFileId && $suppFileDao->suppFileExistsByPublicId($publicSuppFileId, $this->suppFileId, $conference->getId())) { $this->addError('publicSchedConfId', __('author.suppFile.suppFilePublicIdentificationExists')); $this->addErrorField('publicSuppFileId'); } return parent::validate(); }
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); }
function getContents(&$templateMgr) { $user =& Request::getUser(); $conference =& Request::getConference(); if ($user && $conference) { $userId = $user->getId(); $notificationDao =& DAORegistry::getDAO('NotificationDAO'); $templateMgr->assign('unreadNotifications', $notificationDao->getUnreadNotificationCount($userId)); } return parent::getContents($templateMgr); }
/** * Display the form. */ function display() { $conference =& Request::getConference(); $templateMgr =& TemplateManager::getManager(); $templateMgr->assign('versionId', $this->versionId); if (isset($this->context)) { $templateMgr->assign_by_ref('context', $this->context); $templateMgr->assign('contextId', $this->contextId); } $templateMgr->assign('helpTopicId', 'conference.generalManagement.readingTools.contexts'); parent::display(); }
/** * Initialize form data from current review form. */ function initData() { if ($this->reviewFormElementId != null) { $conference =& Request::getConference(); $reviewFormElementDao =& DAORegistry::getDAO('ReviewFormElementDAO'); $reviewFormElement =& $reviewFormElementDao->getReviewFormElement($this->reviewFormElementId); if ($reviewFormElement == null) { $this->reviewFormElementId = null; } else { $this->_data = array('question' => $reviewFormElement->getQuestion(null), 'required' => $reviewFormElement->getRequired(), 'elementType' => $reviewFormElement->getElementType(), 'possibleResponses' => $reviewFormElement->getPossibleResponses(null)); } } }
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); }
function addCustomLocale($hookName, $args) { $locale =& $args[0]; $localeFilename =& $args[1]; $conference = Request::getConference(); $conferenceId = $conference->getId(); $publicFilesDir = Config::getVar('files', 'public_files_dir'); $customLocalePath = $publicFilesDir . DIRECTORY_SEPARATOR . 'conferences' . DIRECTORY_SEPARATOR . $conferenceId . DIRECTORY_SEPARATOR . CUSTOM_LOCALE_DIR . DIRECTORY_SEPARATOR . $locale . DIRECTORY_SEPARATOR . $localeFilename; import('lib.pkp.classes.file.FileManager'); if (FileManager::fileExists($customLocalePath)) { Locale::registerLocaleFile($locale, $customLocalePath, true); } return true; }
/** * Helper Function - set mail from address * @param MailTemplate $mail */ function _setMailFrom(&$mail) { $site =& Request::getSite(); $conference =& Request::getConference(); $schedConf =& Request::getSchedConf(); // Set the sender to one of three different settings, based on context if ($schedConf && $schedConf->getSetting('supportEmail')) { $mail->setFrom($schedConf->getSetting('supportEmail'), $schedConf->getSetting('supportName')); } elseif ($conference && $conference->getSetting('contactEmail')) { $mail->setFrom($conference->getSetting('contactEmail'), $conference->getSetting('contactName')); } else { $mail->setFrom($site->getLocalizedContactEmail(), $site->getLocalizedContactName()); } }
/** * Display the form. */ function display() { $conference =& Request::getConference(); $templateMgr =& TemplateManager::getManager(); $templateMgr->assign('paperId', $this->paperId); $templateMgr->assign('galleyId', $this->galleyId); $templateMgr->assign('round', $this->round); $templateMgr->assign('supportedLocales', $conference->getSupportedLocaleNames()); if (isset($this->galley)) { $templateMgr->assign_by_ref('galley', $this->galley); } $templateMgr->assign('helpTopicId', 'editorial.layoutEditorsRole.layout'); parent::display(); }
/** * Override the block contents based on the current role being * browsed. * @return string */ function getBlockTemplateFilename() { $conference =& Request::getConference(); $schedConf =& Request::getSchedConf(); $user =& Request::getUser(); if (!$conference || !$schedConf || !$user) { return null; } $userId = $user->getId(); $conferenceId = $conference->getId(); $schedConfId = $schedConf->getId(); $templateMgr =& TemplateManager::getManager(); switch (Request::getRequestedPage()) { case 'author': switch (Request::getRequestedOp()) { case 'submit': case 'saveSubmit': case 'submitSuppFile': case 'saveSubmitSuppFile': case 'deleteSubmitSuppFile': // Block disabled for submission return null; default: $authorSubmissionDao =& DAORegistry::getDAO('AuthorSubmissionDAO'); $submissionsCount = $authorSubmissionDao->getSubmissionsCount($userId, $schedConfId); $templateMgr->assign('submissionsCount', $submissionsCount); return 'author.tpl'; } case 'director': if (Request::getRequestedOp() == 'index') { return null; } $directorSubmissionDao =& DAORegistry::getDAO('DirectorSubmissionDAO'); $submissionsCount =& $directorSubmissionDao->getDirectorSubmissionsCount($schedConfId); $templateMgr->assign('submissionsCount', $submissionsCount); return 'director.tpl'; case 'trackDirector': $trackDirectorSubmissionDao =& DAORegistry::getDAO('TrackDirectorSubmissionDAO'); $submissionsCount =& $trackDirectorSubmissionDao->getTrackDirectorSubmissionsCount($userId, $schedConfId); $templateMgr->assign('submissionsCount', $submissionsCount); return 'trackDirector.tpl'; case 'reviewer': $reviewerSubmissionDao =& DAORegistry::getDAO('ReviewerSubmissionDAO'); $submissionsCount = $reviewerSubmissionDao->getSubmissionsCount($userId, $schedConfId); $templateMgr->assign('submissionsCount', $submissionsCount); return 'reviewer.tpl'; } return null; }
function reloadLocalizedDefaultSettings() { // make sure the locale is valid $locale = Request::getUserVar('localeToLoad'); if (!Locale::isLocaleValid($locale)) { Request::redirect(null, null, null, 'languages'); } $this->validate(); $this->setupTemplate(true); $conference =& Request::getConference(); $conferenceSettingsDao =& DAORegistry::getDAO('ConferenceSettingsDAO'); $conferenceSettingsDao->reloadLocalizedDefaultSettings($conference->getId(), 'registry/conferenceSettings.xml', array('indexUrl' => Request::getIndexUrl(), 'conferencePath' => $conference->getData('path'), 'primaryLocale' => $conference->getPrimaryLocale(), 'conferenceName' => $conference->getTitle($conference->getPrimaryLocale())), $locale); $templateMgr =& TemplateManager::getManager(); $templateMgr->assign(array('currentUrl' => Request::url(null, null, null, 'languages'), 'pageTitle' => 'common.languages', 'message' => 'common.changesSaved', 'backLink' => Request::url(null, null, Request::getRequestedPage()), 'backLinkLabel' => 'manager.conferenceSiteManagement')); $templateMgr->display('common/message.tpl'); }
/** * Assigns a track director to a submission. * @param $paperId int * @return boolean true iff ready for redirect */ function assignDirector($paperId, $trackDirectorId, $isDirector = false, $send = false) { $directorSubmissionDao =& DAORegistry::getDAO('DirectorSubmissionDAO'); $editAssignmentDao =& DAORegistry::getDAO('EditAssignmentDAO'); $userDao =& DAORegistry::getDAO('UserDAO'); $user =& Request::getUser(); $conference =& Request::getConference(); $directorSubmission =& $directorSubmissionDao->getDirectorSubmission($paperId); $trackDirector =& $userDao->getUser($trackDirectorId); if (!isset($trackDirector)) { return true; } import('mail.PaperMailTemplate'); $email = new PaperMailTemplate($directorSubmission, 'DIRECTOR_ASSIGN'); if ($user->getId() === $trackDirectorId || !$email->isEnabled() || $send && !$email->hasErrors()) { HookRegistry::call('DirectorAction::assignDirector', array(&$directorSubmission, &$trackDirector, &$isDirector, &$email)); if ($email->isEnabled() && $user->getId() !== $trackDirectorId) { $email->setAssoc(PAPER_EMAIL_DIRECTOR_ASSIGN, PAPER_EMAIL_TYPE_DIRECTOR, $trackDirector->getId()); $email->send(); } $editAssignment = new EditAssignment(); $editAssignment->setPaperId($paperId); // Make the selected director the new director $editAssignment->setDirectorId($trackDirectorId); $editAssignment->setDateNotified(Core::getCurrentDate()); $editAssignment->setDateUnderway(null); $editAssignments =& $directorSubmission->getEditAssignments(); array_push($editAssignments, $editAssignment); $directorSubmission->setEditAssignments($editAssignments); $directorSubmissionDao->updateDirectorSubmission($directorSubmission); // Add log import('paper.log.PaperLog'); import('paper.log.PaperEventLogEntry'); PaperLog::logEvent($paperId, PAPER_LOG_DIRECTOR_ASSIGN, LOG_TYPE_DIRECTOR, $trackDirectorId, 'log.director.directorAssigned', array('directorName' => $trackDirector->getFullName(), 'paperId' => $paperId)); return true; } else { if (!Request::getUserVar('continued')) { $email->addRecipient($trackDirector->getEmail(), $trackDirector->getFullName()); $submissionUrl = Request::url(null, null, $isDirector ? 'director' : 'trackDirector', 'submissionReview', $paperId); $submissionUrl = $submissionUrl . "?u=" . $trackDirector->getUserId(); $paramArray = array('editorialContactName' => $trackDirector->getFullName(), 'directorUsername' => $trackDirector->getUsername(), 'directorPassword' => $trackDirector->getPassword(), 'editorialContactSignature' => $user->getContactSignature(), 'submissionUrl' => $submissionUrl); $email->assignParams($paramArray); } $email->displayEditForm(Request::url(null, null, null, 'assignDirector', 'send'), array('paperId' => $paperId, 'directorId' => $trackDirectorId)); return false; } }
function _announcementIsValid($announcementId) { if ($announcementId == null) { return false; } $announcementDao =& DAORegistry::getDAO('AnnouncementDAO'); switch ($announcementDao->getAnnouncementAssocType($announcementId)) { case ASSOC_TYPE_CONFERENCE: $conference =& Request::getConference(); return $conference && $announcementDao->getAnnouncementAssocId($announcementId) == $conference->getId(); case ASSOC_TYPE_SCHED_CONF: $schedConf =& Request::getSchedConf(); return $schedConf && $announcementDao->getAnnouncementAssocId($announcementId) == $schedConf->getId(); default: return false; } }
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['conferenceName'] = preg_replace('/\\s+/', '', $paramArray['conferenceName']); $paramArray['schedConfName'] = strip_tags($schedConf->getSchedConfTitle()); $paramArray['trackName'] = strip_tags($paper->getTrackTitle()); $paramArray['paperAbstract'] = strip_tags($paper->getLocalizedAbstract()); if ($paramArray['paperAbstract'] === "") { $paramArray['paperAbstract'] = __("common.noData"); } $paramArray['authorString'] = strip_tags($paper->getAuthorString()); parent::assignParams($paramArray); }