コード例 #1
0
 function pendingUsers()
 {
     $this->validate();
     $this->setupTemplate();
     $journal =& Request::getJournal();
     $templateMgr =& TemplateManager::getManager();
     $CBPPlatformDao =& DAORegistry::getDAO('CBPPlatformDAO');
     $journalId = $journal->getJournalId();
     if (Request::getUserVar('approve') && Request::getUserVar('role')) {
         $userId = Request::getUserVar('approve');
         $roleId = Request::getUserVar('role');
         if ($CBPPlatformDao->setUserRegistration($userId, $roleId, $journalId) == true) {
             $templateMgr->assign('usersApproved', true);
         }
     }
     $roleDao =& DAORegistry::getDAO('RoleDAO');
     $pendingUsers = $CBPPlatformDao->getPendingUserRegistrations($journalId);
     foreach ($pendingUsers as &$pendingUser) {
         $role = $roleDao->getRole($pendingUser['journal_id'], $pendingUser['user_id'], $pendingUser['role_id']);
         $roleArr = explode(".", $role->getRoleName());
         $pendingUser['role'] = ucfirst($roleArr[2]);
     }
     $templateMgr->assign('pendingUsers', $pendingUsers);
     $templateMgr->display('manager/pendingUsers/index.tpl');
 }
コード例 #2
0
 /**
  * Become a given role.
  */
 function become($args)
 {
     parent::validate(true, true);
     $user =& Request::getUser();
     if (!$user) {
         Request::redirect(null, null, 'index');
     }
     switch (array_shift($args)) {
         case 'submitter':
             $roleId = ROLE_ID_SUBMITTER;
             $setting = 'enableSubmit';
             $deniedKey = 'user.noRoles.enableSubmitClosed';
             break;
         default:
             Request::redirect('index');
     }
     $site =& Request::getSite();
     if ($site->getSetting($setting)) {
         $role = new Role();
         $role->setRoleId($roleId);
         $role->setUserId($user->getId());
         $roleDao =& DAORegistry::getDAO('RoleDAO');
         $roleDao->insertRole($role);
         Request::redirectUrl(Request::getUserVar('source'));
     } else {
         $templateMgr =& TemplateManager::getManager();
         $templateMgr->assign('message', $deniedKey);
         return $templateMgr->display('common/message.tpl');
     }
 }
コード例 #3
0
ファイル: SuppFileForm.inc.php プロジェクト: sedici/ocs
 /**
  * Display the form.
  */
 function display()
 {
     $conference =& Request::getConference();
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->assign('enablePublicSuppFileId', $conference->getSetting('enablePublicSuppFileId'));
     $templateMgr->assign('rolePath', Request::getRequestedPage());
     $templateMgr->assign('paperId', $this->paper->getPaperId());
     $templateMgr->assign('suppFileId', $this->suppFileId);
     $typeOptionsOutput = array('author.submit.suppFile.researchInstrument', 'author.submit.suppFile.researchMaterials', 'author.submit.suppFile.researchResults', 'author.submit.suppFile.transcripts', 'author.submit.suppFile.dataAnalysis', 'author.submit.suppFile.dataSet', 'author.submit.suppFile.sourceText');
     $typeOptionsValues = $typeOptionsOutput;
     array_push($typeOptionsOutput, 'common.other');
     array_push($typeOptionsValues, '');
     $templateMgr->assign('typeOptionsOutput', $typeOptionsOutput);
     $templateMgr->assign('typeOptionsValues', $typeOptionsValues);
     // Sometimes it's necessary to track the page we came from in
     // order to redirect back to the right place
     $templateMgr->assign('from', Request::getUserVar('from'));
     if (isset($this->paper)) {
         $templateMgr->assign('submissionProgress', $this->paper->getSubmissionProgress());
     }
     if (isset($this->suppFile)) {
         $templateMgr->assign_by_ref('suppFile', $this->suppFile);
     }
     $templateMgr->assign('helpTopicId', 'submission.supplementaryFiles');
     parent::display();
 }
コード例 #4
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();
     }
 }
