summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Wagner2011-10-24 20:10:32 +0200
committerSebastian Wagner2011-10-24 20:10:32 +0200
commit0fdc99085a2e8203faddf971768fe81e7e26c24e (patch)
tree21c323e8609e937665d0bfc5fdc9cc9a08a05fd7
parentevent drop fix (diff)
downloadpoolctrl-0fdc99085a2e8203faddf971768fe81e7e26c24e.tar.gz
poolctrl-0fdc99085a2e8203faddf971768fe81e7e26c24e.tar.xz
poolctrl-0fdc99085a2e8203faddf971768fe81e7e26c24e.zip
minor
-rwxr-xr-xapplication/controllers/EventController.php54
1 files 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) {