summaryrefslogtreecommitdiffstats
path: root/application/views
diff options
context:
space:
mode:
Diffstat (limited to 'application/views')
-rw-r--r--application/views/scripts/event/checkoverlapdrop.phtml (renamed from application/views/scripts/event/checkoverlapevents.phtml)24
-rw-r--r--application/views/scripts/event/checkoverlapresize.phtml42
-rw-r--r--application/views/scripts/event/checkoverlapselect.phtml13
-rwxr-xr-xapplication/views/scripts/event/index.phtml213
4 files changed, 231 insertions, 61 deletions
diff --git a/application/views/scripts/event/checkoverlapevents.phtml b/application/views/scripts/event/checkoverlapdrop.phtml
index 6558e19..279e798 100644
--- a/application/views/scripts/event/checkoverlapevents.phtml
+++ b/application/views/scripts/event/checkoverlapdrop.phtml
@@ -1,10 +1,21 @@
<?php
-// Output
-//print_r($this->overlaps);
-//$overlaps[] = array();
-
+$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;
}
@@ -14,10 +25,9 @@ else {
$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);
}
+// conflict plot without repeat
if(count($this->overlapswithoutrepeat) == 0) {
$output['withoutrepeat'] = -1;
}
@@ -27,8 +37,6 @@ else {
$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/checkoverlapresize.phtml b/application/views/scripts/event/checkoverlapresize.phtml
new file mode 100644
index 0000000..85a1a1c
--- /dev/null
+++ b/application/views/scripts/event/checkoverlapresize.phtml
@@ -0,0 +1,42 @@
+<?php
+$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;
+}
+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>';
+}
+
+// conflict plot without repeat
+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 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..fa87193
--- /dev/null
+++ b/application/views/scripts/event/checkoverlapselect.phtml
@@ -0,0 +1,13 @@
+<?php
+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 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..c5c7c38 100755
--- a/application/views/scripts/event/index.phtml
+++ b/application/views/scripts/event/index.phtml
@@ -135,7 +135,7 @@ var dayClick = false;
$( "#eventDeleteDialog" ).dialog('open');
// dialog for deleting selected wdhEvent
- }else {
+ } else {
$(function() {
$( "#eventDeleteWdhDialog" ).dialog({
autoOpen: false,
@@ -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: false, 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,46 @@ var dayClick = false;
} else
evClick = true;
$('#calendar').fullCalendar( 'unselect' );
+ });
},
eventResize: function( event, dayDelta, minuteDelta, revertFunc ) {
-
- $(this).qtip("destroy");
+
+ $.get("/event/checkoverlapresize/eventID/" + event.id + "/minuteDelta/" + minuteDelta + "/dayDelta/" + dayDelta + "/poolID/" + $("#poolselectbox option:selected").val(), function(data){
+
+ // 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
+ var cfevents = returndata.cfevents;
+
+ //initialize eventNotDroppableDialog Dialog
+ $(function() {
+ $( "#eventNotDroppableDialog" ).dialog({
+ autoOpen: false,
+ width: 820,
+ modal: true,
+ title: 'Resizing 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: false, autoHeight: true });
+ $(".ui-dialog-titlebar-close").hide();
+ $(this).parents(".ui-dialog:first").find(".ui-dialog-titlebar").addClass("ui-state-error");
+ }
+ });
+ });
+
if($.get("/event/checkright/rightShortcut/er")) {
if(event.repeat == 0) {
$(function() {
@@ -355,10 +426,17 @@ 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 () {
$(".ui-dialog-titlebar-close").hide();
@@ -367,7 +445,6 @@ var dayClick = false;
});
});
$( "#defaultDialog" ).dialog('open');
- $(this).qtip("destroy");
} else if (event.repeat == 1) {
$(function() {
$( "#eventResizeWdhDialog" ).dialog({
@@ -381,13 +458,31 @@ 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);
+ cfcell.removeChild(cfcell.firstChild);
+ $("#cfevents").append(returndata.cfplotwithoutrepeat);
+ $("#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);
+ cfcell.removeChild(cfcell.firstChild);
+ $("#cfevents").append(returndata.cfplotwithrepeat);
+ $("#conflicts").append(returndata.withrepeat);
+ $( "#eventNotDroppableDialog" ).dialog('open');
+ }
}
},
open: function () {
@@ -403,10 +498,22 @@ var dayClick = false;
revertFunc();
$( "#errorRightsDialog" ).dialog('open');
}
+ });
+ $(this).qtip("destroy");
},
eventDrop: function( event, dayDelta, minuteDelta, allDay, revertFunc ) {
+ $.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 cfcell = document.getElementById("cfevents");
+ // get conflicts
+ var returndata = jQuery.parseJSON(data);
+ // get conflict free events with repeat
+ var cfevents = returndata.cfevents;
+
//initialize eventNotDroppableDialog Dialog
$(function() {
$( "#eventNotDroppableDialog" ).dialog({
@@ -415,25 +522,23 @@ var dayClick = false;
modal: true,
title: 'Dropping of ' + event.title + ' is not possible!',
buttons: {
+ "Resolve Conflicts": function() {
+ $(this).dialog("close");
+ $.post("/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");
}
});
});
- $.get("/event/checkoverlapevents/eventID/" + event.id + "/date/" + event.start, function(data){
- // delete old conflicts
- var cell = document.getElementById("conflicts");
-
- var returndata = jQuery.parseJSON(data);
-
if(event.repeat == 0 && event.immediate == 0 && $.get("/event/checkright/rightShortcut/er")) {
$(function() {
$( "#defaultDialog" ).dialog({
@@ -481,23 +586,27 @@ 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() {
- 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 {
$(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');
}
}
},
@@ -540,24 +649,29 @@ 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) {
-
-
- // disable resizing if the event is a boot- or shutdown-event
+
+ // add running icons and handle editing of events
+ if(event.running == 0) {
+ // event will take place soon
+ element.addClass("fc-event-time-0");
+ //$('.fc-event-time').css('background','url(/media/img/down.png) top right no-repeat');
+ } else if(event.running == 1) {
+ // event is running
+ element.addClass("fc-event-time-1");
+ event.editable = false;
+ } else if(event.running == 2) {
+ // event successfully
+ element.addClass("fc-event-time-2");
+ event.editable = false;
+ } else if(event.running == 3) {
+ // event failed
+ element.addClass("fc-event-time-3");
+ event.editable = false;
+ }
+
+ // disable resizing if the event is a boot- or shutdown-event
if(event.category == 'Boot' || event.category == 'Shutdown') {
element.resizable(false); // calendar resizing
element.resizable("destroy"); // jqeury resizing
@@ -586,16 +700,6 @@ var dayClick = false;
element.find('.fc-event-title').append("<br/> Type: " + event.category + "<br/> Note: " + event.note + "<br/> Participants: " + event.participants);
}
},
-
- viewDisplay: function(view) {
-
- if (view.name == 'agendaWeek')
- {
- }
- if (view.name == 'agendaDay')
- {
- }
- }
});
@@ -861,6 +965,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>