summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Wagner2011-10-22 15:55:28 +0200
committerSebastian Wagner2011-10-22 15:55:28 +0200
commitc292d06fa6542aad1b1567c7468ff838a5eb5d55 (patch)
treef74b6302c62b9bb5449f91bce714e31a723dda05
parentbugfix (diff)
downloadpoolctrl-c292d06fa6542aad1b1567c7468ff838a5eb5d55.tar.gz
poolctrl-c292d06fa6542aad1b1567c7468ff838a5eb5d55.tar.xz
poolctrl-c292d06fa6542aad1b1567c7468ff838a5eb5d55.zip
bugfix
-rwxr-xr-xapplication/controllers/EventController.php13
-rwxr-xr-xapplication/views/scripts/event/index.phtml2
2 files changed, 8 insertions, 7 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;
}
diff --git a/application/views/scripts/event/index.phtml b/application/views/scripts/event/index.phtml
index 80f1b02..68d8f9a 100755
--- a/application/views/scripts/event/index.phtml
+++ b/application/views/scripts/event/index.phtml
@@ -378,7 +378,7 @@ var dayClick = false;
eventResize: function( event, dayDelta, minuteDelta, revertFunc ) {
- $.get("/event/checkoverlapresize/eventID/" + event.id + "/minuteDelta/" + minuteDelta + "/dayDelta/" + dayDelta, function(data){
+ $.get("/event/checkoverlapresize/eventID/" + event.id + "/minuteDelta/" + minuteDelta + "/dayDelta/" + dayDelta + "/poolID/" + $("#poolselectbox option:selected").val(), function(data){
// get conflicts-HTML Element
var cell = document.getElementById("conflicts");