From 2ca9ebc9793072c261a520f155e0d68b33066b7a Mon Sep 17 00:00:00 2001 From: Sebastian Wagner Date: Tue, 25 Oct 2011 17:07:40 +0200 Subject: was weiß ich --- .../views/scripts/event/checkoverlapdrop.phtml | 46 +++++++++++++++------- .../views/scripts/event/checkoverlapresize.phtml | 46 +++++++++++++--------- .../views/scripts/event/checkoverlapselect.phtml | 16 +++++--- application/views/scripts/event/index.phtml | 20 +++++----- 4 files changed, 79 insertions(+), 49 deletions(-) (limited to 'application/views/scripts') diff --git a/application/views/scripts/event/checkoverlapdrop.phtml b/application/views/scripts/event/checkoverlapdrop.phtml index 279e798..b53c482 100644 --- a/application/views/scripts/event/checkoverlapdrop.phtml +++ b/application/views/scripts/event/checkoverlapdrop.phtml @@ -3,40 +3,56 @@ $output['cfevents'] = $this->cfeventswithrepeat; // conflict free plot with repeat $output['cfplotwithrepeat'] = ''; // conflict free plot without repeat $output['cfplotwithoutrepeat'] = ''; - + // conflict plot with repeat if(count($this->overlapswithrepeat) == 0) { - $output['withrepeat'] = -1; + $output['withrepeat'] = -1; } else { $output['withrepeat'] = ''; } // conflict plot without repeat if(count($this->overlapswithoutrepeat) == 0) { - $output['withoutrepeat'] = -1; + $output['withoutrepeat'] = -1; } else { - $output['withoutrepeat'] = ''; + $output['withoutrepeat'] = ''; } echo json_encode($output); ?> \ No newline at end of file diff --git a/application/views/scripts/event/checkoverlapresize.phtml b/application/views/scripts/event/checkoverlapresize.phtml index 85a1a1c..89b8499 100644 --- a/application/views/scripts/event/checkoverlapresize.phtml +++ b/application/views/scripts/event/checkoverlapresize.phtml @@ -3,40 +3,48 @@ $output['cfevents'] = $this->cfeventswithrepeat; // conflict free plot with repeat $output['cfplotwithrepeat'] = ''; // conflict free plot without repeat $output['cfplotwithoutrepeat'] = ''; - + // conflict plot with repeat if(count($this->overlapswithrepeat) == 0) { - $output['withrepeat'] = -1; + $output['withrepeat'] = -1; } else { - $output['withrepeat'] = ''; + $output['withrepeat'] = ''; } // conflict plot without repeat if(count($this->overlapswithoutrepeat) == 0) { - $output['withoutrepeat'] = -1; + $output['withoutrepeat'] = -1; } else { - $output['withoutrepeat'] = ''; + $output['withoutrepeat'] = ''; } 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 index fa87193..8cc8991 100644 --- a/application/views/scripts/event/checkoverlapselect.phtml +++ b/application/views/scripts/event/checkoverlapselect.phtml @@ -1,13 +1,17 @@ overlaps) == 0) { - $output = -1; + $output = -1; } else { - $output = ''; + $output = ''; } 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 f312c98..c3603ed 100755 --- a/application/views/scripts/event/index.phtml +++ b/application/views/scripts/event/index.phtml @@ -309,7 +309,7 @@ var dayClick = false; select: function( startDate, endDate, allDay, jsEvent, view ) { - var currentDate = $('#calendar').fullCalendar('getDate'); + var currentDate = new Date(); //initialize eventNotDroppableDialog Dialog $(function() { @@ -355,7 +355,7 @@ var dayClick = false; }, "OK": function() { if(returndata == -1) { - if(startDate > currentDate) { + if(startDate < currentDate) { $(this).dialog("close"); self.location="/event/add/evstart/" + startDate + "/evend/" + endDate + "/poolID/" + $("#poolselectbox option:selected").val(); } else { @@ -426,7 +426,7 @@ var dayClick = false; }); if($.get("/event/checkright/rightShortcut/er")) { - if(event.repeat == 0) { + if(event.repeat == 0 || event.repeat == 2) { $(function() { $( "#defaultDialog" ).dialog({ autoOpen: false, @@ -473,7 +473,7 @@ var dayClick = false; 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 = 2; } else { $(this).dialog("close"); cell.removeChild(cell.firstChild); @@ -516,7 +516,7 @@ var dayClick = false; eventDrop: function( event, dayDelta, minuteDelta, allDay, revertFunc ) { - var currentDate = $('#calendar').fullCalendar('getDate'); + var currentDate = new Date(); $.get("/event/checkoverlapdrop/poolID/" + $("#poolselectbox option:selected").val() + "/eventID/" + event.id + "/date/" + event.start, function(data){ @@ -525,8 +525,10 @@ var dayClick = false; var cfcell = document.getElementById("cfevents"); // get conflicts var returndata = jQuery.parseJSON(data); + // get conflict free events with repeat var cfevents = returndata.cfevents; + var cfeventsString = $.toJSON(cfevents); //initialize eventNotDroppableDialog Dialog $(function() { @@ -538,7 +540,7 @@ var dayClick = false; buttons: { "Drop Conflict-Free Events": function() { $(this).dialog("close"); - self.location="/event/eventmovecf/evmindelta/" + minuteDelta + "/evdaydelta/" + dayDelta + "/poolID/" + $("#poolselectbox option:selected").val() + "/cfevents/" + cfevents; + $.post("/event/eventmovecf/evmindelta/" + minuteDelta + "/evdaydelta/" + dayDelta + "/poolID/" + $("#poolselectbox option:selected").val() + "/cfevents/" + cfeventsString); }, "OK": function() { $(this).dialog("close"); @@ -553,7 +555,7 @@ var dayClick = false; }); }); - if(event.repeat == 0 && event.immediate == 0 && $.get("/event/checkright/rightShortcut/er")) { + if((event.repeat == 0 || event.repeat == 2) && event.immediate == 0 && $.get("/event/checkright/rightShortcut/er")) { $(function() { $( "#defaultDialog" ).dialog({ autoOpen: false, @@ -590,7 +592,7 @@ var dayClick = false; }); }); $( "#defaultDialog" ).dialog('open'); - } else if (event.immediate == 0 && $.get("/event/checkright/rightShortcut/er")) { + } else if (event.repeat == 1 && event.immediate == 0 && $.get("/event/checkright/rightShortcut/er")) { $(function() { $( "#eventMoveWdhDialog" ).dialog({ autoOpen: false, @@ -612,7 +614,7 @@ var dayClick = false; $( "#errorTimeDialog" ).dialog('open'); revertFunc(); } - //event.repeat = 0; + event.repeat = 2; } else { $(this).dialog("close"); cell.removeChild(cell.firstChild); -- cgit v1.2.3-55-g7522