Exemple #1
0
 /**
  * Fetch the form
  * @param $request Request
  */
 function fetch($request)
 {
     $templateMgr = TemplateManager::getManager($request);
     $baseUrl = $templateMgr->_request->getBaseUrl();
     // Add extra java script required for ajax components
     // FIXME: Must be removed after OMP->OJS backporting
     // NOTE: I believe this needs attention. jquery.validate.min.js is
     // loaded with our minifiedScripts.tpl list and includes some i18n
     // features.
     $templateMgr->addJavaScript('citation', $baseUrl . '/lib/pkp/js/functions/citation.js', array('contexts' => 'backend'));
     $templateMgr->addJavaScript('jqueryValidate', $baseUrl . '/lib/pkp/js/lib/jquery/plugins/validate/jquery.validate.min.js', array('contexts' => 'backend'));
     $templateMgr->addJavaScript('jqueryValidatorI18n', $baseUrl . '/lib/pkp/js/functions/jqueryValidatorI18n.js', array('contexts' => 'backend'));
     //
     // Citation editor filter configuration
     //
     // 1) Add the filter grid URLs
     $dispatcher = $request->getDispatcher();
     $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);
     // 2) Create a list of all available citation output filters.
     $router = $request->getRouter();
     $journal = $router->getContext($request);
     $filterDao = DAORegistry::getDAO('FilterDAO');
     /* @var $filterDao FilterDAO */
     $metaCitationOutputFilterObjects = $filterDao->getObjectsByGroup('nlm30-element-citation=>plaintext', $journal->getId());
     foreach ($metaCitationOutputFilterObjects as $metaCitationOutputFilterObject) {
         $metaCitationOutputFilters[$metaCitationOutputFilterObject->getId()] = $metaCitationOutputFilterObject->getDisplayName();
     }
     $templateMgr->assign_by_ref('metaCitationOutputFilters', $metaCitationOutputFilters);
     return parent::fetch($request);
 }
 /**
  * @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);
 }
Exemple #3
0
 /**
  * Fetch the form
  * @param $request Request
  */
 function fetch($request)
 {
     $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/functions/citation.js');
     $templateMgr->addJavaScript('lib/pkp/js/lib/jquery/plugins/validate/jquery.validate.min.js');
     $templateMgr->addJavaScript('lib/pkp/js/functions/jqueryValidatorI18n.js');
     //
     // Citation editor filter configuration
     //
     // 1) Add the filter grid URLs
     $dispatcher = $request->getDispatcher();
     $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);
     // 2) Create a list of all available citation output filters.
     $router = $request->getRouter();
     $journal = $router->getContext($request);
     $filterDao = DAORegistry::getDAO('FilterDAO');
     /* @var $filterDao FilterDAO */
     $metaCitationOutputFilterObjects = $filterDao->getObjectsByGroup('nlm30-element-citation=>plaintext', $journal->getId());
     foreach ($metaCitationOutputFilterObjects as $metaCitationOutputFilterObject) {
         $metaCitationOutputFilters[$metaCitationOutputFilterObject->getId()] = $metaCitationOutputFilterObject->getDisplayName();
     }
     $templateMgr->assign_by_ref('metaCitationOutputFilters', $metaCitationOutputFilters);
     return parent::fetch($request);
 }
 /**
  * @copydoc ContextSettingsForm::fetch()
  */
 function fetch($request)
 {
     for ($x = 1; $x < 11; $x++) {
         $numAnnouncementsHomepageOptions[$x] = $x;
     }
     $params = array('numAnnouncementsHomepageOptions' => $numAnnouncementsHomepageOptions, 'disableAnnouncementsHomepage' => !$this->getData('enableAnnouncementsHomepage'));
     return parent::fetch($request, $params);
 }
 /**
  * @copydoc Form::fetch()
  */
 function fetch($request, $params = null)
 {
     $templateMgr = TemplateManager::getManager($request);
     import('lib.pkp.classes.mail.MailTemplate');
     $mail = new MailTemplate('SUBMISSION_ACK');
     $templateMgr->assign('submissionAckDisabled', !$mail->isEnabled());
     return parent::fetch($request, $params);
 }
 /**
  * @see Form::fetch()
  */
 function fetch($request, $params = null)
 {
     $templateMgr = TemplateManager::getManager($request);
     $onixCodelistItemDao = DAORegistry::getDAO('ONIXCodelistItemDAO');
     $codeTypes = $onixCodelistItemDao->getCodes('List44');
     // Name code types for publisher
     $templateMgr->assign('codeTypes', $codeTypes);
     return parent::fetch($request);
 }
 /**
  * @see ContextSettingsForm::execute()
  * @param $request Request
  */
 function execute($request)
 {
     $press = $request->getPress();
     if ($press->getEnabled() !== $this->getData('pressEnabled')) {
         $pressDao = DAORegistry::getDAO('PressDAO');
         $press->setEnabled($this->getData('pressEnabled'));
         $pressDao->updateObject($press);
     }
     parent::execute($request);
 }
 /**
  * Constructor.
  */
 function ContactForm($wizardMode = false)
 {
     $settings = array('contactName' => 'string', 'contactTitle' => 'string', 'contactAffiliation' => 'string', 'contactEmail' => 'string', 'contactPhone' => 'string', 'supportName' => 'string', 'supportEmail' => 'string', 'supportPhone' => 'string');
     parent::ContextSettingsForm($settings, 'controllers/tab/settings/contact/form/contactForm.tpl', $wizardMode);
     $this->addCheck(new FormValidator($this, 'contactName', 'required', 'manager.setup.form.contactNameRequired'));
     $this->addCheck(new FormValidatorEmail($this, 'contactEmail', 'required', 'manager.setup.form.contactEmailRequired'));
     if (!$this->getWizardMode()) {
         $this->addCheck(new FormValidator($this, 'supportName', 'required', 'manager.setup.form.supportNameRequired'));
         $this->addCheck(new FormValidatorEmail($this, 'supportEmail', 'required', 'manager.setup.form.supportEmailRequired'));
     }
 }
 /**
  * @see ContextSettingsForm::initData.
  * @param $request Request
  */
 function initData($request)
 {
     parent::initData($request);
     $press = $request->getPress();
     $this->setData('enabled', (int) $press->getEnabled());
     if ($this->getData('acronym') == null) {
         $acronym = array();
         foreach (array_keys($this->supportedLocales) as $locale) {
             $acronym[$locale] = $press->getPath();
         }
         $this->setData('acronym', $acronym);
     }
 }
 /**
  * @copydoc ContextSettingsForm::fetch()
  */
 function fetch($request)
 {
     $params = array();
     // Ensuring blind review link.
     import('lib.pkp.classes.linkAction.request.ConfirmationModal');
     import('lib.pkp.classes.linkAction.LinkAction');
     $params['ensuringLink'] = new LinkAction('showReviewPolicy', new ConfirmationModal(__('review.blindPeerReview'), __('review.ensuringBlindReview'), 'modal_information', null, null, true, MODAL_WIDTH_DEFAULT), __('review.ensuringBlindReview'));
     $params['scheduledTasksDisabled'] = Config::getVar('general', 'scheduled_tasks') ? false : true;
     $templateMgr = TemplateManager::getManager($request);
     $templateMgr->assign('numDaysBeforeInviteReminderValues', range(3, 10));
     $templateMgr->assign('numDaysBeforeSubmitReminderValues', range(0, 10));
     return parent::fetch($request, $params);
 }
 /**
  * @copydoc ContextSettingsForm::fetch()
  */
 function fetch($request)
 {
     $params = array();
     // Ensuring blind review link.
     import('lib.pkp.classes.linkAction.request.ConfirmationModal');
     import('lib.pkp.classes.linkAction.LinkAction');
     $params['ensuringLink'] = new LinkAction('showReviewPolicy', new ConfirmationModal(__('review.blindPeerReview'), __('review.ensuringBlindReview'), 'modal_information', null, null, true, MODAL_WIDTH_DEFAULT), __('manager.setup.reviewOptions.showBlindReviewLink'));
     $params['scheduledTasksDisabled'] = Config::getVar('general', 'scheduled_tasks') ? false : true;
     $templateMgr = TemplateManager::getManager($request);
     $templateMgr->assign(array('numDaysBeforeInviteReminderValues' => array_combine(range(1, 10), range(1, 10)), 'numDaysBeforeSubmitReminderValues' => array_combine(range(1, 10), range(1, 10))));
     $reviewAssignmentDao = DAORegistry::getDAO('ReviewAssignmentDAO');
     $templateMgr->assign('reviewMethodOptions', $reviewAssignmentDao->getReviewMethodsTranslationKeys());
     return parent::fetch($request, $params);
 }
 /**
  * @copydoc ContextSettingsForm::execute()
  */
 function execute($request)
 {
     $context = $request->getContext();
     // Get the selected payment plugin
     $paymentPluginName = $this->getData('paymentPluginName');
     if (isset($this->paymentPlugins[$paymentPluginName])) {
         $plugin = $this->paymentPlugins[$paymentPluginName];
         // Save the plugin-specific settings
         foreach ($plugin->getSettingsFormFieldNames() as $settingName) {
             $plugin->updateSetting($context->getId(), $settingName, $this->getData($settingName));
         }
         // Remove notification.
         $notificationDao = DAORegistry::getDAO('NotificationDAO');
         $notificationDao->deleteByAssoc($context->getAssocType(), $context->getId(), null, NOTIFICATION_TYPE_CONFIGURE_PAYMENT_METHOD, $context->getId());
     } else {
         // Create notification.
         $notificationMgr = new NotificationManager();
         $notificationMgr->createNotification($request, null, NOTIFICATION_TYPE_CONFIGURE_PAYMENT_METHOD, $context->getId(), $context->getAssocType(), $context->getId(), NOTIFICATION_LEVEL_NORMAL);
     }
     return parent::execute($request);
 }
