summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Wagner2011-10-25 10:27:21 +0200
committerSebastian Wagner2011-10-25 10:27:21 +0200
commit8c7a25f9d415b2727b632323980fd303535d5dc5 (patch)
tree01f508a9bcf36e8462c8b671531c1fd032433301
parentbugfix (diff)
downloadpoolctrl-8c7a25f9d415b2727b632323980fd303535d5dc5.tar.gz
poolctrl-8c7a25f9d415b2727b632323980fd303535d5dc5.tar.xz
poolctrl-8c7a25f9d415b2727b632323980fd303535d5dc5.zip
errorTimeDialog added
-rwxr-xr-xapplication/controllers/EventController.php2
-rwxr-xr-xapplication/views/scripts/event/index.phtml28
2 files changed, 30 insertions, 0 deletions
diff --git a/application/controllers/EventController.php b/application/controllers/EventController.php
index cf1eec4..746f6ba 100755
--- a/application/controllers/EventController.php
+++ b/application/controllers/EventController.php
@@ -1072,6 +1072,7 @@ class EventController extends Zend_Controller_Action
try {
foreach($events as $event) {
+ if($event->getRunning() == 0) {
//1min = 60sec, 1d = 86400sec
$oldStartTime = date('H:i', strtotime($event->getStart()));
$oldStartDate = date('d.m.Y', strtotime($event->getStart()));
@@ -1114,6 +1115,7 @@ class EventController extends Zend_Controller_Action
}
}
$this->eventMapper->save($event); //save the event with the new data
+ }
}
} catch (Zend_Exception $e) {
echo "Caught exception: " . get_class($e) . "<br/>";
diff --git a/application/views/scripts/event/index.phtml b/application/views/scripts/event/index.phtml
index 58441ea..f312c98 100755
--- a/application/views/scripts/event/index.phtml
+++ b/application/views/scripts/event/index.phtml
@@ -361,6 +361,7 @@ var dayClick = false;
} else {
$(this).dialog("close");
$('#calendar').fullCalendar( 'unselect' );
+ $( "#errorTimeDialog" ).dialog('open');
}
} else {
$(this).dialog("close");
@@ -571,6 +572,7 @@ var dayClick = false;
$.post("/event/eventmove/evid/" + event.id + "/evstart/" + event.start + "/evend/" + event.end);
} else {
$(this).dialog("close");
+ $( "#errorTimeDialog" ).dialog('open');
revertFunc();
}
} else {
@@ -607,6 +609,7 @@ var dayClick = false;
$.post("/event/eventmove/evid/" + event.id + "/evstart/" + event.start + "/evend/" + event.end);
} else {
$(this).dialog("close");
+ $( "#errorTimeDialog" ).dialog('open');
revertFunc();
}
//event.repeat = 0;
@@ -624,6 +627,7 @@ var dayClick = false;
self.location="/event/eventmoveall/eventTitle/" + event.title + "/evmindelta/" + minuteDelta + "/evdaydelta/" + dayDelta + "/poolID/" + $("#poolselectbox option:selected").val();
} else {
$(this).dialog("close");
+ $( "#errorTimeDialog" ).dialog('open');
revertFunc();
}
} else {
@@ -920,6 +924,25 @@ var dayClick = false;
});
});
+//initialize errorTime Dialog
+ $(function() {
+ $( "#errorTimeDialog" ).dialog({
+ autoOpen: false,
+ width: 600,
+ modal: true,
+ title: "ERROR",
+ buttons: {
+ "OK": function() {
+ $(this).dialog("close");
+ }
+ },
+ open: function () {
+ $(".ui-dialog-titlebar-close").hide();
+ $(this).parents(".ui-dialog:first").find(".ui-dialog-titlebar").addClass("ui-state-error");
+ }
+ });
+ });
+
</script>
<!-- DIALOG WINDOWS -->
@@ -1007,6 +1030,11 @@ selected one?</p>
<p>Permission denied!</p>
</div>
+<!-- errorTime -->
+<div id="errorTimeDialog" style="display: none">
+<p>Please select a date in the future!</p>
+</div>
+
<!-- no pool selected -->
<div id="noPoolSelectedDialog" style="display: none">
<p>Please choose a Pool first!</p>