summaryrefslogtreecommitdiffstats
path: root/application/views
diff options
context:
space:
mode:
authorSebastian Wagner2011-10-22 14:15:35 +0200
committerSebastian Wagner2011-10-22 14:15:35 +0200
commit4d4b60e3aca6b5e277aa66e746697626465f70b8 (patch)
tree3e378f7ab9622b162dbffbc2dde35afdfd05c657 /application/views
parentsome changes (diff)
downloadpoolctrl-4d4b60e3aca6b5e277aa66e746697626465f70b8.tar.gz
poolctrl-4d4b60e3aca6b5e277aa66e746697626465f70b8.tar.xz
poolctrl-4d4b60e3aca6b5e277aa66e746697626465f70b8.zip
some overlapping changes, conflict-free-event plot implemented
Diffstat (limited to 'application/views')
-rw-r--r--application/views/scripts/event/checkoverlapdrop.phtml18
-rw-r--r--application/views/scripts/event/checkoverlapresize.phtml18
-rwxr-xr-xapplication/views/scripts/event/index.phtml31
3 files changed, 58 insertions, 9 deletions
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 @@
<?php
-$output['cfevents'] = $this->cfevents;
+$output['cfevents'] = $this->cfeventswithrepeat;
+// conflict free plot with repeat
+$output['cfplotwithrepeat'] = '<ul id="cfplot">';
+ foreach($this->cfeventswithrepeat as $c){
+ $output['cfplotwithrepeat'] .= '<li>' . 'EventID: ' . $c['eventID'] . ', Title: ' . $c['title'] . ', Start: ' . $c['start'] . ', End: ' . $c['end'] . '</li>';
+ }
+$output['cfplotwithrepeat'] .= '</ul>';
+
+// conflict free plot without repeat
+$output['cfplotwithoutrepeat'] = '<ul id="cfplot">';
+ foreach($this->cfeventswithoutrepeat as $c){
+ $output['cfplotwithoutrepeat'] .= '<li>' . 'EventID: ' . $c['eventID'] . ', Title: ' . $c['title'] . ', Start: ' . $c['start'] . ', End: ' . $c['end'] . '</li>';
+ }
+$output['cfplotwithoutrepeat'] .= '</ul>';
+
+// conflict plot with repeat
if(count($this->overlapswithrepeat) == 0) {
$output['withrepeat'] = -1;
}
@@ -12,6 +27,7 @@ else {
$output['withrepeat'] .= '</ul>';
}
+// 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 @@
<?php
-$output['cfevents'] = $this->cfevents;
+$output['cfevents'] = $this->cfeventswithrepeat;
+// conflict free plot with repeat
+$output['cfplotwithrepeat'] = '<ul id="cfplot">';
+ foreach($this->cfeventswithrepeat as $c){
+ $output['cfplotwithrepeat'] .= '<li>' . 'EventID: ' . $c['eventID'] . ', Title: ' . $c['title'] . ', Start: ' . $c['start'] . ', End: ' . $c['end'] . '</li>';
+ }
+$output['cfplotwithrepeat'] .= '</ul>';
+
+// conflict free plot without repeat
+$output['cfplotwithoutrepeat'] = '<ul id="cfplot">';
+ foreach($this->cfeventswithoutrepeat as $c){
+ $output['cfplotwithoutrepeat'] .= '<li>' . 'EventID: ' . $c['eventID'] . ', Title: ' . $c['title'] . ', Start: ' . $c['start'] . ', End: ' . $c['end'] . '</li>';
+ }
+$output['cfplotwithoutrepeat'] .= '</ul>';
+
+// conflict plot with repeat
if(count($this->overlapswithrepeat) == 0) {
$output['withrepeat'] = -1;
}
@@ -12,6 +27,7 @@ else {
$output['withrepeat'] .= '</ul>';
}
+// 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?</p>
<h3><a href="#">Show conflicts</a></h3>
<div id="conflicts">
</div>
+ <h3><a href="#">Show conflict-free Events</a></h3>
+ <div id="cfevents">
+ </div>
</div>
</div>