Exemple #13
0
 /**
  * Constructor.
  */
 function AccessForm($wizardMode = false)
 {
     parent::ContextSettingsForm(array('publishingMode' => 'int'), 'controllers/tab/settings/access/form/accessForm.tpl', $wizardMode);
 }
 /**
  * Constructor.
  */
 function SiteAccessOptionsForm($wizardMode = false)
 {
     $settings = array('disableUserReg' => 'bool', 'allowRegAuthor' => 'bool', 'allowRegReviewer' => 'bool', 'restrictSiteAccess' => 'bool', 'restrictArticleAccess' => 'bool', 'showGalleyLinks' => 'bool');
     parent::ContextSettingsForm($settings, 'controllers/tab/settings/siteAccessOptions/form/siteAccessOptionsForm.tpl', $wizardMode);
 }
Exemple #15
0
 /**
  * @copydoc Form::fetch()
  */
 function fetch($request, $params = null)
 {
     $site = $request->getSite();
     $templateMgr = TemplateManager::getManager($request);
     return parent::fetch($request, $params);
 }
 /**
  * Constructor.
  */
 function __construct($wizardMode = false)
 {
     $settings = array('enableLockss' => 'bool', 'enableClockss' => 'bool');
     parent::__construct($settings, 'controllers/tab/settings/archiving/form/archivingForm.tpl', $wizardMode);
 }
 /**
  * @copydoc ContextSettingsForm::execute()
  */
 function execute($request)
 {
     // Clear the template cache if theme has changed
     $context = $request->getContext();
     if ($this->getData('themePluginPath') != $context->getSetting('themePluginPath')) {
         $templateMgr = TemplateManager::getManager($request);
         $templateMgr->clearTemplateCache();
         $templateMgr->clearCssCache();
     }
     parent::execute($request);
     // Save block plugins context positions.
     import('lib.pkp.classes.controllers.listbuilder.ListbuilderHandler');
     ListbuilderHandler::unpack($request, $request->getUserVar('blocks'), array($this, 'deleteEntry'), array($this, 'insertEntry'), array($this, 'updateEntry'));
 }
