From 0fdc99085a2e8203faddf971768fe81e7e26c24e Mon Sep 17 00:00:00 2001 From: Sebastian Wagner Date: Mon, 24 Oct 2011 20:10:32 +0200 Subject: minor --- application/controllers/EventController.php | 54 +++++++++++++++-------------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/application/controllers/EventController.php b/application/controllers/EventController.php index 9490f0e..7af5873 100755 --- a/application/controllers/EventController.php +++ b/application/controllers/EventController.php @@ -691,27 +691,29 @@ class EventController extends Zend_Controller_Action $enewstart = strtotime($e['start']) + $diff; $enewend = strtotime($e['end']) + $diff; $cfv = true; - - // overlap events - foreach($allEvents as $o) { - if($e['running'] == 0) { - if($enewstart <= strtotime($o['start']) && $enewend >= strtotime($o['start']) && $o['eventID'] != $e['eventID'] - || $enewstart >= strtotime($o['start']) && $enewstart <= strtotime($o['end']) && $o['eventID'] != $e['eventID']) { - $overlapswithrepeat[] = $o; - $cfv = false; - } - } else { - if($e['start'] <= strtotime($o['start']) && $e['end'] >= strtotime($o['start']) && $o['eventID'] != $e['eventID'] - || $e['start'] >= strtotime($o['start']) && $e['start'] <= strtotime($o['end']) && $o['eventID'] != $e['eventID']) { - $overlapswithrepeat[] = $o; - $cfv = false; + + //if(intval($enewstart) < time()) { + // overlap events + foreach($others as $o) { + if($e['running'] == 0) { + if($enewstart <= strtotime($o['start']) && $enewend >= strtotime($o['start']) && $o['eventID'] != $e['eventID'] + || $enewstart >= strtotime($o['start']) && $enewstart <= strtotime($o['end']) && $o['eventID'] != $e['eventID']) { + $overlapswithrepeat[] = $o; + $cfv = false; + } + } else { + if($e['start'] <= strtotime($o['start']) && $e['end'] >= strtotime($o['start']) && $o['eventID'] != $e['eventID'] + || $e['start'] >= strtotime($o['start']) && $e['start'] <= strtotime($o['end']) && $o['eventID'] != $e['eventID']) { + $overlapswithrepeat[] = $o; + $cfv = false; + } } } - } - // conflict free events with repeat - if($cfv) { - $cfeventswithrepeat[] = $e; - } + // conflict free events with repeat + if($cfv) { + $cfeventswithrepeat[] = $e; + } + //} $this->_redirect('/event/'); } // Check for overlap without repeat @@ -1038,7 +1040,7 @@ class EventController extends Zend_Controller_Action json_encode($cfevents); print_r($cfevents); - + $events = null; if($cfevents!=null) { @@ -1049,14 +1051,14 @@ class EventController extends Zend_Controller_Action } var_dump($events); - + if ($events!=null) { /*if ($events[0]->getPbs_membershipID() != $this->userIDsNamespace['membershipID']) { if (!$this->acl->checkRight('edo')) { - $this->_redirect('/'); + $this->_redirect('/'); } - }*/ + }*/ try { foreach($events as $event) { //1min = 60sec, 1d = 86400sec @@ -1109,7 +1111,7 @@ class EventController extends Zend_Controller_Action } $this->_redirect('/event/'); } else { - //$this->_redirect('/event/'); + $this->_redirect('/event/'); return; } } @@ -1264,9 +1266,9 @@ class EventController extends Zend_Controller_Action /*if ($events[0]->getPbs_membershipID() != $this->userIDsNamespace['membershipID']) { if (!$this->acl->checkRight('edo')) { - $this->_redirect('/'); + $this->_redirect('/'); } - }*/ + }*/ try { foreach($events as $event) { if($event->getRunning() == 0) { -- cgit v1.2.3-55-g7522