function initialize(&$request) { parent::initialize($request); // Retrieve the authorized monograph. $this->_monograph =& $this->getAuthorizedContextObject(ASSOC_TYPE_MONOGRAPH); // Load submission-specific translations Locale::requireComponents(array(LOCALE_COMPONENT_OMP_SUBMISSION, LOCALE_COMPONENT_PKP_SUBMISSION, LOCALE_COMPONENT_PKP_USER, LOCALE_COMPONENT_OMP_DEFAULT_SETTINGS)); // Get the monograph id $monograph =& $this->getMonograph(); assert(is_a($monograph, 'Monograph')); $monographId = $monograph->getId(); // Retrieve the submissionParticipants associated with this monograph to be displayed in the grid $signoffDao =& DAORegistry::getDAO('SignoffDAO'); /* @var $signoffDao SignoffDAO */ $users =& $signoffDao->getUsersBySymbolic('SIGNOFF_STAGE', ASSOC_TYPE_MONOGRAPH, $monographId); $rowData = array(); while ($user =& $users->next()) { $userId = $user->getId(); $rowData[$userId] = $user; } $this->setData($rowData); // Columns $cellProvider = new SubmissionParticipantGridCellProvider(); $this->addColumn(new GridColumn('name', 'author.users.contributor.name', null, 'controllers/grid/gridCell.tpl', $cellProvider)); }
/** * Display the form * @param $request Request * @param $dispatcher Dispatcher */ function display($request, $dispatcher) { $templateMgr =& TemplateManager::getManager($request); // Add extra style sheets required for ajax components // FIXME: Must be removed after OMP->OJS backporting $templateMgr->addStyleSheet($request->getBaseUrl() . '/styles/ojs.css'); // Add extra java script required for ajax components // FIXME: Must be removed after OMP->OJS backporting $templateMgr->addJavaScript('lib/pkp/js/grid-clickhandler.js'); $templateMgr->addJavaScript('lib/pkp/js/modal.js'); $templateMgr->addJavaScript('lib/pkp/js/lib/jquery/plugins/validate/jquery.validate.min.js'); $templateMgr->addJavaScript('lib/pkp/js/jqueryValidatorI18n.js'); import('classes.mail.MailTemplate'); $mail = new MailTemplate('SUBMISSION_ACK'); if ($mail->isEnabled()) { $templateMgr->assign('submissionAckEnabled', true); } // Citation editor filter configuration // // 1) Check whether PHP5 is available. if (!checkPhpVersion('5.0.0')) { Locale::requireComponents(array(LOCALE_COMPONENT_PKP_SUBMISSION)); $citationEditorError = 'submission.citations.editor.php5Required'; } else { $citationEditorError = null; } $templateMgr->assign('citationEditorError', $citationEditorError); if (!$citationEditorError) { // 2) Add the filter grid URLs $parserFilterGridUrl = $dispatcher->url($request, ROUTE_COMPONENT, null, 'grid.filter.ParserFilterGridHandler', 'fetchGrid'); $templateMgr->assign('parserFilterGridUrl', $parserFilterGridUrl); $lookupFilterGridUrl = $dispatcher->url($request, ROUTE_COMPONENT, null, 'grid.filter.LookupFilterGridHandler', 'fetchGrid'); $templateMgr->assign('lookupFilterGridUrl', $lookupFilterGridUrl); // 3) Create a list of all available citation output filters. $router =& $request->getRouter(); $journal =& $router->getContext($request); import('lib.pkp.classes.metadata.MetadataDescription'); $inputSample = new MetadataDescription('lib.pkp.classes.metadata.nlm.NlmCitationSchema', ASSOC_TYPE_CITATION); $outputSample = 'any string'; $filterDao =& DAORegistry::getDAO('FilterDAO'); $metaCitationOutputFilterObjects =& $filterDao->getCompatibleObjects($inputSample, $outputSample, $journal->getId()); foreach ($metaCitationOutputFilterObjects as $metaCitationOutputFilterObject) { $metaCitationOutputFilters[$metaCitationOutputFilterObject->getId()] = $metaCitationOutputFilterObject->getDisplayName(); } $templateMgr->assign_by_ref('metaCitationOutputFilters', $metaCitationOutputFilters); } $currencyDao =& DAORegistry::getDAO('CurrencyDAO'); $currencies =& $currencyDao->getCurrencies(); $currenciesArray = array(); foreach ($currencies as $currency) { $currenciesArray[$currency->getCodeAlpha()] = $currency->getName() . ' (' . $currency->getCodeAlpha() . ')'; } $templateMgr->assign('currencies', $currenciesArray); $originalSourceCurrencyAlpha = $journal->getSetting('sourceCurrency'); $originalSourceCurrency = $currencyDao->getCurrencyByAlphaCode($originalSourceCurrencyAlpha); $templateMgr->assign('originalSourceCurrency', $originalSourceCurrency->getName() . ' (' . $originalSourceCurrencyAlpha . ')'); $proposalSourceDao =& DAORegistry::getDAO('ProposalSourceDAO'); $templateMgr->assign('countSources', $proposalSourceDao->countSources()); parent::display($request, $dispatcher); }
/** * @see PKPHandler::initialize() */ function initialize(&$request) { // Basic grid configuration $this->setId('fairCopyFiles'); $this->setTitle('editor.monograph.fairCopy'); // Load grid data. $this->loadMonographFiles(); // Test whether the tar binary is available for the export to work, if so, add grid action $tarBinary = Config::getVar('cli', 'tar'); if ($this->hasData() && !empty($tarBinary) && file_exists($tarBinary)) { $monograph =& $this->getMonograph(); $router =& $request->getRouter(); $this->addAction(new LinkAction('downloadAll', new RedirectAction($router->url($request, null, null, 'downloadAllFiles', null, array('monographId' => $monograph->getId()))), 'submission.files.downloadAll', 'getPackage')); } // Load additional translation components. Locale::requireComponents(array(LOCALE_COMPONENT_OMP_EDITOR)); // Columns import('controllers.grid.files.fairCopyFiles.FairCopyFilesGridCellProvider'); $cellProvider =& new FairCopyFilesGridCellProvider(); parent::initialize($request, $cellProvider); // Add a column for the uploader. // FIXME: We're just adding some placeholder text here until this // is correctly implemented, see #6233. $this->addColumn(new GridColumn('select', null, 'FIXME', 'controllers/grid/common/cell/roleCell.tpl', $cellProvider)); // Add another column for the uploader's role // FIXME: We're just adding some placeholder text here until this // is correctly implemented, see #6233. $this->addColumn(new GridColumn('uploader-name', null, 'FIXME', 'controllers/grid/common/cell/roleCell.tpl', $cellProvider)); }
function initialize(&$request) { parent::initialize($request); // Basic grid configuration $this->setId('preparedEmailsGrid'); $this->setTitle('grid.preparedEmails.currentList'); Locale::requireComponents(array(LOCALE_COMPONENT_PKP_MANAGER)); // Elements to be displayed in the grid $press =& $request->getPress(); $emailTemplateDao =& DAORegistry::getDAO('EmailTemplateDAO'); /* @var $emailTemplateDao EmailTemplateDAO */ $emailTemplates =& $emailTemplateDao->getEmailTemplates(Locale::getLocale(), $press->getId()); $rowData = array(); foreach ($emailTemplates as $emailTemplate) { $rowData[$emailTemplate->getEmailKey()] = $emailTemplate; } $this->setGridDataElements($rowData); // Grid actions import('lib.pkp.classes.linkAction.LinkAction'); import('lib.pkp.classes.linkAction.request.ConfirmationModal'); $router =& $request->getRouter(); $this->addAction(new LinkAction('resetAll', new ConfirmationModal(__('manager.emails.resetAll.message'), null, $router->url($request, null, 'grid.settings.preparedEmails.PreparedEmailsGridHandler', 'resetAllEmails')), __('manager.emails.resetAll'), 'delete')); import('controllers.grid.settings.preparedEmails.linkAction.EditEmailLinkAction'); $addEmailLinkAction =& new EditEmailLinkAction($request); $this->addAction($addEmailLinkAction); // Columns import('controllers.grid.settings.preparedEmails.PreparedEmailsGridCellProvider'); $cellProvider =& new PreparedEmailsGridCellProvider(); $this->addColumn(new GridColumn('name', 'common.name', null, 'controllers/grid/gridCell.tpl', $cellProvider)); $this->addColumn(new GridColumn('sender', 'email.sender', null, 'controllers/grid/gridCell.tpl', $cellProvider)); $this->addColumn(new GridColumn('recipient', 'email.recipient', null, 'controllers/grid/gridCell.tpl', $cellProvider)); $this->addColumn(new GridColumn('subject', 'common.subject', null, 'controllers/grid/gridCell.tpl', $cellProvider)); $this->addColumn(new GridColumn('enabled', 'common.enabled', null, 'controllers/grid/common/cell/checkMarkCell.tpl', $cellProvider)); }
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(); } }
/** * Configure the grid * @param $request PKPRequest */ function initialize(&$request) { parent::initialize($request); // Basic grid configuration $this->setId('reviewFormElement'); $this->setTitle('grid.reviewFormElements.title'); Locale::requireComponents(array(LOCALE_COMPONENT_PKP_MANAGER, LOCALE_COMPONENT_OMP_MANAGER)); // Elements to be displayed in the grid $router =& $request->getRouter(); $press =& $router->getContext($request); $reviewFormId = $request->getUserVar('rowId'); $row =& $this->getRow(); $row->setReviewFormId($reviewFormId); $reviewFormElementDao =& DAORegistry::getDAO('ReviewFormElementDAO'); $reviewFormElements =& $reviewFormElementDao->getReviewFormElementsByReviewForm($reviewFormId); $this->setData($reviewFormElements); // Add grid-level actions $this->addAction(new LegacyLinkAction('createReviewFormElement', LINK_ACTION_MODE_MODAL, LINK_ACTION_TYPE_APPEND, $router->url($request, null, null, 'createReviewFormElement', null, array('gridId' => $this->getId(), 'reviewFormId' => $reviewFormId)), 'grid.action.addItem'), GRID_ACTION_POSITION_ABOVE); // Columns import('controllers.grid.settings.reviewForm.ReviewFormElementGridCellProvider'); $cellProvider =& new ReviewFormElementGridCellProvider(); $this->addColumn(new GridColumn('reviewFormElement', 'grid.reviewFormElements.column.elements', 'controllers/grid/gridCell.tpl', $cellProvider)); import('controllers.grid.settings.reviewForm.ReviewFormElementTypeCellProvider'); $cellProvider =& new ReviewFormElementTypeCellProvider(); $this->addColumn(new GridColumn('elementType', 'common.type', null, 'controllers/grid/gridCell.tpl', $cellProvider)); }
function initialize(&$request) { parent::initialize($request); // Retrieve the authorized monograph. $this->setMonograph($this->getAuthorizedContextObject(ASSOC_TYPE_MONOGRAPH)); // Load submission-specific translations Locale::requireComponents(array(LOCALE_COMPONENT_OMP_SUBMISSION, LOCALE_COMPONENT_PKP_SUBMISSION, LOCALE_COMPONENT_PKP_USER, LOCALE_COMPONENT_OMP_DEFAULT_SETTINGS)); // Basic grid configuration $this->setTitle('submission.submit.stageParticipants'); // Get the monograph id $monograph =& $this->getMonograph(); assert(is_a($monograph, 'Monograph')); $monographId = $monograph->getId(); // Retrieve the stageParticipants associated with this monograph to be displayed in the grid $signoffDao =& DAORegistry::getDAO('SignoffDAO'); $data =& $signoffDao->getAllBySymbolic('SIGNOFF_STAGE', ASSOC_TYPE_MONOGRAPH, $monographId, null, $monograph->getCurrentStageId()); $this->setData($data); // Grid actions $router =& $request->getRouter(); $actionArgs = array('monographId' => $monographId, 'stageId' => $monograph->getCurrentStageId()); $this->addAction(new LegacyLinkAction('addStageParticipant', LINK_ACTION_MODE_MODAL, LINK_ACTION_TYPE_REPLACE, $router->url($request, null, null, 'addStageParticipant', null, $actionArgs), 'submission.submit.addStageParticipant')); // Columns $cellProvider = new StageParticipantGridCellProvider(); $this->addColumn(new GridColumn('name', 'author.users.contributor.name', null, 'controllers/grid/gridCell.tpl', $cellProvider)); $this->addColumn(new GridColumn('userGroup', 'author.users.contributor.role', null, 'controllers/grid/gridCell.tpl', $cellProvider)); }
function initialize(&$request) { parent::initialize($request); // Load submission-specific translations Locale::requireComponents(array(LOCALE_COMPONENT_PKP_SUBMISSION, LOCALE_COMPONENT_PKP_MANAGER, LOCALE_COMPONENT_PKP_USER, LOCALE_COMPONENT_OMP_EDITOR)); // Basic grid configuration $this->setTitle('user.role.reviewers'); // Get the monograph $submission =& $this->getAuthorizedContextObject(ASSOC_TYPE_MONOGRAPH); assert(is_a($submission, 'SeriesEditorSubmission')); $monographId = $submission->getId(); // Get the review round currently being looked at $reviewType = $request->getUserVar('reviewType'); $round = $request->getUserVar('round'); // Get the existing review assignments for this monograph $reviewAssignments =& $submission->getReviewAssignments($reviewType, $round); $this->setData($reviewAssignments); // Grid actions $router =& $request->getRouter(); $actionArgs = array('monographId' => $monographId, 'reviewType' => $reviewType, 'round' => $round); $this->addAction(new LegacyLinkAction('addReviewer', LINK_ACTION_MODE_MODAL, LINK_ACTION_TYPE_APPEND, $router->url($request, null, null, 'addReviewer', null, $actionArgs), 'editor.monograph.addReviewer')); // Columns $cellProvider = new ReviewerGridCellProvider(); $this->addColumn(new GridColumn('name', 'user.name', null, 'controllers/grid/gridCell.tpl', $cellProvider)); // Add a column for the stage editor. // FIXME: We're just adding some placeholder text here until this // is correctly implemented, see #6233. $this->addColumn(new GridColumn('FIXME', null, 'FIXME', 'controllers/grid/common/cell/roleCell.tpl', $cellProvider)); // Add a column for the assigned reviewer. $this->addColumn(new GridColumn('reviewer', 'user.role.reviewer', null, 'controllers/grid/common/cell/roleCell.tpl', $cellProvider)); }
/** * Configure the grid * @param $request PKPRequest */ function initialize(&$request) { parent::initialize($request); // Retrieve the authorized monograph $monograph =& $this->getAuthorizedContextObject(ASSOC_TYPE_MONOGRAPH); assert(is_a($monograph, 'Monograph')); $this->setMonograph($monograph); Locale::requireComponents(array(LOCALE_COMPONENT_OMP_DEFAULT_SETTINGS, LOCALE_COMPONENT_OMP_SUBMISSION)); // Basic grid configuration $this->setTitle('grid.chapters.title'); // Set the category data $chapterDao =& DAORegistry::getDAO('ChapterDAO'); $chapters =& $chapterDao->getChapters($monograph->getId()); $this->setGridDataElements($chapters); // Grid actions $router =& $request->getRouter(); $actionArgs = array('monographId' => $monograph->getId()); $this->addAction(new LinkAction('addChapter', new AjaxModal($router->url($request, null, null, 'addChapter', null, $actionArgs), __('submission.chapter.addChapter'), 'fileManagement'), __('grid.action.addItem'), 'add_item')); // Columns // reuse the cell providers for the SubmissionContributorGrid $cellProvider = new SubmissionContributorGridCellProvider(); $this->addColumn(new GridColumn('name', 'author.users.contributor.name', null, 'controllers/grid/gridCell.tpl', $cellProvider)); $this->addColumn(new GridColumn('email', 'author.users.contributor.email', null, 'controllers/grid/gridCell.tpl', $cellProvider)); $this->addColumn(new GridColumn('role', 'author.users.contributor.role', null, 'controllers/grid/gridCell.tpl', $cellProvider)); $this->addColumn(new GridColumn('principalContact', 'author.users.contributor.principalContact', null, 'controllers/grid/users/submissionContributor/primaryContact.tpl', $cellProvider)); }
function display(&$args, $request) { $templateMgr =& TemplateManager::getManager(); parent::display($args, $request); $issueDao =& DAORegistry::getDAO('IssueDAO'); $publishedArticleDao =& DAORegistry::getDAO('PublishedArticleDAO'); $articleGalleyDao =& DAORegistry::getDAO('ArticleGalleyDAO'); $journal =& Request::getJournal(); switch (array_shift($args)) { case 'exportGalley': $articleId = array_shift($args); $galleyId = array_shift($args); $article =& $publishedArticleDao->getPublishedArticleByArticleId($articleId); $galley =& $articleGalleyDao->getGalley($galleyId, $articleId); if ($article && $galley && ($issue =& $issueDao->getIssueById($article->getIssueId(), $journal->getId()))) { $this->exportArticle($journal, $issue, $article, $galley); break; } default: // Display a list of articles for export $this->setBreadcrumbs(); Locale::requireComponents(array(LOCALE_COMPONENT_PKP_SUBMISSION)); $publishedArticleDao =& DAORegistry::getDAO('PublishedArticleDAO'); $rangeInfo = Handler::getRangeInfo('articles'); $articleIds = $publishedArticleDao->getPublishedArticleIdsAlphabetizedByJournal($journal->getId(), false); $totalArticles = count($articleIds); $articleIds = array_slice($articleIds, $rangeInfo->getCount() * ($rangeInfo->getPage() - 1), $rangeInfo->getCount()); import('lib.pkp.classes.core.VirtualArrayIterator'); $iterator = new VirtualArrayIterator(ArticleSearch::formatResults($articleIds), $totalArticles, $rangeInfo->getPage(), $rangeInfo->getCount()); $templateMgr->assign_by_ref('articles', $iterator); $templateMgr->display($this->getTemplatePath() . 'index.tpl'); break; } }
function initialize(&$request) { parent::initialize($request); Locale::requireComponents(array(LOCALE_COMPONENT_OMP_EDITOR, LOCALE_COMPONENT_PKP_USER, LOCALE_COMPONENT_PKP_SUBMISSION)); $monograph =& $this->getAuthorizedContextObject(ASSOC_TYPE_MONOGRAPH); // Retrieve the submissionContributors associated with this monograph to be displayed in the grid $doneMin = $request->getUserVar('doneMin'); $doneMax = $request->getUserVar('doneMax'); $avgMin = $request->getUserVar('avgMin'); $avgMax = $request->getUserVar('avgMax'); $lastMin = $request->getUserVar('lastMin'); $lastMax = $request->getUserVar('lastMax'); $activeMin = $request->getUserVar('activeMin'); $activeMax = $request->getUserVar('activeMax'); $interests = null; $seriesEditorSubmissionDao =& DAORegistry::getDAO('SeriesEditorSubmissionDAO'); $data =& $seriesEditorSubmissionDao->getFilteredReviewers($monograph->getPressId(), $doneMin, $doneMax, $avgMin, $avgMax, $lastMin, $lastMax, $activeMin, $activeMax, $interests, $monograph->getId(), $monograph->getCurrentRound()); $this->setData($data); // Columns $cellProvider = new ReviewerSelectGridCellProvider(); $this->addColumn(new GridColumn('select', '', null, 'controllers/grid/users/reviewerSelect/reviewerSelectRadioButton.tpl', $cellProvider)); $this->addColumn(new GridColumn('name', 'author.users.contributor.name', null, 'controllers/grid/gridCell.tpl', $cellProvider)); $this->addColumn(new GridColumn('done', 'common.done', null, 'controllers/grid/gridCell.tpl', $cellProvider)); $this->addColumn(new GridColumn('avg', 'editor.review.days', null, 'controllers/grid/gridCell.tpl', $cellProvider)); $this->addColumn(new GridColumn('last', 'editor.submissions.lastAssigned', null, 'controllers/grid/gridCell.tpl', $cellProvider)); $this->addColumn(new GridColumn('active', 'common.active', null, 'controllers/grid/gridCell.tpl', $cellProvider)); $this->addColumn(new GridColumn('interests', 'user.interests', null, 'controllers/grid/gridCell.tpl', $cellProvider)); }
/** * Records a director's submission decision. * @param $trackDirectorSubmission object * @param $decision int * @param $stage int */ function recordDecision($trackDirectorSubmission, $decision, $stage) { $editAssignments =& $trackDirectorSubmission->getEditAssignments(); if (empty($editAssignments)) { return; } $trackDirectorSubmissionDao =& DAORegistry::getDAO('TrackDirectorSubmissionDAO'); $user =& Request::getUser(); $directorDecision = array('editDecisionId' => null, 'directorId' => $user->getId(), 'decision' => $decision, 'dateDecided' => date(Core::getCurrentDate())); if (!HookRegistry::call('TrackDirectorAction::recordDecision', array(&$trackDirectorSubmission, $directorDecision))) { if ($decision == SUBMISSION_DIRECTOR_DECISION_DECLINE) { $trackDirectorSubmission->setStatus(STATUS_DECLINED); $trackDirectorSubmission->stampStatusModified(); } else { $trackDirectorSubmission->setStatus(STATUS_QUEUED); $trackDirectorSubmission->stampStatusModified(); } $trackDirectorSubmission->addDecision($directorDecision, $stage); $decisions = TrackDirectorSubmission::getDirectorDecisionOptions(); // Add log import('paper.log.PaperLog'); import('paper.log.PaperEventLogEntry'); Locale::requireComponents(array(LOCALE_COMPONENT_APPLICATION_COMMON, LOCALE_COMPONENT_OCS_DIRECTOR)); PaperLog::logEvent($trackDirectorSubmission->getPaperId(), PAPER_LOG_DIRECTOR_DECISION, LOG_TYPE_DIRECTOR, $user->getId(), 'log.director.decision', array('directorName' => $user->getFullName(), 'paperId' => $trackDirectorSubmission->getPaperId(), 'decision' => Locale::translate($decisions[$decision]), 'round' => $stage == REVIEW_STAGE_ABSTRACT ? 'submission.abstractReview' : 'submission.paperReview')); } if ($decision == SUBMISSION_DIRECTOR_DECISION_ACCEPT || $decision == SUBMISSION_DIRECTOR_DECISION_INVITE) { // completeReview will take care of updating the // submission with the new decision. TrackDirectorAction::completeReview($trackDirectorSubmission); } else { // Insert the new decision. $trackDirectorSubmissionDao->updateTrackDirectorSubmission($trackDirectorSubmission); } }
/** * Fetch * @param $request PKPRequest * @see Form::fetch() */ function fetch(&$request) { $templateMgr =& TemplateManager::getManager(); $templateMgr->assign('monographFileCategories', array(GENRE_CATEGORY_DOCUMENT => Locale::translate('submission.document'), GENRE_CATEGORY_ARTWORK => Locale::translate('submission.art'))); Locale::requireComponents(array(LOCALE_COMPONENT_OMP_MANAGER)); return parent::fetch($request); }
/** * @see PKPHandler::initialize() */ function initialize(&$request, $args) { parent::initialize($request, $args); // Set the uploader roles (if given). $uploaderRoles = $request->getUserVar('uploaderRoles'); if (!is_null($uploaderRoles)) { $this->_uploaderRoles = array(); $uploaderRoles = explode('-', $uploaderRoles); foreach ($uploaderRoles as $uploaderRole) { if (!is_numeric($uploaderRole)) { fatalError('Invalid uploader role!'); } $this->_uploaderRoles[] = (int) $uploaderRole; } } // Do we allow revisions only? $this->_revisionOnly = (bool) $request->getUserVar('revisionOnly'); $this->_reviewType = $request->getUserVar('reviewType') ? (int) $request->getUserVar('reviewType') : null; $this->_round = $request->getUserVar('round') ? (int) $request->getUserVar('round') : null; // The revised file will be non-null if we revise a single existing file. if ($this->getRevisionOnly() && $request->getUserVar('revisedFileId')) { $this->_revisedFileId = (int) $request->getUserVar('revisedFileId'); } // Load translations. Locale::requireComponents(array(LOCALE_COMPONENT_OMP_SUBMISSION, LOCALE_COMPONENT_PKP_SUBMISSION, LOCALE_COMPONENT_PKP_COMMON, LOCALE_COMPONENT_APPLICATION_COMMON)); }
function initialize(&$request) { parent::initialize($request); import('classes.file.LibraryFileManager'); $libraryFileManager = new LibraryFileManager(); // Fetch and validate fileType (validated in getNameFromType) $fileType = (int) $request->getUserVar('fileType'); $this->setFileType($fileType); $name = $libraryFileManager->getNameFromType($this->getFileType()); // Basic grid configuration $this->setId('libraryFile' . ucwords(strtolower($name))); $this->setTitle("grid.libraryFiles.{$name}.title"); Locale::requireComponents(array(LOCALE_COMPONENT_PKP_COMMON, LOCALE_COMPONENT_APPLICATION_COMMON, LOCALE_COMPONENT_PKP_SUBMISSION)); // Elements to be displayed in the grid $router =& $request->getRouter(); $context =& $router->getContext($request); $libraryFileDao =& DAORegistry::getDAO('LibraryFileDAO'); $libraryFiles =& $libraryFileDao->getByPressId($context->getId(), $this->getFileType()); $this->setGridDataElements($libraryFiles); // Add grid-level actions $this->addAction(new LinkAction('addFile', new AjaxModal($router->url($request, null, null, 'addFile', null, array('fileType' => $this->getFileType())), __('grid.action.addItem'), 'fileManagement'), __('grid.action.addItem'), 'add_item')); // Columns // Basic grid row configuration import('controllers.grid.settings.library.LibraryFileGridCellProvider'); $this->addColumn(new GridColumn('files', 'grid.libraryFiles.column.files', null, 'controllers/grid/gridCell.tpl', new LibraryFileGridCellProvider())); }
/** * Setup common template variables. * @param $subclass boolean set to true if caller is below this handler in the hierarchy */ function setupTemplate($subclass = false) { parent::setupTemplate(); Locale::requireComponents(array(LOCALE_COMPONENT_PKP_ADMIN, LOCALE_COMPONENT_OCS_ADMIN, LOCALE_COMPONENT_OCS_MANAGER)); $templateMgr =& TemplateManager::getManager(); $templateMgr->assign('pageHierarchy', $subclass ? array(array(Request::url(null, null, 'user'), 'navigation.user'), array(Request::url(null, null, ROLE_PATH_SITE_ADMIN), 'admin.siteAdmin')) : array(array(Request::url(null, null, 'user'), 'navigation.user'))); }
function initialize(&$request) { parent::initialize($request); // Retrieve the authorized monograph. $this->setMonograph($this->getAuthorizedContextObject(ASSOC_TYPE_MONOGRAPH)); // Load submission-specific translations Locale::requireComponents(array(LOCALE_COMPONENT_OMP_SUBMISSION, LOCALE_COMPONENT_PKP_SUBMISSION, LOCALE_COMPONENT_PKP_USER, LOCALE_COMPONENT_OMP_DEFAULT_SETTINGS)); // Basic grid configuration $this->setTitle('submission.submit.addAuthor'); // Get the monograph id $monograph =& $this->getMonograph(); assert(is_a($monograph, 'Monograph')); $monographId = $monograph->getId(); // Retrieve the submissionContributors associated with this monograph to be displayed in the grid $authorDao =& DAORegistry::getDAO('AuthorDAO'); $data =& $authorDao->getAuthorsByMonographId($monographId); $this->setData($data); // Grid actions $router =& $request->getRouter(); $actionArgs = array('monographId' => $monographId); $this->addAction(new LegacyLinkAction('addSubmissionContributor', LINK_ACTION_MODE_MODAL, LINK_ACTION_TYPE_APPEND, $router->url($request, null, null, 'addSubmissionContributor', null, $actionArgs), 'grid.action.addAuthor')); // Columns $cellProvider = new SubmissionContributorGridCellProvider(); $this->addColumn(new GridColumn('name', 'author.users.contributor.name', null, 'controllers/grid/gridCell.tpl', $cellProvider)); $this->addColumn(new GridColumn('email', 'author.users.contributor.email', null, 'controllers/grid/gridCell.tpl', $cellProvider)); $this->addColumn(new GridColumn('role', 'author.users.contributor.role', null, 'controllers/grid/gridCell.tpl', $cellProvider)); $this->addColumn(new GridColumn('principalContact', 'author.users.contributor.principalContact', null, 'controllers/grid/users/submissionContributor/primaryContact.tpl', $cellProvider)); }
function register($category, $path) { $success = parent::register($category, $path); if ($success) { Locale::requireComponents(array(LOCALE_COMPONENT_PKP_USER)); } return $success; }
/** * Read installation parameters from stdin. * FIXME: May want to implement an abstract "CLIForm" class handling input/validation. * FIXME: Use readline if available? */ function readParams() { Locale::requireComponents(array(LOCALE_COMPONENT_PKP_INSTALLER, LOCALE_COMPONENT_APPLICATION_COMMON)); printf("%s\n", Locale::translate('installer.ocsInstallation')); parent::readParams(); $this->readParamBoolean('install', 'installer.installApplication'); return $this->params['install']; }
/** * Constructor * @param $approvalNotice ApprovalNotice object * @param $sectionEditorSubmission ApprovalNotice object, null if just for preview */ function ApprovalNoticeDocx($approvalNotice, $sectionEditorSubmission) { Locale::requireComponents(array(LOCALE_COMPONENT_APPLICATION_COMMON, LOCALE_COMPONENT_PKP_SUBMISSION)); // Set variables $this->header = $approvalNotice->getCleanHtml('getApprovalNoticeHeader'); $this->body = $approvalNotice->getCleanHtml('getApprovalNoticeBody'); $this->footer = $approvalNotice->getCleanHtml('getApprovalNoticeFooter'); //.'<br/><p style="text-align: center;">{PAGE}</p>'; $this->sectionEditorSubmission = $sectionEditorSubmission; }
/** * @see PKPHandler::initialize() */ function initialize(&$request) { parent::initialize($request); // Set title. $this->setTitle('common.queue.long.submissionsUnassigned'); $cellProvider = new SubmissionsListGridCellProvider(); $this->addColumn(new GridColumn('title', 'monograph.title', null, 'controllers/grid/gridCell.tpl', $cellProvider)); // Add editor specific locale component. Locale::requireComponents(array(LOCALE_COMPONENT_OMP_EDITOR)); }
/** * @see OAIMetadataFormat#toXML */ function toXml(&$record, $format = null) { $response = null; if (!HookRegistry::call('OAIMetadataFormat_DC::toXml', array(&$this, $record, &$response))) { $article =& $record->getData('article'); $journal =& $record->getData('journal'); $section =& $record->getData('section'); $issue =& $record->getData('issue'); $galleys =& $record->getData('galleys'); Locale::requireComponents(array(LOCALE_COMPONENT_APPLICATION_COMMON)); // Sources contains journal title, issue ID, and pages $sources = $this->stripAssocArray((array) $journal->getTitle(null)); $pages = $article->getPages(); if (!empty($pages)) { $pages = '; ' . $pages; } foreach ($sources as $key => $source) { $sources[$key] .= '; ' . $issue->getIssueIdentification() . $pages; } // Format creators $creators = array(); $authors = $article->getAuthors(); for ($i = 0, $num = count($authors); $i < $num; $i++) { $authorName = $authors[$i]->getFullName(true); $affiliation = $authors[$i]->getLocalizedAffiliation(); if (!empty($affiliation)) { $authorName .= '; ' . $affiliation; } $creators[] = $authorName; } // Publisher $publishers = $this->stripAssocArray((array) $journal->getTitle(null)); // Default $publisherInstitution = $journal->getSetting('publisherInstitution'); if (!empty($publisherInstitution)) { $publishers = array($journal->getPrimaryLocale() => $publisherInstitution); } // Types $types = $this->stripAssocArray((array) $section->getIdentifyType(null)); $types = array_merge_recursive(empty($types) ? array(Locale::getLocale() => Locale::translate('rt.metadata.pkp.peerReviewed')) : $types, $this->stripAssocArray((array) $article->getType(null))); // Formats $formats = array(); foreach ($galleys as $galley) { $formats[] = $galley->getFileType(); } // Relation $relation = array(); foreach ($article->getSuppFiles() as $suppFile) { $relation[] = Request::url($journal->getPath(), 'article', 'downloadSuppFile', array($article->getId(), $suppFile->getFileId())); } $response = "<oai_dc:dc\n" . "\txmlns:oai_dc=\"http://www.openarchives.org/OAI/2.0/oai_dc/\"\n" . "\txmlns:dc=\"http://purl.org/dc/elements/1.1/\"\n" . "\txmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" . "\txsi:schemaLocation=\"http://www.openarchives.org/OAI/2.0/oai_dc/\n" . "\thttp://www.openarchives.org/OAI/2.0/oai_dc.xsd\">\n" . $this->formatElement('title', $this->stripAssocArray((array) $article->getTitle(null)), true) . $this->formatElement('creator', $creators) . $this->formatElement('subject', array_merge_recursive($this->stripAssocArray((array) $article->getDiscipline(null)), $this->stripAssocArray((array) $article->getSubject(null)), $this->stripAssocArray((array) $article->getSubjectClass(null))), true) . $this->formatElement('description', $this->stripAssocArray((array) $article->getAbstract(null)), true) . $this->formatElement('publisher', $publishers, true) . $this->formatElement('contributor', $this->stripAssocArray((array) $article->getSponsor(null)), true) . $this->formatElement('date', date('Y-m-d', strtotime($issue->getDatePublished()))) . $this->formatElement('type', $types, true) . $this->formatElement('format', $formats) . $this->formatElement('identifier', Request::url($journal->getPath(), 'article', 'view', array($article->getBestArticleId()))) . (($doi = $article->getDOI()) ? $this->formatElement('identifier', $doi, false, array('xsi:type' => 'dcterms:DOI')) : '') . $this->formatElement('source', $sources, true) . $this->formatElement('language', strip_tags($article->getLanguage())) . $this->formatElement('relation', $relation) . $this->formatElement('coverage', array_merge_recursive($this->stripAssocArray((array) $article->getCoverageGeo(null)), $this->stripAssocArray((array) $article->getCoverageChron(null)), $this->stripAssocArray((array) $article->getCoverageSample(null))), true) . $this->formatElement('rights', $this->stripAssocArray((array) $journal->getSetting('copyrightNotice'))) . "</oai_dc:dc>\n"; } return $response; }
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); }
/** * Setup common template variables. * @param $subclass boolean set to true if caller is below this handler in the hierarchy */ function setupTemplate($subclass = false) { parent::setupTemplate(); $templateMgr =& TemplateManager::getManager(); $journal =& Request::getJournal(); Locale::requireComponents(array(LOCALE_COMPONENT_OJS_MANAGER, LOCALE_COMPONENT_PKP_MANAGER)); if (!$journal || !$journal->getSetting('restrictSiteAccess')) { $templateMgr->setCacheability(CACHEABILITY_PUBLIC); } $templateMgr->assign('pageHierarchy', array(array(Request::url(null, 'about'), 'about.aboutTheJournal'))); }
function register($category, $path) { $success = parent::register($category, $path); if ($success) { //$this->addLocaleData(); Locale::requireComponents(array(LOCALE_COMPONENT_PKP_USER)); $this->import('PopularArticlesDAO'); $PopularArticlesDAO =& new PopularArticlesDAO(); $ret =& DAORegistry::registerDAO('PopularArticlesDAO', $PopularArticlesDAO); } return $success; }
/** * Display the submission's metadata * @return string Serialized JSON object * @see Form::fetch() * @param $args array * @param $request PKPRequest */ function fetch($args, &$request) { // Identify the press Id $pressId = $request->getUserVar('pressId'); Locale::requireComponents(array(LOCALE_COMPONENT_APPLICATION_COMMON)); // Form handling import('controllers.modals.competingInterests.form.CompetingInterestsForm'); $competingInterestsForm = new CompetingInterestsForm($pressId); $competingInterestsForm->initData($args, $request); $json = new JSON(true, $competingInterestsForm->fetch($request)); return $json->getString(); }
function setupTemplate($subclass = true) { parent::setupTemplate(); $templateMgr =& TemplateManager::getManager(); Locale::requireComponents(array(LOCALE_COMPONENT_PKP_ADMIN, LOCALE_COMPONENT_PKP_MANAGER)); $pageHierarchy = array(array(Request::url(null, 'user'), 'navigation.user'), array(Request::url(null, 'admin'), 'admin.siteAdmin')); if ($subclass) { $pageHierarchy[] = array(Request::url(null, 'translate'), 'plugins.generic.translator.name'); } $templateMgr->assign('pageHierarchy', $pageHierarchy); $templateMgr->assign('helpTopicId', 'plugins.generic.TranslatorPlugin'); }
/** * Display the submission's metadata * @param $args array * @param $request PKPRequest * @return string Serialized JSON object * @see Form::fetch() */ function fetch($args, &$request) { // Identify the submission Id $monographId = $request->getUserVar('monographId'); Locale::requireComponents(array(LOCALE_COMPONENT_OMP_SUBMISSION)); // Form handling import('controllers.modals.submissionMetadata.form.SubmissionMetadataForm'); $submissionMetadataForm = new SubmissionMetadataForm($monographId); $submissionMetadataForm->initData($args, $request); $json = new JSON('true', $submissionMetadataForm->fetch($request)); return $json->getString(); }
/** * Initialize form data from the associated chapter. * @param $chapter Chapter */ function initData() { Locale::requireComponents(array(LOCALE_COMPONENT_OMP_DEFAULT_SETTINGS)); $monograph =& $this->getMonograph(); $this->setData('monographId', $monograph->getId()); $chapter =& $this->getChapter(); if ($chapter) { $this->setData('chapterId', $chapter->getId()); $this->setData('title', $chapter->getLocalizedTitle()); } else { $this->setData('title', null); } }
/** * Fetch * @param $request PKPRequest * @see Form::fetch() */ function fetch(&$request) { Locale::requireComponents(array(LOCALE_COMPONENT_OMP_MANAGER)); if ($this->fileId) { $libraryFileDao =& DAORegistry::getDAO('LibraryFileDAO'); $libraryFile =& $libraryFileDao->getById($this->fileId); assert(!is_null($libraryFile)); $templateMgr =& TemplateManager::getManager(); $templateMgr->assign_by_ref('libraryFile', $libraryFile); $templateMgr->assign_by_ref('libraryFileName', $libraryFile->getLocalizedName()); } return parent::fetch($request); }