<%@language = "javascript" %>
<% /*
    $Revision$
    $Id$

    File:               shared/fullcalendar.asp
    Description:        Toont een standaard calendar met daarin de events gepresenteerd
                        zoals die door de "worker" worden opgeleverd.
                        Die worker levert JSON gegevens op die dynamisch worden opgehaald.

    Context:
    Notes:              De toegestane workers zijn hier gewhitelist.

*/
DOCTYPE_Disable = 1;
%>
<!--#include file="../Shared/common.inc" -->
<!--#include file="../Shared/iface.inc" -->
<%
 var pworker = getQParamSafe("worker");

 var lworker = "";
 // whitelist tevens vertaaltabel
 switch (pworker)
 {
    case "faclist" : lworker = "../fac/fac_list_worker.asp"; break;
    case "mldlist" : lworker = "../mld/mld_melding_worker.asp?bk="+getQParamInt("bk");
                     break;
    case "opdrlist" : lworker = "../mld/mld_opdr_worker.asp"; break;
    // Leuk zou zijn om hier een exit te hebben die een usrrap als worker kan definieren worker=usrrap en workerkey=usrrapkey
}

 FCLTHeader.Requires({plugins: ["jQuery"],
                      js:      ["date.js", "jQuery-ui.js", "../Localscripts/fullcalendar/fullcalendar.min.js"],
                      css:     ["../Localscripts/fullcalendar/fullcalendar.css"]});
%>
<html>
<head>
<%
    FCLTHeader.Generate()
%>
    <style>
    .loading
            {
                padding: 10px;
                font-size: 1em;
                line-height: 1.9em;
            }
    </style>
    <script type='text/javascript'>
        var events = [];

        $(document).ready(function() {
            $('#calendar').fullCalendar({
                events: "<%= lworker%>",
                firstDay : 1,
                minTime: 7,
                weekMode: 'liquid',
                header: {
                    left: 'today',
                    center: 'prev title next',
                    right: 'month,agendaWeek'
                },
                editable: false,
                timeFormat: 'H:mm',
                axisFormat: 'H:mm',
                buttonText: {
                    prev:     '&nbsp;&#9668;&nbsp;',  // left triangle
                    next:     '&nbsp;&#9658;&nbsp;',  // right triangle
                    prevYear: '&nbsp;&lt;&lt;&nbsp;', // <<
                    nextYear: '&nbsp;&gt;&gt;&nbsp;', // >>
                    today:    L("lcl_today"),
                    month:    L("lcl_month"),
                    week:     L("lcl_week"),
                    day:      L("lcl_day")
                },
                columnFormat: {
                    month: 'ddd',    // Mon
                    week: 'ddd d MMM', // Mon 9/7
                    day: 'dddd d MMM'  // Monday 9/7
                },
                titleFormat: {
                    month: 'MMMM yyyy',                             // September 2009
                    week: "d[ MMM][ yyyy]{ '&#8212;' d  MMM yyyy}", // 7 - 13 Sep 2009
                    day: 'dddd d MMMM yyyy'                        // Dinsdag 8 Sep 2009
                },
                dayNames: calendar_names.days,
                dayNamesMin: calendar_names.daysMin,
                dayNamesShort: calendar_names.daysMin,
                monthNamesShort: calendar_names.monthsShort,
                monthNames: calendar_names.months,
                weekMin: calendar_names.weekMin,
                eventClick: function(evt) {
                    if (evt.fclturl)
                        FcltMgr.openDetail(evt.fclturl);
                },
                loading: function ( isLoading, view )
    		    {
		            if (!$("span.loading").length)
		                $("td.fc-header-left").append("<span class='loading'><%=L("lcl_shared_loading")%></span>");
  		            $("span.loading").css('visibility', isLoading?'visible':'hidden');
    		    },
                dayClick: function() {
                }
            });
        });
    </script>
</head>

<body>
<div id="calendar"><div>
</body>
</html>
