Esempio n. 1
0
 /**
  * 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;
 }
Esempio n. 2
0
 /**
  * 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());
     }
 }
Esempio n. 3
0
 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();
     }
 }
Esempio n. 4
0
 /**
  * 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 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();
     }
 }
Esempio n. 6
0
 /**
  * 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;
 }
 /**
  * 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);
     }
 }
Esempio n. 8
0
 /**
  * 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');
     }
 }
 /**
  * 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;
 }
Esempio n. 10
0
 /**
  * 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();
     }
 }
Esempio n. 11
0
 /**
  * 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');
 }
Esempio n. 12
0
 /**
  * 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);
         }
     }
 }
Esempio n. 13
0
 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);
 }
Esempio n. 14
0
 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);
 }
Esempio n. 15
0
 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;
 }
Esempio n. 16
0
 /**
  * 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());
     }
 }
Esempio n. 17
0
 /**
  * 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;
 }
Esempio n. 18
0
 /**
  * Save settings 
  */
 function execute()
 {
     $schedConf =& Request::getSchedConf();
     // Save the general settings for the form
     foreach (array('paymentMethodPluginName') as $schedConfSettingName) {
         $schedConf->updateSetting($schedConfSettingName, $this->getData($schedConfSettingName));
     }
     // Save the specific settings for the plugin
     $paymentMethodPluginName = $this->getData('paymentMethodPluginName');
     if (isset($this->plugins[$paymentMethodPluginName])) {
         $plugin =& $this->plugins[$paymentMethodPluginName];
         foreach ($plugin->getSettingsFormFieldNames() as $field) {
             $plugin->updateSetting($schedConf->getConferenceId(), $schedConf->getId(), $field, $this->getData($field));
         }
     }
 }
Esempio n. 19
0
 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;
     }
 }
Esempio n. 20
0
 /**
  * Display form to create a new scheduled conference.
  */
 function createSchedConf()
 {
     import('schedConf.SchedConf');
     $schedConf = Request::getSchedConf();
     $conference = Request::getConference();
     if ($schedConf) {
         $schedConfId = $schedConf->getId();
     } else {
         $schedConfId = null;
     }
     if ($conference) {
         $conferenceId = $conference->getId();
     } else {
         $conferenceId = null;
     }
     ManagerSchedConfHandler::editSchedConf(array($conferenceId, $schedConfId));
 }
Esempio n. 21
0
 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);
 }
Esempio n. 22
0
 /**
  * Display a landing page for a received registration payment.
  */
 function landing($args)
 {
     $this->validate();
     $this->setupTemplate();
     $user =& Request::getUser();
     $schedConf =& Request::getSchedConf();
     if (!$user || !$schedConf) {
         Request::redirect(null, null, 'index');
     }
     $registrationDao =& DAORegistry::getDAO('RegistrationDAO');
     $registrationId = $registrationDao->getRegistrationIdByUser($user->getId(), $schedConf->getId());
     $registration =& $registrationDao->getRegistration($registrationId);
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->assign('message', $registration && $registration->getDatePaid() ? 'schedConf.registration.landingPaid' : 'schedConf.registration.landingUnpaid');
     $templateMgr->assign('backLink', Request::url(null, null, 'index'));
     $templateMgr->assign('backLinkLabel', 'common.continue');
     $templateMgr->display('common/message.tpl');
 }
Esempio n. 23
0
 function getPaperType($typeId)
 {
     //$types = $this->getPaperTypes($schedConfId);
     //$controlledVocabDao =& DAORegistry::getDAO('ControlledVocabDAO');
     $schedConf =& Request::getSchedConf();
     $paperTypeEntryIterator = $this->getPaperTypes($schedConf->getId());
     while ($paperTypeEntry =& $paperTypeEntryIterator->next()) {
         //if (!in_array($paperTypeEntry->getId(), $paperTypeIds)) {
         //        $paperTypeEntryDao->deleteObject($paperTypeEntry);
         //}
         //unset($paperTypeEntry);
         if ($paperTypeEntry->getId() == $typeId) {
             return $paperTypeEntry;
         }
     }
     //$sessionTypes = $controlledVocabDao->enumerateBySymbolic('paperType', ASSOC_TYPE_SCHED_CONF, $schedConf->getId());
     //print_r($sessionTypes);
 }
