summaryrefslogtreecommitdiffstats
path: root/application/controllers
diff options
context:
space:
mode:
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;
}