summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Wagner2011-10-25 09:50:24 +0200
committerSebastian Wagner2011-10-25 09:50:24 +0200
commit6ad18ed5f2e9ef9e3422f29ed116023015fc80ea (patch)
tree0b0fbe739fa5bdbc9bb3431e8641800b0103b01e
parentcurrent timeline implemented (diff)
downloadpoolctrl-6ad18ed5f2e9ef9e3422f29ed116023015fc80ea.tar.gz
poolctrl-6ad18ed5f2e9ef9e3422f29ed116023015fc80ea.tar.xz
poolctrl-6ad18ed5f2e9ef9e3422f29ed116023015fc80ea.zip
event move to the past - check
-rwxr-xr-xapplication/controllers/EventController.php64
1 files changed, 36 insertions, 28 deletions
diff --git a/application/controllers/EventController.php b/application/controllers/EventController.php
index 7af5873..f6fe538 100755
--- a/application/controllers/EventController.php
+++ b/application/controllers/EventController.php
@@ -691,28 +691,28 @@ class EventController extends Zend_Controller_Action
$enewstart = strtotime($e['start']) + $diff;
$enewend = strtotime($e['end']) + $diff;
$cfv = true;
-
+
//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;
- }
+ // 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/');
}
@@ -967,6 +967,14 @@ class EventController extends Zend_Controller_Action
$this->_redirect('/');
}
}
+
+ // event move to the past - check
+ foreach($events as $event) {
+ $evstartTime = intval(strtotime($event->getStart())) + intval($evmindelta*60) + intval($evdaydelta*86400);
+ if($evstartTime < time())
+ $this->_redirect('/event/');
+ }
+
try {
foreach($events as $event) {
if($event->getRunning() == 0) {
@@ -1040,7 +1048,7 @@ class EventController extends Zend_Controller_Action
json_encode($cfevents);
print_r($cfevents);
-
+
$events = null;
if($cfevents!=null) {
@@ -1055,10 +1063,10 @@ class EventController extends Zend_Controller_Action
if ($events!=null) {
/*if ($events[0]->getPbs_membershipID() != $this->userIDsNamespace['membershipID']) {
- if (!$this->acl->checkRight('edo')) {
- $this->_redirect('/');
- }
- }*/
+ if (!$this->acl->checkRight('edo')) {
+ $this->_redirect('/');
+ }
+ }*/
try {
foreach($events as $event) {
//1min = 60sec, 1d = 86400sec
@@ -1265,10 +1273,10 @@ class EventController extends Zend_Controller_Action
if ($events!=null) {
/*if ($events[0]->getPbs_membershipID() != $this->userIDsNamespace['membershipID']) {
- if (!$this->acl->checkRight('edo')) {
- $this->_redirect('/');
- }
- }*/
+ if (!$this->acl->checkRight('edo')) {
+ $this->_redirect('/');
+ }
+ }*/
try {
foreach($events as $event) {
if($event->getRunning() == 0) {