コード例 #5
0
 /**
  * Display record list or archive list.
  */
 function index($args)
 {
     $this->validate();
     $templateMgr =& TemplateManager::getManager();
     $archiveDao =& DAORegistry::getDAO('ArchiveDAO');
     $recordDao =& DAORegistry::getDAO('RecordDAO');
     $archiveId = array_shift($args);
     $archive = null;
     if (($archive =& $archiveDao->getArchive($archiveId)) || $archiveId == 'all') {
         $this->setupTemplate($archive, true);
         $rangeInfo = PKPHandler::getRangeInfo('records');
         $sortOrderDao =& DAORegistry::getDAO('SortOrderDAO');
         $sortOrderId = Request::getUserVar('sortOrderId');
         $sortOrder =& $sortOrderDao->getSortOrder($sortOrderId);
         if ($sortOrder) {
             $templateMgr->assign('sortOrderId', $sortOrderId);
         }
         $sortOrders =& $sortOrderDao->getSortOrders();
         $templateMgr->assign_by_ref('sortOrders', $sortOrders);
         // The user has chosen an archive or opted to browse all
         $records =& $recordDao->getRecords($archive ? (int) $archiveId : null, true, $sortOrder, $rangeInfo);
         $templateMgr->assign_by_ref('records', $records);
         $templateMgr->assign_by_ref('archive', $archive);
         $templateMgr->display('browse/records.tpl');
     } else {
         $this->setupTemplate($archive);
         // List archives for the user to browse.
         $rangeInfo = PKPHandler::getRangeInfo('archives');
         $archives =& $archiveDao->getArchives(true, $rangeInfo);
         $templateMgr->assign_by_ref('archives', $archives);
         $templateMgr->display('browse/index.tpl');
     }
 }
コード例 #6
0
 /**
  * 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');
 }
コード例 #7
0
 function saveSettings()
 {
     RTAdminHandler::validate();
     // Bring in the comments constants.
     $commentDao =& DAORegistry::getDao('CommentDAO');
     $journal = Request::getJournal();
     if ($journal) {
         $rtDao =& DAORegistry::getDAO('RTDAO');
         $rt = $rtDao->getJournalRTByJournal($journal);
         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->setEmailAuthor(Request::getUserVar('emailAuthor') == true);
         $rt->setEmailOthers(Request::getUserVar('emailOthers') == true);
         $rt->setFindingReferences(Request::getUserVar('findingReferences') == true);
         $journal->updateSetting('enableComments', Request::getUserVar('enableComments') ? Request::getUserVar('enableCommentsMode') : COMMENTS_DISABLED);
         $rtDao->updateJournalRT($rt);
     }
     Request::redirect(null, Request::getRequestedPage());
 }
コード例 #8
0
ファイル: SetMeetingForm.inc.php プロジェクト: JovanyJeff/hrp
 /**
  * Display the form.
  */
 function display(&$args)
 {
     $meetingId = isset($args[0]) ? $args[0] : 0;
     $journal =& Request::getJournal();
     $journalId = $journal->getId();
     $user =& Request::getUser();
     $sectionDecisionDao =& DAORegistry::getDAO('SectionDecisionDAO');
     $sort = Request::getUserVar('sort');
     $sort = isset($sort) ? $sort : 'id';
     $sortDirection = Request::getUserVar('sortDirection');
     $availableSectionDecisions =& $sectionDecisionDao->getSectionDecisionsAvailableForMeeting($user->getSecretaryCommitteeId(), $journalId, $sort, $sortDirection);
     /*Get the selected submissions to be reviewed*/
     $meetingDao =& DAORegistry::getDAO('MeetingDAO');
     $meeting =& $meetingDao->getMeetingById($meetingId);
     /*Get the selected submissions to be reviewed*/
     $meetingSectionDecisionDao =& DAORegistry::getDAO('MeetingSectionDecisionDAO');
     $mSectionDecisions = $meetingSectionDecisionDao->getMeetingSectionDecisionsByMeetingId($meetingId);
     $sectionDecisionsId = array();
     foreach ($mSectionDecisions as $mSectionDecision) {
         array_push($sectionDecisionsId, $mSectionDecision->getSectionDecisionId());
     }
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->assign('sort', $sort);
     $templateMgr->assign('sortDirection', $sortDirection);
     $templateMgr->assign('meetingId', $meetingId);
     $templateMgr->assign('meetingDate', $meeting->getDate());
     $templateMgr->assign('meetingLength', $meeting->getLength());
     $templateMgr->assign('location', $meeting->getLocation());
     $templateMgr->assign('investigator', $meeting->getInvestigator());
     $templateMgr->assign_by_ref('availableSectionDecisions', $availableSectionDecisions);
     $templateMgr->assign_by_ref('sectionDecisionsId', $sectionDecisionsId);
     $templateMgr->assign('baseUrl', Config::getVar('general', "base_url"));
     parent::display();
 }
