Merge branch 'spidev' into 'master'

Kalender

See merge request fronk/thetool!707
This commit is contained in:
Daniel Spitzer
2024-11-11 06:34:58 +00:00
2 changed files with 20 additions and 1 deletions

View File

@@ -62,15 +62,19 @@ class CalendarModel
{
$dbcal = self::dbKalender();
$termstring = trim($r->term);
$calendars = $r->calendars;
$termExplode = explode(" ", $termstring);
$where = "";
foreach ($termExplode as $term) {
$where .= " AND (name LIKE '%" . $term . "%' OR location LIKE '%" . $term . "%') ";
}
$where .= " AND calendar_id IN (" . implode(",",$calendars) . ")";
$res = $dbcal->select("cal_events", "id, uuid, calendar_id, user_id, start_time, end_time, timezone, all_day_event, name, description, location, repeat_end_time, reminder, ctime, mtime, muser_id, busy, status, resource_event_id, private, rrule, background, files_folder_id, read_only, category_id, exception_for_event_id, recurrence_id, is_organizer,event_type", "1=1 $where ORDER BY name");
$rows=array();
while ($data = $dbcal->fetch_array($res)) {
if ($data['location']) {
$searchName = $data['name'] . " @" . $data['location'];

View File

@@ -1328,6 +1328,21 @@ $(document).ready(function () {
language: "de",
ajax: {
url: requestEventSearchURL,
data: function (params) {
let checkbox = $(".calendar-check");
let visibleCalendars = [];
visibleCalendars.push(0);
checkbox.each(function () {
if ($(this).prop('checked')) {
visibleCalendars.push($(this).data('calendar_id'));
}
});
return {
q: params.term, // Der Suchbegriff
term: params.term, // Der Suchbegriff
calendars: visibleCalendars // Die dynamische Variable, die du hinzufügen möchtest
};
},
dataType: 'json',
delay: 250,
processResults: function (data) {