summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
authorBjörn Geiger2011-09-07 17:14:16 +0200
committerBjörn Geiger2011-09-07 17:14:16 +0200
commit0b0d6221d23b9f5b125062adf1d249ab5d1a6d61 (patch)
treeaf16a179302360e6d8a5b174c9218a48d65c835d /application
parentkleine Korrektur (diff)
downloadpoolctrl-0b0d6221d23b9f5b125062adf1d249ab5d1a6d61.tar.gz
poolctrl-0b0d6221d23b9f5b125062adf1d249ab5d1a6d61.tar.xz
poolctrl-0b0d6221d23b9f5b125062adf1d249ab5d1a6d61.zip
default eventcategory geändert
Diffstat (limited to 'application')
-rw-r--r--application/configs/application.ini.dist1
-rw-r--r--application/controllers/EventController.php4
-rw-r--r--application/forms/EventAdd.php45
3 files changed, 39 insertions, 11 deletions
diff --git a/application/configs/application.ini.dist b/application/configs/application.ini.dist
index a444d79..3acfdbc 100644
--- a/application/configs/application.ini.dist
+++ b/application/configs/application.ini.dist
@@ -50,6 +50,7 @@ gearman.worker.ps.blacklist.10 = vmware-vmx
gearman.worker.ps.whitelist.0 = gnome-screensav
gearman.worker.ps.whitelist.1 = Kscreensaver
event.updatePeriod = 5
+event.category.default = Lecture
[staging : production]
diff --git a/application/controllers/EventController.php b/application/controllers/EventController.php
index 546dc66..4edabab 100644
--- a/application/controllers/EventController.php
+++ b/application/controllers/EventController.php
@@ -232,9 +232,9 @@ class EventController extends Zend_Controller_Action
$evend = date ('m/d/Y H:i', strtotime(substr($this->getRequest()->getParam('evend'), 0, 24)));
}
if (!isset($add)){
- $addForm = new Application_Form_EventAdd(array('eventcategorylist' => $eventcategorylist, 'bootoslist' => $bootoslist, 'poollist' => $poollist, 'start' => $evstart, 'end' => $evend));
+ $addForm = new Application_Form_EventAdd(array('eventcategorylist' => $eventcategorylist, 'bootoslist' => $bootoslist, 'poollist' => $poollist, 'start' => $evstart, 'end' => $evend, 'defaultEventCategory' => $this->config['event']['category']['default']));
} else {
- $addForm = new Application_Form_EventAdd(array('eventcategorylist' => $eventcategorylist, 'bootoslist' => $bootoslist, 'poollist' => $poollist, $this->getRequest()->getParams()));
+ $addForm = new Application_Form_EventAdd(array('eventcategorylist' => $eventcategorylist, 'bootoslist' => $bootoslist, 'poollist' => $poollist, 'defaultEventCategory' => $this->config['event']['category']['default'], $this->getRequest()->getParams()));
if ($addForm->isValid($this->getRequest()->getParams())) {
$this->getRequest()->setParam('start', date ('Y-m-d H:i', strtotime($this->getRequest()->getParam('start'))));
if($this->getRequest()->getParam('end')) {
diff --git a/application/forms/EventAdd.php b/application/forms/EventAdd.php
index be2c77c..b62eed5 100644
--- a/application/forms/EventAdd.php
+++ b/application/forms/EventAdd.php
@@ -8,6 +8,7 @@ class Application_Form_EventAdd extends Zend_Form
private $eventcategorylist;
private $start;
private $end;
+ private $defaultEventCategory;
public function setMembershiplist($membershiplist){
$this->membershiplist = $membershiplist;
@@ -32,30 +33,50 @@ class Application_Form_EventAdd extends Zend_Form
}
+ public function getPoollist(){
+ return $this->poollist;
+ }
+
+ public function getEventcategorylist()
+ {
+ return $this->eventcategorylist;
+ }
+
+ public function setEventcategorylist($eventcategorylist)
+ {
+ $this->eventcategorylist = $eventcategorylist;
+ }
+
+ public function getStart()
+ {
+ return $this->start;
+ }
+
public function setStart($start)
{
$this->start = $start;
return $this;
}
+ public function getEnd()
+ {
+ return $this->end;
+ }
+
public function setEnd($end)
{
$this->end = $end;
return $this;
}
- public function getPoollist(){
- return $this->poollist;
- }
-
- public function getEventcategorylist()
+ public function getDefaultEventCategory()
{
- return $this->eventcategorylist;
+ return $this->defaultEventCategory;
}
- public function setEventcategorylist($eventcategorylist)
+ public function setDefaultEventCategory($defaultEventCategory)
{
- $this->eventcategorylist = $eventcategorylist;
+ $this->defaultEventCategory = $defaultEventCategory;
}
public function init()
@@ -68,12 +89,18 @@ class Application_Form_EventAdd extends Zend_Form
if(count($this->eventcategorylist)>0){
foreach($this->eventcategorylist as $category => $c){
- $eventcategoryfield->addMultiOption($c->getID(), $c->getTitle());
+ $title = $c->getTitle();
+ $id = $c->getID();
+ $eventcategoryfield->addMultiOption($id, $title);
+ if($title == $this->defaultEventCategory) {
+ $defaultEventCategoryID = $id;
+ }
}
}
$eventcategoryfield->setRegisterInArrayValidator(false);
$eventcategoryfield->setAttrib('onchange', "eventcategoryfieldChanged('category');");
+ $eventcategoryfield->setValue($defaultEventCategoryID);
$this->addElement($eventcategoryfield);
$this->addElement('text', 'title', array(