コード例 #9
0
 function manage($verb, $args)
 {
     if (parent::manage($verb, $args)) {
         return true;
     }
     if (!$this->getEnabled()) {
         return false;
     }
     switch ($verb) {
         case 'settings':
             $journal =& Request::getJournal();
             $this->import('SettingsForm');
             $form = new SettingsForm($this, $journal->getId());
             if (Request::getUserVar('save')) {
                 $form->readInputData();
                 if ($form->validate()) {
                     $form->execute();
                     Request::redirect(null, null, 'plugins');
                 } else {
                     $form->display();
                 }
             } else {
                 $form->initData();
                 $form->display();
             }
             break;
         default:
             return false;
     }
     return true;
 }
コード例 #10
0
 /**
  * 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
0
 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());
 }
コード例 #12
0
 /**
  * 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();
     }
 }
コード例 #13
0
 /**
  * Save changes to an announcement type.
  */
 function updateReferral()
 {
     $referralId = (int) Request::getUserVar('referralId');
     if ($referralId === 0) {
         $referralId = null;
     }
     list($plugin, $referral, $article) = $this->validate($referralId);
     // If it's an insert, ensure that it's allowed for this article
     if (!isset($referral)) {
         $publishedArticleDao =& DAORegistry::getDAO('PublishedArticleDAO');
         $journal =& Request::getJournal();
         $article =& $publishedArticleDao->getPublishedArticleByArticleId((int) Request::getUserVar('articleId'));
         if (!$article || $article->getUserId() != $user->getId() && !Validation::isSectionEditor($journal->getId()) && !Validation::isEditor($journal->getId())) {
             Request::redirect(null, 'author');
         }
     }
     $this->setupTemplate();
     $plugin->import('ReferralForm');
     $referralForm = new ReferralForm($plugin, $article, $referralId);
     $referralForm->readInputData();
     if ($referralForm->validate()) {
         $referralForm->execute();
         Request::redirect(null, 'author');
     } else {
         $templateMgr =& TemplateManager::getManager();
         if ($referralId == null) {
             $templateMgr->assign('referralTitle', 'plugins.generic.referral.createReferral');
         } else {
             $templateMgr->assign('referralTitle', 'plugins.generic.referral.editReferral');
         }
         $referralForm->display();
     }
 }
コード例 #14
0
ファイル: CommentHandler.inc.php プロジェクト: Jouper/jouper
 function view($args)
 {
     $articleId = isset($args[0]) ? (int) $args[0] : 0;
     $galleyId = isset($args[1]) ? (int) $args[1] : 0;
     $commentId = isset($args[2]) ? (int) $args[2] : 0;
     list($journal, $issue, $article) = CommentHandler::validate($articleId);
     $user =& Request::getUser();
     $userId = isset($user) ? $user->getUserId() : null;
     $commentDao =& DAORegistry::getDAO('CommentDAO');
     $comment =& $commentDao->getComment($commentId, $articleId, 2);
     $roleDao =& DAORegistry::getDAO('RoleDAO');
     $isManager = $roleDao->roleExists($journal->getJournalId(), $userId, ROLE_ID_JOURNAL_MANAGER);
     if (!$comment) {
         $comments =& $commentDao->getRootCommentsByArticleId($articleId, 1);
     } else {
         $comments =& $comment->getChildren();
     }
     CommentHandler::setupTemplate($article, $galleyId, $comment);
     $templateMgr =& TemplateManager::getManager();
     if (Request::getUserVar('refresh')) {
         $templateMgr->setCacheability(CACHEABILITY_NO_CACHE);
     }
     if ($comment) {
         $templateMgr->assign_by_ref('comment', $comment);
         $templateMgr->assign_by_ref('parent', $commentDao->getComment($comment->getParentCommentId(), $articleId));
     }
     $templateMgr->assign_by_ref('comments', $comments);
     $templateMgr->assign('articleId', $articleId);
     $templateMgr->assign('galleyId', $galleyId);
     $templateMgr->assign('enableComments', $journal->getSetting('enableComments'));
     $templateMgr->assign('isManager', $isManager);
     $templateMgr->display('comment/comments.tpl');
 }
