summaryrefslogtreecommitdiffstats
path: root/application/controllers/EventController.php
diff options
context:
space:
mode:
Diffstat (limited to 'application/controllers/EventController.php')
-rwxr-xr-xapplication/controllers/EventController.php92
1 files changed, 87 insertions, 5 deletions
diff --git a/application/controllers/EventController.php b/application/controllers/EventController.php
index ab24d63..6e67617 100755
--- a/application/controllers/EventController.php
+++ b/application/controllers/EventController.php
@@ -638,6 +638,50 @@ class EventController extends Zend_Controller_Action
$this->eventMapper->save($event); //save the event with the new data
}
}
+
+ public function eventmoveallAction() {
+ if(!$this->acl->checkRight('eo')) {
+ $this->_redirect('/');
+ }
+ $this->_helper->layout->disableLayout();
+ $this->_helper->viewRenderer->setNoRender();
+
+ $event = new Application_Model_Event();
+
+ $eventTitle = $this->getRequest()->getParam('eventTitle');
+ $evmindelta = $this->getRequest()->getParam('evmindelta');
+ $evdaydelta = $this->getRequest()->getParam('evdaydelta');
+ $poolID = $this->getRequest()->getParam('poolID');
+
+ if ($eventTitle!=null) {
+
+ $events = $this->eventMapper->findBy(array("title" => $eventTitle));
+ if ($events[0]->getPbs_membershipID() != $this->userIDsNamespace['membershipID']) {
+ if (!$this->acl->checkRight('edo')) {
+ $this->_redirect('/');
+ }
+ }
+ try {
+ foreach($events as $event) {
+ //1min = 60sec, 1d = 86400sec
+ $eventStart = date('Y-m-d H:i:s', intval(strtotime($event->getStart())) + intval($evmindelta*60) + intval($evdaydelta*86400));
+ $eventEnd = date('Y-m-d H:i:s', intval(strtotime($event->getEnd())) + intval($evmindelta*60) + intval($evdaydelta*86400));
+ $event->setStart($eventStart);
+ $event->setEnd($eventEnd);
+ $event->setPbs_poolID($poolID);
+ $this->eventMapper->save($event); //save the event with the new data
+ }
+ } catch (Zend_Exception $e) {
+ echo "Caught exception: " . get_class($e) . "<br/>";
+ echo "Message: " . $e->getMessage() . "<br/>";
+ return;
+ }
+ $this->_redirect('/event/');
+ } else {
+ $this->_redirect('/event/');
+ return;
+ }
+ }
public function eventresizeAction() {
if(!$this->acl->checkRight('eo')) {
@@ -651,20 +695,58 @@ class EventController extends Zend_Controller_Action
$evid = $this->getRequest()->getParam('evid');
$evend = $this->getRequest()->getParam('evend');
$poolID = $this->getRequest()->getParam('poolID');
- if($poolID != null); {
-
- }
- var_dump(date('Y-m-d H:i:s', strtotime(substr($evend, 0, 24))));
+ //var_dump(date('Y-m-d H:i:s', strtotime(substr($evend, 0, 24))));
if ($evid!=null) {
$this->eventMapper->find($evid,$event); //locate the event in the DB
$event->setEnd(date('Y-m-d H:i:s', strtotime(substr($evend, 0, 24))));
- $event->setPoolID($poolID);
+ $event->setPbs_poolID($poolID);
$this->eventMapper->save($event); //save the event with the new data
}
}
+
+ public function eventresizeallAction() {
+ if(!$this->acl->checkRight('eo')) {
+ $this->_redirect('/');
+ }
+ $this->_helper->layout->disableLayout();
+ $this->_helper->viewRenderer->setNoRender();
+
+ $event = new Application_Model_Event();
+
+ $eventTitle = $this->getRequest()->getParam('eventTitle');
+ $evmindelta = $this->getRequest()->getParam('evmindelta');
+ $poolID = $this->getRequest()->getParam('poolID');
+
+ if ($eventTitle!=null) {
+
+ $events = $this->eventMapper->findBy(array("title" => $eventTitle));
+ if ($events[0]->getPbs_membershipID() != $this->userIDsNamespace['membershipID']) {
+ if (!$this->acl->checkRight('edo')) {
+ $this->_redirect('/');
+ }
+ }
+ try {
+ foreach($events as $event) {
+ $eventEnd = date('Y-m-d H:i:s', intval(strtotime($event->getEnd())) + intval($evmindelta*60));
+ $event->setEnd($eventEnd);
+ $event->setPbs_poolID($poolID);
+ $this->eventMapper->save($event); //save the event with the new data
+ }
+ } catch (Zend_Exception $e) {
+ echo "Caught exception: " . get_class($e) . "<br/>";
+ echo "Message: " . $e->getMessage() . "<br/>";
+ return;
+ }
+ $this->_redirect('/event/');
+ } else {
+ $this->_redirect('/event/');
+ return;
+ }
+ }
+
public function eventlistAction() {
if(!$this->acl->checkRight('eo')) {