summaryrefslogtreecommitdiffstats
path: root/application/views/scripts/event/index.phtml
diff options
context:
space:
mode:
authorSebastian Wagner2011-09-28 10:35:22 +0200
committerSebastian Wagner2011-09-28 10:35:22 +0200
commit123ae744cb625da94adda8622a404941b545950c (patch)
treeac3d2c1e5f81337bf7771ac5120b0f9e98c76943 /application/views/scripts/event/index.phtml
parentRepeat Events getestet und korrigiert (diff)
downloadpoolctrl-123ae744cb625da94adda8622a404941b545950c.tar.gz
poolctrl-123ae744cb625da94adda8622a404941b545950c.tar.xz
poolctrl-123ae744cb625da94adda8622a404941b545950c.zip
dayClick to add events
Diffstat (limited to 'application/views/scripts/event/index.phtml')
-rwxr-xr-xapplication/views/scripts/event/index.phtml44
1 files changed, 41 insertions, 3 deletions
diff --git a/application/views/scripts/event/index.phtml b/application/views/scripts/event/index.phtml
index 3c9fc2b..6db6a49 100755
--- a/application/views/scripts/event/index.phtml
+++ b/application/views/scripts/event/index.phtml
@@ -30,6 +30,9 @@ var overlappEnd;
// poolSelectVal
var poolIDtmp;
+// dayClick
+var dayClick = false;
+
// change border color of an event
function eventSelected(event) {
@@ -201,7 +204,42 @@ var poolIDtmp;
defaultEventMinutes: 20,
dayClick: function( date, allDay, jsEvent, view ) {
+
selectedDate = date;
+ dayClick = true;
+
+ if($("#poolselectbox option:selected").val() == 'default') {
+ $( "#noPoolSelectedDialog" ).dialog('open');
+ } else if ($.get("/event/checkright/rightShortcut/ec")) {
+ $(function() {
+ $( "#eventAddDialog" ).dialog({
+ autoOpen: false,
+ width: 600,
+ modal: true,
+ title: "Add Event from " + date,
+ buttons: {
+ "Cancel": function() {
+ dayClick = false;
+ $(this).dialog("close");
+ $('#calendar').fullCalendar( 'unselect' );
+ },
+ "OK": function() {
+ $(this).dialog("close");
+ self.location="/event/add/evstart/" + date + "/poolID/" + $("#poolselectbox option:selected").val();
+ }
+ },
+ open: function () {
+ $(".ui-dialog-titlebar-close").hide();
+ //$(this).parents(".ui-dialog:first").find(".ui-dialog-titlebar").addClass("ui-state-error");
+ }
+ });
+ });
+ $( "#eventAddDialog" ).dialog('open');
+ } else {
+ dayClick = false;
+ $('#calendar').fullCalendar( 'unselect' );
+ $( "#errorRightsDialog" ).dialog('open');
+ }
},
eventMouseover: function( event, jsEvent, view ) {
@@ -232,9 +270,9 @@ var poolIDtmp;
select: function( startDate, endDate, allDay, jsEvent, view ) {
- if($("#poolselectbox option:selected").val() == 'default') {
+ if($("#poolselectbox option:selected").val() == 'default' && dayClick == false) {
$( "#noPoolSelectedDialog" ).dialog('open');
- } else if ($.get("/event/checkright/rightShortcut/ec")) {
+ } else if ($.get("/event/checkright/rightShortcut/ec") && dayClick == false) {
$(function() {
$( "#eventAddDialog" ).dialog({
autoOpen: false,
@@ -258,7 +296,7 @@ var poolIDtmp;
});
});
$( "#eventAddDialog" ).dialog('open');
- } else {
+ } else if (dayClick == false) {
$('#calendar').fullCalendar( 'unselect' );
$( "#errorRightsDialog" ).dialog('open');
}