Exemple #18
0
 /**
  * Constructor.
  */
 function GuidelinesForm($wizardMode = false)
 {
     $settings = array('authorGuidelines' => 'string');
     parent::ContextSettingsForm($settings, 'controllers/tab/settings/guidelines/form/guidelinesForm.tpl', $wizardMode);
 }
 /**
  * @copydoc ContextSettingsForm::fetch()
  */
 function fetch($request)
 {
     $context = $request->getContext();
     $dispatcher = $request->getDispatcher();
     return parent::fetch($request, array('envelopeSenderDisabled' => !Config::getVar('email', 'allow_envelope_sender') || Config::getVar('email', 'force_default_envelope_sender') && Config::getVar('email', 'default_envelope_sender'), 'emailVariables' => array('contextName' => $context->getLocalizedName(), 'senderName' => __('email.senderName'), 'senderEmail' => __('email.senderEmail'))));
 }
 /**
  * Constructor.
  * @param $wizardMode boolean
  */
 function AffiliationForm($wizardMode = false)
 {
     $settings = array('sponsorNote' => 'string', 'contributorNote' => 'string');
     parent::ContextSettingsForm($settings, 'controllers/tab/settings/affiliation/form/affiliationForm.tpl', $wizardMode);
 }
 /**
  * Constructor.
  */
 function ArchivingForm($wizardMode = false)
 {
     $settings = array('enableLockss' => 'bool', 'lockssLicense' => 'string', 'enableClockss' => 'bool', 'clockssLicense' => 'string');
     parent::ContextSettingsForm($settings, 'controllers/tab/settings/archiving/form/archivingForm.tpl', $wizardMode);
 }
 /**
  * Constructor.
  */
 function ProductionStageForm($wizardMode = false)
 {
     $settings = array('publisherNote' => 'string', 'publisherInstitution' => 'string', 'publisherUrl' => 'string');
     parent::ContextSettingsForm($settings, 'controllers/tab/settings/productionStage/form/productionStageForm.tpl', $wizardMode);
     $this->addCheck(new FormValidatorUrl($this, 'publisherUrl', 'optional', 'user.profile.form.urlInvalid'));
 }
