Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
SubmissionSubmitStep1Form.inc.php
1 <?php
2 
16 import('lib.pkp.classes.submission.form.PKPSubmissionSubmitStep1Form');
17 import('classes.monograph.Monograph'); // WORK_TYPE_... constants for form
18 
23  function SubmissionSubmitStep1Form($context, $submission = null) {
24  parent::PKPSubmissionSubmitStep1Form($context, $submission);
25  }
26 
30  function fetch($request) {
31  $templateMgr = TemplateManager::getManager($request);
32 
33  // Get series for this context
34  $seriesDao = DAORegistry::getDAO('SeriesDAO');
35  $seriesOptions = array('0' => __('submission.submit.selectSeries')) + $seriesDao->getTitlesByPressId($this->context->getId(), true);
36  $templateMgr->assign('seriesOptions', $seriesOptions);
37 
38  return parent::fetch($request);
39  }
40 
44  function initData() {
45  if (isset($this->submission)) {
46  parent::initData(array(
47  'seriesId' => $this->submission->getSeriesId(),
48  'seriesPosition' => $this->submission->getSeriesPosition(),
49  'workType' => $this->submission->getWorkType(),
50  ));
51  } else {
52  parent::initData();
53  }
54  }
55 
59  function readInputData() {
60  $this->readUserVars(array(
61  'workType', 'seriesId', 'seriesPosition',
62  ));
63  parent::readInputData();
64  }
65 
70  function validate() {
71  if (!parent::validate()) return false;
72 
73  // Validate that the series ID is attached to this press.
74  if ($seriesId = $this->getData('seriesId')) {
75  $request = Application::getRequest();
76  $context = $request->getContext();
77  $seriesDao = DAORegistry::getDAO('SeriesDAO');
78  $series = $seriesDao->getById($seriesId, $context->getId());
79  if (!$series) return false;
80  }
81 
82  return true;
83  }
84 
90  $submission->setWorkType($this->getData('workType'));
91  $submission->setSeriesId($this->getData('seriesId'));
92  $submission->setSeriesPosition($this->getData('seriesPosition'));
93  parent::setSubmissionData($submission);
94  }
95 }
96 
97 ?>
static & getDAO($name, $dbconn=null)
readUserVars($vars)
Definition: Form.inc.php:364
getData($key)
Definition: Form.inc.php:210
SubmissionSubmitStep1Form($context, $submission=null)
Form for Step 1 of author submission.
Form for Step 1 of author submission: terms, conditions, etc.