/**
  * Fetch the form.
  * @param $request PKPRequest
  */
 function fetch($request)
 {
     $templateMgr = TemplateManager::getManager($request);
     $context = $request->getContext();
     // Tell the form what fields are enabled (and which of those are required)
     foreach (array_keys(MetadataGridHandler::getNames()) as $field) {
         $templateMgr->assign($a = array($field . 'Enabled' => $context->getSetting($field . 'EnabledSubmission'), $field . 'Required' => $context->getSetting($field . 'Required')));
     }
     return parent::fetch($request);
 }
Example #2
0
 /**
  * Constructor.
  * @param $wizardMode boolean True iff in wizard mode.
  */
 function SubmissionStageForm($wizardMode = false)
 {
     $this->addCheck(new FormValidatorEmail($this, 'copySubmissionAckAddress'));
     // Add the list of metadata field-related settings per the MetadataGridHandler
     // e.g.: typeEnabledSubmission; typeEnabledWorkflow; typeRequired
     $metadataFieldNames = array_keys(MetadataGridHandler::getNames());
     $metadataSettings = array_merge(array_map(function ($n) {
         return $n . 'EnabledSubmission';
     }, $metadataFieldNames), array_map(function ($n) {
         return $n . 'EnabledWorkflow';
     }, $metadataFieldNames), array_map(function ($n) {
         return $n . 'Required';
     }, $metadataFieldNames));
     parent::ContextSettingsForm(array_merge(array('copySubmissionAckPrimaryContact' => 'bool', 'copySubmissionAckAddress' => 'string', 'authorGuidelines' => 'string'), array_combine($metadataSettings, array_fill(0, count($metadataSettings), 'bool'))), 'controllers/tab/settings/submissionStage/form/submissionStageForm.tpl', $wizardMode);
 }
 /**
  * Fetch the HTML contents of the form.
  * @param $request PKPRequest
  * return string
  */
 function fetch($request)
 {
     $submission = $this->getSubmission();
     $templateMgr = TemplateManager::getManager($request);
     $templateMgr->assign(array('submissionId' => $submission->getId(), 'stageId' => $this->getStageId(), 'formParams' => $this->getFormParams()));
     // Tell the form what fields are enabled (and which of those are required)
     import('lib.pkp.controllers.grid.settings.metadata.MetadataGridHandler');
     $context = $request->getContext();
     foreach (array_keys(MetadataGridHandler::getNames()) as $field) {
         $templateMgr->assign(array($field . 'Enabled' => $context->getSetting($field . 'EnabledWorkflow'), $field . 'Required' => $context->getSetting($field . 'Required')));
     }
     return parent::fetch($request);
 }
 /**
  * Fetch the HTML contents of the form.
  * @param $request PKPRequest
  * return string
  */
 function fetch($request)
 {
     $submission = $this->getSubmission();
     $templateMgr = TemplateManager::getManager($request);
     $templateMgr->assign(array('submissionId' => $submission->getId(), 'stageId' => $this->getStageId(), 'formParams' => $this->getFormParams()));
     // Tell the form what fields are enabled (and which of those are required)
     import('lib.pkp.controllers.grid.settings.metadata.MetadataGridHandler');
     $context = $request->getContext();
     foreach (array_keys(MetadataGridHandler::getNames()) as $field) {
         $templateMgr->assign(array($field . 'Enabled' => $context->getSetting($field . 'EnabledWorkflow'), $field . 'Required' => $context->getSetting($field . 'Required')));
     }
     // Provide available submission languages. (Convert the array
     // of locale symbolic names xx_XX into an associative array
     // of symbolic names => readable names.)
     $supportedSubmissionLocales = $context->getSetting('supportedSubmissionLocales');
     if (empty($supportedSubmissionLocales)) {
         $supportedSubmissionLocales = array($context->getPrimaryLocale());
     }
     $templateMgr->assign('supportedSubmissionLocaleNames', array_flip(array_intersect(array_flip(AppLocale::getAllLocales()), $supportedSubmissionLocales)));
     return parent::fetch($request);
 }