summaryrefslogtreecommitdiffstats
path: root/application/views
diff options
context:
space:
mode:
authorSebastian Wagner2011-10-17 19:42:23 +0200
committerSebastian Wagner2011-10-17 19:42:23 +0200
commit36307007193a1d7c7207604a1c0220098e1e8d63 (patch)
tree2089aaf298b5e14c448e23fa59b25cc963ba23b3 /application/views
parentKorrektur (diff)
downloadpoolctrl-36307007193a1d7c7207604a1c0220098e1e8d63.tar.gz
poolctrl-36307007193a1d7c7207604a1c0220098e1e8d63.tar.xz
poolctrl-36307007193a1d7c7207604a1c0220098e1e8d63.zip
collision-detection implemented
Diffstat (limited to 'application/views')
-rw-r--r--application/views/scripts/event/checkoverlapevents.phtml4
-rwxr-xr-xapplication/views/scripts/event/index.phtml25
2 files changed, 20 insertions, 9 deletions
diff --git a/application/views/scripts/event/checkoverlapevents.phtml b/application/views/scripts/event/checkoverlapevents.phtml
index 26b6274..66916aa 100644
--- a/application/views/scripts/event/checkoverlapevents.phtml
+++ b/application/views/scripts/event/checkoverlapevents.phtml
@@ -3,10 +3,10 @@
//print_r($this->overlaps);
if(count($this->overlaps) == 0) {
- echo '<p>no overlapping events</p>';
+ echo -1;
}
else {
- echo '<ul>';
+ echo '<ul id="conflictEvents">';
foreach($this->overlaps as $o){
echo '<li>' . 'EventID: ' . $o['eventID'] . ', Title: ' . $o['title'] . ', Start: ' . $o['start'] . ', End: ' . $o['end'] . '</li>';
}
diff --git a/application/views/scripts/event/index.phtml b/application/views/scripts/event/index.phtml
index 3882ec9..b551e14 100755
--- a/application/views/scripts/event/index.phtml
+++ b/application/views/scripts/event/index.phtml
@@ -24,7 +24,7 @@ var clickTmp = true;
var evClick = false;
// overlapping
-var isDroppable = true;
+var isDroppable;
var overlappStart;
var overlappEnd;
@@ -209,6 +209,8 @@ var dayClick = false;
defaultEventMinutes: 10,
dayClick: function( date, allDay, jsEvent, view ) {
+ console.log(date);
+ alert(date);
/*
selectedDate = date;
dayClick = true;
@@ -409,6 +411,17 @@ var dayClick = false;
eventDrop: function( event, dayDelta, minuteDelta, allDay, revertFunc ) {
+ $.get("/event/checkoverlapevents/eventID/" + event.id + "/date/" + event.start, function(checkoverlapeventsresult){
+ var cell = document.getElementById("conflicts");
+ cell.removeChild(cell.firstChild);
+ $("#conflicts").append(checkoverlapeventsresult);
+ if(checkoverlapeventsresult == -1) {
+ isDroppable = true;
+ overlapevents = null;
+ } else {
+ isDroppable = false;
+ }
+
if(event.repeat == 0 && isDroppable && event.immediate == 0 && $.get("/event/checkright/rightShortcut/er")) {
$(function() {
$( "#defaultDialog" ).dialog({
@@ -491,18 +504,17 @@ var dayClick = false;
$(function() {
$( "#eventNotDroppableDialog" ).dialog({
autoOpen: false,
- width: 600,
+ width: 810,
modal: true,
- title: 'Dropping of' + event.title + 'is not possible!',
+ title: 'Dropping of ' + event.title + ' is not possible!',
buttons: {
"OK": function() {
$(this).dialog("close");
- $(this).qtip("destroy");
revertFunc();
}
},
open: function () {
- $("#accordion").accordion({collapsible: true, active: 1, autoHeight: true });
+ $("#accordion").accordion({clearStyle: true, collapsible: true, active: 1, autoHeight: true });
$(".ui-dialog-titlebar-close").hide();
$(this).parents(".ui-dialog:first").find(".ui-dialog-titlebar").addClass("ui-state-error");
}
@@ -512,7 +524,7 @@ var dayClick = false;
} else {
revertFunc();
$(this).qtip("destroy");
- }
+ }});
$(this).qtip("destroy");
},
@@ -524,7 +536,6 @@ var dayClick = false;
eventDragStop: function(event, jsEvent, ui, view, date) {
/*
- //alert(date);
overlapevents = $.get("/event/checkoverlapevents/eventID/" + event.id + "/date/" + date, function(checkoverlapeventsresult){
$("#conflicts").append(checkoverlapeventsresult);});
if(overlapevents != '<p>no overlapping events</p>') {