summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
authorBjörn Geiger2011-09-08 14:54:50 +0200
committerBjörn Geiger2011-09-08 14:54:50 +0200
commit53befebf24d06b8c976780cc82e0513a8a4b5011 (patch)
tree10d6c9b9ed11b7e66ace109ed0ba35a05d22778f /application
parentMerge branch 'master' of git.openslx.org:lsfks/projekte/poolctrl (diff)
downloadpoolctrl-53befebf24d06b8c976780cc82e0513a8a4b5011.tar.gz
poolctrl-53befebf24d06b8c976780cc82e0513a8a4b5011.tar.xz
poolctrl-53befebf24d06b8c976780cc82e0513a8a4b5011.zip
verschiedene Änderungen + DB Update
Diffstat (limited to 'application')
-rw-r--r--application/controllers/EventController.php1
-rw-r--r--application/forms/EventEdit.php55
-rw-r--r--application/models/Event.php12
-rw-r--r--application/models/EventMapper.php4
4 files changed, 57 insertions, 15 deletions
diff --git a/application/controllers/EventController.php b/application/controllers/EventController.php
index 9ec5bd3..fdea2db 100644
--- a/application/controllers/EventController.php
+++ b/application/controllers/EventController.php
@@ -491,6 +491,7 @@ class EventController extends Zend_Controller_Action
$this->getRequest()->setParam('start', $event->getStart());
$this->getRequest()->setParam('end', $event->getEnd());
$this->getRequest()->setParam('repeat', $event->getRepeat());
+ $this->getRequest()->setParam('repeatEnd', $event->getRepeatEnd());
$this->getRequest()->setParam('participants', $event->getParticipants());
$this->getRequest()->setParam('category', $event->getCategory());
$this->getRequest()->setParam('note', $event->getNote());
diff --git a/application/forms/EventEdit.php b/application/forms/EventEdit.php
index 41e9c11..992f5ae 100644
--- a/application/forms/EventEdit.php
+++ b/application/forms/EventEdit.php
@@ -106,22 +106,36 @@ class Application_Form_EventEdit extends Zend_Form
array('Date', false, array('format' => 'mm/dd/yyyy H:i')),
),
'required' => true,
- 'label' => 'Start (mm/dd/yyyy H:min):',
+ 'label' => 'Start:',
'value' => date ('m/d/Y H:i', strtotime( $this->params['start'])),
));
- $this->addElement('text', 'end', array(
+ if(isset($this->params['end'])) {
+ $this->addElement('text', 'end', array(
'filters' => array('StringTrim'),
'validators' => array(
- array('StringLength', false, array(0, 16)),
- array('Date', false, array('format' => 'mm/dd/yyyy H:i')),
- array('DateGreaterThan', false, array('element' => 'End', 'compare' => 'Start', 'min' => $this->getElement('start')->getValue())),
- ),
+ array('StringLength', false, array(0, 16)),
+ array('Date', false, array('format' => 'mm/dd/yyyy H:i')),
+ array('DateGreaterThan', false, array('element' => 'End', 'compare' => 'Start', 'min' => $this->getElement('start')->getValue())),
+ ),
'required' => true,
- 'label' => 'End (mm/dd/yyyy H:min):',
+ 'label' => 'End:',
'value' => date ('m/d/Y H:i', strtotime( $this->params['end'])),
- ));
- $this->getElement('end')->addPrefixPath('Poolctrl_Validate', 'Poolctrl/Validator/', 'validate');
+ ));
+ $this->getElement('end')->addPrefixPath('Poolctrl_Validate', 'Poolctrl/Validator/', 'validate');
+ } else {
+ $this->addElement('text', 'end', array(
+ 'filters' => array('StringTrim'),
+ 'validators' => array(
+ array('StringLength', false, array(0, 16)),
+ array('Date', false, array('format' => 'mm/dd/yyyy H:i')),
+ array('DateGreaterThan', false, array('element' => 'End', 'compare' => 'Start', 'min' => $this->getElement('start')->getValue())),
+ ),
+ 'required' => true,
+ 'label' => 'End:',
+ ));
+ $this->getElement('end')->addPrefixPath('Poolctrl_Validate', 'Poolctrl/Validator/', 'validate');
+ }
if( $this->params['repeat'] == 1) {
$this->addElement('checkbox', 'repeat', array(
@@ -140,14 +154,27 @@ class Application_Form_EventEdit extends Zend_Form
));
}
- $this->addElement('text', 'repeatEnd', array(
+ if(isset($this->params['repeatEnd'])) {
+ $this->addElement('text', 'repeatEnd', array(
'filters' => array('StringTrim'),
'validators' => array(
- array('StringLength', false, array(0, 16)),
- ),
+ array('StringLength', false, array(0, 16)),
+ ),
'required' => false,
- 'label' => 'Repeat end (mm/dd/yyyy H:min):',
- ));
+ 'label' => 'Repeat end:',
+ 'value' => $this->params['repeatEnd']
+ ));
+ } else {
+ $this->addElement('text', 'repeatEnd', array(
+ 'filters' => array('StringTrim'),
+ 'validators' => array(
+ array('StringLength', false, array(0, 16)),
+ ),
+ 'required' => false,
+ 'label' => 'Repeat end:',
+ 'value' => 'mm/dd/yyyy H:min'
+ ));
+ }
$this->addElement('text', 'participants', array(
'filters' => array('StringTrim'),
diff --git a/application/models/Event.php b/application/models/Event.php
index 9033824..7f20d10 100644
--- a/application/models/Event.php
+++ b/application/models/Event.php
@@ -25,6 +25,7 @@ class Application_Model_Event
protected $_pbs_bootmenuID;
protected $_pbs_filterID;
protected $_repeat;
+ protected $_repeatEnd;
protected $_immediate;
protected $_running;
protected $_runningtype;
@@ -223,6 +224,17 @@ class Application_Model_Event
return $this;
}
+ public function getRepeatEnd()
+ {
+ return $this->_repeatEnd;
+ }
+
+ public function setRepeatEnd($_repeatEnd)
+ {
+ $this->_repeatEnd = $_repeatEnd;
+ return $this;
+ }
+
public function getImmediate()
{
return $this->_immediate;
diff --git a/application/models/EventMapper.php b/application/models/EventMapper.php
index 98e6c14..921fb41 100644
--- a/application/models/EventMapper.php
+++ b/application/models/EventMapper.php
@@ -85,7 +85,7 @@ class Application_Model_EventMapper
public function save(Application_Model_Event $event)
{
- $data = array('eventID'=> $event->getID() ,'category'=> $event->getCategory() ,'title'=> $event->getTitle(), 'pbs_membershipID'=> $event->getPbs_membershipID(),'end'=> $event->getEnd() ,'immediate'=> $event->getImmediate() ,'note'=> $event->getNote() ,'participants'=> $event->getParticipants() ,'pbs_bootosID'=> $event->getPbs_bootosID(),'pbs_poolID'=> $event->getPbs_poolID(),'repeat'=> $event->getRepeat(),'start'=> $event->getStart(),'pbs_bootmenuID'=> $event->getPbs_bootmenuID(),'pbs_filterID'=> $event->getPbs_filterID(), 'running' => $event->getRunning(), 'runningtype' => $event->getRunningtype() );
+ $data = array('eventID'=> $event->getID() ,'category'=> $event->getCategory() ,'title'=> $event->getTitle(), 'pbs_membershipID'=> $event->getPbs_membershipID(),'end'=> $event->getEnd() ,'immediate'=> $event->getImmediate() ,'note'=> $event->getNote() ,'participants'=> $event->getParticipants() ,'pbs_bootosID'=> $event->getPbs_bootosID(),'pbs_poolID'=> $event->getPbs_poolID(),'repeat'=> $event->getRepeat(),'repeatEnd'=> $event->getRepeatEnd(),'start'=> $event->getStart(),'pbs_bootmenuID'=> $event->getPbs_bootmenuID(),'pbs_filterID'=> $event->getPbs_filterID(), 'running' => $event->getRunning(), 'runningtype' => $event->getRunningtype() );
if (null === ($id = $event->getID()) ) {
unset($data['eventID']);
return $this->getDbTable()->insert($data);
@@ -130,6 +130,7 @@ class Application_Model_EventMapper
->setPbs_filterID($row->pbs_filterID)
->setPbs_bootmenuID($row->pbs_bootmenuID)
->setRepeat($row->repeat)
+ ->setRepeatEnd($row->repeatEnd)
->setStart($row->start)
->setRunning($row->running)
->setRunningtype($row->runningtype);
@@ -157,6 +158,7 @@ class Application_Model_EventMapper
->setPbs_filterID($row->pbs_filterID)
->setPbs_bootmenuID($row->pbs_bootmenuID)
->setRepeat($row->repeat)
+ ->setRepeatEnd($row->repeatEnd)
->setStart($row->start)
->setRunning($row->running)
->setRunningtype($row->runningtype);