summaryrefslogtreecommitdiffstats
path: root/application/views/scripts
diff options
context:
space:
mode:
authorBjörn Geiger2011-11-15 15:05:03 +0100
committerBjörn Geiger2011-11-15 15:05:03 +0100
commit145695a16c62abbd99df4aed80a60e54d09d369b (patch)
tree4e45dbca8f0e7d2fa5bd6932da1fe9372a008b5f /application/views/scripts
parentMerge branch 'master' of git.openslx.org:lsfks/projekte/poolctrl (diff)
downloadpoolctrl-145695a16c62abbd99df4aed80a60e54d09d369b.tar.gz
poolctrl-145695a16c62abbd99df4aed80a60e54d09d369b.tar.xz
poolctrl-145695a16c62abbd99df4aed80a60e54d09d369b.zip
Code Cleaning und verschiedene kleine Korrekturen
Diffstat (limited to 'application/views/scripts')
-rwxr-xr-xapplication/views/scripts/event/index.phtml871
1 files changed, 2 insertions, 869 deletions
diff --git a/application/views/scripts/event/index.phtml b/application/views/scripts/event/index.phtml
index f79dd6c..3fe0194 100755
--- a/application/views/scripts/event/index.phtml
+++ b/application/views/scripts/event/index.phtml
@@ -1,875 +1,8 @@
<h1>Pool Control</h1>
-
<div id='calendar'
style='margin: 3em 0; font-size: 13px'></div>
-
-<script type="text/javascript">
-
-$(document).ready(function() {iniCalendar();});
-
-/*
- * calendar variables
- */
-
-// eventSelect
-var eventColor = {ev:null, color:null};
-
-// keydown
-var selectedEvent = null;
-
-// dblclick
-var clickTmp = true;
-
-// poolSelectVal
-var poolIDtmp;
-
-//change border color of an event
-function eventSelected(event) {
- if (eventColor.ev != null){
- event.selected = false;
- selectedEvent = null;
- eventColor.ev.borderColor = eventColor.color;
- }
- event.selected = true;
- selectedEvent = event;
- eventColor.ev = event;
- eventColor.color = event.borderColor;
- event.borderColor = 'black';
- $('#calendar').fullCalendar("rerenderEvents");
- // show report button
- if($.get("/event/checkright/rightShortcut/er")){
- $('#eventReportButton').show();
- } else {
- $('#eventReportButton').hide();
- }
- // show edit button
- if($.get("/event/checkright/rightShortcut/ee")) {
- $('#editEvent').show();
- } else {
- $('#editEvent').hide();
- }
-}
-
-// change view to addEvent
- function addEvent() {
- if($("#poolselectbox option:selected").val() == 'defaultPool' || $("#poolselectbox option:selected").val() == 'noPool') {
- $("#noPoolSelectedDialog").dialog('open');
- } else {
- self.location="/event/add/";}
- }
-
- function setOpacity(type, value) {
- var events = $('#calendar').fullCalendar( 'clientEvents' , function(event) {
- if(event.category == type) {
- event.opacity = value;
- }
- return false;
- });
- $('#calendar').fullCalendar( 'rerenderEvents' );
- }
-
- function setPoolIDtmp() {
- poolIDtmp = $("#poolselectbox option:selected").val();
- }
-
-// fetch all poolevents of the selected #poolselectbox value
- function fetchPoolEvents() {
- poolID = $("#poolselectbox option:selected").val();
- $('#calendar').fullCalendar("removeEvents");
- $('#calendar').fullCalendar("removeEventSource", "/event/eventlist/poolID/" + poolIDtmp);
- $('#calendar').fullCalendar("addEventSource", "/event/eventlist/poolID/" + poolID);
- }
-
- $(window).load(function() {
- var formularOverlappVar = getOverlappingVar();
- if(formularOverlappVar == 1) {
- $( "#formularOverlappingDialog" ).dialog('open');}
- });
-
-/*
- * KEYDOWN FUNCTION
- * delete selected event by key del(8) OR entf(46)
- */
-
- $(document).keydown(function (e) {
- //delete selected event by key del(8) OR entf(46)
- if (e.keyCode == 8 || e.keyCode == 46 && selectedEvent.selected == true, $.get("/event/checkright/rightShortcut/ed")) {
- // check if the event is an wdhEvent
- if(selectedEvent.repeat == 0 || selectedEvent.repeat == 2) {
- // dialog for deleting selected event
- $(function() {
- $( "#eventDeleteDialog" ).dialog({
- autoOpen: false,
- width: 600,
- modal: true,
- title: "Delete " + selectedEvent.title,
- buttons: {
- "Cancel": function() {
- $(this).dialog("close");
- },
- "OK": function() {
- $(this).dialog("close");
- $.post("/event/delete/eventID/" + selectedEvent.id);
- $('#calendar').fullCalendar( 'removeEvents', selectedEvent.id );
- $('#calendar').fullCalendar( 'rerenderEvents' );
- }
- },
- open: function () {
- $(".ui-dialog-titlebar-close").hide();
- }
- });
- });
- $( "#eventDeleteDialog" ).dialog('open');
-
- // dialog for deleting selected wdhEvent
- } else if (selectedEvent.repeat == 1) {
- $(function() {
- $( "#eventDeleteWdhDialog" ).dialog({
- autoOpen: false,
- width: 600,
- modal: true,
- title: 'Delete ' + selectedEvent.title,
- buttons: {
- "Cancel": function() {
- $(this).dialog("close");
- },
- "Delete just this Event": function() {
- $(this).dialog("close");
- $.post("/event/delete/eventID/" + selectedEvent.id);
- $('#calendar').fullCalendar( 'removeEvents', selectedEvent.id );
- $('#calendar').fullCalendar( 'rerenderEvents' );
- },
- "Delete all Events": function() {
- $(this).dialog("close");
- self.location="/event/deleteall/eventTitle/" + selectedEvent.title;
- }
- },
- open: function () {
- $(".ui-dialog-titlebar-close").hide();
- }
- });
- });
- $( "#eventDeleteWdhDialog" ).dialog('open');}
- }
- });
-
-/*
- * initialize fullCalendar and all calendar-functions
- */
-
- function iniCalendar() {
-
- var calendar = $('#calendar').fullCalendar({
-
- // fullCalendar header
- header: {
- default: 'week',
- left: 'title',
- center: 'today prev,next',
- right: 'agendaWeek,agendaDay'
- },
-
- // set some default options
- editable: true,
- allDaySlot: false,
- selectable: true,
- selectHelper: true,
- currentTimeIndicator: true,
- allDay : false,
- defaultView: 'agendaWeek',
- slotMinutes: 15,
- defaultEventMinutes: 10,
-
- loading: function(bool) { if (bool) $('#progress').show(); else $('#progress').hide(); },
-
- eventClick: function( event, jsEvent, view ) {
-
- if(clickTmp) {
- clickTmp = false;
- setTimeout(function() {clickTmp = true;} , 300);
- $(this).qtip("destroy");
- eventSelected(event);
- } else if ($.get("/event/checkright/rightShortcut/ed")) {
- // this is the dblclick
- $(this).qtip("destroy");
- if(event.repeat == 1) {
- $(function() {
- $( "#eventEditWdhDialog" ).dialog({
- autoOpen: false,
- width: 600,
- modal: true,
- title: 'Edit ' + event.title,
- buttons: {
- "Cancel": function() {
- $(this).dialog("close");
- },
- "Edit just this Event": function() {
- $(this).dialog("close");
- self.location = "/event/edit/eventID/" + event.id + "/wdh/" + 0 + "/poolID/" + $("#poolselectbox option:selected").val();
- },
- "Edit all Events": function() {
- $(this).dialog("close");
- self.location = "/event/edit/eventID/" + event.id + "/wdh/" + 1 + "/poolID/" + $("#poolselectbox option:selected").val();
- }
- },
- open: function () {
- $(".ui-dialog-titlebar-close").hide();
- }
- });
- });
- $( "#eventEditWdhDialog" ).dialog('open');
- } else self.location = "/event/edit/eventID/" + event.id + "/wdh/" + 0 + "/poolID/" + $("#poolselectbox option:selected").val();
- } else if (!$.get("/event/checkright/rightShortcut/ee")) {
- $( "#errorRightsDialog" ).dialog('open');
- }
- },
-
- select: function( startDate, endDate, allDay, jsEvent, view ) {
-
- var currentDate = new Date();
-
- //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/checkright/rightShortcut/ec", function(right){
- $.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() == 'defaultPool' || $("#poolselectbox option:selected").val() == 'noPool') {
- $( "#noPoolSelectedDialog" ).dialog('open');
- } else if (right) {
- $(function() {
- $( "#eventAddDialog" ).dialog({
- autoOpen: false,
- width: 600,
- modal: true,
- title: "Add Event from " + startDate + " to " + endDate,
- buttons: {
- "Cancel": function() {
- $(this).dialog("close");
- $('#calendar').fullCalendar( 'unselect' );
- },
- "OK": function() {
- if(returndata == -1) {
- if(startDate > currentDate) {
- $(this).dialog("close");
- self.location="/event/add/evstart/" + startDate + "/evend/" + endDate + "/poolID/" + $("#poolselectbox option:selected").val();
- } else {
- $(this).dialog("close");
- $('#calendar').fullCalendar( 'unselect' );
- $( "#errorTimeDialog" ).dialog('open');
- }
- } else {
- $(this).dialog("close");
- cell.removeChild(cell.firstChild);
- $("#conflicts").append(returndata);
- $( "#eventNotDroppableDialog" ).dialog('open');
- }
- }
- },
- open: function () {
- $(".ui-dialog-titlebar-close").hide();
- }
- });
- });
- $( "#eventAddDialog" ).dialog('open');
- } else if (!right) {
- $('#calendar').fullCalendar( 'unselect' );
- $( "#errorRightsDialog" ).dialog('open');
- } else
- $('#calendar').fullCalendar( 'unselect' );
- });
- });
- },
-
- eventResize: function( event, dayDelta, minuteDelta, revertFunc ) {
-
- $.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;
- var cfeventsString = $.toJSON(cfevents);
-
-
- //initialize eventNotDroppableDialog Dialog
- $(function() {
- $( "#eventNotDroppableDialog" ).dialog({
- autoOpen: false,
- width: 820,
- modal: true,
- title: 'Resizing of ' + event.title + ' is not possible!',
- buttons: {
- "Resize Conflict-Free Events": function() {
- $(this).dialog("close");
- self.location="/event/eventresizecf/evmindelta/" + minuteDelta + "/evdaydelta/" + dayDelta + "/poolID/" + $("#poolselectbox option:selected").val() + "/cfevents/" + cfeventsString;
- },
- "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");
- }
- });
- });
-
- //initialize eventNotDroppable Dialog2
- $(function() {
- $( "#eventNotDroppableDialog2" ).dialog({
- autoOpen: false,
- width: 820,
- modal: true,
- title: 'Dropping of ' + event.title + ' is not possible!',
- buttons: {
- "OK": function() {
- $(this).dialog("close");
- revertFunc();
- }
- },
- open: function () {
- $(".ui-dialog-titlebar-close").hide();
- $(this).parents(".ui-dialog:first").find(".ui-dialog-titlebar").addClass("ui-state-error");
- }
- });
- });
-
- if($.get("/event/checkright/rightShortcut/ee")) {
- if(event.repeat == 0 || event.repeat == 2) {
- $(function() {
- $( "#defaultDialog" ).dialog({
- autoOpen: false,
- width: 600,
- modal: true,
- title: "The End Date of " + event.title + " is now " + event.end,
- buttons: {
- "Cancel": function() {
- $(this).dialog("close");
- revertFunc();
- },
- "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");
- $( "#eventNotDroppableDialog2" ).dialog('open');
- }
- }
- },
- open: function () {
- $(".ui-dialog-titlebar-close").hide();
- }
- });
- });
- $( "#defaultDialog" ).dialog('open');
- } else if (event.repeat == 1) {
- $(function() {
- $( "#eventResizeWdhDialog" ).dialog({
- autoOpen: false,
- width: 600,
- modal: true,
- title: 'Resize ' + event.title + ' (' + minuteDelta + ' minutes)',
- buttons: {
- "Cancel": function() {
- $(this).dialog("close");
- 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 = 2;
- } else {
- $(this).dialog("close");
- $( "#eventNotDroppableDialog2" ).dialog('open');
- }
- },
- "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();
- } 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 () {
- $(".ui-dialog-titlebar-close").hide();
- }
- });
- });
- $( "#eventResizeWdhDialog" ).dialog('open');
- }
- }
- else {
- revertFunc();
- $( "#errorRightsDialog" ).dialog('open');
- }
- });
- $(this).qtip("destroy");
- },
-
- eventDrop: function( event, dayDelta, minuteDelta, allDay, revertFunc ) {
-
- var currentDate = new Date();
-
- $.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 past
- var past = returndata.past;
- // get conflict free events with repeat
- var cfevents = returndata.cfevents;
- var cfeventsString = $.toJSON(cfevents);
-
- //initialize eventNotDroppable Dialog
- $(function() {
- $( "#eventNotDroppableDialog" ).dialog({
- autoOpen: false,
- width: 820,
- modal: true,
- title: 'Dropping of ' + event.title + ' is not possible!',
- buttons: {
- "Drop Conflict-Free Events": function() {
- $(this).dialog("close");
- self.location="/event/eventmovecf/evmindelta/" + minuteDelta + "/evdaydelta/" + dayDelta + "/poolID/" + $("#poolselectbox option:selected").val() + "/cfevents/" + cfeventsString;
- },
- "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");
- }
- });
- });
-
- //initialize eventNotDroppable Dialog2
- $(function() {
- $( "#eventNotDroppableDialog2" ).dialog({
- autoOpen: false,
- width: 820,
- modal: true,
- title: 'Dropping of ' + event.title + ' is not possible!',
- buttons: {
- "OK": function() {
- $(this).dialog("close");
- revertFunc();
- }
- },
- open: function () {
- $(".ui-dialog-titlebar-close").hide();
- $(this).parents(".ui-dialog:first").find(".ui-dialog-titlebar").addClass("ui-state-error");
- }
- });
- });
-
- if((event.repeat == 0 || event.repeat == 2) && $.get("/event/checkright/rightShortcut/ee")) {
- $(function() {
- $( "#defaultDialog" ).dialog({
- autoOpen: false,
- width: 600,
- modal: true,
- title: event.title + " was moved to " + event.start,
- buttons: {
- "Cancel": function() {
- $(this).dialog("close");
- revertFunc();
- },
- "OK": function() {
- if(returndata.withoutrepeat == -1) {
- if(event.start > currentDate) {
- $(this).dialog("close");
- $.post("/event/eventmove/evid/" + event.id + "/evstart/" + event.start + "/evend/" + event.end);
- } else {
- $(this).dialog("close");
- $( "#errorTimeDialog" ).dialog('open');
- revertFunc();
- }
- } else {
- $(this).dialog("close");
- $( "#eventNotDroppableDialog2" ).dialog('open');
- }
- }
- },
- open: function () {
- $(".ui-dialog-titlebar-close").hide();
- }
- });
- });
- $( "#defaultDialog" ).dialog('open');
- } else if (event.repeat == 1 && $.get("/event/checkright/rightShortcut/ee")) {
- $(function() {
- $( "#eventMoveWdhDialog" ).dialog({
- autoOpen: false,
- width: 600,
- modal: true,
- title: 'Move ' + event.title,
- buttons: {
- "Cancel": function() {
- $(this).dialog("close");
- revertFunc();
- },
- "Move just this Event": function() {
- if(returndata.withoutrepeat == -1) {
- if(event.start > currentDate) {
- $(this).dialog("close");
- $.post("/event/eventmove/evid/" + event.id + "/evstart/" + event.start + "/evend/" + event.end);
- } else {
- $(this).dialog("close");
- $( "#errorTimeDialog" ).dialog('open');
- revertFunc();
- }
- event.repeat = 2;
- } else {
- $(this).dialog("close");
- $( "#eventNotDroppableDialog2" ).dialog('open');
- }
- },
- "Move all Events": function() {
- if(returndata.withrepeat == -1) {
- if(event.start > currentDate && !past) {
- $(this).dialog("close");
- 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 {
- $(this).dialog("close");
- cell.removeChild(cell.firstChild);
- cfcell.removeChild(cfcell.firstChild);
- $("#cfevents").append(returndata.cfplotwithrepeat);
- $("#conflicts").append(returndata.withrepeat);
- $( "#eventNotDroppableDialog" ).dialog('open');
- }
- }
- },
- open: function () {
- $(".ui-dialog-titlebar-close").hide();
- }
- });
- });
- $( "#eventMoveWdhDialog" ).dialog('open');
- } else {
- revertFunc();
- $(this).qtip("destroy");
- }});
- $(this).qtip("destroy");
- },
-
- eventDragStart: function( event, jsEvent, ui, view ) {
- if(!$.get("/event/checkright/rightShortcut/ee")) {
- $( "#errorRightsDialog" ).dialog('open');
- }
- },
-
- eventRender: function(event, element, view) {
-
- var eventTmp = element.attr("id", "evID_" + event.id);
-
- // add running icons and handle editing of events
- if(event.running == 0) {
- // event will take place soon
- $(element).find('.fc-event-time').addClass("fc-event-time-0");
- } else if(event.running == 1) {
- // event is running
- $(element).find('.fc-event-time').addClass("fc-event-time-1");
- event.editable = false;
- element.resizable("destroy"); // jqeury resizing
- element.removeClass('fc-event-vert'); // css class
- } else if(event.running == 2) {
- // event successfully
- $(element).find('.fc-event-time').addClass("fc-event-time-2");
- event.editable = false;
- element.resizable("destroy"); // jqeury resizing
- element.removeClass('fc-event-vert'); // css class
- } else if(event.running == 3) {
- // event failed
- $(element).find('.fc-event-time').addClass("fc-event-time-3");
- event.editable = false;
- element.resizable("destroy"); // jqeury resizing
- element.removeClass('fc-event-vert'); // css class
- }
-
- // 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
- element.removeClass('fc-event-vert'); // css class
- }
-
- element.qtip({
- content:
- 'Title: ' + event.title + '<br/>' +
- 'Type: ' + event.category + '<br/>' +
- 'Note: ' + event.note + '<br/>' +
- 'Participants: ' + event.participants,
- show: 'mouseover',
- hide: 'mouseout'
- });
-
- if (view.name == 'agendaDay') {
- if(event.participants) {
- element.find('.fc-event-title').append(
- "<br/> Type: " + event.category +
- "<br/> Note: " + event.note +
- "<br/> Participants: " + event.participants +
- "<br/> Repeat: " + event.repeat);
- } else {
- element.find('.fc-event-title').append(
- "<br/> Type: " + event.category +
- "<br/> Note: " + event.note +
- "<br/> Participants: ALL" +
- "<br/> Repeat: " + event.repeat);
- }
- }
- }
- });
-
-
- /*
- * Button definitions
- */
-
- // EventType Buttons
- $('.fc-header-center').append('<span id="lecture" class="fc-button fc-state-default fc-corner-right fc-state-active"><span class="fc-button-inner"><span class="fc-button-content">Lecture</span><span class="fc-button-effect"><span></span></span></span></span>');
- $('.fc-header-center').append('<span id="maintenance" class="fc-button fc-state-default fc-corner-right fc-state-active"><span class="fc-button-inner"><span class="fc-button-content">Maintenance</span><span class="fc-button-effect"><span></span></span></span></span>');
- $('.fc-header-center').append('<span id="boot" class="fc-button fc-state-default fc-corner-right fc-state-active"><span class="fc-button-inner"><span class="fc-button-content">Boot</span><span class="fc-button-effect"><span></span></span></span></span>');
- $('.fc-header-center').append('<span id="shutdown" class="fc-button fc-state-default fc-corner-right fc-state-active"><span class="fc-button-inner"><span class="fc-button-content">Shutdown</span><span class="fc-button-effect"><span></span></span></span></span>');
-
- // PoolSelectBox
- $('.fc-header-left').append('<form name="PoolSelectForm"><select id="poolselectbox" name="PoolSelectbox" onclick="setPoolIDtmp()" onChange="fetchPoolEvents();"><option value="defaultPool" >Please choose a Pool</option></select></form>');
-
- // Add Button
- $('.fc-header-right').append('<span id="addEvent" class="fc-button fc-state-default fc-state-hover"><span class="fc-button-inner"><span class="fc-button-content">+</span><span class="fc-button-effect"><span></span></span></span></span>');
-
- // Edit Button
- $('.fc-header-right').append('<span id="editEvent" style=display:none class="fc-button fc-state-default fc-state-hover "><span class="fc-button-inner"><span class="fc-button-content"><IMG src="/media/img/edit.png"/></span><span class="fc-button-effect"><span></span></span></span>');
-
- // Report Button
- $('.fc-header-center').append('<span id="eventReportButton" style=display:none class="fc-button fc-state-default fc-state-hover"><span class="fc-button-inner"><span class="fc-button-content">Report</span><span class="fc-button-effect"><span></span></span></span></span>');
-
- // Change Button-Style
- $("#lecture").click(function(){
- if($("#poolselectbox option:selected").val() == 'defaultPool' || $("#poolselectbox option:selected").val() == 'noPool') {
- $( "#noPoolSelectedDialog" ).dialog('open');
- } else {
- if($(this).hasClass("fc-state-active")) {
- $(this).removeClass("fc-state-active");
- setOpacity('Lecture', '.5');
- } else {$(this).addClass("fc-state-active"); setOpacity('Lecture', '1');}
- }
- });
- $("#maintenance").click(function(){
- if($("#poolselectbox option:selected").val() == 'defaultPool' || $("#poolselectbox option:selected").val() == 'noPool') {
- $( "#noPoolSelectedDialog" ).dialog('open');
- } else {
- if($(this).hasClass("fc-state-active")) {
- $(this).removeClass("fc-state-active");
- setOpacity('Maintenance', '.5');
- } else {$(this).addClass("fc-state-active"); setOpacity('Maintenance', '1');}
- }
- });
- $("#boot").click(function(){
- if($("#poolselectbox option:selected").val() == 'defaultPool' || $("#poolselectbox option:selected").val() == 'noPool') {
- $( "#noPoolSelectedDialog" ).dialog('open');
- } else {
- if($(this).hasClass("fc-state-active")) {
- $(this).removeClass("fc-state-active");
- setOpacity('Boot', '.5');
- } else {$(this).addClass("fc-state-active"); setOpacity('Boot', '1');}
- }
- });
- $("#shutdown").click(function(){
- if($("#poolselectbox option:selected").val() == 'defaultPool' || $("#poolselectbox option:selected").val() == 'noPool') {
- $( "#noPoolSelectedDialog" ).dialog('open');
- } else {
- if($(this).hasClass("fc-state-active")) {
- $(this).removeClass("fc-state-active");
- setOpacity('Shutdown', '.5');
- } else {$(this).addClass("fc-state-active"); setOpacity('Shutdown', '1');}
- }
- });
-
- $("#addEvent").click(function(){
- addEvent();
- });
-
- $("#editEvent").click(function(){
- if(selectedEvent != null) {
- if(selectedEvent.repeat == 1) {
- $(function() {
- $( "#eventEditWdhDialog" ).dialog({
- autoOpen: false,
- width: 600,
- modal: true,
- title: 'Edit ' + selectedEvent.title,
- buttons: {
- "Cancel": function() {
- $(this).dialog("close");
- },
- "Edit just this Event": function() {
- $(this).dialog("close");
- self.location = "/event/edit/eventID/" + selectedEvent.id + "/wdh/" + 0 + "/poolID/" + $("#poolselectbox option:selected").val();
- },
- "Edit all Events": function() {
- $(this).dialog("close");
- self.location = "/event/edit/eventID/" + selectedEvent.id + "/wdh/" + 1 + "/poolID/" + $("#poolselectbox option:selected").val();
- }
- },
- open: function () {
- $(".ui-dialog-titlebar-close").hide();
- }
- });
- });
- $( "#eventEditWdhDialog" ).dialog('open');
- } else if ( selectedEvent.repeat == 0 || selectedEvent.repeat == 2 ) self.location = "/event/edit/eventID/" + selectedEvent.id + "/wdh/" + 0 + "/poolID/" + $("#poolselectbox option:selected").val();
- else if (!$.get("/event/checkright/rightShortcut/ee")) {
- $( "#errorRightsDialog" ).dialog('open');
- }
- }
- });
-
- $("#eventReportButton").click(function(){
- if(selectedEvent != null) {
- self.location="/event/showreports/eventID/" + selectedEvent.id;
- }
- });
-
- //fetch poollist from pbs database
- $.get("/event/getpoollist/", function(getpoollistresult){
- $("#poolselectbox").append(getpoollistresult);
- poolIDtmp = $("#poolselectbox option:selected").val();
- fetchPoolEvents();
- });
-
-}
-
-/*
- * Initialisation of Dialogs
- */
-
-// errorRights Dialog
- $(function() {
- $( "#errorRightsDialog" ).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");
- }
- });
- });
-
-// noPoolSelected Dialog
- $(function() {
- $( "#noPoolSelectedDialog" ).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");
- }
- });
- });
-
-// 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");
- }
- });
- });
-
-// formularOverlappingDialog Dialog
- $(function() {
- $( "#formularOverlappingDialog" ).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>
+<script
+ type="text/javascript" src="/media/js/calendar.js"></script>
<!-- DIALOG WINDOWS -->