summaryrefslogtreecommitdiffstats
path: root/application/controllers
diff options
context:
space:
mode:
authorSebastian Wagner2011-10-22 15:55:28 +0200
committerSebastian Wagner2011-10-22 15:55:28 +0200
commitc292d06fa6542aad1b1567c7468ff838a5eb5d55 (patch)
treef74b6302c62b9bb5449f91bce714e31a723dda05 /application/controllers
parentbugfix (diff)
downloadpoolctrl-c292d06fa6542aad1b1567c7468ff838a5eb5d55.tar.gz
poolctrl-c292d06fa6542aad1b1567c7468ff838a5eb5d55.tar.xz
poolctrl-c292d06fa6542aad1b1567c7468ff838a5eb5d55.zip
bugfix
Diffstat (limited to 'application/controllers')
-rwxr-xr-xapplication/controllers/EventController.php13
1 files changed, 7 insertions, 6 deletions
diff --git a/application/controllers/EventController.php b/application/controllers/EventController.php
index 21b6fd4..f19f850 100755
--- a/application/controllers/EventController.php
+++ b/application/controllers/EventController.php
@@ -778,6 +778,7 @@ class EventController extends Zend_Controller_Action
$events['withoutrepeat'] = $this->eventMapper->getDraggingEvent($eventID);
$others = $this->eventMapper->getNotDraggingEvents($eventID);
+ $allEvents = $this->eventMapper->fetchAllasArray($poolID);
// Check for overlap with repeat
$overlapswithrepeat = array();
@@ -790,9 +791,9 @@ class EventController extends Zend_Controller_Action
$cfv = true;
// overlap events
- foreach($others as $o) {
- if($enewstart <= strtotime($o['start']) && $enewend >= strtotime($o['start'])
- || $enewstart >= strtotime($o['start']) && $enewstart <= strtotime($o['end'])) {
+ foreach($allEvents as $o) {
+ if($enewstart <= strtotime($o['start']) && $enewend >= strtotime($o['start']) && $o['eventID'] != $e['eventID'] && $o['eventID'] != $eventID
+ || $enewstart >= strtotime($o['start']) && $enewstart <= strtotime($o['end']) && $o['eventID'] != $e['eventID'] && $o['eventID'] != $eventID) {
$overlapswithrepeat[] = $o;
$cfv = false;
}
@@ -814,9 +815,9 @@ class EventController extends Zend_Controller_Action
$cfv = true;
// overlap events
- foreach($others as $o) {
- if($enewstart <= strtotime($o['start']) && $enewend >= strtotime($o['start'])
- || $enewstart >= strtotime($o['start']) && $enewstart <= strtotime($o['end'])) {
+ foreach($allEvents as $o) {
+ if($enewstart <= strtotime($o['start']) && $enewend >= strtotime($o['start']) && $o['eventID'] != $eventID
+ || $enewstart >= strtotime($o['start']) && $enewstart <= strtotime($o['end']) && $o['eventID'] != $eventID) {
$overlapswithoutrepeat[] = $o;
$cfv = false;
}