Esempio n. 24
0
 function display(&$args)
 {
     $conference =& Request::getConference();
     $schedConf =& Request::getSchedConf();
     Locale::requireComponents(array(LOCALE_COMPONENT_APPLICATION_COMMON, LOCALE_COMPONENT_PKP_USER, LOCALE_COMPONENT_OCS_MANAGER));
     header('content-type: text/comma-separated-values');
     header('content-disposition: attachment; filename=report.csv');
     $registrantReportDao =& DAORegistry::getDAO('RegistrantReportDAO');
     list($registrants, $registrantOptions) = $registrantReportDao->getRegistrantReport($conference->getId(), $schedConf->getId());
     $columns = array('userid' => Locale::translate('plugins.reports.registrants.userid'), 'uname' => Locale::translate('user.username'), 'fname' => Locale::translate('user.firstName'), 'mname' => Locale::translate('user.middleName'), 'lname' => Locale::translate('user.lastName'), 'affiliation' => Locale::translate('user.affiliation'), 'url' => Locale::translate('user.url'), 'email' => Locale::translate('user.email'), 'phone' => Locale::translate('user.phone'), 'fax' => Locale::translate('user.fax'), 'address' => Locale::translate('common.mailingAddress'), 'country' => Locale::translate('common.country'), 'type' => Locale::translate('manager.registration.registrationType'));
     $registrationOptionDAO =& DAORegistry::getDAO('RegistrationOptionDAO');
     $registrationOptions =& $registrationOptionDAO->getRegistrationOptionsBySchedConfId($schedConf->getId());
     // column name = 'option' + optionId => column value = name of the registration option
     while ($registrationOption =& $registrationOptions->next()) {
         $registrationOptionIds[] = $registrationOption->getOptionId();
         $columns = array_merge($columns, array('option' . $registrationOption->getOptionId() => $registrationOption->getRegistrationOptionName()));
         unset($registrationOption);
     }
     $columns = array_merge($columns, array('regdate' => Locale::translate('manager.registration.dateRegistered'), 'paiddate' => Locale::translate('manager.registration.datePaid'), 'specialreq' => Locale::translate('schedConf.registration.specialRequests')));
     $fp = fopen('php://output', 'wt');
     String::fputcsv($fp, array_values($columns));
     while ($row =& $registrants->next()) {
         if (isset($registrantOptions[$row['registration_id']])) {
             $options = $this->mergeRegistrantOptions($registrationOptionIds, $registrantOptions[$row['registration_id']]);
         } else {
             $options = $this->mergeRegistrantOptions($registrationOptionIds);
         }
         foreach ($columns as $index => $junk) {
             if (isset($row[$index])) {
                 $columns[$index] = $row[$index];
             } else {
                 if (isset($options[$index])) {
                     $columns[$index] = $options[$index];
                 } else {
                     $columns[$index] = '';
                 }
             }
         }
         String::fputcsv($fp, $columns);
         unset($row);
     }
     fclose($fp);
 }
