From 4d4b60e3aca6b5e277aa66e746697626465f70b8 Mon Sep 17 00:00:00 2001 From: Sebastian Wagner Date: Sat, 22 Oct 2011 14:15:35 +0200 Subject: some overlapping changes, conflict-free-event plot implemented --- .../views/scripts/event/checkoverlapdrop.phtml | 18 ++++++++++++- .../views/scripts/event/checkoverlapresize.phtml | 18 ++++++++++++- application/views/scripts/event/index.phtml | 31 +++++++++++++++++----- 3 files changed, 58 insertions(+), 9 deletions(-) (limited to 'application/views') diff --git a/application/views/scripts/event/checkoverlapdrop.phtml b/application/views/scripts/event/checkoverlapdrop.phtml index 1ca1b29..279e798 100644 --- a/application/views/scripts/event/checkoverlapdrop.phtml +++ b/application/views/scripts/event/checkoverlapdrop.phtml @@ -1,6 +1,21 @@ cfevents; +$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; } @@ -12,6 +27,7 @@ else { $output['withrepeat'] .= ''; } +// conflict plot without repeat if(count($this->overlapswithoutrepeat) == 0) { $output['withoutrepeat'] = -1; } diff --git a/application/views/scripts/event/checkoverlapresize.phtml b/application/views/scripts/event/checkoverlapresize.phtml index 4f0ad3d..85a1a1c 100644 --- a/application/views/scripts/event/checkoverlapresize.phtml +++ b/application/views/scripts/event/checkoverlapresize.phtml @@ -1,6 +1,21 @@ cfevents; +$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; } @@ -12,6 +27,7 @@ else { $output['withrepeat'] .= ''; } +// conflict plot without repeat if(count($this->overlapswithoutrepeat) == 0) { $output['withoutrepeat'] = -1; } diff --git a/application/views/scripts/event/index.phtml b/application/views/scripts/event/index.phtml index e14887c..80f1b02 100755 --- a/application/views/scripts/event/index.phtml +++ b/application/views/scripts/event/index.phtml @@ -382,6 +382,7 @@ var dayClick = false; // get conflicts-HTML Element var cell = document.getElementById("conflicts"); + var cfcell = document.getElementById("cfevents"); // get conflicts var returndata = jQuery.parseJSON(data); // get conflict free events @@ -405,7 +406,7 @@ var dayClick = false; } }, open: function () { - $("#accordion").accordion({clearStyle: true, collapsible: true, active: 1, autoHeight: true }); + $("#accordion").accordion({clearStyle: true, collapsible: true, active: false, autoHeight: true }); $(".ui-dialog-titlebar-close").hide(); $(this).parents(".ui-dialog:first").find(".ui-dialog-titlebar").addClass("ui-state-error"); } @@ -460,10 +461,12 @@ 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 = 0; } else { $(this).dialog("close"); cell.removeChild(cell.firstChild); + cfcell.removeChild(cfcell.firstChild); + $("#cfevents").append(returndata.cfplotwithoutrepeat); $("#conflicts").append(returndata.withoutrepeat); $( "#eventNotDroppableDialog" ).dialog('open'); } @@ -475,6 +478,8 @@ var dayClick = false; } else { $(this).dialog("close"); cell.removeChild(cell.firstChild); + cfcell.removeChild(cfcell.firstChild); + $("#cfevents").append(returndata.cfplotwithrepeat); $("#conflicts").append(returndata.withrepeat); $( "#eventNotDroppableDialog" ).dialog('open'); } @@ -503,9 +508,10 @@ var dayClick = false; // get conflicts-HTML Element var cell = document.getElementById("conflicts"); + var cfcell = document.getElementById("cfevents"); // get conflicts var returndata = jQuery.parseJSON(data); - // get conflict free events + // get conflict free events with repeat var cfevents = data['cfevents']; //initialize eventNotDroppableDialog Dialog @@ -516,13 +522,17 @@ var dayClick = false; modal: true, title: 'Dropping of ' + event.title + ' is not possible!', buttons: { + "Resolve Conflicts": function() { + $(this).dialog("close"); + self.location="/event/eventmovecf/evmindelta/" + minuteDelta + "/evdaydelta/" + dayDelta + "/poolID/" + $("#poolselectbox option:selected").val() + "/cfevents/" + cfevents; + }, "OK": function() { $(this).dialog("close"); revertFunc(); } }, open: function () { - $("#accordion").accordion({clearStyle: true, collapsible: true, active: 1, autoHeight: true }); + $("#accordion").accordion({clearStyle: true, collapsible: true, active: false, autoHeight: true }); $(".ui-dialog-titlebar-close").hide(); $(this).parents(".ui-dialog:first").find(".ui-dialog-titlebar").addClass("ui-state-error"); } @@ -576,12 +586,14 @@ var dayClick = false; if(returndata.withoutrepeat == -1) { $(this).dialog("close"); $.post("/event/eventmove/evid/" + event.id + "/evstart/" + event.start + "/evend/" + event.end); - event.repeat = 0; + //event.repeat = 0; } else { $(this).dialog("close"); cell.removeChild(cell.firstChild); + cfcell.removeChild(cfcell.firstChild); + $("#cfevents").append(returndata.cfplotwithoutrepeat); $("#conflicts").append(returndata.withoutrepeat); - $( "#eventNotDroppableDialog" ).dialog('open'); + $( "#eventNotDroppableDialog" ).dialog('open'); } }, "Move all Events": function() { @@ -591,8 +603,10 @@ var dayClick = false; } else { $(this).dialog("close"); cell.removeChild(cell.firstChild); + cfcell.removeChild(cfcell.firstChild); + $("#cfevents").append(returndata.cfplotwithrepeat); $("#conflicts").append(returndata.withrepeat); - $( "#eventNotDroppableDialog" ).dialog('open'); + $( "#eventNotDroppableDialog" ).dialog('open'); } } }, @@ -943,6 +957,9 @@ selected one?

Show conflicts

+

Show conflict-free Events

+
+
-- cgit v1.2.3-55-g7522