コード例 #15
0
ファイル: AuthorHandler.inc.php プロジェクト: artkuo/ocs
 /**
  * Constructor
  **/
 function AuthorHandler()
 {
     parent::Handler();
     $this->addCheck(new HandlerValidatorConference($this));
     $this->addCheck(new HandlerValidatorSchedConf($this));
     $this->addCheck(new HandlerValidatorRoles($this, true, null, array('requiresAuthor' => Request::getUserVar('requiresAuthor')), array(ROLE_ID_AUTHOR)));
 }
コード例 #16
0
ファイル: ProfileHandler.inc.php プロジェクト: jalperin/ocs
 /**
  * Validate and save changes to user's profile.
  */
 function saveProfile()
 {
     $this->validate();
     $this->setupTemplate();
     $dataModified = false;
     import('user.form.ProfileForm');
     $profileForm = new ProfileForm();
     $profileForm->readInputData();
     if (Request::getUserVar('uploadProfileImage')) {
         if (!$profileForm->uploadProfileImage()) {
             $profileForm->addError('profileImage', Locale::translate('user.profile.form.profileImageInvalid'));
         }
         $dataModified = true;
     } else {
         if (Request::getUserVar('deleteProfileImage')) {
             $profileForm->deleteProfileImage();
             $dataModified = true;
         }
     }
     if (!$dataModified && $profileForm->validate()) {
         $profileForm->execute();
         Request::redirect(null, null, Request::getRequestedPage());
     } else {
         $profileForm->display();
     }
 }
コード例 #17
0
 /**
  * Save comment.
  */
 function saveComment()
 {
     $paperId = Request::getUserVar('paperId');
     $commentId = Request::getUserVar('commentId');
     // If the user pressed the "Save and email" button, then email the comment.
     $emailComment = Request::getUserVar('saveAndEmail') != null ? true : false;
     $this->addCheck(new HandlerValidatorSubmissionComment($this, $commentId));
     $this->validate();
     $comment =& $this->comment;
     $this->setupTemplate(true);
     $trackSubmissionHandler = new TrackSubmissionHandler();
     $trackSubmissionHandler->validate($paperId);
     $authorSubmission =& $trackSubmissionHandler->submission;
     if ($comment->getCommentType() == COMMENT_TYPE_DIRECTOR_DECISION) {
         // Cannot edit a director decision comment.
         Request::redirect(null, null, Request::getRequestedPage());
     }
     AuthorAction::saveComment($authorSubmission, $comment, $emailComment);
     $paperCommentDao =& DAORegistry::getDAO('PaperCommentDAO');
     $comment =& $paperCommentDao->getPaperCommentById($commentId);
     // Redirect back to initial comments page
     if ($comment->getCommentType() == COMMENT_TYPE_DIRECTOR_DECISION) {
         Request::redirect(null, null, null, 'viewDirectorDecisionComments', $paperId);
     }
 }
コード例 #18
0
 /**
  * Display the form.
  */
 function display()
 {
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->assign('reviewFormId', $this->reviewFormId);
     $templateMgr->assign('helpTopicId', 'conference.managementPages.reviewForms');
     $templateMgr->assign('source', Request::getUserVar('source'));
     parent::display();
 }
コード例 #19
0
 /**
  * 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');
 }
コード例 #20
0
 /**
  * Constructor.
  */
 function RepresentativeForm($monograph, $representative)
 {
     parent::Form('controllers/grid/catalogEntry/form/representativeForm.tpl');
     $this->setMonograph($monograph);
     $this->setRepresentative($representative);
     // Validation checks for this form
     $this->addCheck(new FormValidatorCustom($this, 'isSupplier', 'required', 'grid.catalogEntry.roleRequired', create_function('$isSupplier, $form, $onixDao, $agentRole, $supplierRole', 'return (!$isSupplier && $onixDao->codeExistsInList($agentRole, \'List69\')) || ($isSupplier && $onixDao->codeExistsInList($supplierRole, \'List93\'));'), array(&$this, DAORegistry::getDAO('ONIXCodelistItemDAO'), Request::getUserVar('agentRole'), Request::getUserVar('supplierRole'))));
     $this->addCheck(new FormValidatorPost($this));
 }
