summaryrefslogtreecommitdiffstats
path: root/application/views
diff options
context:
space:
mode:
authorSebastian Wagner2011-10-21 19:13:38 +0200
committerSebastian Wagner2011-10-21 19:13:38 +0200
commit4561f98c7a00d74462ac771eae1796b6cca13566 (patch)
tree8f44694d11f066a7f90dc810d09fe73b1b704fb1 /application/views
parentverschiedenesĀ§ (diff)
downloadpoolctrl-4561f98c7a00d74462ac771eae1796b6cca13566.tar.gz
poolctrl-4561f98c7a00d74462ac771eae1796b6cca13566.tar.xz
poolctrl-4561f98c7a00d74462ac771eae1796b6cca13566.zip
overlapping for resizing and selecting implemented
Diffstat (limited to 'application/views')
-rw-r--r--application/views/scripts/event/checkoverlapdrop.phtml (renamed from application/views/scripts/event/checkoverlapevents.phtml)0
-rw-r--r--application/views/scripts/event/checkoverlapresize.phtml34
-rw-r--r--application/views/scripts/event/checkoverlapselect.phtml19
-rwxr-xr-xapplication/views/scripts/event/index.phtml138
4 files changed, 159 insertions, 32 deletions
diff --git a/application/views/scripts/event/checkoverlapevents.phtml b/application/views/scripts/event/checkoverlapdrop.phtml
index 6558e19..6558e19 100644
--- a/application/views/scripts/event/checkoverlapevents.phtml
+++ b/application/views/scripts/event/checkoverlapdrop.phtml
diff --git a/application/views/scripts/event/checkoverlapresize.phtml b/application/views/scripts/event/checkoverlapresize.phtml
new file mode 100644
index 0000000..05a7f42
--- /dev/null
+++ b/application/views/scripts/event/checkoverlapresize.phtml
@@ -0,0 +1,34 @@
+<?php
+// Output
+//print_r($this->overlaps);
+//$overlaps[] = array();
+
+
+
+if(count($this->overlapswithrepeat) == 0) {
+ $output['withrepeat'] = -1;
+}
+else {
+ $output['withrepeat'] = '<ul id="conflictEvents">';
+ foreach($this->overlapswithrepeat as $o){
+ $output['withrepeat'] .= '<li>' . 'EventID: ' . $o['eventID'] . ', Title: ' . $o['title'] . ', Start: ' . $o['start'] . ', End: ' . $o['end'] . '</li>';
+ }
+ $output['withrepeat'] .= '</ul>';
+ // Echo contents of output, e.g. required values, such as title, date, etc.
+ //echo json_encode($this->overlaps);
+}
+
+if(count($this->overlapswithoutrepeat) == 0) {
+ $output['withoutrepeat'] = -1;
+}
+else {
+ $output['withoutrepeat'] = '<ul id="conflictEvents">';
+ foreach($this->overlapswithoutrepeat as $o){
+ $output['withoutrepeat'] .= '<li>' . 'EventID: ' . $o['eventID'] . ', Title: ' . $o['title'] . ', Start: ' . $o['start'] . ', End: ' . $o['end'] . '</li>';
+ }
+ $output['withoutrepeat'] .= '</ul>';
+ // Echo contents of output, e.g. required values, such as title, date, etc.
+ //echo json_encode($this->overlaps);
+}
+echo json_encode($output);
+?> \ No newline at end of file
diff --git a/application/views/scripts/event/checkoverlapselect.phtml b/application/views/scripts/event/checkoverlapselect.phtml
new file mode 100644
index 0000000..e6fc8c1
--- /dev/null
+++ b/application/views/scripts/event/checkoverlapselect.phtml
@@ -0,0 +1,19 @@
+<?php
+// Output
+//print_r($this->overlaps);
+//$overlaps[] = array();
+
+if(count($this->overlaps) == 0) {
+ $output = -1;
+}
+else {
+ $output = '<ul id="conflictEvents">';
+ foreach($this->overlaps as $o){
+ $output .= '<li>' . 'EventID: ' . $o['eventID'] . ', Title: ' . $o['title'] . ', Start: ' . $o['start'] . ', End: ' . $o['end'] . '</li>';
+ }
+ $output .= '</ul>';
+ // Echo contents of output, e.g. required values, such as title, date, etc.
+ //echo json_encode($this->overlaps);
+}
+echo json_encode($output);
+?> \ No newline at end of file
diff --git a/application/views/scripts/event/index.phtml b/application/views/scripts/event/index.phtml
index f2c8a4b..5b9e352 100755
--- a/application/views/scripts/event/index.phtml
+++ b/application/views/scripts/event/index.phtml
@@ -207,9 +207,10 @@ var dayClick = false;
allDay : false,
slotMinutes: 15,
defaultEventMinutes: 10,
-
+
+ /*
dayClick: function( date, allDay, jsEvent, view ) {
- /*
+
selectedDate = date;
dayClick = true;
$('#calendar').fullCalendar( 'unselect' );
@@ -247,9 +248,9 @@ var dayClick = false;
$( "#errorRightsDialog" ).dialog('open');
}
else $('#calendar').fullCalendar( 'unselect' );
- */
+
//self.location="/event/add/evstart/" + date + "/poolID/" + $("#poolselectbox option:selected").val();
- },
+ },*/
eventMouseover: function( event, jsEvent, view ) {
evClick = true;
@@ -304,6 +305,34 @@ var dayClick = false;
},
select: function( startDate, endDate, allDay, jsEvent, view ) {
+
+ //initialize eventNotDroppableDialog Dialog
+ $(function() {
+ $( "#eventNotDroppableDialog" ).dialog({
+ autoOpen: false,
+ width: 820,
+ modal: true,
+ title: 'Adding of an Event at this position is not possible!',
+ buttons: {
+ "OK": function() {
+ $(this).dialog("close");
+ $('#calendar').fullCalendar( 'unselect' );
+ }
+ },
+ open: function () {
+ $("#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");
+ }
+ });
+ });
+
+ $.get("/event/checkoverlapselect/poolID/" + $("#poolselectbox option:selected").val() + "/startDate/" + startDate + "/endDate/" + endDate, function(data){
+
+ // get conflicts-HTML Element
+ var cell = document.getElementById("conflicts");
+ // get conflicts
+ var returndata = jQuery.parseJSON(data);
if($("#poolselectbox option:selected").val() == 'default') {
$( "#noPoolSelectedDialog" ).dialog('open');
@@ -319,9 +348,16 @@ var dayClick = false;
$(this).dialog("close");
$('#calendar').fullCalendar( 'unselect' );
},
- "OK": function() {
+ "OK": function() {
+ if(returndata == -1) {
$(this).dialog("close");
self.location="/event/add/evstart/" + startDate + "/evend/" + endDate + "/poolID/" + $("#poolselectbox option:selected").val();
+ } else {
+ $(this).dialog("close");
+ cell.removeChild(cell.firstChild);
+ $("#conflicts").append(returndata);
+ $( "#eventNotDroppableDialog" ).dialog('open');
+ }
}
},
open: function () {
@@ -337,11 +373,39 @@ var dayClick = false;
} else
evClick = true;
$('#calendar').fullCalendar( 'unselect' );
+ });
},
eventResize: function( event, dayDelta, minuteDelta, revertFunc ) {
-
- $(this).qtip("destroy");
+
+ //initialize eventNotDroppableDialog Dialog
+ $(function() {
+ $( "#eventNotDroppableDialog" ).dialog({
+ autoOpen: false,
+ width: 820,
+ modal: true,
+ title: 'Resizing of ' + event.title + ' is not possible!',
+ buttons: {
+ "OK": function() {
+ $(this).dialog("close");
+ revertFunc();
+ }
+ },
+ open: function () {
+ $("#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");
+ }
+ });
+ });
+
+ $.get("/event/checkoverlapresize/eventID/" + event.id + "/minuteDelta/" + minuteDelta + "/dayDelta/" + dayDelta, function(data){
+
+ // get conflicts-HTML Element
+ var cell = document.getElementById("conflicts");
+ // get conflicts
+ var returndata = jQuery.parseJSON(data);
+
if($.get("/event/checkright/rightShortcut/er")) {
if(event.repeat == 0) {
$(function() {
@@ -355,9 +419,16 @@ var dayClick = false;
$(this).dialog("close");
revertFunc();
},
- "OK": function() {
- $(this).dialog("close");
- $.post("/event/eventresize/evid/" + event.id + "/evend/" + event.end + "/poolID/" + $("#poolselectbox option:selected").val());
+ "OK": function() {
+ if(returndata.withoutrepeat == -1) {
+ $(this).dialog("close");
+ $.post("/event/eventresize/evid/" + event.id + "/evend/" + event.end + "/poolID/" + $("#poolselectbox option:selected").val());
+ } else {
+ $(this).dialog("close");
+ cell.removeChild(cell.firstChild);
+ $("#conflicts").append(returndata.withoutrepeat);
+ $( "#eventNotDroppableDialog" ).dialog('open');
+ }
}
},
open: function () {
@@ -367,7 +438,6 @@ var dayClick = false;
});
});
$( "#defaultDialog" ).dialog('open');
- $(this).qtip("destroy");
} else if (event.repeat == 1) {
$(function() {
$( "#eventResizeWdhDialog" ).dialog({
@@ -381,13 +451,27 @@ var dayClick = false;
revertFunc();
},
"Resize just this Event": function() {
+ if(returndata.withoutrepeat == -1) {
$(this).dialog("close");
$.post("/event/eventresize/evid/" + event.id + "/evend/" + event.end + "/poolID/" + $("#poolselectbox option:selected").val());
- event.repeat = 0;
+ event.repeat = 0;
+ } else {
+ $(this).dialog("close");
+ cell.removeChild(cell.firstChild);
+ $("#conflicts").append(returndata.withoutrepeat);
+ $( "#eventNotDroppableDialog" ).dialog('open');
+ }
},
- "Resize all Events": function() {
+ "Resize all Events": function() {
+ if(returndata.withrepeat == -1) {
$(this).dialog("close");
- self.location="/event/eventresizeall/eventTitle/" + event.title + "/evmindelta/" + minuteDelta + "/poolID/" + $("#poolselectbox option:selected").val();
+ self.location="/event/eventresizeall/eventTitle/" + event.title + "/evmindelta/" + minuteDelta + "/poolID/" + $("#poolselectbox option:selected").val();
+ } else {
+ $(this).dialog("close");
+ cell.removeChild(cell.firstChild);
+ $("#conflicts").append(returndata.withrepeat);
+ $( "#eventNotDroppableDialog" ).dialog('open');
+ }
}
},
open: function () {
@@ -403,6 +487,8 @@ var dayClick = false;
revertFunc();
$( "#errorRightsDialog" ).dialog('open');
}
+ });
+ $(this).qtip("destroy");
},
eventDrop: function( event, dayDelta, minuteDelta, allDay, revertFunc ) {
@@ -428,11 +514,12 @@ var dayClick = false;
});
});
- $.get("/event/checkoverlapevents/eventID/" + event.id + "/date/" + event.start, function(data){
- // delete old conflicts
+ $.get("/event/checkoverlapdrop/poolID/" + $("#poolselectbox option:selected").val() + "/eventID/" + event.id + "/date/" + event.start, function(data){
+
+ // get conflicts-HTML Element
var cell = document.getElementById("conflicts");
-
- var returndata = jQuery.parseJSON(data);
+ // get conflicts
+ var returndata = jQuery.parseJSON(data);
if(event.repeat == 0 && event.immediate == 0 && $.get("/event/checkright/rightShortcut/er")) {
$(function() {
@@ -490,7 +577,7 @@ var dayClick = false;
}
},
"Move all Events": function() {
- if(returndata.witrepeat == -1) {
+ if(returndata.withrepeat == -1) {
$(this).dialog("close");
self.location="/event/eventmoveall/eventTitle/" + event.title + "/evmindelta/" + minuteDelta + "/evdaydelta/" + dayDelta + "/poolID/" + $("#poolselectbox option:selected").val();
} else {
@@ -540,19 +627,6 @@ var dayClick = false;
$( "#errorRightsDialog" ).dialog('open');
}
},
-
- eventDragStop: function(event, jsEvent, ui, view, date) {
- /*
- overlapevents = $.get("/event/checkoverlapevents/eventID/" + event.id + "/date/" + date, function(checkoverlapeventsresult){
- $("#conflicts").append(checkoverlapeventsresult);});
- if(overlapevents != '<p>no overlapping events</p>') {
- isDroppable = false;
- } else {
- isDroppable = true;
- overlapevents = null;
- }
- */
- },
eventRender: function(event, element, view) {