classes/manager/form/schedConfSetup/SchedConfSetupStep1Form.inc.php

Go to the documentation of this file.
00001 <?php
00002 
00019 //$Id$
00020 
00021 import("manager.form.schedConfSetup.SchedConfSetupForm");
00022 
00023 class SchedConfSetupStep1Form extends SchedConfSetupForm {
00024 
00025    function SchedConfSetupStep1Form() {
00026       parent::SchedConfSetupForm(
00027          1,
00028          array(
00029             'introduction' => 'string',
00030             'overview' => 'string',
00031             'locationName' => 'string',
00032             'locationAddress' => 'string',
00033             'locationCity' => 'string',
00034             'locationCountry' => 'string',
00035             'contactName' => 'string',
00036             'contactTitle' => 'string',
00037             'contactAffiliation' => 'string',
00038             'contactEmail' => 'string',
00039             'contactPhone' => 'string',
00040             'contactFax' => 'string',
00041             'contactMailingAddress' => 'string',
00042             'supportName' => 'string',
00043             'supportEmail' => 'string',
00044             'supportPhone' => 'string',
00045             'emailSignature' => 'string',
00046             'envelopeSender' => 'string',
00047             'sponsorNote' => 'string',
00048             'sponsors' => 'object',
00049             'contributorNote' => 'string',
00050             'contributors' => 'object'
00051          )
00052       );
00053 
00054       $this->addCheck(new FormValidator($this, 'contactName', 'required', 'manager.schedConfSetup.details.contactNameRequired'));
00055       $this->addCheck(new FormValidatorEmail($this, 'contactEmail', 'required', 'manager.schedConfSetup.details.contactEmailRequired'));
00056       $this->addCheck(new FormValidator($this, 'supportName', 'required', 'manager.schedConfSetup.details.supportNameRequired'));
00057       $this->addCheck(new FormValidatorEmail($this, 'supportEmail', 'required', 'manager.schedConfSetup.details.supportEmailRequired'));
00058    }
00059 
00064    function getLocaleFieldNames() {
00065       return array('introduction', 'contactAffiliation', 'overview', 'emailSignature', 'sponsorNote', 'contributorNote');
00066    }
00067 
00073    function execute() {
00074       foreach (array('sponsors', 'contributors') as $element) {
00075          $elementValue = (array) $this->getData($element);
00076          foreach (array_keys($elementValue) as $key) {
00077             $values = array_values((array) $elementValue[$key]);
00078             $isEmpty = true;
00079             foreach ($values as $value) {
00080                if (!empty($value)) $isEmpty = false;
00081             }
00082             if ($isEmpty) unset($elementValue[$key]);
00083          }
00084          $this->setData($element, $elementValue);
00085 
00086       }
00087 
00088       return parent::execute();
00089    }
00090 
00091    function display() {
00092       $templateMgr =& TemplateManager::getManager();
00093       if (Config::getVar('email', 'allow_envelope_sender'))
00094          $templateMgr->assign('envelopeSenderEnabled', true);
00095 
00096       $countryDao =& DAORegistry::getDAO('CountryDAO');
00097       $countries =& $countryDao->getCountries();
00098       $templateMgr->assign_by_ref('countries', $countries);
00099 
00100       parent::display();
00101    }
00102 }
00103 
00104 ?>

Generated on 25 Jul 2013 for Open Conference Systems by  doxygen 1.4.7