コード例 #21
0
ファイル: GatewayHandler.inc.php プロジェクト: philschatz/ojs
 function lockss()
 {
     $this->validate();
     $this->setupTemplate();
     $journal =& Request::getJournal();
     $templateMgr =& TemplateManager::getManager();
     if ($journal != null) {
         if (!$journal->getSetting('enableLockss')) {
             Request::redirect(null, 'index');
         }
         $year = Request::getUserVar('year');
         $issueDao =& DAORegistry::getDAO('IssueDAO');
         // FIXME Should probably go in IssueDAO or a subclass
         if (isset($year)) {
             $year = (int) $year;
             $result =& $issueDao->retrieve('SELECT * FROM issues WHERE journal_id = ? AND year = ? AND published = 1 ORDER BY current DESC, year ASC, volume ASC, number ASC', array($journal->getId(), $year));
             if ($result->RecordCount() == 0) {
                 unset($year);
             }
         }
         if (!isset($year)) {
             $showInfo = true;
             $result =& $issueDao->retrieve('SELECT MAX(year) FROM issues WHERE journal_id = ? AND published = 1', $journal->getId());
             list($year) = $result->fields;
             $result =& $issueDao->retrieve('SELECT * FROM issues WHERE journal_id = ? AND year = ? AND published = 1 ORDER BY current DESC, year ASC, volume ASC, number ASC', array($journal->getId(), $year));
         } else {
             $showInfo = false;
         }
         $issues = new DAOResultFactory($result, $issueDao, '_returnIssueFromRow');
         $prevYear = null;
         $nextYear = null;
         if (isset($year)) {
             $result =& $issueDao->retrieve('SELECT MAX(year) FROM issues WHERE journal_id = ? AND published = 1 AND year < ?', array($journal->getId(), $year));
             list($prevYear) = $result->fields;
             $result =& $issueDao->retrieve('SELECT MIN(year) FROM issues WHERE journal_id = ? AND published = 1 AND year > ?', array($journal->getId(), $year));
             list($nextYear) = $result->fields;
         }
         $templateMgr->assign_by_ref('journal', $journal);
         $templateMgr->assign_by_ref('issues', $issues);
         $templateMgr->assign('year', $year);
         $templateMgr->assign('prevYear', $prevYear);
         $templateMgr->assign('nextYear', $nextYear);
         $templateMgr->assign('showInfo', $showInfo);
         $locales =& $journal->getSupportedLocaleNames();
         if (!isset($locales) || empty($locales)) {
             $localeNames =& Locale::getAllLocales();
             $primaryLocale = Locale::getPrimaryLocale();
             $locales = array($primaryLocale => $localeNames[$primaryLocale]);
         }
         $templateMgr->assign_by_ref('locales', $locales);
     } else {
         $journalDao =& DAORegistry::getDAO('JournalDAO');
         $journals =& $journalDao->getEnabledJournals();
         $templateMgr->assign_by_ref('journals', $journals);
     }
     $templateMgr->display('gateway/lockss.tpl');
 }