Esempio n. 25
0
 /**
  * If a scheduled conference in a conference is specified, display it.
  * If no scheduled conference is specified, display a list of scheduled conferences.
  * If no conference is specified, display list of conferences.
  */
 function index($args)
 {
     $this->validate();
     $this->setupTemplate();
     $conference =& Request::getConference();
     $schedConf =& Request::getSchedConf();
     if ($schedConf && $conference) {
         // A scheduled conference was specified; display it.
         import('pages.schedConf.SchedConfHandler');
         SchedConfHandler::index($args);
     } elseif ($conference) {
         $redirect = $conference->getSetting('schedConfRedirect');
         if (!empty($redirect)) {
             $schedConfDao =& DAORegistry::getDAO('SchedConfDAO');
             $redirectSchedConf =& $schedConfDao->getSchedConf($redirect, $conference->getId());
             if ($redirectSchedConf) {
                 Request::redirect($conference->getPath(), $redirectSchedConf->getPath());
             }
         }
         // A scheduled conference was specified; display it.
         import('pages.conference.ConferenceHandler');
         ConferenceHandler::index($args);
     } else {
         // Otherwise, display a list of conferences to choose from.
         $templateMgr =& TemplateManager::getManager();
         $conferenceDao =& DAORegistry::getDAO('ConferenceDAO');
         $templateMgr->assign('helpTopicId', 'user.home');
         // If the site specifies that we should redirect to a specific conference
         // by default, do it.
         $siteDao =& DAORegistry::getDAO('SiteDAO');
         $site =& $siteDao->getSite();
         $conference = $conferenceDao->getConference($site->getRedirect());
         if ($site->getRedirect() && $conference) {
             Request::redirect($conference->getPath());
         }
         // Otherwise, show a list of hosted conferences.
         $templateMgr->assign('intro', $site->getLocalizedIntro());
         $conferences =& $conferenceDao->getEnabledConferences();
         $templateMgr->assign_by_ref('conferences', $conferences);
         $templateMgr->setCacheability(CACHEABILITY_PUBLIC);
         $templateMgr->display('index/site.tpl');
     }
 }
 /**
  * Save changes to paper.
  */
 function execute()
 {
     $paperDao =& DAORegistry::getDAO('PaperDAO');
     $reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
     $conference = Request::getConference();
     $schedConf = Request::getSchedConf();
     // Update paper
     $paper =& $this->paper;
     $paper->setDateSubmitted(Core::getCurrentDate());
     $paper->setSubmissionProgress(0);
     $paper->stampStatusModified();
     // We've collected the paper now -- bump the review progress
     if ($this->paper->getSubmissionFileId() != null) {
         $paper->setCurrentStage(REVIEW_STAGE_PRESENTATION);
     }
     $paperDao->updatePaper($paper);
     // Designate this as the review version by default.
     $authorSubmissionDao =& DAORegistry::getDAO('AuthorSubmissionDAO');
     $authorSubmission =& $authorSubmissionDao->getAuthorSubmission($paper->getId());
     AuthorAction::designateReviewVersion($authorSubmission);
     unset($authorSubmission);
     // Update any review assignments so they may access the file
     $authorSubmission =& $authorSubmissionDao->getAuthorSubmission($paper->getId());
     $reviewAssignments =& $reviewAssignmentDao->getReviewAssignmentsByPaperId($paper->getId(), REVIEW_STAGE_PRESENTATION);
     foreach ($reviewAssignments as $reviewAssignment) {
         $reviewAssignment->setReviewFileId($authorSubmission->getReviewFileId());
         $reviewAssignmentDao->updateReviewAssignment($reviewAssignment);
     }
     $reviewMode = $authorSubmission->getReviewMode();
     $user =& Request::getUser();
     if ($reviewMode == REVIEW_MODE_BOTH_SIMULTANEOUS || $reviewMode == REVIEW_MODE_PRESENTATIONS_ALONE) {
         // Editors have not yet been assigned; assign them.
         $this->assignDirectors($paper);
     }
     $this->confirmSubmission($paper, $user, $schedConf, $conference, $reviewMode == REVIEW_MODE_BOTH_SEQUENTIAL ? 'SUBMISSION_UPLOAD_ACK' : 'SUBMISSION_ACK');
     // 同時寄一封給大會主席
     $this->confirmSubmissionBBC($paper, $user, $schedConf, $conference, $reviewMode == REVIEW_MODE_BOTH_SEQUENTIAL ? 'SUBMISSION_UPLOAD_ACK_BCC' : 'SUBMISSION_ACK_BCC');
     import('paper.log.PaperLog');
     import('paper.log.PaperEventLogEntry');
     PaperLog::logEvent($this->paperId, PAPER_LOG_PRESENTATION_SUBMIT, LOG_TYPE_AUTHOR, $user->getId(), 'log.author.presentationSubmitted', array('submissionId' => $paper->getId(), 'authorName' => $user->getFullName()));
     return $this->paperId;
 }
 function index()
 {
     AppLocale::requireComponents(array(LOCALE_COMPONENT_PKP_COMMON, LOCALE_COMPONENT_APPLICATION_COMMON));
     $templateMgr =& TemplateManager::getManager();
     $conference =& Request::getConference();
     $schedConf =& Request::getSchedConf();
     $schedConfId = $schedConf ? $schedConf->getId() : $conference->getId();
     $templateMgr->addStyleSheet(Request::getBaseUrl() . '/plugins/generic/listOfAttendees/listOfAttendees.css');
     $templateMgr->assign('pageHierarchy', array(array(Request::url(null, 'index', 'index'), $conference->getConferenceTitle(), true), array(Request::url(null, null, 'index'), $schedConf->getSchedConfTitle(), true)));
     $templateMgr->assign('title', __('plugins.generic.listOfAttendees.pageTitle'));
     $listOfAttendeesDAO =& DAORegistry::getDAO('ListOfAttendeesDAO');
     $attendees =& $listOfAttendeesDAO->getListOfAttendees($schedConfId);
     $attendees =& $attendees->toArray();
     $templateMgr->assign_by_ref('attendees', $attendees);
     $countryDao =& DAORegistry::getDAO('CountryDAO');
     $countries =& $countryDao->getCountries();
     $templateMgr->assign_by_ref('countries', $countries);
     $listOfAttendeesPlugin =& PluginRegistry::getPlugin('generic', 'ListOfAttendeesPlugin');
     $templateMgr->display($listOfAttendeesPlugin->getTemplatePath() . 'index.tpl');
 }
 /**
  * Save changes to payment settings.
  */
 function savePaymentSettings()
 {
     $this->validate();
     $this->setupTemplate(true);
     $schedConf =& Request::getSchedConf();
     if (!$schedConf) {
         Request::redirect(null, null, 'index');
     }
     import('classes.manager.form.PaymentSettingsForm');
     $settingsForm = new PaymentSettingsForm();
     $settingsForm->readInputData();
     if ($settingsForm->validate()) {
         $settingsForm->execute();
         $templateMgr =& TemplateManager::getManager();
         $templateMgr->assign(array('currentUrl' => Request::url(null, null, null, 'paymentSettings'), 'pageTitle' => 'manager.payment.paymentSettings', 'message' => 'common.changesSaved', 'backLink' => Request::url(null, null, Request::getRequestedPage()), 'backLinkLabel' => 'manager.conferenceSiteManagement'));
         $templateMgr->display('common/message.tpl');
     } else {
         $settingsForm->display();
     }
 }
