Kalender Update
* Feature Implementation Excel Export
This commit is contained in:
@@ -556,8 +556,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
$('.show-attendee').hide();
|
||||
$('#recurringCheck').prop('checked', true);
|
||||
$('#recurringCheck').change();
|
||||
if (data.data.recurrence)
|
||||
{
|
||||
if (data.data.recurrence) {
|
||||
$('#rrule-frequency').val(data.data.recurrence.recurrence.rrule_frequency);
|
||||
$('#rrule-frequency').trigger('change');
|
||||
$('#rrule-interval').val(data.data.recurrence.recurrence.rrule_interval);
|
||||
@@ -1321,26 +1320,26 @@ $(document).ready(function () {
|
||||
users.push($(this).val());
|
||||
});
|
||||
|
||||
if ($('#recurringCheck').is(':checked') && $('#rrule-frequency').val() !== '') {
|
||||
var rruleData = {};
|
||||
rruleData.rrule_frequency = $('#rrule-frequency').val();
|
||||
if ($('#recurringCheck').is(':checked') && $('#rrule-frequency').val() !== '') {
|
||||
var rruleData = {};
|
||||
rruleData.rrule_frequency = $('#rrule-frequency').val();
|
||||
|
||||
if (rruleData.rrule_frequency === 'WEEKLY') {
|
||||
// Mehrere Wochentage als Array
|
||||
rruleData['rrule-byweekday'] = $('#rrule-byweekday').val();
|
||||
} else if (rruleData.rrule_frequency === 'MONTHLY') {
|
||||
rruleData.monthly_type = $('#monthly-type').val();
|
||||
if (rruleData.monthly_type === 'BYMONTHDAY') {
|
||||
rruleData.rrule_bymonthday = $('#rrule-bymonthday').val();
|
||||
} else if (rruleData.monthly_type === 'BYSETPOS') {
|
||||
rruleData.rrule_setpos = $('#rrule-setpos').val();
|
||||
rruleData.rrule_bynweekday = $('#rrule-bynweekday').val();
|
||||
}
|
||||
if (rruleData.rrule_frequency === 'WEEKLY') {
|
||||
// Mehrere Wochentage als Array
|
||||
rruleData['rrule-byweekday'] = $('#rrule-byweekday').val();
|
||||
} else if (rruleData.rrule_frequency === 'MONTHLY') {
|
||||
rruleData.monthly_type = $('#monthly-type').val();
|
||||
if (rruleData.monthly_type === 'BYMONTHDAY') {
|
||||
rruleData.rrule_bymonthday = $('#rrule-bymonthday').val();
|
||||
} else if (rruleData.monthly_type === 'BYSETPOS') {
|
||||
rruleData.rrule_setpos = $('#rrule-setpos').val();
|
||||
rruleData.rrule_bynweekday = $('#rrule-bynweekday').val();
|
||||
}
|
||||
// Optionale Felder
|
||||
rruleData.rrule_count = $('#rrule-count').val();
|
||||
rruleData.rrule_until = $('#rrule-until').val();
|
||||
}
|
||||
// Optionale Felder
|
||||
rruleData.rrule_count = $('#rrule-count').val();
|
||||
rruleData.rrule_until = $('#rrule-until').val();
|
||||
}
|
||||
|
||||
|
||||
$.post(requestInsertUrl, {
|
||||
@@ -2094,6 +2093,63 @@ $(document).ready(function () {
|
||||
}
|
||||
});
|
||||
|
||||
$("body").on("click", ".fa-xls-calendar", function (e) {
|
||||
let checkbox = $(".calendar-check");
|
||||
let calendarFilter = $('.btn-light-search');
|
||||
let visibleCalendars = [];
|
||||
let visibleCalendarTypes = [];
|
||||
let mycalendar_id = $('#calendar-id').data('calendarid');
|
||||
visibleCalendars.push(0);
|
||||
checkbox.each(function () {
|
||||
if ($(this).prop('checked')) {
|
||||
visibleCalendars.push($(this).data('calendar_id'));
|
||||
}
|
||||
});
|
||||
calendarFilter.each(function () {
|
||||
if (!$(this).hasClass('top-search-filter')) {
|
||||
visibleCalendarTypes.push($(this).data('ctype'));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$.ajax({
|
||||
url: requestgenerateEventsxlsx,
|
||||
method: 'POST',
|
||||
data: {
|
||||
visibleCalendars: visibleCalendars,
|
||||
visibleCalendarTypes: visibleCalendarTypes
|
||||
},
|
||||
xhrFields: {
|
||||
responseType: 'blob' // Erwartet binäre Daten als Blob
|
||||
},
|
||||
success: function (data, status, xhr) {
|
||||
// Header auslesen, um den Dateinamen zu erhalten
|
||||
var disposition = xhr.getResponseHeader('Content-Disposition');
|
||||
var filename = "download.xlsx";
|
||||
if (disposition && disposition.indexOf('attachment') !== -1) {
|
||||
var filenameRegex = /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/;
|
||||
var matches = filenameRegex.exec(disposition);
|
||||
if (matches != null && matches[1]) {
|
||||
filename = matches[1].replace(/['"]/g, '');
|
||||
}
|
||||
}
|
||||
// Blob in eine URL umwandeln und Download auslösen
|
||||
var url = window.URL.createObjectURL(data);
|
||||
var a = document.createElement('a');
|
||||
a.href = url;
|
||||
a.download = filename;
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
a.remove();
|
||||
window.URL.revokeObjectURL(url);
|
||||
},
|
||||
error: function (jqXHR, status, error) {
|
||||
console.error("Download error:", error);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$("body").on("blur", ".cal-group-name-input", function (e) {
|
||||
let groupname = $.trim($(this).val());
|
||||
if (groupname.length > 3) {
|
||||
@@ -2461,7 +2517,7 @@ $(document).ready(function () {
|
||||
;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
$(document).on('focusin', function (e) {
|
||||
if ($(e.target).closest(".tox-tinymce, .tox-tinymce-aux, .moxman-window, .tam-assetmanager-root").length) {
|
||||
e.stopImmediatePropagation();
|
||||
@@ -2472,7 +2528,7 @@ $(document).ready(function () {
|
||||
$('#recurringCheck').on('change', function () {
|
||||
if ($(this).is(':checked')) {
|
||||
$('#recurring-settings').show();
|
||||
$('#rrule-until').attr('min' , $('#start-date').val());
|
||||
$('#rrule-until').attr('min', $('#start-date').val());
|
||||
} else {
|
||||
$('#recurring-settings').hide();
|
||||
$('#weekly-options').hide();
|
||||
|
||||
Reference in New Issue
Block a user