コード例 #22
0
 /**
  * Show list of journal sections identify types.
  */
 function identifyTypes($args = array(), &$request)
 {
     $this->setupTemplate($request, true);
     $router =& $request->getRouter();
     $journal =& $router->getContext($request);
     $browsePlugin =& PluginRegistry::getPlugin('generic', BROWSE_PLUGIN_NAME);
     $enableBrowseByIdentifyTypes = $browsePlugin->getSetting($journal->getId(), 'enableBrowseByIdentifyTypes');
     if ($enableBrowseByIdentifyTypes) {
         if (isset($args[0]) && $args[0] == 'view') {
             $identifyType = Request::getUserVar('identifyType');
             $sectionDao =& DAORegistry::getDAO('SectionDAO');
             $sectionsIterator =& $sectionDao->getJournalSections($journal->getId());
             $sections = array();
             while ($section =& $sectionsIterator->next()) {
                 if ($section->getLocalizedIdentifyType() == $identifyType) {
                     $sections[] =& $section;
                 }
             }
             $publishedArticleDao =& DAORegistry::getDAO('PublishedArticleDAO');
             $publishedArticleIds = array();
             foreach ($sections as $section) {
                 $publishedArticleIdsBySection = $publishedArticleDao->getPublishedArticleIdsBySection($section->getId());
                 $publishedArticleIds = array_merge($publishedArticleIds, $publishedArticleIdsBySection);
             }
             $rangeInfo = Handler::getRangeInfo('search');
             $totalResults = count($publishedArticleIds);
             $publishedArticleIds = array_slice($publishedArticleIds, $rangeInfo->getCount() * ($rangeInfo->getPage() - 1), $rangeInfo->getCount());
             $results = new VirtualArrayIterator(ArticleSearch::formatResults($publishedArticleIds), $totalResults, $rangeInfo->getPage(), $rangeInfo->getCount());
             $templateMgr =& TemplateManager::getManager();
             $templateMgr->assign_by_ref('results', $results);
             $templateMgr->assign('title', $identifyType);
             $templateMgr->assign('enableBrowseByIdentifyTypes', $enableBrowseByIdentifyTypes);
             $templateMgr->display($browsePlugin->getTemplatePath() . 'searchDetails.tpl');
         } else {
             $excludedIdentifyTypes = $browsePlugin->getSetting($journal->getId(), 'excludedIdentifyTypes');
             $sectionDao =& DAORegistry::getDAO('SectionDAO');
             $sectionsIterator =& $sectionDao->getJournalSections($journal->getId());
             $sectionidentifyTypes = array();
             while ($section =& $sectionsIterator->next()) {
                 if ($section->getLocalizedIdentifyType() && !in_array($section->getId(), $excludedIdentifyTypes) && !in_array($section->getLocalizedIdentifyType(), $sectionidentifyTypes)) {
                     $sectionidentifyTypes[] =& $section->getLocalizedIdentifyType();
                 }
             }
             sort($sectionidentifyTypes);
             $rangeInfo = Handler::getRangeInfo('search');
             $totalResults = count($sectionidentifyTypes);
             $sectionidentifyTypes = array_slice($sectionidentifyTypes, $rangeInfo->getCount() * ($rangeInfo->getPage() - 1), $rangeInfo->getCount());
             $results = new VirtualArrayIterator($sectionidentifyTypes, $totalResults, $rangeInfo->getPage(), $rangeInfo->getCount());
             $templateMgr =& TemplateManager::getManager();
             $templateMgr->assign_by_ref('results', $results);
             $templateMgr->assign('enableBrowseByIdentifyTypes', $enableBrowseByIdentifyTypes);
             $templateMgr->display($browsePlugin->getTemplatePath() . 'searchIndex.tpl');
         }
     } else {
         $request->redirect(null, 'index');
     }
 }
コード例 #23
0
 /**
  * Sets proofreader completion date
  */
 function completeProofreader($args)
 {
     $articleId = Request::getUserVar('articleId');
     SubmissionProofreadHandler::validate($articleId);
     parent::setupTemplate(true);
     if (ProofreaderAction::proofreadEmail($articleId, 'PROOFREAD_COMPLETE', Request::getUserVar('send') ? '' : Request::url(null, 'proofreader', 'completeProofreader'))) {
         Request::redirect(null, null, 'submission', $articleId);
     }
 }
コード例 #24
0
ファイル: Request.inc.php プロジェクト: pulipulichen/ocs
 /**
  * Redirect to the specified page within OCS. Shorthand for a common call to Request::redirect(Request::url(...)).
  * @param $conferencePath string The path of the conference to redirect to.
  * @param $schedConfPath string The path of the conference to redirect to.
  * @param $page string The name of the op to redirect to.
  * @param $op string optional The name of the op to redirect to.
  * @param $path mixed string or array containing path info for redirect.
  * @param $params array Map of name => value pairs for additional parameters
  * @param $anchor string Name of desired anchor on the target page
  */
 function redirect($conferencePath = null, $schedConfPath = null, $page = null, $op = null, $path = null, $params = null, $anchor = null)
 {
     $_this =& PKPRequest::_checkThis();
     $source = Request::getUserVar("source");
     if (isset($source) && substr($source, 0, 1) === '/') {
         $_this->redirectUrl($source);
     }
     $_this->redirectUrl($_this->url($conferencePath, $schedConfPath, $page, $op, $path, $params, $anchor));
 }
コード例 #25
0
 /**
  * Assign form data to user-submitted data.
  */
 function readInputData()
 {
     $terms_agreed = $this->getData('terms_of_use_agreement');
     if (Request::getUserVar('terms_agreed')) {
         foreach (array_keys(Request::getUserVar('terms_agreed')) as $term_agreed) {
             $terms_agreed[$term_agreed] = TRUE;
         }
         $this->setData('terms_of_use_agreement', $terms_agreed);
     }
 }
