/** * @copydoc PKPHandler::initialize() */ function initialize($request) { parent::initialize($request); // Load user-related translations. AppLocale::requireComponents(LOCALE_COMPONENT_PKP_USER, LOCALE_COMPONENT_PKP_MANAGER, LOCALE_COMPONENT_APP_MANAGER); $this->_oldUserId = (int) $request->getUserVar('oldUserId'); // Basic grid configuration. $this->setTitle('grid.user.currentUsers'); // Grid actions. $router = $request->getRouter(); import('lib.pkp.classes.linkAction.request.AjaxModal'); $this->addAction(new LinkAction('addUser', new AjaxModal($router->url($request, null, null, 'addUser', null, null), __('grid.user.add'), 'modal_add_user', true), __('grid.user.add'), 'add_user')); // // Grid columns. // // First Name. $cellProvider = new DataObjectGridCellProvider(); $this->addColumn(new GridColumn('firstName', 'user.firstName', null, 'controllers/grid/gridCell.tpl', $cellProvider)); // Last Name. $cellProvider = new DataObjectGridCellProvider(); $this->addColumn(new GridColumn('lastName', 'user.lastName', null, 'controllers/grid/gridCell.tpl', $cellProvider)); // User name. $cellProvider = new DataObjectGridCellProvider(); $this->addColumn(new GridColumn('username', 'user.username', null, 'controllers/grid/gridCell.tpl', $cellProvider)); // Email. $cellProvider = new DataObjectGridCellProvider(); $this->addColumn(new GridColumn('email', 'user.email', null, 'controllers/grid/gridCell.tpl', $cellProvider)); }
/** * @copydoc PKPHandler::initialize() */ function initialize($request) { parent::initialize($request); // Load user-related translations. AppLocale::requireComponents(LOCALE_COMPONENT_PKP_USER, LOCALE_COMPONENT_PKP_MANAGER, LOCALE_COMPONENT_APP_MANAGER); // Basic grid configuration. $this->setTitle('grid.user.currentUsers'); // Grid actions. $router = $request->getRouter(); $pluginName = $request->getUserVar('pluginName'); assert(!empty($pluginName)); $this->_pluginName = $pluginName; $dispatcher = $request->getDispatcher(); $url = $dispatcher->url($request, ROUTE_PAGE, null, 'manager', 'importexport', array('plugin', $pluginName, 'exportAllUsers')); $this->addAction(new LinkAction('exportAllUsers', new RedirectConfirmationModal(__('grid.users.confirmExportAllUsers'), null, $url), __('grid.action.exportAllUsers'), 'export_users')); // // Grid columns. // // First Name. $cellProvider = new DataObjectGridCellProvider(); $this->addColumn(new GridColumn('firstName', 'user.firstName', null, null, $cellProvider)); // Last Name. $cellProvider = new DataObjectGridCellProvider(); $this->addColumn(new GridColumn('lastName', 'user.lastName', null, null, $cellProvider)); // User name. $cellProvider = new DataObjectGridCellProvider(); $this->addColumn(new GridColumn('username', 'user.username', null, null, $cellProvider)); // Email. $cellProvider = new DataObjectGridCellProvider(); $this->addColumn(new GridColumn('email', 'user.email', null, null, $cellProvider)); }
/** * Displays the context settings wizard. * @param $args array * @param $request Request * @return JSONMessage JSON object */ function startWizard($args, $request) { $templateMgr = TemplateManager::getManager($request); AppLocale::requireComponents(LOCALE_COMPONENT_APP_MANAGER, LOCALE_COMPONENT_PKP_MANAGER); $this->setupTemplate($request); return $templateMgr->fetchJson('controllers/wizard/settings/settingsWizard.tpl'); }
/** * Return a mapping of workflow stages and its translation keys. * @return array */ static function getWorkflowStageTranslationKeys() { $applicationStages = Application::getApplicationStages(); AppLocale::requireComponents(LOCALE_COMPONENT_PKP_SUBMISSION, LOCALE_COMPONENT_APP_SUBMISSION); static $stageMapping = array(WORKFLOW_STAGE_ID_SUBMISSION => 'submission.submission', WORKFLOW_STAGE_ID_INTERNAL_REVIEW => 'workflow.review.internalReview', WORKFLOW_STAGE_ID_EXTERNAL_REVIEW => 'workflow.review.externalReview', WORKFLOW_STAGE_ID_EDITING => 'submission.editorial', WORKFLOW_STAGE_ID_PRODUCTION => 'submission.production'); return array_intersect_key($stageMapping, array_flip($applicationStages)); }
/** * @copydoc SetupListbuilderHandler::initialize() */ function initialize($request) { parent::initialize($request); AppLocale::requireComponents(LOCALE_COMPONENT_PKP_MANAGER); $footerCategoryId = (int) $request->getUserVar('footerCategoryId'); $context = $request->getContext(); $footerCategoryDao = DAORegistry::getDAO('FooterCategoryDAO'); $footerCategory = $footerCategoryDao->getById($footerCategoryId, $context->getId()); if ($footerCategoryId && !isset($footerCategory)) { fatalError('Footer Category does not exist within this context.'); } else { $this->_footerCategoryId = $footerCategoryId; } // Basic configuration $this->setTitle('grid.content.navigation.footer.FooterLink'); $this->setSourceType(LISTBUILDER_SOURCE_TYPE_TEXT); $this->setSaveType(LISTBUILDER_SAVE_TYPE_EXTERNAL); $this->setSaveFieldName('footerLinks'); import('lib.pkp.controllers.listbuilder.content.navigation.FooterLinkListbuilderGridCellProvider'); // Title column $titleColumn = new MultilingualListbuilderGridColumn($this, 'title', 'common.title', null, null, null, null, array('tabIndex' => 1)); $titleColumn->setCellProvider(new FooterLinkListbuilderGridCellProvider()); $this->addColumn($titleColumn); // Url column $urlColumn = new MultilingualListbuilderGridColumn($this, 'url', 'common.url', null, null, null, null, array('tabIndex' => 2)); $urlColumn->setCellProvider(new FooterLinkListbuilderGridCellProvider()); $this->addColumn($urlColumn); }
/** * Display the publication format template (grid + actions). * @param $args array * @param $request PKPRequest * @return JSONMessage JSON object */ function fetchRepresentation($args, $request) { AppLocale::requireComponents(LOCALE_COMPONENT_PKP_SUBMISSION, LOCALE_COMPONENT_APP_SUBMISSION, LOCALE_COMPONENT_APP_EDITOR); $templateMgr = TemplateManager::getManager($request); $templateMgr->assign(array('submission' => $this->getAuthorizedContextObject(ASSOC_TYPE_SUBMISSION), 'stageId' => $this->getAuthorizedContextObject(ASSOC_TYPE_WORKFLOW_STAGE), 'representation' => $this->getAuthorizedContextObject(ASSOC_TYPE_REPRESENTATION))); return $templateMgr->fetchJson('controllers/tab/workflow/publicationFormat.tpl'); }
/** * Constructor * @param $request Request * @param $submissionId int the ID of the submission to present link for * to show information about. */ function SubmissionLibraryLinkAction($request, $submissionId) { $dispatcher = $request->getDispatcher(); AppLocale::requireComponents(LOCALE_COMPONENT_PKP_EDITOR); import('lib.pkp.classes.linkAction.request.AjaxModal'); parent::LinkAction('editorialHistory', new AjaxModal($dispatcher->url($request, ROUTE_COMPONENT, null, 'modals.documentLibrary.DocumentLibraryHandler', 'documentLibrary', null, array('submissionId' => $submissionId)), __('editor.submissionLibrary'), 'modal_information'), __('editor.submissionLibrary'), 'more_info'); }
/** * @copydoc GridHandler::initialize() */ function initialize($request) { parent::initialize($request); // Load language components AppLocale::requireComponents(LOCALE_COMPONENT_PKP_MANAGER, LOCALE_COMPONENT_PKP_COMMON, LOCALE_COMPONENT_APP_MANAGER); // Basic grid configuration $this->setTitle('common.plugins'); // Set the no items row text $this->setEmptyRowText('grid.noItems'); // Columns import('lib.pkp.controllers.grid.plugins.PluginGridCellProvider'); $pluginCellProvider = new PluginGridCellProvider(); $this->addColumn(new GridColumn('name', 'common.name', null, null, $pluginCellProvider, array('multiline' => true, 'showTotalItemsNumber' => true, 'collapseAllColumnsInCategories' => true))); $descriptionColumn = new GridColumn('description', 'common.description', null, null, $pluginCellProvider); $descriptionColumn->addFlag('html', true); $this->addColumn($descriptionColumn); $this->addColumn(new GridColumn('enabled', 'common.enabled', null, 'controllers/grid/common/cell/selectStatusCell.tpl', $pluginCellProvider)); $router = $request->getRouter(); // Grid level actions. $userRoles = $this->getAuthorizedContextObject(ASSOC_TYPE_USER_ROLES); if (in_array(ROLE_ID_SITE_ADMIN, $userRoles)) { import('lib.pkp.classes.linkAction.request.AjaxModal'); // Install plugin. $this->addAction(new LinkAction('upload', new AjaxModal($router->url($request, null, null, 'uploadPlugin'), __('manager.plugins.upload'), 'modal_add_file'), __('manager.plugins.upload'), 'add')); } }
/** * @see PKPStatisticsHelper::getReportObjectTypesArray() */ protected function getReportObjectTypesArray() { $objectTypes = parent::getReportObjectTypesArray(); AppLocale::requireComponents(LOCALE_COMPONENT_APP_EDITOR); $objectTypes = $objectTypes + array(ASSOC_TYPE_JOURNAL => __('context.context'), ASSOC_TYPE_SECTION => __('section.section'), ASSOC_TYPE_ISSUE => __('issue.issue'), ASSOC_TYPE_ISSUE_GALLEY => __('editor.issues.galley'), ASSOC_TYPE_ARTICLE => __('article.article'), ASSOC_TYPE_SUBMISSION_FILE => __('submission.galleyFiles')); return $objectTypes; }
/** * @copydoc SettingsTabHandler::initialize() */ function initialize($request, $args = null) { $this->setWizardMode($request->getUserVar('wizardMode')); parent::initialize($request, $args); // Load handler specific translations. AppLocale::requireComponents(LOCALE_COMPONENT_PKP_MANAGER, LOCALE_COMPONENT_APP_MANAGER, LOCALE_COMPONENT_PKP_GRID); }
/** * Constructor. */ function PKPManageFileApiHandler() { parent::Handler(); $this->addRoleAssignment(array(ROLE_ID_MANAGER, ROLE_ID_SUB_EDITOR, ROLE_ID_ASSISTANT, ROLE_ID_REVIEWER, ROLE_ID_AUTHOR), array('deleteFile', 'editMetadata', 'editMetadataTab', 'saveMetadata')); // Load submission-specific translations AppLocale::requireComponents(LOCALE_COMPONENT_PKP_SUBMISSION); }
/** * @copydoc PKPHandler::initialize() */ function initialize($request) { parent::initialize($request); // Load submission-specific translations. AppLocale::requireComponents(LOCALE_COMPONENT_APP_COMMON, LOCALE_COMPONENT_APP_SUBMISSION, LOCALE_COMPONENT_PKP_SUBMISSION); // Fetch the authorized roles and determine if the user is a manager. $authorizedRoles = $this->getAuthorizedContextObject(ASSOC_TYPE_USER_ROLES); $this->_isManager = in_array(ROLE_ID_MANAGER, $authorizedRoles); // If there is more than one context in the system, add a context column $contextDao = Application::getContextDAO(); $contexts = $contextDao->getAll(); $cellProvider = new SubmissionsListGridCellProvider($authorizedRoles); if ($contexts->getCount() > 1) { $hasRoleCount = 0; $userGroupDao = DAORegistry::getDAO('UserGroupDAO'); $user = $request->getUser(); while ($context = $contexts->next()) { $userGroups = $userGroupDao->getByUserId($user->getId(), $context->getId()); if ($userGroups->getCount() > 0) { $hasRoleCount++; } } if ($hasRoleCount > 1 || $request->getContext() == null) { $this->addColumn(new GridColumn('context', 'context.context', null, null, $cellProvider)); } } $this->addColumn(new GridColumn('id', null, __('common.id'), 'controllers/grid/gridCell.tpl', $cellProvider, array('alignment' => COLUMN_ALIGNMENT_LEFT, 'width' => 10))); $this->addColumn(new GridColumn('title', 'submission.title', null, null, $cellProvider, array('html' => true, 'alignment' => COLUMN_ALIGNMENT_LEFT))); $this->addColumn(new GridColumn('stage', 'workflow.stage', null, null, $cellProvider, array('alignment' => COLUMN_ALIGNMENT_LEFT, 'width' => 15))); }
/** * Configure the grid * @param PKPRequest $request */ function initialize($request) { parent::initialize($request); AppLocale::requireComponents(LOCALE_COMPONENT_APP_EDITOR); $this->setTitle('submission.files'); $this->_chapterId = $request->getUserVar('chapterId'); }
/** * @see MetadataDataObjectAdapter::extractMetadataFromDataObject() * @param $monograph Monograph * @return MetadataDescription */ function extractMetadataFromDataObject($monograph) { assert(is_a($monograph, 'Monograph')); AppLocale::requireComponents(LOCALE_COMPONENT_APP_COMMON); // Retrieve data that belongs to the publication format. $oaiDao = DAORegistry::getDAO('OAIDAO'); /* @var $oaiDao OAIDAO */ $publishedMonographDao = DAORegistry::getDAO('PublishedMonographDAO'); $chapterDao = DAORegistry::getDAO('ChapterDAO'); $monograph = $publishedMonographDao->getById($monograph->getId()); $press = $oaiDao->getPress($monograph->getPressId()); $description = $this->instantiateMetadataDescription(); // Update status // Is communicated via an attribute, so property value is empty $description->addStatement('administrative_data/delivery/update_status[@type="urn_new"]', ""); $urn = ""; $scheme = ""; $pubIdPlugins = PluginRegistry::loadCategory('pubIds'); if (isset($pubIdPlugins) && array_key_exists('URNDNBPubIdPlugin', $pubIdPlugins) && $pubIdPlugins['URNDNBPubIdPlugin']->getEnabled() == true) { $urn = $pubIdPlugins['URNDNBPubIdPlugin']->getPubId($monograph); $namespaces = explode(':', $urn); $numberOfNamespaces = min(sizeof($namespaces), 3); $scheme = implode(":", array_slice($namespaces, 0, $numberOfNamespaces)); } // URN $description->addStatement('record/identifier', $urn . ' [@scheme="' . $scheme . '"]'); // URL $url = Request::url($press->getPath(), 'catalog', 'book', array($monograph->getId())); $description->addStatement('record/resource/identifier[@scheme="url", @type="frontpage", @role="primary"]', $url); // URL Mime type $description->addStatement('record/resource/format[@scheme="imt"]', "text/html"); return $description; }
function initialize($request) { parent::initialize($request); // Add locale keys AppLocale::requireComponents(LOCALE_COMPONENT_APP_SUBMISSION, LOCALE_COMPONENT_PKP_SUBMISSION); // Basic configuration $this->setTitle('submission.submit.addAuthor'); $this->setSourceType(LISTBUILDER_SOURCE_TYPE_SELECT); $this->setSaveType(LISTBUILDER_SAVE_TYPE_EXTERNAL); $this->setSaveFieldName('authors'); // Fetch and authorize chapter $chapterDao = DAORegistry::getDAO('ChapterDAO'); $monograph = $this->getMonograph(); $chapter = $chapterDao->getChapter($request->getUserVar('chapterId'), $monograph->getId()); if ($chapter) { // This is an existing chapter $this->setChapterId($chapter->getId()); } else { // This is a new chapter $this->setChapterId(null); } // Name column $nameColumn = new ListbuilderGridColumn($this, 'name', 'common.name'); // We can reuse the User cell provider because getFullName import('lib.pkp.controllers.listbuilder.users.UserListbuilderGridCellProvider'); $nameColumn->setCellProvider(new UserListbuilderGridCellProvider()); $this->addColumn($nameColumn); }
/** * @see PKPHandler::initialize() */ function initialize($request) { // Load user-related translations. AppLocale::requireComponents(LOCALE_COMPONENT_APP_ADMIN, LOCALE_COMPONENT_APP_MANAGER, LOCALE_COMPONENT_APP_COMMON, LOCALE_COMPONENT_PKP_USER, LOCALE_COMPONENT_PKP_GRID, LOCALE_COMPONENT_PKP_MANAGER); // Basic grid configuration. $this->setTitle('manager.reviewForms'); // Grid actions. $router = $request->getRouter(); import('lib.pkp.classes.linkAction.request.AjaxModal'); $this->addAction(new LinkAction('createReviewForm', new AjaxModal($router->url($request, null, null, 'createReviewForm', null, null), __('manager.reviewForms.create'), 'modal_add_item', true), __('manager.reviewForms.create'), 'add_item')); // // Grid columns. // import('lib.pkp.controllers.grid.settings.reviewForms.ReviewFormGridCellProvider'); $reviewFormGridCellProvider = new ReviewFormGridCellProvider(); // Review form name. $this->addColumn(new GridColumn('name', 'manager.reviewForms.title', null, null, $reviewFormGridCellProvider)); // Review Form 'in review' $this->addColumn(new GridColumn('inReview', 'manager.reviewForms.inReview', null, null, $reviewFormGridCellProvider)); // Review Form 'completed'. $this->addColumn(new GridColumn('completed', 'manager.reviewForms.completed', null, null, $reviewFormGridCellProvider)); // Review form 'activate/deactivate' // if ($element->getActive()) { $this->addColumn(new GridColumn('active', 'common.active', null, 'controllers/grid/common/cell/selectStatusCell.tpl', $reviewFormGridCellProvider)); }
/** * 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(); AppLocale::requireComponents(LOCALE_COMPONENT_PKP_ADMIN, LOCALE_COMPONENT_OJS_ADMIN, LOCALE_COMPONENT_OJS_MANAGER); $templateMgr =& TemplateManager::getManager(); $templateMgr->assign('pageHierarchy', $subclass ? array(array(Request::url(null, 'user'), 'navigation.user'), array(Request::url(null, 'admin'), 'admin.siteAdmin')) : array(array(Request::url(null, 'user'), 'navigation.user'))); }
/** * @copydoc ContextSettingsForm::fetch */ function fetch($request, $params = null) { $templateMgr = TemplateManager::getManager($request); AppLocale::requireComponents(LOCALE_COMPONENT_PKP_SUBMISSION); $templateMgr->assign('ccLicenseOptions', array_merge(array('' => 'common.other'), Application::getCCLicenseOptions())); return parent::fetch($request, $params); }
/** * @copydoc PKPHandler::initialize() */ function initialize($request) { parent::initialize($request); AppLocale::requireComponents(LOCALE_COMPONENT_PKP_ADMIN, LOCALE_COMPONENT_PKP_MANAGER, LOCALE_COMPONENT_APP_MANAGER); // Grid actions. $router = $request->getRouter(); import('lib.pkp.classes.linkAction.request.AjaxModal'); $this->addAction(new LinkAction('installLocale', new AjaxModal($router->url($request, null, null, 'installLocale', null, null), __('admin.languages.installLocale'), null, true), __('admin.languages.installLocale'), 'add')); $cellProvider = $this->getCellProvider(); // Columns. // Enable locale. $this->addColumn(new GridColumn('enable', 'common.enable', null, 'controllers/grid/common/cell/selectStatusCell.tpl', $cellProvider, array('width' => 10))); // Locale name. $this->addNameColumn(); // Primary locale. if ($this->_canManage($request)) { $primaryId = 'contextPrimary'; } else { $primaryId = 'sitePrimary'; } $this->addPrimaryColumn($primaryId); if ($this->_canManage($request)) { $this->addManagementColumns(); } $this->setFootNote('admin.locale.maybeIncomplete'); }
/** * Records a director's submission decision. * @param $trackDirectorSubmission object * @param $decision int * @param $round int */ function recordDecision($trackDirectorSubmission, $decision, $round) { $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, $round); $decisions = TrackDirectorSubmission::getDirectorDecisionOptions(); // Add log import('classes.paper.log.PaperLog'); import('classes.paper.log.PaperEventLogEntry'); AppLocale::requireComponents(LOCALE_COMPONENT_APP_COMMON, LOCALE_COMPONENT_APP_EDITOR); PaperLog::logEvent($trackDirectorSubmission->getId(), PAPER_LOG_DIRECTOR_DECISION, LOG_TYPE_DIRECTOR, $user->getId(), 'log.director.decision', array('directorName' => $user->getFullName(), 'paperId' => $trackDirectorSubmission->getId(), 'decision' => __($decisions[$decision]), 'round' => $round == REVIEW_ROUND_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); } }
/** * Constructor. * @param $args array script arguments */ function FileLoader($args) { parent::ScheduledTask($args); // Set an initial process id and load translations (required // for email notifications). AppLocale::requireComponents(LOCALE_COMPONENT_PKP_ADMIN); $this->_newProcessId(); // Canonicalize the base path. $basePath = rtrim($args[0], DIRECTORY_SEPARATOR); $basePathFolder = basename($basePath); // We assume that the parent folder of the base path // does already exist and can be canonicalized. $basePathParent = realpath(dirname($basePath)); if ($basePathParent === false) { $basePath = null; } else { $basePath = $basePathParent . DIRECTORY_SEPARATOR . $basePathFolder; } $this->_basePath = $basePath; // Configure paths. if (!is_null($basePath)) { $this->_stagePath = $basePath . DIRECTORY_SEPARATOR . FILE_LOADER_PATH_STAGING; $this->_archivePath = $basePath . DIRECTORY_SEPARATOR . FILE_LOADER_PATH_ARCHIVE; $this->_rejectPath = $basePath . DIRECTORY_SEPARATOR . FILE_LOADER_PATH_REJECT; $this->_processingPath = $basePath . DIRECTORY_SEPARATOR . FILE_LOADER_PATH_PROCESSING; } // Set admin email and name. $siteDao = DAORegistry::getDAO('SiteDAO'); /* @var $siteDao SiteDAO */ $site = $siteDao->getSite(); /* @var $site Site */ $this->_adminEmail = $site->getLocalizedContactEmail(); $this->_adminName = $site->getLocalizedContactName(); }
/** * @see GridHandler::initialize() */ function initialize($request, $args = null) { parent::initialize($request, $args); // Basic grid configuration $this->setId('preparedEmailsGrid'); AppLocale::requireComponents(LOCALE_COMPONENT_PKP_MANAGER, LOCALE_COMPONENT_PKP_USER); // Set the grid title. $this->setTitle('grid.preparedEmails.title'); $this->setInstructions('grid.preparedEmails.description'); // Grid actions import('lib.pkp.controllers.grid.settings.preparedEmails.linkAction.EditEmailLinkAction'); $addEmailLinkAction = new EditEmailLinkAction($request); $this->addAction($addEmailLinkAction); import('lib.pkp.classes.linkAction.LinkAction'); import('lib.pkp.classes.linkAction.request.RemoteActionConfirmationModal'); $router = $request->getRouter(); $this->addAction(new LinkAction('resetAll', new RemoteActionConfirmationModal(__('manager.emails.resetAll.message'), null, $router->url($request, null, 'grid.settings.preparedEmails.PreparedEmailsGridHandler', 'resetAllEmails')), __('manager.emails.resetAll'), 'reset_default')); // Columns import('lib.pkp.controllers.grid.settings.preparedEmails.PreparedEmailsGridCellProvider'); $cellProvider = new PreparedEmailsGridCellProvider(); $this->addColumn(new GridColumn('name', 'common.name', null, null, $cellProvider, array('width' => 40))); $this->addColumn(new GridColumn('sender', 'email.sender', null, null, $cellProvider, array('width' => 10))); $this->addColumn(new GridColumn('recipient', 'email.recipient', null, null, $cellProvider)); $this->addColumn(new GridColumn('subject', 'common.subject', null, null, $cellProvider)); $this->addColumn(new GridColumn('enabled', 'common.enabled', null, 'controllers/grid/common/cell/selectStatusCell.tpl', $cellProvider, array('width' => 5))); }
/** * @see DOIExportPlugin::generateExportFiles() */ function generateExportFiles($request, $exportType, &$objects, $targetPath, $journal, &$errors) { // Additional locale file. AppLocale::requireComponents(array(LOCALE_COMPONENT_APP_EDITOR)); // Export objects one by one (DataCite does not allow // multiple objects per file). $this->import('classes.DataciteExportDom'); $exportFiles = array(); foreach ($objects as $object) { // Generate the export XML. $dom = new DataciteExportDom($request, $this, $journal, $this->getCache()); $doc =& $dom->generate($object); if ($doc === false) { $this->cleanTmpfiles($targetPath, array_keys($exportFiles)); $errors =& $dom->getErrors(); return false; } // Write the result. $exportFile = $this->getTargetFileName($targetPath, $exportType, $object->getId()); file_put_contents($exportFile, XMLCustomWriter::getXML($doc)); $fileManager = new FileManager(); $fileManager->setMode($exportFile, FILE_MODE_MASK); $exportFiles[$exportFile] = array(&$object); unset($object); } return $exportFiles; }
function sendReminder($subscription, $journal, $emailKey) { $userDao = DAORegistry::getDAO('UserDAO'); $subscriptionTypeDao = DAORegistry::getDAO('SubscriptionTypeDAO'); $journalName = $journal->getLocalizedName(); $user = $userDao->getById($subscription->getUserId()); if (!isset($user)) { return false; } $subscriptionType = $subscriptionTypeDao->getSubscriptionType($subscription->getTypeId()); $subscriptionName = $journal->getSetting('subscriptionName'); $subscriptionEmail = $journal->getSetting('subscriptionEmail'); $subscriptionPhone = $journal->getSetting('subscriptionPhone'); $subscriptionMailingAddress = $journal->getSetting('subscriptionMailingAddress'); $subscriptionContactSignature = $subscriptionName; AppLocale::requireComponents(LOCALE_COMPONENT_PKP_USER, LOCALE_COMPONENT_APP_COMMON); if ($subscriptionMailingAddress != '') { $subscriptionContactSignature .= "\n" . $subscriptionMailingAddress; } if ($subscriptionPhone != '') { $subscriptionContactSignature .= "\n" . AppLocale::Translate('user.phone') . ': ' . $subscriptionPhone; } $subscriptionContactSignature .= "\n" . AppLocale::Translate('user.email') . ': ' . $subscriptionEmail; $paramArray = array('subscriberName' => $user->getFullName(), 'journalName' => $journalName, 'subscriptionType' => $subscriptionType->getSummaryString(), 'expiryDate' => $subscription->getDateEnd(), 'username' => $user->getUsername(), 'subscriptionContactSignature' => $subscriptionContactSignature); import('lib.pkp.classes.mail.MailTemplate'); $mail = new MailTemplate($emailKey, $journal->getPrimaryLocale(), $journal, false); $mail->setReplyTo($subscriptionEmail, $subscriptionName); $mail->addRecipient($user->getEmail(), $user->getFullName()); $mail->setSubject($mail->getSubject($journal->getPrimaryLocale())); $mail->setBody($mail->getBody($journal->getPrimaryLocale())); $mail->assignParams($paramArray); $mail->send(); }
/** * Displays the issue listings in a tabbed interface. * @param $args array * @param $request PKPRequest */ function index($args, $request) { $this->setupTemplate($request); AppLocale::requireComponents(LOCALE_COMPONENT_APP_EDITOR); $templateMgr = TemplateManager::getManager($request); $templateMgr->display('manageIssues/issues.tpl'); }
/** * @copydoc PKPHandler::initialize() */ function initialize($request) { parent::initialize($request); $context = $request->getContext(); $this->_contextId = $context->getId(); // Load user-related translations. AppLocale::requireComponents(LOCALE_COMPONENT_PKP_USER, LOCALE_COMPONENT_PKP_MANAGER, LOCALE_COMPONENT_APP_MANAGER, LOCALE_COMPONENT_PKP_SUBMISSION); // Basic grid configuration. $this->setTitle('grid.roles.currentRoles'); // Add grid-level actions. $router = $request->getRouter(); $this->addAction(new LinkAction('addUserGroup', new AjaxModal($router->url($request, null, null, 'addUserGroup'), __('grid.roles.add'), 'modal_add_role'), __('grid.roles.add'), 'add_role')); import('lib.pkp.controllers.grid.settings.roles.UserGroupGridCellProvider'); $cellProvider = new UserGroupGridCellProvider(); $workflowStagesLocales = WorkflowStageDAO::getWorkflowStageTranslationKeys(); // Set array containing the columns info with the same cell provider. $columnsInfo = array(1 => array('id' => 'name', 'title' => 'settings.roles.roleName', 'template' => null), 2 => array('id' => 'abbrev', 'title' => 'settings.roles.roleAbbrev', 'template' => null)); foreach ($workflowStagesLocales as $stageId => $stageTitleKey) { $columnsInfo[] = array('id' => $stageId, 'title' => $stageTitleKey, 'template' => 'controllers/grid/common/cell/selectStatusCell.tpl'); } // Add array columns to the grid. foreach ($columnsInfo as $columnInfo) { $this->addColumn(new GridColumn($columnInfo['id'], $columnInfo['title'], null, $columnInfo['template'], $cellProvider)); } }
/** * Fetch * @param $request PKPRequest * @see Form::fetch() */ function fetch($request) { $templateMgr = TemplateManager::getManager($request); $templateMgr->assign('submissionFileCategories', array(GENRE_CATEGORY_DOCUMENT => __('submission.document'), GENRE_CATEGORY_ARTWORK => __('submission.art'), GENRE_CATEGORY_SUPPLEMENTARY => __('submission.supplementary'))); AppLocale::requireComponents(LOCALE_COMPONENT_APP_MANAGER); return parent::fetch($request); }
/** * Fetch the modal contents for the monograph selection form * @param $args array * @param $request PKPRequest * @return JSONMessage JSON object */ function fetch($args, $request) { $templateMgr = TemplateManager::getManager($request); AppLocale::requireComponents(LOCALE_COMPONENT_APP_SUBMISSION); // submission.select return new JSONMessage(true, $templateMgr->fetch('controllers/modals/submissionMetadata/selectMonograph.tpl')); }
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(); AppLocale::requireComponents(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); // Basic grid configuration $this->setId('preparedEmailsGrid'); AppLocale::requireComponents(LOCALE_COMPONENT_PKP_MANAGER); // Set the grid title. $this->setTitle('grid.preparedEmails.title'); $this->setInstructions('grid.preparedEmails.description'); // Elements to be displayed in the grid $emailTemplateDao =& DAORegistry::getDAO('EmailTemplateDAO'); /* @var $emailTemplateDao EmailTemplateDAO */ $emailTemplates =& $emailTemplateDao->getEmailTemplates(AppLocale::getLocale(), $this->getContextId($request)); $rowData = array(); foreach ($emailTemplates as $emailTemplate) { $rowData[$emailTemplate->getEmailKey()] = $emailTemplate; } $this->setGridDataElements($rowData); // Grid actions import('lib.pkp.controllers.grid.settings.preparedEmails.linkAction.EditEmailLinkAction'); $addEmailLinkAction = new EditEmailLinkAction($request); $this->addAction($addEmailLinkAction); import('lib.pkp.classes.linkAction.LinkAction'); import('lib.pkp.classes.linkAction.request.RemoteActionConfirmationModal'); $router =& $request->getRouter(); $this->addAction(new LinkAction('resetAll', new RemoteActionConfirmationModal(__('manager.emails.resetAll.message'), null, $router->url($request, null, 'grid.settings.preparedEmails.PreparedEmailsGridHandler', 'resetAllEmails')), __('manager.emails.resetAll'), 'reset_default')); // Columns import('lib.pkp.controllers.grid.settings.preparedEmails.PreparedEmailsGridCellProvider'); $cellProvider = new PreparedEmailsGridCellProvider(); $this->addColumn(new GridColumn('name', 'common.name', null, 'controllers/grid/gridCell.tpl', $cellProvider, array('width' => 40))); $this->addColumn(new GridColumn('sender', 'email.sender', null, 'controllers/grid/gridCell.tpl', $cellProvider, array('width' => 10))); $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/selectStatusCell.tpl', $cellProvider, array('width' => 5))); }