Exemple #23
0
 /**
  * @copydoc ContextSettingsForm::execute()
  * @param $request Request
  */
 function execute($request)
 {
     $journal = $request->getContext();
     if ($journal->getEnabled() !== $this->getData('journalEnabled')) {
         $journalDao = DAORegistry::getDAO('JournalDAO');
         $journal->setEnabled($this->getData('journalEnabled'));
         $journalDao->updateObject($journal);
     }
     // Save block plugins context positions.
     import('lib.pkp.classes.controllers.listbuilder.ListbuilderHandler');
     $this->categories = $journal->getSetting('categories');
     ListbuilderHandler::unpack($request, $request->getUserVar('categories'));
     $this->setData('categories', $this->categories);
     parent::execute($request);
 }
 /**
  * Constructor.
  */
 function ContextIndexingForm($wizardMode = false)
 {
     $settings = array('searchDescription' => 'string', 'searchKeywords' => 'string', 'customHeaders' => 'string');
     parent::ContextSettingsForm($settings, 'controllers/tab/settings/contextIndexing/form/contextIndexingForm.tpl', $wizardMode);
 }
Exemple #25
0
 /**
  * @copydoc ContextSettingsForm::execute()
  */
 function execute($request)
 {
     parent::execute($request);
     // Save block plugins context positions.
     import('lib.pkp.classes.controllers.listbuilder.ListbuilderHandler');
     ListbuilderHandler::unpack($request, $request->getUserVar('blocks'));
     // Activate the selected theme plugin
     $context = $request->getContext();
     $themePlugins = PluginRegistry::loadCategory('themes');
     $selectedThemePluginPath = $this->getData('themePluginPath');
     $selectedThemePlugin = null;
     foreach ($themePlugins as $themePlugin) {
         if (basename($themePlugin->getPluginPath()) != $selectedThemePluginPath) {
             if ($themePlugin->getEnabled()) {
                 $themePlugin->setEnabled(false);
             }
         } else {
             $selectedThemePlugin = $themePlugin;
         }
     }
     if ($selectedThemePlugin) {
         // Activate the selected theme to trigger a CSS recompile.
         $selectedThemePlugin->setEnabled(true);
     } else {
         assert(false);
         // Couldn't identify the selected theme plugin
     }
 }
Exemple #26
0
 /**
  * Constructor.
  */
 function IdentifiersForm($wizardMode = false)
 {
     parent::ContextSettingsForm(array('enablePublicArticleId' => 'bool', 'enablePublicIssueId' => 'bool', 'enablePublicGalleyId' => 'bool', 'enablePageNumber' => 'bool'), 'controllers/tab/settings/identifiers/form/identifiersForm.tpl', $wizardMode);
 }
 /**
  * Constructor.
  */
 function __construct($wizardMode = false)
 {
     $settings = array('readerInformation' => 'string', 'authorInformation' => 'string', 'librarianInformation' => 'string');
     parent::__construct($settings, 'controllers/tab/settings/information/form/informationForm.tpl', $wizardMode);
 }
 /**
  * Constructor.
  */
 function ContentIndexingForm($wizardMode = false)
 {
     $settings = array('metaDiscipline' => 'bool', 'metaSubjectClass' => 'bool', 'metaSubjectClassTitle' => 'string', 'metaSubjectClassUrl' => 'string', 'metaCoverage' => 'bool', 'metaType' => 'bool');
     parent::ContextSettingsForm($settings, 'controllers/tab/settings/contentIndexing/form/contentIndexingForm.tpl', $wizardMode);
     $this->addCheck(new FormValidatorLocaleURL($this, 'metaSubjectClassUrl', 'optional', 'manager.setup.subjectClassificationURLValid'));
 }
 /**
  * Constructor.
  * @param $wizardMode boolean Whether the form should operate in wizard mode
  * @param $additionalSettings array Optional name => type mappings for additional settings (e.g. implemented by subclasses)
  */
 function PoliciesForm($wizardMode = false, $additionalSettings = array())
 {
     $settings = array_merge($additionalSettings, array('focusScopeDesc' => 'string', 'openAccessPolicy' => 'string', 'reviewPolicy' => 'string', 'competingInterestsPolicy' => 'string', 'privacyStatement' => 'string'));
     AppLocale::requireComponents(LOCALE_COMPONENT_APP_COMMON);
     parent::ContextSettingsForm($settings, 'controllers/tab/settings/policies/form/policiesForm.tpl', $wizardMode);
 }
 /**
  * Constructor.
  */
 function SiteAccessOptionsForm($wizardMode = false)
 {
     $settings = array('disableUserReg' => 'bool', 'restrictSiteAccess' => 'bool', 'restrictMonographAccess' => 'bool');
     parent::ContextSettingsForm($settings, 'controllers/tab/settings/siteAccessOptions/form/siteAccessOptionsForm.tpl', $wizardMode);
 }