コード例 #26
0
ファイル: InstallHandler.inc.php プロジェクト: Jouper/jouper
 /**
  * Display upgrade form.
  */
 function upgrade()
 {
     InstallHandler::validate();
     if (($setLocale = Request::getUserVar('setLocale')) != null && Locale::isLocaleValid($setLocale)) {
         Request::setCookieVar('currentLocale', $setLocale);
     }
     $installForm =& new UpgradeForm();
     $installForm->initData();
     $installForm->display();
 }
 /**
  * Display the form.
  */
 function display()
 {
     $templateMgr =& TemplateManager::getManager();
     $countryDao =& DAORegistry::getDAO('CountryDAO');
     $countries =& $countryDao->getCountries();
     $templateMgr->assign_by_ref('countries', $countries);
     if (Request::getUserVar('addAuthor') || Request::getUserVar('delAuthor') || Request::getUserVar('moveAuthor')) {
         $templateMgr->assign('scrollToAuthor', true);
     }
     parent::display();
 }
コード例 #28
0
 /**
  * Create an authentication source.
  */
 function createAuthSource()
 {
     $this->validate();
     $auth = new AuthSource();
     $auth->setPlugin(Request::getUserVar('plugin'));
     $authDao =& DAORegistry::getDAO('AuthSourceDAO');
     if ($authDao->insertSource($auth)) {
         Request::redirect(null, null, 'editAuthSource', $auth->getAuthId());
     } else {
         Request::redirect(null, null, 'auth');
     }
 }
コード例 #29
0
ファイル: FilesHandler.inc.php プロジェクト: jerico-dev/omp
 /**
  * Create a new directory
  */
 function fileMakeDir($args)
 {
     FilesHandler::parseDirArg($args, $currentDir, $parentDir);
     if ($dirName = Request::getUserVar('dirName')) {
         $currentPath = FilesHandler::getRealFilesDir($currentDir);
         $newDir = $currentPath . '/' . FilesHandler::cleanFileName($dirName);
         import('lib.pkp.classes.file.FileManager');
         $fileMgr = new FileManager();
         @$fileMgr->mkdir($newDir);
     }
     Request::redirect(null, null, 'files', explode('/', $currentDir));
 }
コード例 #30
0
 /**
  * Return the key name of the user's currently selected locale (default
  * is "en_US" for U.S. English).
  * @return string
  */
 function getLocale()
 {
     static $currentLocale;
     if (!isset($currentLocale)) {
         if (defined('SESSION_DISABLE_INIT') || !Config::getVar('general', 'installed')) {
             // If the locale is specified in the URL, allow
             // it to override. (Necessary when locale is
             // being set, as cookie will not yet be re-set)
             $locale = Request::getUserVar('setLocale');
             if (empty($locale) || !in_array($locale, array_keys(AppLocale::getSupportedLocales()))) {
                 $locale = Request::getCookieVar('currentLocale');
             }
         } else {
             $sessionManager =& SessionManager::getManager();
             $session =& $sessionManager->getUserSession();
             $locale = Request::getUserVar('uiLocale');
             $journal =& Request::getJournal();
             $site =& Request::getSite();
             if (!isset($locale)) {
                 $locale = $session->getSessionVar('currentLocale');
             }
             if (!isset($locale)) {
                 $locale = Request::getCookieVar('currentLocale');
             }
             if (isset($locale)) {
                 // Check if user-specified locale is supported
                 if ($journal != null) {
                     $locales =& $journal->getSupportedLocaleNames();
                 } else {
                     $locales =& $site->getSupportedLocaleNames();
                 }
                 if (!in_array($locale, array_keys($locales))) {
                     unset($locale);
                 }
             }
             if (!isset($locale)) {
                 // Use journal/site default
                 if ($journal != null) {
                     $locale = $journal->getPrimaryLocale();
                 }
                 if (!isset($locale)) {
                     $locale = $site->getPrimaryLocale();
                 }
             }
         }
         if (!AppLocale::isLocaleValid($locale)) {
             $locale = LOCALE_DEFAULT;
         }
         $currentLocale = $locale;
     }
     return $currentLocale;
 }