Kalender
Update: * Abwesenheiten werden nun bei den Kalendern angezeigt
This commit is contained in:
@@ -248,22 +248,24 @@ endforeach;
|
|||||||
</div>
|
</div>
|
||||||
</h5>
|
</h5>
|
||||||
<div class="calendar-side-borders-sub-inner data-origin-2">
|
<div class="calendar-side-borders-sub-inner data-origin-2">
|
||||||
<div class="form-check text-left ml-2" data-origin="2">
|
<!-- <div style="display:none">-->
|
||||||
<input data-calendar_id="999" class="form-check-input calendar-check"
|
<!-- <div class="form-check text-left ml-2" data-origin="2">-->
|
||||||
name="form-check-input"
|
<!-- <input data-calendar_id="999" class="form-check-input calendar-check"-->
|
||||||
type="checkbox" value="">
|
<!-- name="form-check-input"-->
|
||||||
<input data-calendar_id="999" type="color"
|
<!-- type="checkbox" value="">-->
|
||||||
class="form-control-color color-input"
|
<!-- <input data-calendar_id="999" type="color"-->
|
||||||
value="<?= ($Calendar_colors[999]['bgcolor']) ?: $specialCalendarColors[999] ?>"
|
<!-- class="form-control-color color-input"-->
|
||||||
title="Hintergrundfarbe">
|
<!-- value="--><?php //= ($Calendar_colors[999]['bgcolor']) ?: $specialCalendarColors[999] ?><!--"-->
|
||||||
<input data-calendar_id="999" type="color"
|
<!-- title="Hintergrundfarbe">-->
|
||||||
class="form-control-color color-text-input"
|
<!-- <input data-calendar_id="999" type="color"-->
|
||||||
value="<?= ($Calendar_colors[999]['txtcolor']) ? $Calendar_colors[999]['txtcolor'] : '#ffffff' ?>"
|
<!-- class="form-control-color color-text-input"-->
|
||||||
title="Textfarbe">
|
<!-- value="--><?php //= ($Calendar_colors[999]['txtcolor']) ? $Calendar_colors[999]['txtcolor'] : '#ffffff' ?><!--"-->
|
||||||
<label class="calendar-side-label" for="" style="margin-top:2px;">
|
<!-- title="Textfarbe">-->
|
||||||
Abwesenheiten
|
<!-- <label class="calendar-side-label" for="" style="margin-top:2px;">-->
|
||||||
</label>
|
<!-- Abwesenheiten-->
|
||||||
</div>
|
<!-- </label>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- </div>-->
|
||||||
<div class="form-check text-left ml-2" data-origin="2">
|
<div class="form-check text-left ml-2" data-origin="2">
|
||||||
<input data-calendar_id="998" class="form-check-input calendar-check"
|
<input data-calendar_id="998" class="form-check-input calendar-check"
|
||||||
name="form-check-input"
|
name="form-check-input"
|
||||||
|
|||||||
@@ -212,6 +212,8 @@ class CalendarController extends mfBaseController
|
|||||||
$timerecordingemployees = TimerecordingEmployeeModel::getAll();
|
$timerecordingemployees = TimerecordingEmployeeModel::getAll();
|
||||||
$standardCalendarColors = CalendarModel::$standardCalendarColors;
|
$standardCalendarColors = CalendarModel::$standardCalendarColors;
|
||||||
$specialCalendarColors = CalendarModel::$specialCalendarColors;
|
$specialCalendarColors = CalendarModel::$specialCalendarColors;
|
||||||
|
|
||||||
|
|
||||||
$this->layout()->set("timerecordingemployees", $timerecordingemployees);
|
$this->layout()->set("timerecordingemployees", $timerecordingemployees);
|
||||||
$this->layout()->set("standardCalendarColors", $standardCalendarColors);
|
$this->layout()->set("standardCalendarColors", $standardCalendarColors);
|
||||||
$this->layout()->set("specialCalendarColors", $specialCalendarColors);
|
$this->layout()->set("specialCalendarColors", $specialCalendarColors);
|
||||||
|
|||||||
@@ -155,6 +155,7 @@ class CalendarModel
|
|||||||
$visibleCalendars = $r->visibleCalendars;
|
$visibleCalendars = $r->visibleCalendars;
|
||||||
if ($visibleCalendars) {
|
if ($visibleCalendars) {
|
||||||
$where .= " AND calendar_id IN (" . implode(",", $visibleCalendars) . ")";
|
$where .= " AND calendar_id IN (" . implode(",", $visibleCalendars) . ")";
|
||||||
|
$whereTimeRecording = " AND `Calendar`.`go_calendar_id` IN (" . implode(",", $visibleCalendars) . ")";
|
||||||
}
|
}
|
||||||
$sql = "SELECT `cal_events`.id, uuid, calendar_id, `cal_events`.user_id, start_time, end_time, timezone, all_day_event, `cal_events`.name,`cal_calendars`.name calendar_name, description, location, repeat_end_time, reminder, ctime,cname, mtime,mname, muser_id, busy, status, resource_event_id, private, rrule, `cal_events`.background, `cal_events`.files_folder_id, read_only, category_id, exception_for_event_id, recurrence_id, is_organizer,event_type,busy,recurrence FROM cal_events INNER JOIN `cal_calendars` ON (`cal_calendars`.`id`=`cal_events`.`calendar_id`) WHERE 1=1 $where ";
|
$sql = "SELECT `cal_events`.id, uuid, calendar_id, `cal_events`.user_id, start_time, end_time, timezone, all_day_event, `cal_events`.name,`cal_calendars`.name calendar_name, description, location, repeat_end_time, reminder, ctime,cname, mtime,mname, muser_id, busy, status, resource_event_id, private, rrule, `cal_events`.background, `cal_events`.files_folder_id, read_only, category_id, exception_for_event_id, recurrence_id, is_organizer,event_type,busy,recurrence FROM cal_events INNER JOIN `cal_calendars` ON (`cal_calendars`.`id`=`cal_events`.`calendar_id`) WHERE 1=1 $where ";
|
||||||
|
|
||||||
@@ -231,7 +232,7 @@ class CalendarModel
|
|||||||
}
|
}
|
||||||
if ($calenderRights[$data['calendar_id']]) {
|
if ($calenderRights[$data['calendar_id']]) {
|
||||||
$rights = $calenderRights[$data['calendar_id']];
|
$rights = $calenderRights[$data['calendar_id']];
|
||||||
|
$CalendarUsers[$data['calendar_id']] = $data['calendar_name'];
|
||||||
$rows[] = array(
|
$rows[] = array(
|
||||||
'id' => array('id' => $data['id']),
|
'id' => array('id' => $data['id']),
|
||||||
'cstart' => array('cstart' => $starttime),
|
'cstart' => array('cstart' => $starttime),
|
||||||
@@ -257,9 +258,59 @@ class CalendarModel
|
|||||||
'mname' => array('mname' => $data['mname']),
|
'mname' => array('mname' => $data['mname']),
|
||||||
'isorganizer' => array('isorganizer' => $data['is_organizer']),
|
'isorganizer' => array('isorganizer' => $data['is_organizer']),
|
||||||
'busy' => array('busy' => $data['busy']),
|
'busy' => array('busy' => $data['busy']),
|
||||||
|
'timerecording' => array('timerecording' => 0),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$db = FronkDB::singleton();
|
||||||
|
$sql = "SELECT `Timerecording`.`id`, `Timerecording`.`start` start_time, `Timerecording`.`end` end_time,`Calendar`.`go_calendar_id` calendar_id,`TimerecordingCategory`.`name`,`TimerecordingCategory`.`id` CategoryId,`Timerecording`.`create` ctime,`Timerecording`.`edit` mtime FROM `Timerecording`
|
||||||
|
INNER JOIN `TimerecordingCategory` ON `TimerecordingCategory`.`id`=`Timerecording`.`timerecordingCategory_id`
|
||||||
|
INNER JOIN `Calendar` ON `Calendar`.`user_id`=`Timerecording`.`user_id`
|
||||||
|
WHERE `TimerecordingCategory`.`hourday`!='1' AND `TimerecordingCategory`.`hourday`!='7' AND `TimerecordingCategory`.`hourday`!='5' $whereTimeRecording";
|
||||||
|
$res = $db->query($sql);
|
||||||
|
if ($db->num_rows($res)) {
|
||||||
|
while ($data = $db->fetch_array($res)) {
|
||||||
|
|
||||||
|
if ($calendarColors[$data['calendar_id']]['bgcolor']) {
|
||||||
|
$bgcolor = $calendarColors[$data['calendar_id']]['bgcolor'];
|
||||||
|
$txtcolor = $calendarColors[$data['calendar_id']]['txtcolor'];
|
||||||
|
} else {
|
||||||
|
$bgcolor = $standardCalendarColors[$colorCounter];
|
||||||
|
$txtcolor = "#000";
|
||||||
|
$colorCounter++;
|
||||||
|
}
|
||||||
|
if ($data['CategoryId'] != 11) {
|
||||||
|
$starttime = date("Y-m-d", $data['start_time']);
|
||||||
|
$endtime = date("Y-m-d", $data['end_time']);
|
||||||
|
if ($starttime != $endtime) {
|
||||||
|
$endtime = $data['end_time'] + 86400;
|
||||||
|
$endtime = date("Y-m-d", $endtime);
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
$starttime = date("Y-m-d H:i", $data['start_time']);
|
||||||
|
$endtime = date("Y-m-d H:i", $data['end_time']);
|
||||||
|
}
|
||||||
|
$rows[] = array(
|
||||||
|
'id' => array('id' => "9999" . $data['id']),
|
||||||
|
'category' => array('category' => $data['name']),
|
||||||
|
'ccategory' => array('ccategory' => $data['name']),
|
||||||
|
'cstart' => array('cstart' => $starttime),
|
||||||
|
'cend' => array('cend' => $endtime),
|
||||||
|
'calendar_id' => array('calendar_id' => $data['calendar_id']),
|
||||||
|
'ctime' => array('ctime' => date("d.m.Y H:i", $data['ctime'])),
|
||||||
|
'cname' => array('cname' => $CalendarUsers[$data['calendar_id']]),
|
||||||
|
'mtime' => array('mtime' => date("d.m.Y H:i", $data['mtime'])),
|
||||||
|
'mname' => array('mname' => $CalendarUsers[$data['calendar_id']]),
|
||||||
|
'description' => array('description' => ""),
|
||||||
|
'bgColor' => array('bgColor' => $bgcolor),
|
||||||
|
'txtColor' => array('txtColor' => $txtcolor),
|
||||||
|
'timerecording' => array('timerecording' => 1),
|
||||||
|
'calendar_name' => array('calendar_name' => $CalendarUsers[$data['calendar_id']]),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
$json['success'] = true;
|
$json['success'] = true;
|
||||||
$json['data'] = $rows;
|
$json['data'] = $rows;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -462,7 +462,7 @@ thead .fc-day-today .fc-scrollgrid-sync-inner .fc-col-header-cell-cushion {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.event-search-result {
|
.event-search-result {
|
||||||
box-shadow: 0px 0px 3px 3px #48ff00 !important;
|
box-shadow: 0px 0px 3px 3px #f2ff00 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-div .select2 {
|
.search-div .select2 {
|
||||||
|
|||||||
@@ -101,6 +101,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
|
|
||||||
|
|
||||||
$.each(json.data, function (index, value) {
|
$.each(json.data, function (index, value) {
|
||||||
|
if (!value.timerecording.timerecording) {
|
||||||
rrule = null;
|
rrule = null;
|
||||||
duration = null;
|
duration = null;
|
||||||
rruleflag = false;
|
rruleflag = false;
|
||||||
@@ -184,6 +185,27 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
let event = {
|
||||||
|
id: value.id.id,
|
||||||
|
start: value.cstart.cstart,
|
||||||
|
end: value.cend.cend,
|
||||||
|
title: value.category.category,
|
||||||
|
description: value.description.description,
|
||||||
|
calendar_id: value.calendar_id,
|
||||||
|
textColor: value.txtColor.txtColor,
|
||||||
|
backgroundColor: value.bgColor.bgColor,
|
||||||
|
resourceId: value.calendar_id.calendar_id,
|
||||||
|
calendar_name: value.calendar_name.calendar_name,
|
||||||
|
mtime: value.mtime.mtime,
|
||||||
|
mname: value.mname.mname,
|
||||||
|
ctime: value.ctime.ctime,
|
||||||
|
cname: value.cname.cname,
|
||||||
|
editable: false,
|
||||||
|
|
||||||
|
};
|
||||||
|
userevents.push(event);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function sleep(ms) {
|
function sleep(ms) {
|
||||||
@@ -205,8 +227,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
schedulerLicenseKey: 'CC-Attribution-NonCommercial-NoDerivatives',
|
schedulerLicenseKey: 'CC-Attribution-NonCommercial-NoDerivatives',
|
||||||
timeZone: 'UTC',
|
timeZone: 'UTC',
|
||||||
locale: 'de',
|
locale: 'de',
|
||||||
|
resourceAreaWidth: '220px',
|
||||||
|
|
||||||
themeSystem: 'bootstrap4',
|
themeSystem: 'bootstrap4',
|
||||||
snapDuration: '00:15:00',
|
snapDuration: '00:15:00',
|
||||||
selectable: true,
|
selectable: true,
|
||||||
@@ -1762,6 +1783,7 @@ Xinon GMbH`;
|
|||||||
|
|
||||||
|
|
||||||
$.each(json.data, function (index, value) {
|
$.each(json.data, function (index, value) {
|
||||||
|
if (!value.timerecording.timerecording) {
|
||||||
rrule = null;
|
rrule = null;
|
||||||
duration = null;
|
duration = null;
|
||||||
rruleflag = false;
|
rruleflag = false;
|
||||||
@@ -1838,6 +1860,28 @@ Xinon GMbH`;
|
|||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
let event = {
|
||||||
|
id: value.id.id,
|
||||||
|
start: value.cstart.cstart,
|
||||||
|
end: value.cend.cend,
|
||||||
|
title: value.category.category,
|
||||||
|
description: value.description.description,
|
||||||
|
calendar_id: value.calendar_id,
|
||||||
|
textColor: value.txtColor.txtColor,
|
||||||
|
backgroundColor: value.bgColor.bgColor,
|
||||||
|
resourceId: value.calendar_id.calendar_id,
|
||||||
|
calendar_name: value.calendar_name.calendar_name,
|
||||||
|
mtime: value.mtime.mtime,
|
||||||
|
mname: value.mname.mname,
|
||||||
|
ctime: value.ctime.ctime,
|
||||||
|
cname: value.cname.cname,
|
||||||
|
editable: false,
|
||||||
|
|
||||||
|
};
|
||||||
|
userevents.push(event);
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
calendar.addEventSource(userevents);
|
calendar.addEventSource(userevents);
|
||||||
if (visibleCalendars.includes(998)) {
|
if (visibleCalendars.includes(998)) {
|
||||||
@@ -1851,5 +1895,6 @@ Xinon GMbH`;
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
;
|
;
|
||||||
|
|||||||
Reference in New Issue
Block a user