Esempio n. 29
0
 /**
  * Display account form for new users.
  */
 function account()
 {
     $this->validate();
     $this->setupTemplate(true);
     $conference =& Request::getConference();
     $schedConf =& Request::getSchedConf();
     if ($conference != null && $schedConf != null) {
         // We're trying to create an account for a specific scheduled conference
         import('classes.user.form.CreateAccountForm');
         if (checkPhpVersion('5.0.0')) {
             // WARNING: This form needs $this in constructor
             $regForm = new CreateAccountForm();
         } else {
             $regForm =& new CreateAccountForm();
         }
         if ($regForm->isLocaleResubmit()) {
             $regForm->readInputData();
         } else {
             $regForm->initData();
         }
         $regForm->display();
     } elseif ($conference != null) {
         // We have the conference, but need to select a scheduled conference
         $schedConfDao =& DAORegistry::getDAO('SchedConfDAO');
         $schedConfs =& $schedConfDao->getEnabledSchedConfs($conference->getId());
         $templateMgr =& TemplateManager::getManager();
         $templateMgr->assign('pageHierarchy', array(array(Request::url(null, 'index', 'index'), $conference->getConferenceTitle(), true)));
         $templateMgr->assign('source', Request::getUserVar('source'));
         $templateMgr->assign_by_ref('schedConfs', $schedConfs);
         $templateMgr->display('user/createAccountConference.tpl');
     } else {
         // We have neither conference nor scheduled conference; start by selecting a
         // conference and we'll end up above after a redirect.
         $conferencesDao =& DAORegistry::getDAO('ConferenceDAO');
         $conferences =& $conferencesDao->getConferences(true);
         $templateMgr =& TemplateManager::getManager();
         $templateMgr->assign('source', Request::getUserVar('source'));
         $templateMgr->assign_by_ref('conferences', $conferences);
         $templateMgr->display('user/createAccountSite.tpl');
     }
 }
Esempio n. 30
0
 /**
  * Display the form
  */
 function display()
 {
     $templateMgr =& TemplateManager::getManager();
     import('mail.MailTemplate');
     $mail = new MailTemplate('SUBMISSION_ACK');
     if ($mail->isEnabled()) {
         $templateMgr->assign('submissionAckEnabled', true);
     }
     if ($this->_data['reviewDeadlineType'] == REVIEW_DEADLINE_TYPE_ABSOLUTE) {
         $templateMgr->assign('absoluteReviewDate', $this->_data['numWeeksPerReviewAbsolute']);
     }
     if (Config::getVar('general', 'scheduled_tasks')) {
         $templateMgr->assign('scheduledTasksEnabled', true);
     }
     import('manager.form.TimelineForm');
     $schedConf =& Request::getSchedConf();
     list($earliestDate, $latestDate) = TimelineForm::getOutsideDates($schedConf);
     $templateMgr->assign('firstYear', strftime('%Y', $earliestDate));
     $templateMgr->assign('lastYear', strftime('%Y', $latestDate));
     parent::display();
 }