summaryrefslogtreecommitdiffstats
path: root/application/views
diff options
context:
space:
mode:
authorSebastian Wagner2011-10-25 17:07:40 +0200
committerSebastian Wagner2011-10-25 17:07:40 +0200
commit2ca9ebc9793072c261a520f155e0d68b33066b7a (patch)
treed046061ee82cb33dd0fb747bc75afec08ecc9ec7 /application/views
parenterrorTimeDialog added (diff)
downloadpoolctrl-2ca9ebc9793072c261a520f155e0d68b33066b7a.tar.gz
poolctrl-2ca9ebc9793072c261a520f155e0d68b33066b7a.tar.xz
poolctrl-2ca9ebc9793072c261a520f155e0d68b33066b7a.zip
was weiß ich
Diffstat (limited to 'application/views')
-rw-r--r--application/views/scripts/event/checkoverlapdrop.phtml46
-rw-r--r--application/views/scripts/event/checkoverlapresize.phtml46
-rw-r--r--application/views/scripts/event/checkoverlapselect.phtml16
-rwxr-xr-xapplication/views/scripts/event/index.phtml20
4 files changed, 79 insertions, 49 deletions
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'] = '<ul id="cfplot">';
- foreach($this->cfeventswithrepeat as $c){
- $output['cfplotwithrepeat'] .= '<li>' . 'EventID: ' . $c['eventID'] . ', Title: ' . $c['title'] . ', Start: ' . $c['start'] . ', End: ' . $c['end'] . '</li>';
- }
+foreach($this->cfeventswithrepeat as $c){
+ if(isset($c['end'])) {
+ $output['cfplotwithrepeat'] .= '<li>' . 'EventID: ' . $c['eventID'] . ', Title: ' . $c['title'] . ', Start: ' . $c['start'] . ', End: ' . $c['end'] . '</li>';
+ } else {
+ $output['cfplotwithrepeat'] .= '<li>' . 'EventID: ' . $c['eventID'] . ', Title: ' . $c['title'] . ', Start: ' . $c['start'] . '</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>';
- }
+foreach($this->cfeventswithoutrepeat as $c){
+ if(isset($c['end'])) {
+ $output['cfplotwithoutrepeat'] .= '<li>' . 'EventID: ' . $c['eventID'] . ', Title: ' . $c['title'] . ', Start: ' . $c['start'] . ', End: ' . $c['end'] . '</li>';
+ } else {
+ $output['cfplotwithoutrepeat'] .= '<li>' . 'EventID: ' . $c['eventID'] . ', Title: ' . $c['title'] . ', Start: ' . $c['start'] . '</li>';
+ }
+}
$output['cfplotwithoutrepeat'] .= '</ul>';
-
+
// conflict plot with repeat
if(count($this->overlapswithrepeat) == 0) {
- $output['withrepeat'] = -1;
+ $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>';
+ if(isset($o['end'])) {
+ $output['withrepeat'] .= '<li>' . 'EventID: ' . $o['eventID'] . ', Title: ' . $o['title'] . ', Start: ' . $o['start'] . ', End: ' . $o['end'] . '</li>';
+ } else {
+ $output['withrepeat'] .= '<li>' . 'EventID: ' . $o['eventID'] . ', Title: ' . $o['title'] . ', Start: ' . $o['start'] . '</li>';
+ }
}
$output['withrepeat'] .= '</ul>';
}
// conflict plot without repeat
if(count($this->overlapswithoutrepeat) == 0) {
- $output['withoutrepeat'] = -1;
+ $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>';
+ $output['withoutrepeat'] = '<ul id="conflictEvents">';
+ foreach($this->overlapswithoutrepeat as $o) {
+ if(isset($o['end'])) {
+ $output['withoutrepeat'] .= '<li>' . 'EventID: ' . $o['eventID'] . ', Title: ' . $o['title'] . ', Start: ' . $o['start'] . ', End: ' . $o['end'] . '</li>';
+ } else {
+ $output['withoutrepeat'] .= '<li>' . 'EventID: ' . $o['eventID'] . ', Title: ' . $o['title'] . ', Start: ' . $o['start'] . '</li>';
+ }
+ }
+ $output['withoutrepeat'] .= '</ul>';
}
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'] = '<ul id="cfplot">';
- foreach($this->cfeventswithrepeat as $c){
- $output['cfplotwithrepeat'] .= '<li>' . 'EventID: ' . $c['eventID'] . ', Title: ' . $c['title'] . ', Start: ' . $c['start'] . ', End: ' . $c['end'] . '</li>';
- }
+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>';
- }
+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;
+ $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>';
+ $output['withrepeat'] = '<ul id="conflictEvents">';
+ foreach($this->overlapswithrepeat as $o){
+ if(isset($o['end'])) {
+ $output['withrepeat'] .= '<li>' . 'EventID: ' . $o['eventID'] . ', Title: ' . $o['title'] . ', Start: ' . $o['start'] . ', End: ' . $o['end'] . '</li>';
+ } else {
+ $output['withrepeat'] .= '<li>' . 'EventID: ' . $o['eventID'] . ', Title: ' . $o['title'] . ', Start: ' . $o['start'] . '</li>';
+ }
+ }
+ $output['withrepeat'] .= '</ul>';
}
// conflict plot without repeat
if(count($this->overlapswithoutrepeat) == 0) {
- $output['withoutrepeat'] = -1;
+ $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>';
+ $output['withoutrepeat'] = '<ul id="conflictEvents">';
+ foreach($this->overlapswithoutrepeat as $o){
+ if(isset($o['end'])) {
+ $output['withoutrepeat'] .= '<li>' . 'EventID: ' . $o['eventID'] . ', Title: ' . $o['title'] . ', Start: ' . $o['start'] . ', End: ' . $o['end'] . '</li>';
+ } else {
+ $output['withoutrepeat'] .= '<li>' . 'EventID: ' . $o['eventID'] . ', Title: ' . $o['title'] . ', Start: ' . $o['start'] . '</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
index fa87193..8cc8991 100644
--- a/application/views/scripts/event/checkoverlapselect.phtml
+++ b/application/views/scripts/event/checkoverlapselect.phtml
@@ -1,13 +1,17 @@
<?php
if(count($this->overlaps) == 0) {
- $output = -1;
+ $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>';
+ $output = '<ul id="conflictEvents">';
+ foreach($this->overlaps as $o){
+ if(isset($o['end'])) {
+ $output .= '<li>' . 'EventID: ' . $o['eventID'] . ', Title: ' . $o['title'] . ', Start: ' . $o['start'] . ', End: ' . $o['end'] . '</li>';
+ } else {
+ $output .= '<li>' . 'EventID: ' . $o['eventID'] . ', Title: ' . $o['title'] . ', Start: ' . $o['start'] . '</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 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);