00001 <?php
00002
00015
00016
00017 import("manager.form.schedConfSetup.SchedConfSetupForm");
00018 import('form.Form');
00019
00020 class SchedConfSetupForm extends Form {
00021 var $step;
00022 var $settings;
00023
00029 function SchedConfSetupForm($step, $settings) {
00030 parent::Form(sprintf('manager/schedConfSetup/step%d.tpl', $step));
00031 $this->addCheck(new FormValidatorPost($this));
00032 $this->step = $step;
00033 $this->settings = $settings;
00034 }
00035
00039 function display() {
00040 $templateMgr =& TemplateManager::getManager();
00041 $templateMgr->assign('setupStep', $this->step);
00042 $templateMgr->assign('helpTopicId', 'conference.currentConferences.setup');
00043 $templateMgr->setCacheability(CACHEABILITY_MUST_REVALIDATE);
00044 $templateMgr->assign('yearOffsetFuture', SCHED_CONF_DATE_YEAR_OFFSET_FUTURE);
00045 parent::display();
00046 }
00047
00051 function initData() {
00052 $schedConf =& Request::getSchedConf();
00053 $this->_data = $schedConf->getSettings();
00054 }
00055
00059 function readInputData() {
00060 $this->readUserVars(array_keys($this->settings));
00061 }
00062
00066 function execute() {
00067 $schedConf =& Request::getSchedConf();
00068 $settingsDao =& DAORegistry::getDAO('SchedConfSettingsDAO');
00069
00070 foreach ($this->_data as $name => $value) {
00071 if (isset($this->settings[$name])) {
00072 $isLocalized = in_array($name, $this->getLocaleFieldNames());
00073 $settingsDao->updateSetting(
00074 $schedConf->getId(),
00075 $name,
00076 $value,
00077 $this->settings[$name],
00078 $isLocalized
00079 );
00080 }
00081 }
00082 }
00083 }
00084
00085 ?>