classes/manager/form/GroupForm.inc.php

Go to the documentation of this file.
00001 <?php
00002 
00015 //$Id$
00016 
00017 import('form.Form');
00018 
00019 class GroupForm extends Form {
00021    var $group;
00022 
00027    function GroupForm($group = null) {
00028       $conference =& Request::getConference();
00029 
00030       parent::Form('manager/groups/groupForm.tpl');
00031 
00032       // Group title is provided
00033       $this->addCheck(new FormValidatorLocale($this, 'title', 'required', 'manager.groups.form.groupTitleRequired'));
00034       $this->addCheck(new FormValidatorPost($this));
00035 
00036       $this->group =& $group;
00037    }
00038 
00043    function getLocaleFieldNames() {
00044       $groupDao =& DAORegistry::getDAO('GroupDAO');
00045       return $groupDao->getLocaleFieldNames();
00046    }
00047 
00051    function display() {
00052       $templateMgr =& TemplateManager::getManager();
00053       $templateMgr->assign_by_ref('group', $this->group);
00054       $templateMgr->assign('helpTopicId', 'conference.currentConferences.organizingTeam');
00055       parent::display();
00056    }
00057 
00061    function initData() {
00062       if ($this->group != null) {
00063          $this->_data = array(
00064             'title' => $this->group->getTitle(null) // Localized
00065          );
00066       }
00067    }
00068 
00072    function readInputData() {
00073       $this->readUserVars(array('title'));
00074    }
00075 
00079    function execute() {
00080       $groupDao =& DAORegistry::getDAO('GroupDAO');
00081       $conference =& Request::getConference();
00082       $schedConf =& Request::getSchedConf();
00083 
00084       if (!isset($this->group)) {
00085          $this->group = new Group();
00086       }
00087 
00088       $this->group->setAssocType(ASSOC_TYPE_SCHED_CONF);
00089       $this->group->setAssocId($schedConf->getId());
00090       $this->group->setTitle($this->getData('title'), null); // Localized
00091 
00092       // Eventually this will be a general Groups feature; for now,
00093       // we're just using it to display conference team entries in About.
00094       $this->group->setAboutDisplayed(true);
00095 
00096       // Update or insert group group
00097       if ($this->group->getId() != null) {
00098          $groupDao->updateObject($this->group);
00099       } else {
00100          $this->group->setSequence(REALLY_BIG_NUMBER);
00101          $groupDao->insertGroup($this->group);
00102 
00103          // Re-order the groups so the new one is at the end of the list.
00104          $groupDao->resequenceGroups($this->group->getAssocType(), $this->group->getAssocId());
00105       }
00106    }
00107 
00108 }
00109 
00110 ?>

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