Plugin Directory

Changeset 3307433


Ignore:
Timestamp:
06/06/2025 09:00:25 AM (10 months ago)
Author:
curato
Message:

Update Tagesansicht Belegungsplan

File:
1 edited

Legend:

Unmodified
Added
Removed
  • bookyt/trunk/js/belegungsplan.js

    r3306149 r3307433  
    1111    var stationState = {}; // { stationId: { currentDate, view } }
    1212    var defaultView = jQuery('#bookyt_belegungsplan_tabs_container').attr("view") || "month";
     13    var currentView = defaultView;
    1314
    1415    // Datum formatieren YYYY-MM-DD
     
    3738
    3839    function renderDayView(station, container) {
     40        currentView = "day";
    3941        var totalCols = 1 + 24;
    4042        var table = $('<table style="width:100%; table-layout:auto;"></table>');
    4143        var header = $('<tr></tr>');
    4244        header.append('<th></th>');
    43         for (var h = 8; h < 24; h++) {
     45        var minHour = 8;
     46        var maxHour = 23;
     47        for (var h = minHour; h <= maxHour; h++) {
    4448            var hh = (h < 10) ? "0" + h : "" + h;
    4549            header.append('<th class="small-header">' + hh + '</th>');
     
    5458                var row = $('<tr></tr>');
    5559                row.append('<td class="resource">' + res.name + '</td>');
    56                 for (var h = 0; h < 24; h++) {
     60                for (var h = minHour; h <= maxHour; h++) {
    5761                    row.append('<td data-resource="' + res.id + '" data-hour="' + h + '"></td>');
    5862                }
     
    8993
    9094    function renderWeekView(station, container) {
     95        currentView = "week";
    9196        var totalCols = 1 + 7;
    9297        var table = $('<table style="width:100%; table-layout:auto;"></table>');
     
    139144
    140145    function renderMonthView(station, container) {
     146        currentView = "month";
    141147        var current = stationState[station.id].currentDate;
    142148        var year = current.getFullYear();
     
    220226                dateObj = new Date($(this).data('date'));
    221227            }
     228            //console.log("Klicke auf freie Zelle:", catId, resourceId, dateObj);
    222229            onCellClick(catId, station.id, dateObj);
    223230        });
     
    227234    function onCellClick(categoryId, station_id, dateObj) {
    228235
    229         var vURL = data["url_frontend"] + "?fahrzeugsubgruppe_id=" + categoryId + "&station_id=" + station_id + "&start=" + dateObj.toISOString();
     236        var vURL = data["url_frontend"] + "?fahrzeugsubgruppe_id=" + categoryId + "&station_id=" + station_id + "&start=" + dateObj.toISOString()+"&view=" + currentView+"&from=wordpress";
     237        //console.log(vURL);
    230238        bookytNeueBuchung(vURL);
    231239        //alert("Leere Zelle geklickt:\nKategorie-ID: " + categoryId + "\nResource-ID: " + resourceId + "\nDatum: " + dateObj.toString());
Note: See TracChangeset for help on using the changeset viewer.