From c39f7172679b55e03be9846ab5941f109206de98 Mon Sep 17 00:00:00 2001 From: Spitzer Daniel Date: Thu, 29 Feb 2024 21:52:52 +0100 Subject: [PATCH 01/11] Zeiterfassung Update * Fix Summe bei Urlauben und Feiertagen (Buchungen und Auswertungen) --- .../Timerecording/TimerecordingController.php | 27 ++++++++++++++----- .../TimerecordingReportController.php | 20 +++++++++----- 2 files changed, 33 insertions(+), 14 deletions(-) diff --git a/application/Timerecording/TimerecordingController.php b/application/Timerecording/TimerecordingController.php index df79da385..248b6f1ea 100644 --- a/application/Timerecording/TimerecordingController.php +++ b/application/Timerecording/TimerecordingController.php @@ -538,6 +538,7 @@ class TimerecordingController extends mfBaseController $day = $daysgerm[date("w", $timerecording->start)]; $isSeconds = $isSeconds + $seconds; } else if ($timerecording->timerecordingCategory->hourday == 2 || ($timerecording->timerecordingCategory->hourday == 3 && $timerecording->end)) { + $date = date("d.m.", $timerecording->start) . " - " . $daysgerm[date("w", $timerecording->end)] . " " . date("d.m.Y", $timerecording->end); $datadate = date("Y-m-d", $timerecording->start); $enddate = date("Y-m-d", $timerecording->end); @@ -559,8 +560,11 @@ class TimerecordingController extends mfBaseController $savecounter = 0; for ($i = $starttimecalc; $i <= $endtimecalc; $i = $i + 86400) { $holidaycounter = $workingHours[date("w", $i)]; - $isSeconds = $isSeconds + $holidaycounter; - $summcounter = $summcounter + $holidaycounter; + $daycheck = date("Y-m-d", $i); + if (!$holiDay[$daycheck]) { + $isSeconds = $isSeconds + $holidaycounter; + $summcounter = $summcounter + $holidaycounter; + } if ($savecounter == 1000) { echo $savecounter; die(); @@ -575,14 +579,19 @@ class TimerecordingController extends mfBaseController } else if ($timerecording->timerecordingCategory->hourday == 3 && !$timerecording->end) { $date = date("d.m.Y", $timerecording->start) . " - " . $daysgerm[date("w", time())] . " " . date("d.m.Y", time());; $datadate = date("Y-m-d", $timerecording->start); + $enddatetemp = date("Y-m-d", time()); + $enddatetemp = strtotime($enddatetemp . " 23:59:59"); + $enddate = date("Y-m-d", $enddatetemp + 7200); $start = "-"; $end = "-"; $day = $daysgerm[date("w", $timerecording->start)]; - if ($lastdate < $timerecording->end) { + + if ($lastdate < time()) { $endtimecalc = $lastdate; } else { - $endtimecalc = $timerecording->end; + $endtimecalc = time(); } + $summcounter = 0; if ($firstdate > $timerecording->start) { $starttimecalc = $firstdate; } else { @@ -590,10 +599,14 @@ class TimerecordingController extends mfBaseController } $summcounter = 0; $savecounter = 0; +// echo $starttimecalc."
"; for ($i = $starttimecalc; $i <= $endtimecalc; $i = $i + 86400) { - $holidaycounter = $workingHours[date("w", $i)]; - $isSeconds = $isSeconds + $holidaycounter; - $summcounter = $summcounter + $holidaycounter; + $holidaycounter = $workingHours[$timerecording->user_id][date("w", $i)]; + $daycheck = date("Y-m-d", $i); + if (!$holiDay[$daycheck]) { + $isSeconds = $isSeconds + $holidaycounter; + $summcounter = $summcounter + $holidaycounter;; + } if ($savecounter == 1000) { echo $savecounter; die(); diff --git a/application/TimerecordingReport/TimerecordingReportController.php b/application/TimerecordingReport/TimerecordingReportController.php index 68a0333fc..923b37fbf 100644 --- a/application/TimerecordingReport/TimerecordingReportController.php +++ b/application/TimerecordingReport/TimerecordingReportController.php @@ -41,7 +41,7 @@ class TimerecordingReportController extends mfBaseController case "getTimerecordings": $return = $this->getTimerecordingsApi($datatype, $dataweek, $datamonth, $datayear); break; - case "getTimerecordingsTimes": + case "getTimerecordingsTimes": $return = $this->getTimerecordingsTimes($datatype, $dataweek, $datamonth, $datayear); break; default: @@ -103,7 +103,7 @@ class TimerecordingReportController extends mfBaseController $dDate = date('Y-m-d', $timestamp); $dDay = date('w', $timestamp); if (!$holiDay[$dDate]) { - // $mustSeconds = $mustSeconds + $workingHours[$dDay]; + // $mustSeconds = $mustSeconds + $workingHours[$dDay]; } $timestamp = $timestamp + 86400; @@ -120,7 +120,7 @@ class TimerecordingReportController extends mfBaseController $dDate = date('Y-m-d', $timestamp); $dDay = date('w', $timestamp); if (!$holiDay[$dDate]) { - // $mustSeconds = $mustSeconds + $workingHours[$dDay]; + // $mustSeconds = $mustSeconds + $workingHours[$dDay]; } $timestamp = $timestamp + 86400; } @@ -192,8 +192,11 @@ class TimerecordingReportController extends mfBaseController // echo $starttimecalc."
"; for ($i = $starttimecalc; $i <= $endtimecalc; $i = $i + 86400) { $holidaycounter = $workingHours[$timerecording->user_id][date("w", $i)]; - $isSeconds = $isSeconds + $holidaycounter; - $summcounter = $summcounter + $holidaycounter;; + $daycheck = date("Y-m-d", $i); + if (!$holiDay[$daycheck]) { + $isSeconds = $isSeconds + $holidaycounter; + $summcounter = $summcounter + $holidaycounter;; + } if ($savecounter == 1000) { echo $savecounter; die(); @@ -231,8 +234,11 @@ class TimerecordingReportController extends mfBaseController // echo $starttimecalc."
"; for ($i = $starttimecalc; $i <= $endtimecalc; $i = $i + 86400) { $holidaycounter = $workingHours[$timerecording->user_id][date("w", $i)]; - $isSeconds = $isSeconds + $holidaycounter; - $summcounter = $summcounter + $holidaycounter;; + $daycheck = date("Y-m-d", $i); + if (!$holiDay[$daycheck]) { + $isSeconds = $isSeconds + $holidaycounter; + $summcounter = $summcounter + $holidaycounter;; + } if ($savecounter == 1000) { echo $savecounter; die(); From cc00f70cd694b99031efaf6cea76f9d39aee51b5 Mon Sep 17 00:00:00 2001 From: Spitzer Daniel Date: Mon, 4 Mar 2024 11:51:19 +0100 Subject: [PATCH 02/11] =?UTF-8?q?Zeiterfassung=20Update=20=20*=20Soll=20ze?= =?UTF-8?q?iten=20nun=20vom=20Startdatum=20abh=C3=A4ngig=20=20*=20Neue=20S?= =?UTF-8?q?ummierung=20der=20Sollzeiten=20in=20der=20Personalverwaltung?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../default/TimerecordingEmployee/Index.php | 25 ++++++++-- .../Timerecording/TimerecordingController.php | 36 ++++++++------ .../TimerecordingEmployeeWorkingHourModel.php | 49 ++++++++++++++++++- .../TimerecordingReportController.php | 7 +-- 4 files changed, 92 insertions(+), 25 deletions(-) diff --git a/Layout/default/TimerecordingEmployee/Index.php b/Layout/default/TimerecordingEmployee/Index.php index db7d108cd..6d4534690 100644 --- a/Layout/default/TimerecordingEmployee/Index.php +++ b/Layout/default/TimerecordingEmployee/Index.php @@ -5,6 +5,14 @@ $type[3] = "Lehrling"; ?> +
@@ -71,6 +79,14 @@ $type[3] = "Lehrling"; } else { $sum = ""; } + if ($timerecordingemployees[$timerecordinguser->id]['plushours_now'] < 0) { + $plusHours = $timerecordingemployees[$timerecordinguser->id]['plushours_now'] * -1; + $plusHours = "-" . sprintf('%02dh:%02dm', floor($plusHours / 3600), floor($plusHours / 60 % 60)); + + } else { + $plusHours = $timerecordingemployees[$timerecordinguser->id]['plushours_now']; + $plusHours = sprintf('%02dh:%02dm', floor($plusHours / 3600), floor($plusHours / 60 % 60)); + } ?> @@ -79,9 +95,10 @@ $type[3] = "Lehrling"; id]['startdate']) ? date("d.m.Y", $timerecordingemployees[$timerecordinguser->id]['startdate']) : "-" ?> id]['datetimetext'] : "" ?> - id]['plushours_now']/ 3600),($timerecordingemployees[$timerecordinguser->id]['plushours_now']/ 60 % 60)) ?> - id]['overtime_now']/ 3600),($timerecordingemployees[$timerecordinguser->id]['overtime_now']/ 60 % 60)) ?> - id]['holidays_now']) ? $timerecordingemployees[$timerecordinguser->id]['holidays_now'].' Tage' : '' ?> + + id]['overtime_now'] / 3600), floor($timerecordingemployees[$timerecordinguser->id]['overtime_now'] / 60 % 60)) ?> + id]['holidays_now']) ? $timerecordingemployees[$timerecordinguser->id]['holidays_now'] . ' Tage' : '' ?> id]['auto_workinghours'] == '1') ? 'Ja' : 'Nein' ?> $timerecordingemployees[$timerecordinguser->id]['id'], "userid" => $timerecordinguser->id]) ?>"> - var hidesearch = [3,4,5,6,7,9]; + var hidesearch = [3, 4, 5, 6, 7, 9]; $(document).ready(function () { diff --git a/application/Timerecording/TimerecordingController.php b/application/Timerecording/TimerecordingController.php index 248b6f1ea..0c5af6a36 100644 --- a/application/Timerecording/TimerecordingController.php +++ b/application/Timerecording/TimerecordingController.php @@ -369,7 +369,7 @@ class TimerecordingController extends mfBaseController } } - protected function updatePlushours($userid) + public function updatePlushours($userid) { $employee = TimerecordingEmployeeModel::search(['user_id' => $userid]); if ($employee) { @@ -386,7 +386,7 @@ class TimerecordingController extends mfBaseController $endtime = strtotime($endtime . " 23:59:00"); if ($plushours_timestamp > 0) { - $return = $this->getTimerecordingsApi(5, null, null, null, $plushours_timestamp, $endtime); + $return = $this->getTimerecordingsApi(5, null, null, null, $plushours_timestamp, $endtime, $userid); $diffTime = $return['is'] - $return['must']; $plushours_now = $plushours_now + $diffTime; } else { @@ -402,22 +402,25 @@ class TimerecordingController extends mfBaseController } } - protected function getTimerecordingsApi($datatype, $dataweek, $datamonth, $datayear, $startime = null, $endtime = null) + protected function getTimerecordingsApi($datatype, $dataweek, $datamonth, $datayear, $startime = null, $endtime = null, $userid = null) { $mustSeconds = 0; $isSeconds = 0; $holiDays = 0; $plusHours = 0; - + $startdate=time(); + if (!$userid) { + $userid = $this->me->id; + } $rows = []; - $employee = TimerecordingEmployeeModel::search(['user_id' => $this->me->id]); + $employee = TimerecordingEmployeeModel::search(['user_id' => $userid]); if ($employee) { $holiDays = $employee[0]->holidays_now; $plusHours = $employee[0]->plushours_now; $auto_workinghours = $employee[0]->auto_workinghours; - + $startdate = $employee[0]->startdate; } - $workinghours = TimerecordingEmployeeWorkingHourModel::search(['user_id' => $this->me->id]); + $workinghours = TimerecordingEmployeeWorkingHourModel::search(['user_id' => $userid]); $holidays = TimerecordingHolidayModel::getAll(); foreach ($workinghours as $workinghour) { @@ -440,7 +443,7 @@ class TimerecordingController extends mfBaseController $timestamp_sonntag = strtotime("{$year}-W{$kw}-7"); $firstdate = strtotime(date("Y-m-d", $timestamp_montag) . " 00:00:00"); $lastdate = strtotime(date("Y-m-d", $timestamp_sonntag) . ' 23:59:59'); - $searchArray = ['user_id' => $this->me->id, 'start' => $timestamp_montag, 'end' => $lastdate]; + $searchArray = ['user_id' => $userid, 'start' => $timestamp_montag, 'end' => $lastdate]; $daycounter = '0'; @@ -448,7 +451,7 @@ class TimerecordingController extends mfBaseController for ($i = 1; $i <= 7; $i++) { $dDate = date('Y-m-d', $timestamp); $dDay = date('w', $timestamp); - if (!$holiDay[$dDate]) { + if (!$holiDay[$dDate] && $dDate >= date('Y-m-d', $startdate)) { $mustSeconds = $mustSeconds + $workingHours[$dDay]; } @@ -459,13 +462,13 @@ class TimerecordingController extends mfBaseController $lastdate = strtotime(date("Y-m-t", $datamonth)); $daycount = date("t", $datamonth); $lastdate = strtotime(date("Y-m-d", $lastdate) . ' 23:59:59'); - $searchArray = ['user_id' => $this->me->id, 'start' => $firstdate, 'end' => $lastdate]; + $searchArray = ['user_id' => $userid, 'start' => $firstdate, 'end' => $lastdate]; $timestamp = $firstdate; for ($i = 1; $i <= $daycount; $i++) { $dDate = date('Y-m-d', $timestamp); $dDay = date('w', $timestamp); - if (!$holiDay[$dDate]) { + if (!$holiDay[$dDate] && $dDate >= date('Y-m-d', $startdate)) { $mustSeconds = $mustSeconds + $workingHours[$dDay]; } @@ -478,7 +481,7 @@ class TimerecordingController extends mfBaseController $lastdate = strtotime(date("Y-12-31 23:59:59", $datayear)); $daycount = date("t", $datamonth); $lastdate = strtotime(date("Y-m-d", $lastdate) . ' 23:59:59'); - $searchArray = ['user_id' => $this->me->id, 'start' => $firstdate, 'end' => $lastdate]; + $searchArray = ['user_id' => $userid, 'start' => $firstdate, 'end' => $lastdate]; $timestamp = $firstdate; for ($i = 1; $i <= $daycount; $i++) { @@ -498,7 +501,7 @@ class TimerecordingController extends mfBaseController $timediff = $lastdate - $firstdate; $daycount = $timediff / 86400; $daycount = round($daycount, 0, PHP_ROUND_HALF_DOWN); - $searchArray = ['user_id' => $this->me->id, 'start' => $firstdate, 'end' => $lastdate]; + $searchArray = ['user_id' => $userid, 'start' => $firstdate, 'end' => $lastdate]; $timestamp = $firstdate; for ($i = 1; $i <= $daycount; $i++) { @@ -672,9 +675,10 @@ class TimerecordingController extends mfBaseController return $response; } else { if ($plusHours < 0) { - $plusHoursMinutes = $plusHours * -1; + $plusHours = $plusHours * -1; + $plusHours = "-" . sprintf('%02dh:%02dm', floor($plusHours / 3600), floor($plusHours / 60 % 60)); } else { - $plusHoursMinutes = $plusHours; + $plusHours = sprintf('%02dh:%02dm', floor($plusHours / 3600), floor($plusHours / 60 % 60)); } $json['success'] = true; @@ -682,7 +686,7 @@ class TimerecordingController extends mfBaseController $json['time']['is'] = sprintf('%02dh:%02dm', floor($isSeconds / 3600), floor($isSeconds / 60 % 60)); $json['time']['must'] = sprintf('%02dh:%02dm', floor($mustSeconds / 3600), floor($mustSeconds / 60 % 60)); $json['time']['holidays'] = $holiDays; - $json['time']['plushours'] = sprintf('%02dh:%02dm', floor($plusHours / 3600), floor($plusHoursMinutes / 60 % 60)); + $json['time']['plushours'] = $plusHours; $json['data'] = $rows; $json['recordsFiltered'] = $responsecount; $json['recordsTotal'] = $responsecount; diff --git a/application/TimerecordingEmployeeWorkingHour/TimerecordingEmployeeWorkingHourModel.php b/application/TimerecordingEmployeeWorkingHour/TimerecordingEmployeeWorkingHourModel.php index 4ea253a79..593f2a8ad 100644 --- a/application/TimerecordingEmployeeWorkingHour/TimerecordingEmployeeWorkingHourModel.php +++ b/application/TimerecordingEmployeeWorkingHour/TimerecordingEmployeeWorkingHourModel.php @@ -103,6 +103,8 @@ class TimerecordingEmployeeWorkingHourModel $secondcounter = 0; while ($data = $db->fetch_array($res)) { + $dayHours[$data['user_id']][$data['day']][] = $data['start'] . " - " . $data['end']; + if ($olduser != $data['user_id']) { if ($counter > 0) { $secondcounter = 0; @@ -121,7 +123,6 @@ class TimerecordingEmployeeWorkingHourModel if (!$datetimetext) { $datetimetext = $daysshort[$data['day']]; } - echo $oldstart . $data['start']; if (($oldstart != $data['start'] || $oldend != $data['end']) && $oldend) { $datetimetext .= " - " . $daysshort[$oldday] . " " . $oldstart . " - " . $oldend; $datetimetext .= "
" . $daysshort[$data['day']]; @@ -139,6 +140,51 @@ class TimerecordingEmployeeWorkingHourModel $datetimetext = TimerecordingEmployeeWorkingHourModel::cleardays($datetimetext); $items[$olduser]['datetimetext'] = $datetimetext; } + foreach ($dayHours as $key => $dayHour) { + foreach ($dayHour as $key2 => $dayHour2) { + $dayhours[$key][$key2] = implode("
", $dayHour2); + } + } + foreach ($dayhours as $key => $dayhour) { + $oldday = false; + $oldstring = false; + $counter = 0; + $oldkey = false; + $oldkey2 = false; + foreach ($dayhour as $key2 => $dayhour2) { + if ($oldday != $key2) { + if ($oldstring != $dayhour2 || $key2!=$oldkey2+1) { + if ($oldkey2) { + $daysitems[$key][$counter]['end'] = $oldkey2; + $counter++; + } + $daysitems[$key][$counter]['start'] = $key2; + } + + $daysitems[$key][$counter]['string'] = $dayhour2; + } + $oldkey2 = $key2; + $oldkey = $key; + $oldstring = $dayhour2; + + } + $daysitems[$key][$counter]['end'] = $key2; + + } + + foreach ($daysitems as $key => $daysitem) { + $datetimetext = ""; + foreach ($daysitem as $key2 => $daysItem) { + if ($daysItem['start'] != $daysItem['end']) { + $datetimetext .= '
' . $daysshort[$daysItem['start']] . "-" . $daysshort[$daysItem['end']] . '
' . $daysItem['string'] . '
'; + } else { + $datetimetext .= '
' . $daysshort[$daysItem['start']] . '
' . $daysItem['string'] . '
'; + } + } + $items[$key]['datetimetext'] = $datetimetext; + } + + return $items; } @@ -153,7 +199,6 @@ class TimerecordingEmployeeWorkingHourModel public static function getFirst() { $db = FronkDB::singleton(); - $where = self::getSqlFilter($filter); $res = $db->select("TimerecordingEmployeeWorkingHour", "*", "$where "); if ($db->num_rows($res)) { diff --git a/application/TimerecordingReport/TimerecordingReportController.php b/application/TimerecordingReport/TimerecordingReportController.php index 923b37fbf..57b4b8273 100644 --- a/application/TimerecordingReport/TimerecordingReportController.php +++ b/application/TimerecordingReport/TimerecordingReportController.php @@ -331,7 +331,7 @@ class TimerecordingReportController extends mfBaseController $holiDays = $employee[0]->holidays; $plusHours = $employee[0]->plushours; $auto_workinghours = $employee[0]->auto_workinghours; - + $startdate = $employee[0]->startdate; } $workinghours = TimerecordingEmployeeWorkingHourModel::search(['user_id' => $r->user_id]); $holidays = TimerecordingHolidayModel::getAll(); @@ -364,7 +364,8 @@ class TimerecordingReportController extends mfBaseController for ($i = 1; $i <= 7; $i++) { $dDate = date('Y-m-d', $timestamp); $dDay = date('w', $timestamp); - if (!$holiDay[$dDate]) { + + if (!$holiDay[$dDate] && $dDate >= date('Y-m-d', $startdate)) { $mustSeconds = $mustSeconds + $workingHours[$dDay]; } @@ -381,7 +382,7 @@ class TimerecordingReportController extends mfBaseController for ($i = 1; $i <= $daycount; $i++) { $dDate = date('Y-m-d', $timestamp); $dDay = date('w', $timestamp); - if (!$holiDay[$dDate]) { + if (!$holiDay[$dDate] && $dDate >= date('Y-m-d', $startdate)) { $mustSeconds = $mustSeconds + $workingHours[$dDay]; } From 65d313b6d11a176b1a4d0c3c8831a937de2c0f79 Mon Sep 17 00:00:00 2001 From: Spitzer Daniel Date: Mon, 4 Mar 2024 12:26:35 +0100 Subject: [PATCH 03/11] =?UTF-8?q?Zeiterfassung=20Update=20=20*=20Soll=20ze?= =?UTF-8?q?iten=20nun=20vom=20Startdatum=20abh=C3=A4ngig=20=20*=20Neue=20S?= =?UTF-8?q?ummierung=20der=20Sollzeiten=20in=20der=20Personalverwaltung=20?= =?UTF-8?q?=20*=20Urlaubstage=20werden=20nun=20Tage=20statt=20Stunden=20an?= =?UTF-8?q?gezeigt=20(in=20Buchungen=20und=20Auswertungen)=20=20*=20Urlaub?= =?UTF-8?q?e=20werden=20nun=20bis=201.1.2024=20ber=C3=BCcksichtigt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Timerecording/TimerecordingController.php | 22 ++++++++++++++----- .../TimerecordingReportController.php | 15 ++++++++++--- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/application/Timerecording/TimerecordingController.php b/application/Timerecording/TimerecordingController.php index 0c5af6a36..5edcce29c 100644 --- a/application/Timerecording/TimerecordingController.php +++ b/application/Timerecording/TimerecordingController.php @@ -325,7 +325,8 @@ class TimerecordingController extends mfBaseController $realholiDay[date('Y-m-d', $realHoliday->timestamp)] = $realHoliday->timestamp; } if (!$holidays_timestamp) { - $holidays_timestamp = $employee->startdate; + //$holidays_timestamp = $employee->startdate; + $holidays_timestamp = strtotime('2024-01-01 00:00:00'); $holidays_now = $holidays; } $timerecordings = TimerecordingModel::search(['user_id' => $userid, 'start' => $holidays_timestamp, 'timerecordingCategory_id' => 3]); @@ -408,7 +409,7 @@ class TimerecordingController extends mfBaseController $isSeconds = 0; $holiDays = 0; $plusHours = 0; - $startdate=time(); + $startdate = time(); if (!$userid) { $userid = $this->me->id; } @@ -527,6 +528,7 @@ class TimerecordingController extends mfBaseController $state = ""; $enddate = ""; $sum = "-"; + $day = ""; $orderdate = $timerecording->start; if ($timerecording->timerecordingCategory->hourday == 1) { @@ -561,12 +563,16 @@ class TimerecordingController extends mfBaseController } $summcounter = 0; $savecounter = 0; + $sumdays = 0; for ($i = $starttimecalc; $i <= $endtimecalc; $i = $i + 86400) { $holidaycounter = $workingHours[date("w", $i)]; $daycheck = date("Y-m-d", $i); if (!$holiDay[$daycheck]) { - $isSeconds = $isSeconds + $holidaycounter; - $summcounter = $summcounter + $holidaycounter; + if ($holidaycounter) { + $isSeconds = $isSeconds + $holidaycounter; + $summcounter = $summcounter + $holidaycounter; + $sumdays++; + } } if ($savecounter == 1000) { echo $savecounter; @@ -577,8 +583,12 @@ class TimerecordingController extends mfBaseController $seconds = $summcounter; $minutes = floor(($seconds % 3600) / 60); $hours = floor($seconds / 3600); - $sum = sprintf("%02d", $hours) . ":" . sprintf("%02d", $minutes); - +// $sum = sprintf("%02d", $hours) . ":" . sprintf("%02d", $minutes); + if ($sumdays == 1 || $sumdays == 0) { + $sum = $sumdays . " Tag"; + } else if ($sumdays > 1) { + $sum = $sumdays . " Tage"; + } } else if ($timerecording->timerecordingCategory->hourday == 3 && !$timerecording->end) { $date = date("d.m.Y", $timerecording->start) . " - " . $daysgerm[date("w", time())] . " " . date("d.m.Y", time());; $datadate = date("Y-m-d", $timerecording->start); diff --git a/application/TimerecordingReport/TimerecordingReportController.php b/application/TimerecordingReport/TimerecordingReportController.php index 57b4b8273..c2a576960 100644 --- a/application/TimerecordingReport/TimerecordingReportController.php +++ b/application/TimerecordingReport/TimerecordingReportController.php @@ -189,13 +189,17 @@ class TimerecordingReportController extends mfBaseController } $summcounter = 0; $savecounter = 0; + $sumdays = 0; // echo $starttimecalc."
"; for ($i = $starttimecalc; $i <= $endtimecalc; $i = $i + 86400) { $holidaycounter = $workingHours[$timerecording->user_id][date("w", $i)]; $daycheck = date("Y-m-d", $i); if (!$holiDay[$daycheck]) { - $isSeconds = $isSeconds + $holidaycounter; - $summcounter = $summcounter + $holidaycounter;; + if ($holidaycounter) { + $isSeconds = $isSeconds + $holidaycounter; + $summcounter = $summcounter + $holidaycounter; + $sumdays++; + } } if ($savecounter == 1000) { echo $savecounter; @@ -206,7 +210,12 @@ class TimerecordingReportController extends mfBaseController $seconds = $summcounter; $minutes = floor(($seconds % 3600) / 60); $hours = floor($seconds / 3600); - $sum = sprintf("%02d", $hours) . ":" . sprintf("%02d", $minutes); +// $sum = sprintf("%02d", $hours) . ":" . sprintf("%02d", $minutes); + if ($sumdays == 1 || $sumdays == 0) { + $sum = $sumdays . " Tag"; + } else if ($sumdays > 1) { + $sum = $sumdays . " Tage"; + } } else if ($timerecording->timerecordingCategory->hourday == 3 && !$timerecording->end) { $date = date("d.m.Y", $timerecording->start) . " - " . $daysgerm[date("w", time())] . " " . date("d.m.Y", time());; From ee5ab065d852df0d2952fcab7700d43d348ba928 Mon Sep 17 00:00:00 2001 From: Spitzer Daniel Date: Mon, 4 Mar 2024 13:57:44 +0100 Subject: [PATCH 04/11] =?UTF-8?q?Zeiterfassung=20Update=20=20*=20Neue=20mi?= =?UTF-8?q?gration=20f=C3=BCr=20Homeoffice=20=20*=20Soll=20zeiten=20nun=20?= =?UTF-8?q?vom=20Startdatum=20abh=C3=A4ngig=20=20*=20Neue=20Summierung=20d?= =?UTF-8?q?er=20Sollzeiten=20in=20der=20Personalverwaltung=20=20*=20Urlaub?= =?UTF-8?q?stage=20werden=20nun=20Tage=20statt=20Stunden=20angezeigt=20(in?= =?UTF-8?q?=20Buchungen=20und=20Auswertungen)=20=20*=20Urlaube=20werden=20?= =?UTF-8?q?nun=20bis=201.1.2024=20ber=C3=BCcksichtigt=20=20*=20Homeoffice?= =?UTF-8?q?=20Flag=20nun=20m=C3=B6glich?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Layout/default/Timerecording/Index.php | 20 ++++++-- Layout/default/TimerecordingReport/Index.php | 18 +++++-- .../Timerecording/TimerecordingController.php | 9 +++- .../Timerecording/TimerecordingModel.php | 1 + .../TimerecordingReportController.php | 3 ++ ...35_timerecording_add_fields_homeoffice.php | 31 ++++++++++++ public/js/pages/timerecording/index.js | 47 +++++++++++++++++- public/js/pages/timerecordingReport/index.js | 49 +++++++++++++++++-- 8 files changed, 164 insertions(+), 14 deletions(-) create mode 100644 db/migrations/20240304113235_timerecording_add_fields_homeoffice.php diff --git a/Layout/default/Timerecording/Index.php b/Layout/default/Timerecording/Index.php index af5b2dcee..0359e58ae 100644 --- a/Layout/default/Timerecording/Index.php +++ b/Layout/default/Timerecording/Index.php @@ -126,7 +126,9 @@ $years[time() - 31536000] = date('Y', time() - 31536000); data-approval="approval ?>" data-comment="require_comment ?>" data-hourday="hourday ?>" - data-businesstrip="businesstrip ?>">name ?> + data-businesstrip="businesstrip ?>" + data-homeoffice="hourday==1) ? 1 : 0 ?>">name ?> + @@ -179,9 +181,19 @@ $years[time() - 31536000] = date('Y', time() - 31536000);
-
+
+
-
+
+ + +
+
+ +
-
+
diff --git a/Layout/default/TimerecordingReport/Index.php b/Layout/default/TimerecordingReport/Index.php index 497c0cff0..bfbdee064 100644 --- a/Layout/default/TimerecordingReport/Index.php +++ b/Layout/default/TimerecordingReport/Index.php @@ -140,7 +140,8 @@ $years[time() - 31536000] = date('Y', time() - 31536000); data-approval="approval ?>" data-comment="require_comment ?>" data-hourday="hourday ?>" - data-businesstrip="businesstrip ?>">name ?> + data-businesstrip="businesstrip ?>" + data-homeoffice="hourday==1) ? 1 : 0 ?>">name ?> @@ -192,9 +193,18 @@ $years[time() - 31536000] = date('Y', time() - 31536000);
-
+
+
-
+
+ + +
+
+
-
+
diff --git a/application/Timerecording/TimerecordingController.php b/application/Timerecording/TimerecordingController.php index 5edcce29c..81d9215e1 100644 --- a/application/Timerecording/TimerecordingController.php +++ b/application/Timerecording/TimerecordingController.php @@ -207,10 +207,14 @@ class TimerecordingController extends mfBaseController $data['comment'] = trim($r->comment); $data['businesstrip'] = $r->businesstrip; $data['businesstrip_info'] = $r->businesstrip_info; + $data['homeoffice'] = $r->homeoffice; if (!$data['businesstrip'] || $data['businesstrip'] == "false") { $data['businesstrip'] = 0; } + if (!$data['homeoffice'] || $data['homeoffice'] == "false") { + $data['homeoffice'] = 0; + } if ($r->businesstrip == 1 && !$r->businesstrip_info) { $result['state'] = "error"; $result['error'] = "Geschäftsreiseinformationen darf nicht leer sein"; @@ -640,7 +644,9 @@ class TimerecordingController extends mfBaseController } $edit = ""; if ($timerecording->businesstrip == 1) { - $category = "" . $timerecording->timerecordingCategory->name . " (Dienstreise: " . $timerecording->businesstrip_info . ")"; + $category = "" . $timerecording->timerecordingCategory->name . " (Dienstreise: " . $timerecording->businesstrip_info . ")"; + } else if ($timerecording->homeoffice == 1) { + $category = "" . $timerecording->timerecordingCategory->name . " (Homeoffice)"; } else { $category = $timerecording->timerecordingCategory->name; } @@ -660,6 +666,7 @@ class TimerecordingController extends mfBaseController data-comment="' . $timerecording->comment . '" data-businesstrip="' . $timerecording->businesstrip . '" data-businesstripinfo="' . $timerecording->businesstrip_info . '" + data-homeoffice="' . $timerecording->homeoffice . '" title="Bearbeiten">'; else : $edit .= '
'; diff --git a/application/Timerecording/TimerecordingModel.php b/application/Timerecording/TimerecordingModel.php index cfd5833e7..5966253c4 100644 --- a/application/Timerecording/TimerecordingModel.php +++ b/application/Timerecording/TimerecordingModel.php @@ -8,6 +8,7 @@ class TimerecordingModel private $timerecordingCategory_id; private $businesstrip; private $businesstrip_info; + private $homeoffice; private $comment; private $approved; private $completed; diff --git a/application/TimerecordingReport/TimerecordingReportController.php b/application/TimerecordingReport/TimerecordingReportController.php index c2a576960..48b80efbf 100644 --- a/application/TimerecordingReport/TimerecordingReportController.php +++ b/application/TimerecordingReport/TimerecordingReportController.php @@ -269,6 +269,8 @@ class TimerecordingReportController extends mfBaseController $edit = ""; if ($timerecording->businesstrip == 1) { $category = "" . $timerecording->timerecordingCategory->name . " (Dienstreise: " . $timerecording->businesstrip_info . ")"; + } else if ($timerecording->homeoffice == 1) { + $category = "" . $timerecording->timerecordingCategory->name . " (Homeoffice)"; } else { $category = $timerecording->timerecordingCategory->name; } @@ -289,6 +291,7 @@ class TimerecordingReportController extends mfBaseController data-userid="' . $timerecording->user_id . '" data-businesstrip="' . $timerecording->businesstrip . '" data-businesstripinfo="' . $timerecording->businesstrip_info . '" + data-homeoffice="' . $timerecording->homeoffice . '" title="Bearbeiten">
'; else : $edit .= '
'; diff --git a/db/migrations/20240304113235_timerecording_add_fields_homeoffice.php b/db/migrations/20240304113235_timerecording_add_fields_homeoffice.php new file mode 100644 index 000000000..ed7060f76 --- /dev/null +++ b/db/migrations/20240304113235_timerecording_add_fields_homeoffice.php @@ -0,0 +1,31 @@ +getEnvironment() == "thetool") { + $table = $this->table("Timerecording", ["signed" => true]); + $table->addColumn("homeoffice", "integer", ["null" => false, "default" => '0', "after" => "businesstrip_info"]); + $table->update(); + } + + if($this->getEnvironment() == "addressdb") { + + } + } + + public function down(): void + { + if($this->getEnvironment() == "thetool") { + $this->table("Timerecording")->removeColumn("homeoffice")->save(); + } + + if($this->getEnvironment() == "addressdb") { + + } + } +} diff --git a/public/js/pages/timerecording/index.js b/public/js/pages/timerecording/index.js index 6bfceedec..e2bf423bb 100644 --- a/public/js/pages/timerecording/index.js +++ b/public/js/pages/timerecording/index.js @@ -224,16 +224,24 @@ $(document).ready(function () { } if (parseInt($(this).find(':selected').data('businesstrip')) === 1) { - $('#businesstrip-div').show(); + $('.businesstrip-div').show(); $('#businesstrip').prop("checked", false); $('#businesstrip_info').val(''); $('#businesstrip_info').hide(); } else { - $('#businesstrip-div').hide(); + $('.businesstrip-div').hide(); $('#businesstrip').prop("checked", false); $('#businesstrip_info').val(''); $('#businesstrip_info').hide(); } + + if (parseInt($(this).find(':selected').data('homeoffice')) === 1) { + $('#homeoffice-div').show(); + $('#homeoffice').prop("checked", false); + } else { + $('#homeoffice').prop("checked", false); + $('#homeoffice-div').hide(); + } }); $("body").on("change", "#date", function () { if ($('#enddate-div').css('display') === "block") { @@ -269,6 +277,12 @@ $(document).ready(function () { $('#businesstrip_info').val($(this).data('businesstripinfo')); $('#businesstrip_info').show(); $('#businesstrip_info').prop('required', true); + $('#homeoffice-div').hide(); + } + if ($(this).data('homeoffice') == 1) { + $('.businesstrip-div').hide(); + $('#homeoffice').prop("checked", true); + $('#homeoffice-div').show(); } $('.alert-success').remove(); window.scrollTo(0, 0); @@ -278,6 +292,12 @@ $(document).ready(function () { $('#submit-button').text('Speichern'); $('#cancel-button').hide(); $('#id').val(''); + $('.businesstrip-div').hide(); + $('#businesstrip').prop("checked", false); + $('#businesstrip_info').val(''); + $('#businesstrip_info').hide(); + $('#homeoffice').prop("checked", false); + $('#timerecordingCategory_id').change(); }); $("body").on("change", "#dataweek,#datamonth,#datayear", function () { @@ -312,15 +332,33 @@ $(document).ready(function () { if ($(this).prop('checked') == true) { $('#businesstrip_info').show(); $('#businesstrip_info').prop('required', true); + $('#homeoffice').prop('checked', false); + $('#homeoffice-div').hide(); } else { $('#businesstrip_info').hide(); $('#businesstrip_info').val(''); $('#businesstrip_info').prop('required', false); + $('#timerecordingCategory_id').change(); } }); + $("body").on("click", "#homeoffice", function () { + if ($(this).prop('checked') == true) { + $('#businesstrip').prop('checked', false); + $('.businesstrip-div').hide(); + $('#businesstrip_info').hide(); + $('#businesstrip_info').val(''); + $('#businesstrip_info').prop('required', false); + + } else { + $('#timerecordingCategory_id').change(); + } + + + }); + $("body").on("click", "#auto-workinghours-button", function () { var timestamp = $('#dataweek').val() * 1000 const date = new Date(timestamp); @@ -363,9 +401,13 @@ $(document).ready(function () { e.preventDefault(); $('#alert-box').remove(); var businesstrip = false; + var homeoffice = false; if ($('#businesstrip').prop('checked') == true) { businesstrip = 1; } + if ($('#homeoffice').prop('checked') == true) { + homeoffice = 1; + } $.post(insertUrl, { id: $.trim($('#id').val()), timerecordingCategory_id: $.trim($('#timerecordingCategory_id').val()), @@ -376,6 +418,7 @@ $(document).ready(function () { comment: $.trim($('#comment').val()), businesstrip: businesstrip, businesstrip_info: $.trim($('#businesstrip_info').val()), + homeoffice: homeoffice, hourday: $.trim($('#timerecordingCategory_id').find(':selected').data('hourday')), ajax: 1 }).done(function (data) { diff --git a/public/js/pages/timerecordingReport/index.js b/public/js/pages/timerecordingReport/index.js index e7714c9e5..b43a83b60 100644 --- a/public/js/pages/timerecordingReport/index.js +++ b/public/js/pages/timerecordingReport/index.js @@ -229,16 +229,24 @@ $(document).ready(function () { } if (parseInt($(this).find(':selected').data('businesstrip')) === 1) { - $('#businesstrip-div').show(); + $('.businesstrip-div').show(); $('#businesstrip').prop("checked", false); $('#businesstrip_info').val(''); $('#businesstrip_info').hide(); } else { - $('#businesstrip-div').hide(); + $('.businesstrip-div').hide(); $('#businesstrip').prop("checked", false); $('#businesstrip_info').val(''); $('#businesstrip_info').hide(); } + + if (parseInt($(this).find(':selected').data('homeoffice')) === 1) { + $('#homeoffice-div').show(); + $('#homeoffice').prop("checked", false); + } else { + $('#homeoffice').prop("checked", false); + $('#homeoffice-div').hide(); + } }); $("body").on("change", "#date", function () { if ($('#enddate-div').css('display') === "block") { @@ -280,18 +288,31 @@ $(document).ready(function () { $('#businesstrip_info').val($(this).data('businesstripinfo')); $('#businesstrip_info').show(); $('#businesstrip_info').prop('required', true); + $('#homeoffice-div').hide(); + } + if ($(this).data('homeoffice') == 1) { + $('.businesstrip-div').hide(); + $('#homeoffice').prop("checked", true); + $('#homeoffice-div').show(); } $('.alert-success').remove(); window.scrollTo(0, 0); }); $("body").on("click", "#cancel-button", function () { + $('#submit-button').hide().removeClass('btn-danger').addClass('btn-primary').show(); $('#submit-button').text('Speichern'); $('#cancel-button').hide(); $('#user_id_select').prop('disabled', false); $('#user_id_input').prop('disabled', true); $('#user_id_select').change(); - $('#timerecordingCategory_id').val($(this).data('category')).change(); + $('#timerecordingCategory_id').change(); $('#id').val(''); + $('.businesstrip-div').hide(); + $('#businesstrip').prop("checked", false); + $('#businesstrip_info').val(''); + $('#businesstrip_info').hide(); + $('#homeoffice').prop("checked", false); + $('#timerecordingCategory_id').change(); }); $("body").on("change", "#dataweek,#datamonth,#datayear", function () { @@ -355,11 +376,28 @@ $(document).ready(function () { if ($(this).prop('checked') == true) { $('#businesstrip_info').show(); $('#businesstrip_info').prop('required', true); + $('#homeoffice').prop('checked', false); + $('#homeoffice-div').hide(); } else { $('#businesstrip_info').hide(); $('#businesstrip_info').val(''); $('#businesstrip_info').prop('required', false); + $('#timerecordingCategory_id').change(); + } + + + }); + $("body").on("click", "#homeoffice", function () { + if ($(this).prop('checked') == true) { + $('#businesstrip').prop('checked', false); + $('.businesstrip-div').hide(); + $('#businesstrip_info').hide(); + $('#businesstrip_info').val(''); + $('#businesstrip_info').prop('required', false); + + } else { + $('#timerecordingCategory_id').change(); } @@ -382,9 +420,13 @@ $(document).ready(function () { var userid; userid = $('#user_id_select').val(); var businesstrip = false; + var homeoffice = false; if ($('#businesstrip').prop('checked') == true) { businesstrip = 1; } + if ($('#homeoffice').prop('checked') == true) { + homeoffice = 1; + } $.post(insertUrl, { id: $.trim($('#id').val()), user_id: userid, @@ -396,6 +438,7 @@ $(document).ready(function () { comment: $.trim($('#comment').val()), businesstrip: businesstrip, businesstrip_info: $.trim($('#businesstrip_info').val()), + homeoffice: homeoffice, hourday: $.trim($('#timerecordingCategory_id').find(':selected').data('hourday')), ajax: 1 }).done(function (data) { From 6e53d0f6d7205d6b53319f925d8575756e818ba8 Mon Sep 17 00:00:00 2001 From: Spitzer Daniel Date: Mon, 4 Mar 2024 14:26:03 +0100 Subject: [PATCH 05/11] =?UTF-8?q?Zeiterfassung=20Update=20=20*=20Neue=20mi?= =?UTF-8?q?gration=20f=C3=BCr=20Homeoffice=20=20*=20Soll=20zeiten=20nun=20?= =?UTF-8?q?vom=20Startdatum=20abh=C3=A4ngig=20=20*=20Neue=20Summierung=20d?= =?UTF-8?q?er=20Sollzeiten=20in=20der=20Personalverwaltung=20=20*=20Urlaub?= =?UTF-8?q?stage=20werden=20nun=20Tage=20statt=20Stunden=20angezeigt=20(in?= =?UTF-8?q?=20Buchungen=20und=20Auswertungen)=20=20*=20Urlaube=20werden=20?= =?UTF-8?q?nun=20bis=201.1.2024=20ber=C3=BCcksichtigt=20=20*=20Homeoffice?= =?UTF-8?q?=20Flag=20nun=20m=C3=B6glich=20=20*=20Abwesenheitskalender=20Si?= =?UTF-8?q?chtbar=20f=C3=BCr=20alle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Layout/default/menu.php | 2 +- application/Timerecording/TimerecordingModel.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Layout/default/menu.php b/Layout/default/menu.php index 1b45a2dfd..eb9cd226f 100644 --- a/Layout/default/menu.php +++ b/Layout/default/menu.php @@ -36,9 +36,9 @@
  • Zeiterfassung
  • - +
    - businesstrip) echo 'checked="checked"'; ?> + businesstrip) echo 'checked="checked"'; ?> type="checkbox" name="businesstrip" value="1">
    - +
    - only_admin) echo 'checked="checked"'; ?> + only_admin) echo 'checked="checked"'; ?> type="checkbox" name="only_admin" value="1">
    @@ -130,6 +136,15 @@ $('form').on('blur', 'input[type=number]', function (e) { $(this).off('wheel.disableScroll') }); + $(document).ready(function () { + $("body").on("change", "#hourday", function () { + if ($(this).val() == 5) { + $("#only_admin").prop("checked", true); + } else { + } + }); + $("#hourday").change(); + }); \ No newline at end of file diff --git a/Layout/default/TimerecordingReport/Index.php b/Layout/default/TimerecordingReport/Index.php index bfbdee064..eb85aa984 100644 --- a/Layout/default/TimerecordingReport/Index.php +++ b/Layout/default/TimerecordingReport/Index.php @@ -92,7 +92,9 @@ $years[time() - 31536000] = date('Y', time() - 31536000); .fixed-state { background-color: #d0fbd9; } - + .form-check-label { + margin-top: 2px; + }
    @@ -141,7 +143,7 @@ $years[time() - 31536000] = date('Y', time() - 31536000); data-comment="require_comment ?>" data-hourday="hourday ?>" data-businesstrip="businesstrip ?>" - data-homeoffice="hourday==1) ? 1 : 0 ?>">name ?> + data-homeoffice="hourday == 1) ? 1 : 0 ?>">name ?> @@ -186,6 +188,16 @@ $years[time() - 31536000] = date('Y', time() - 31536000);
    + +
    -
    +
    @@ -326,7 +338,7 @@ $years[time() - 31536000] = date('Y', time() - 31536000); - + diff --git a/application/Timerecording/TimerecordingController.php b/application/Timerecording/TimerecordingController.php index 81d9215e1..b05da577a 100644 --- a/application/Timerecording/TimerecordingController.php +++ b/application/Timerecording/TimerecordingController.php @@ -169,10 +169,14 @@ class TimerecordingController extends mfBaseController } else if ($hourday == 3) { $starttime = strtotime($r->date . " 00:00:00"); $endtime = NULL; + } else if ($hourday == 5) { + $starttime = strtotime($r->date . " 00:00:00"); + $endtime = strtotime($r->date . " 23:59:00"); } - - $result = $this->checkTimerecording($starttime, $endtime, $id); + if ($hourday != 5) { + $result = $this->checkTimerecording($starttime, $endtime, $id); + } if ($result['state'] == "error") { if ($r->ajax == 1) { echo json_encode($result); @@ -208,6 +212,7 @@ class TimerecordingController extends mfBaseController $data['businesstrip'] = $r->businesstrip; $data['businesstrip_info'] = $r->businesstrip_info; $data['homeoffice'] = $r->homeoffice; + $data['days'] = $r->days; if (!$data['businesstrip'] || $data['businesstrip'] == "false") { $data['businesstrip'] = 0; @@ -215,6 +220,9 @@ class TimerecordingController extends mfBaseController if (!$data['homeoffice'] || $data['homeoffice'] == "false") { $data['homeoffice'] = 0; } + if (!$data['days'] || $data['days'] == "false") { + $data['days'] = 0; + } if ($r->businesstrip == 1 && !$r->businesstrip_info) { $result['state'] = "error"; $result['error'] = "Geschäftsreiseinformationen darf nicht leer sein"; @@ -227,16 +235,36 @@ class TimerecordingController extends mfBaseController if (!$data['user_id']) { + if ($r->ajax == 1) { + $result['state'] = "error"; + $result['error'] = "Benutzer darf nicht leer sein"; + echo json_encode($result); + die(); + } $this->layout()->setFlash("Benutzer darf nicht leer sein", "error"); $this->redirect("Timerecording"); + } if ($data['start'] < 1577833200) { + if ($r->ajax == 1) { + $result['state'] = "error"; + $result['error'] = "Ungültige Startzeit"; + echo json_encode($result); + die(); + } $this->layout()->setFlash("Ungültige Startzeit", "error"); $this->redirect("Timerecording"); } if ($data['end'] && $data['end'] < 1577833200) { + if ($r->ajax == 1) { + $result['state'] = "error"; + $result['error'] = "Ungültige Endzeit"; + echo json_encode($result); + die(); + } $this->layout()->setFlash("Ungültige Endzeit", "error"); $this->redirect("Timerecording"); + } if (!$data['timerecordingCategory_id']) { $data['timerecordingCategory_id'] = NULL; @@ -294,7 +322,7 @@ class TimerecordingController extends mfBaseController $email->setTo(TT_TIMERECORDING_EMAIL); $email->send(); } - if ($data['timerecordingCategory_id'] == "3") { + if ($data['timerecordingCategory_id'] == "3" || $timerecordingCategoriess[0]->hourday == "5") { $this->updateHolidays($data['user_id']); } $this->updatePlushours($data['user_id']); @@ -334,6 +362,7 @@ class TimerecordingController extends mfBaseController $holidays_now = $holidays; } $timerecordings = TimerecordingModel::search(['user_id' => $userid, 'start' => $holidays_timestamp, 'timerecordingCategory_id' => 3]); + $timerecordingscorrections = TimerecordingModel::search(['user_id' => $userid, 'start' => $holidays_timestamp, 'days' => 1]); foreach ($timerecordings as $timerecording) { $daycounter = ($timerecording->end - $timerecording->start) / 86400; $daycounter = intval(round($daycounter, 0, PHP_ROUND_HALF_DOWN)); @@ -364,6 +393,10 @@ class TimerecordingController extends mfBaseController $holidays_now--; } } + foreach ($timerecordingscorrections as $timerecordingscorrection) { + $holidays_now = $holidays_now + $timerecordingscorrection->days; + } + if ($holidays_now != $employee->holidays_now) { $employeeupdate = new TimerecordingEmployee($employee->id); $data = []; @@ -635,6 +668,12 @@ class TimerecordingController extends mfBaseController $hours = floor($seconds / 3600); $sum = sprintf("%02d", $hours) . ":" . sprintf("%02d", $minutes); + } else if ($timerecording->timerecordingCategory->hourday == 5) { + + $start = "-"; + $end = "-"; + $day = $daysgerm[date("w", $timerecording->start)]; + $sum = $timerecording->days . " Tage"; } if ($timerecording->timerecordingCategory->approval == 1 && $timerecording->approved == 0) { diff --git a/application/Timerecording/TimerecordingModel.php b/application/Timerecording/TimerecordingModel.php index 39dd00e64..ac35e39e9 100644 --- a/application/Timerecording/TimerecordingModel.php +++ b/application/Timerecording/TimerecordingModel.php @@ -5,6 +5,7 @@ class TimerecordingModel private $user_id; private $start; private $end; + private $days; private $timerecordingCategory_id; private $businesstrip; private $businesstrip_info; @@ -158,6 +159,13 @@ class TimerecordingModel $where .= " AND `start` >= $start AND `timerecordingCategory_id` = $timerecordingCategory_id ORDER by start ASC"; } } + if (array_key_exists("start", $filter) && array_key_exists("days", $filter)) { + $days = $filter['days']; + $start = $filter['start']; + if ($days === 1) { + $where .= " AND `start` >= $start AND `days` !=0 ORDER by start ASC"; + } + } if (array_key_exists("starttime", $filter) && array_key_exists("endtime", $filter)) { diff --git a/application/TimerecordingCategory/TimerecordingCategoryModel.php b/application/TimerecordingCategory/TimerecordingCategoryModel.php index 48fca4b83..5ff7f26f5 100644 --- a/application/TimerecordingCategory/TimerecordingCategoryModel.php +++ b/application/TimerecordingCategory/TimerecordingCategoryModel.php @@ -9,7 +9,7 @@ class TimerecordingCategoryModel private $require_comment; private $only_admin; private $businesstrip; - public static $hourday_definition = array(1 => "Uhrzeit (von/bis)", 2 => "Tage (von/bis)", 3 => "Startdatum", 4 => "Enddatum"); + public static $hourday_definition = array(1 => "Uhrzeit (von/bis)", 2 => "Tage (von/bis)", 3 => "Startdatum", 4 => "Enddatum", 5 => "Anzahl Tage"); public static $approval_definition = array(0 => "Nein", 1 => "Ja"); public static $require_comment_definition = array(0 => "Nein", 1 => "Ja"); public static $businesstrip_definition = array(0 => "Nein", 1 => "Ja"); diff --git a/application/TimerecordingReport/TimerecordingReportController.php b/application/TimerecordingReport/TimerecordingReportController.php index 48b80efbf..94a275036 100644 --- a/application/TimerecordingReport/TimerecordingReportController.php +++ b/application/TimerecordingReport/TimerecordingReportController.php @@ -259,6 +259,12 @@ class TimerecordingReportController extends mfBaseController $hours = floor($seconds / 3600); $sum = sprintf("%02d", $hours) . ":" . sprintf("%02d", $minutes); + } else if ($timerecording->timerecordingCategory->hourday == 5) { + + $start = "-"; + $end = "-"; + $day = $daysgerm[date("w", $timerecording->start)]; + $sum = $timerecording->days . " Tage"; } if ($timerecording->timerecordingCategory->approval == 1 && $timerecording->approved == 0) { @@ -292,6 +298,7 @@ class TimerecordingReportController extends mfBaseController data-businesstrip="' . $timerecording->businesstrip . '" data-businesstripinfo="' . $timerecording->businesstrip_info . '" data-homeoffice="' . $timerecording->homeoffice . '" + data-days="' . $timerecording->days . '" title="Bearbeiten">'; else : $edit .= '
    '; @@ -514,6 +521,12 @@ class TimerecordingReportController extends mfBaseController $hours = floor($seconds / 3600); $sum = sprintf("%02d", $hours) . ":" . sprintf("%02d", $minutes); + } else if ($timerecording->timerecordingCategory->hourday == 5) { + + $start = "-"; + $end = "-"; + $day = $daysgerm[date("w", $timerecording->start)]; + $sum = $timerecording->days . " Tage"; } if ($timerecording->timerecordingCategory->approval == 1 && $timerecording->approved == 0) { diff --git a/db/migrations/20240304141012_timerecording_add_fields_days.php b/db/migrations/20240304141012_timerecording_add_fields_days.php new file mode 100644 index 000000000..3a6705173 --- /dev/null +++ b/db/migrations/20240304141012_timerecording_add_fields_days.php @@ -0,0 +1,31 @@ +getEnvironment() == "thetool") { + $table = $this->table("Timerecording", ["signed" => true]); + $table->addColumn("days", "integer", ["null" => false, "default" => '0', "after" => "end"]); + $table->update(); + } + + if($this->getEnvironment() == "addressdb") { + + } + } + + public function down(): void + { + if($this->getEnvironment() == "thetool") { + $this->table("Timerecording")->removeColumn("days")->save(); + } + + if($this->getEnvironment() == "addressdb") { + + } + } +} diff --git a/public/js/pages/timerecording/index.js b/public/js/pages/timerecording/index.js index e2bf423bb..62dad2845 100644 --- a/public/js/pages/timerecording/index.js +++ b/public/js/pages/timerecording/index.js @@ -135,7 +135,7 @@ table = $('#datatable').DataTable({ _: "comment.comment", "sort": "comment.order" }, - className: "text-center" + className: "text-left" }, { "data": { _: "edit.edit", diff --git a/public/js/pages/timerecordingReport/index.js b/public/js/pages/timerecordingReport/index.js index b43a83b60..8fc15eedb 100644 --- a/public/js/pages/timerecordingReport/index.js +++ b/public/js/pages/timerecordingReport/index.js @@ -139,7 +139,7 @@ table = $('#datatable').DataTable({ _: "comment.comment", "sort": "comment.order" }, - className: "text-center" + className: "text-left" }, { "data": { _: "edit.edit", @@ -195,7 +195,9 @@ $(document).ready(function () { $(this).prop("required", true); $(this).prop("min", $('#date').val()); $(this).val($('#date').val()); - }) + }); + $('#days-div').hide(); + $('#days').prop("required", false); } else if (parseInt($(this).find(':selected').data('hourday')) === 1) { $("#endtime-div").show(); $("#endtime-div").find('input').each(function () { @@ -207,7 +209,9 @@ $(document).ready(function () { $(this).prop("required", false); $(this).prop("min", ''); $(this).val(''); - }) + }); + $('#days-div').hide(); + $('#days').prop("required", false); } else if (parseInt($(this).find(':selected').data('hourday')) === 3 || parseInt($(this).find(':selected').data('hourday')) === 4) { $("#endtime-div").hide(); $("#endtime-div").find('input').each(function () { @@ -220,7 +224,25 @@ $(document).ready(function () { $(this).prop("required", false); $(this).prop("min", ''); $(this).val(''); - }) + }); + $('#days-div').hide(); + $('#days').prop("required", false); + } else if (parseInt($(this).find(':selected').data('hourday')) === 5) { + $("#endtime-div").hide(); + $("#endtime-div").find('input').each(function () { + $(this).prop("required", false); + $(this).prop("disabled", true); + + }); + $("#enddate-div").hide(); + $("#enddate-div").find('input').each(function () { + $(this).prop("required", false); + $(this).prop("min", ''); + $(this).val(''); + }); + $('#days-div').show(); + $('#days').prop("required", true); + } if (parseInt($(this).find(':selected').data('comment')) === 1) { $('#comment').prop("required", true); @@ -281,6 +303,7 @@ $(document).ready(function () { $('#date').val($(this).data('date')); $('#start').val($(this).data('start')); $('#end').val($(this).data('end')); + $('#days').val($(this).data('days')); $('#enddate').val($(this).data('enddate')); $('#comment').val($(this).data('comment')); if ($(this).data('businesstrip') == 1) { @@ -435,6 +458,7 @@ $(document).ready(function () { enddate: $.trim($('#enddate').val()), start: $.trim($('#start').val()), end: $.trim($('#end').val()), + days: $.trim($('#days').val()), comment: $.trim($('#comment').val()), businesstrip: businesstrip, businesstrip_info: $.trim($('#businesstrip_info').val()), From fd38c069e617f3737c88b379cd469a654f617e8a Mon Sep 17 00:00:00 2001 From: Spitzer Daniel Date: Tue, 5 Mar 2024 08:45:42 +0100 Subject: [PATCH 07/11] =?UTF-8?q?Zeiterfassung=20Update=20=20*=20Neue=20mi?= =?UTF-8?q?gration=20f=C3=BCr=20Homeoffice/Urlaubs=C3=A4nderungen=20=20*?= =?UTF-8?q?=20Soll=20zeiten=20nun=20vom=20Startdatum=20abh=C3=A4ngig=20=20?= =?UTF-8?q?*=20Neue=20Summierung=20der=20Sollzeiten=20in=20der=20Personalv?= =?UTF-8?q?erwaltung=20=20*=20Urlaubstage=20werden=20nun=20Tage=20statt=20?= =?UTF-8?q?Stunden=20angezeigt=20(in=20Buchungen=20und=20Auswertungen)=20?= =?UTF-8?q?=20*=20Urlaube=20werden=20nun=20bis=201.1.2024=20ber=C3=BCcksic?= =?UTF-8?q?htigt=20=20*=20Homeoffice=20Flag=20nun=20m=C3=B6glich=20=20*=20?= =?UTF-8?q?Abwesenheitskalender=20Sichtbar=20f=C3=BCr=20alle=20=20*=20Neue?= =?UTF-8?q?r=20Buchungszeitraum=20f=C3=BCr=20Urlaubsgutschrift/Urlaubsmind?= =?UTF-8?q?erung?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TimerecordingCalendar/TimerecordingCalendarController.php | 2 +- .../TimerecordingReport/TimerecordingReportController.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/application/TimerecordingCalendar/TimerecordingCalendarController.php b/application/TimerecordingCalendar/TimerecordingCalendarController.php index 699da04fe..86d8714f8 100644 --- a/application/TimerecordingCalendar/TimerecordingCalendarController.php +++ b/application/TimerecordingCalendar/TimerecordingCalendarController.php @@ -11,7 +11,7 @@ class TimerecordingCalendarController extends mfBaseController $this->me = $me; $this->layout()->set("me", $me); - if (!$me->can(["Fibu"])) { + if (!$me->is(["employee"])) { $this->redirect("Dashboard"); } } diff --git a/application/TimerecordingReport/TimerecordingReportController.php b/application/TimerecordingReport/TimerecordingReportController.php index 94a275036..6d97f26e3 100644 --- a/application/TimerecordingReport/TimerecordingReportController.php +++ b/application/TimerecordingReport/TimerecordingReportController.php @@ -11,7 +11,7 @@ class TimerecordingReportController extends mfBaseController $this->me = $me; $this->layout()->set("me", $me); - if (!$me->can(["Fibu"])) { + if (!$me->is(["employee"])) { $this->redirect("Dashboard"); } } From 0722aa026598ccb4f6ba23132f7b8abbd078b0b1 Mon Sep 17 00:00:00 2001 From: Spitzer Daniel Date: Tue, 5 Mar 2024 09:00:24 +0100 Subject: [PATCH 08/11] =?UTF-8?q?Zeiterfassung=20Update=20=20*=20Neue=20mi?= =?UTF-8?q?gration=20f=C3=BCr=20Homeoffice/Urlaubs=C3=A4nderungen=20=20*?= =?UTF-8?q?=20Soll=20zeiten=20nun=20vom=20Startdatum=20abh=C3=A4ngig=20=20?= =?UTF-8?q?*=20Neue=20Summierung=20der=20Sollzeiten=20in=20der=20Personalv?= =?UTF-8?q?erwaltung=20=20*=20Urlaubstage=20werden=20nun=20Tage=20statt=20?= =?UTF-8?q?Stunden=20angezeigt=20(in=20Buchungen=20und=20Auswertungen)=20?= =?UTF-8?q?=20*=20Urlaube=20werden=20nun=20bis=201.1.2024=20ber=C3=BCcksic?= =?UTF-8?q?htigt=20=20*=20Homeoffice=20Flag=20nun=20m=C3=B6glich=20=20*=20?= =?UTF-8?q?Abwesenheitskalender=20Sichtbar=20f=C3=BCr=20alle=20=20*=20Neue?= =?UTF-8?q?r=20Buchungszeitraum=20f=C3=BCr=20Urlaubsgutschrift/Urlaubsmind?= =?UTF-8?q?erung?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../default/TimerecordingCalendar/Index.php | 21 +++++++++++-------- .../TimerecordingReportController.php | 2 ++ 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/Layout/default/TimerecordingCalendar/Index.php b/Layout/default/TimerecordingCalendar/Index.php index 502f4d150..ae9f2b5dd 100644 --- a/Layout/default/TimerecordingCalendar/Index.php +++ b/Layout/default/TimerecordingCalendar/Index.php @@ -223,16 +223,19 @@ $daysgerm = array("So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"); } oldname = value.user.user; } - holidays.push({ - id: cindex, - backgroundColor: bgcolors[colorcount], - start: value.cstart.cstart, - end: value.cend.cend, - title: value.ccategory.ccategory + " " + value.user.user, - description: value.ccategory.ccategory + " " + value.user.user - }); + if (value.hourday.hourday!='5') { + holidays.push({ + id: cindex, + backgroundColor: bgcolors[colorcount], + start: value.cstart.cstart, + end: value.cend.cend, + title: value.ccategory.ccategory + " " + value.user.user, + description: value.ccategory.ccategory + " " + value.user.user + }); + cindex++; + } oldname = value.user.user; - cindex++; + }); var initialLocaleCode = 'en'; diff --git a/application/TimerecordingReport/TimerecordingReportController.php b/application/TimerecordingReport/TimerecordingReportController.php index 6d97f26e3..91de31b94 100644 --- a/application/TimerecordingReport/TimerecordingReportController.php +++ b/application/TimerecordingReport/TimerecordingReportController.php @@ -319,6 +319,8 @@ class TimerecordingReportController extends mfBaseController 'category' => array('category' => $category, 'order' => $timerecording->timerecordingCategory->name), 'comment' => array('comment' => $timerecording->comment, 'order' => $timerecording->comment), 'edit' => array('edit' => $edit, 'order' => $edit), + 'hourday' => array('hourday' => $timerecording->timerecordingCategory->hourday, 'order' => $timerecording->timerecordingCategory->hourday), + ); } endforeach; From 5bfe5fb4e549f1ec1c0362ef43b56bc273e344a1 Mon Sep 17 00:00:00 2001 From: Spitzer Daniel Date: Tue, 5 Mar 2024 09:09:09 +0100 Subject: [PATCH 09/11] =?UTF-8?q?Zeiterfassung=20Update=20=20*=20Neue=20mi?= =?UTF-8?q?gration=20f=C3=BCr=20Homeoffice/Urlaubs=C3=A4nderungen=20=20*?= =?UTF-8?q?=20Soll=20zeiten=20nun=20vom=20Startdatum=20abh=C3=A4ngig=20=20?= =?UTF-8?q?*=20Neue=20Summierung=20der=20Sollzeiten=20in=20der=20Personalv?= =?UTF-8?q?erwaltung=20=20*=20Urlaubstage=20werden=20nun=20Tage=20statt=20?= =?UTF-8?q?Stunden=20angezeigt=20(in=20Buchungen=20und=20Auswertungen)=20?= =?UTF-8?q?=20*=20Urlaube=20werden=20nun=20bis=201.1.2024=20ber=C3=BCcksic?= =?UTF-8?q?htigt=20=20*=20Homeoffice=20Flag=20nun=20m=C3=B6glich=20=20*=20?= =?UTF-8?q?Abwesenheitskalender=20Sichtbar=20f=C3=BCr=20alle=20=20*=20Neue?= =?UTF-8?q?r=20Buchungszeitraum=20f=C3=BCr=20Urlaubsgutschrift/Urlaubsmind?= =?UTF-8?q?erung?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/Timerecording/TimerecordingController.php | 2 +- .../TimerecordingReport/TimerecordingReportController.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/application/Timerecording/TimerecordingController.php b/application/Timerecording/TimerecordingController.php index b05da577a..b404daf9d 100644 --- a/application/Timerecording/TimerecordingController.php +++ b/application/Timerecording/TimerecordingController.php @@ -669,7 +669,7 @@ class TimerecordingController extends mfBaseController $sum = sprintf("%02d", $hours) . ":" . sprintf("%02d", $minutes); } else if ($timerecording->timerecordingCategory->hourday == 5) { - + $date = date("d.m.Y", $timerecording->start); $start = "-"; $end = "-"; $day = $daysgerm[date("w", $timerecording->start)]; diff --git a/application/TimerecordingReport/TimerecordingReportController.php b/application/TimerecordingReport/TimerecordingReportController.php index 91de31b94..0c380fed5 100644 --- a/application/TimerecordingReport/TimerecordingReportController.php +++ b/application/TimerecordingReport/TimerecordingReportController.php @@ -260,7 +260,7 @@ class TimerecordingReportController extends mfBaseController $sum = sprintf("%02d", $hours) . ":" . sprintf("%02d", $minutes); } else if ($timerecording->timerecordingCategory->hourday == 5) { - + $date = date("d.m.Y", $timerecording->start); $start = "-"; $end = "-"; $day = $daysgerm[date("w", $timerecording->start)]; From 56734edd1dc7d5b6e1c55ef47006a5b113f51f88 Mon Sep 17 00:00:00 2001 From: Spitzer Daniel Date: Tue, 5 Mar 2024 09:15:59 +0100 Subject: [PATCH 10/11] =?UTF-8?q?Zeiterfassung=20Update=20=20*=20Neue=20mi?= =?UTF-8?q?gration=20f=C3=BCr=20Homeoffice/Urlaubs=C3=A4nderungen=20=20*?= =?UTF-8?q?=20Soll=20zeiten=20nun=20vom=20Startdatum=20abh=C3=A4ngig=20=20?= =?UTF-8?q?*=20Neue=20Summierung=20der=20Sollzeiten=20in=20der=20Personalv?= =?UTF-8?q?erwaltung=20=20*=20Urlaubstage=20werden=20nun=20Tage=20statt=20?= =?UTF-8?q?Stunden=20angezeigt=20(in=20Buchungen=20und=20Auswertungen)=20?= =?UTF-8?q?=20*=20Urlaube=20werden=20nun=20bis=201.1.2024=20ber=C3=BCcksic?= =?UTF-8?q?htigt=20=20*=20Homeoffice=20Flag=20nun=20m=C3=B6glich=20=20*=20?= =?UTF-8?q?Abwesenheitskalender=20Sichtbar=20f=C3=BCr=20alle=20=20*=20Neue?= =?UTF-8?q?r=20Buchungszeitraum=20f=C3=BCr=20Urlaubsgutschrift/Urlaubsmind?= =?UTF-8?q?erung?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Timerecording/TimerecordingController.php | 14 +++++++++++++- .../TimerecordingReportController.php | 15 ++++++++++++++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/application/Timerecording/TimerecordingController.php b/application/Timerecording/TimerecordingController.php index b404daf9d..d083e071a 100644 --- a/application/Timerecording/TimerecordingController.php +++ b/application/Timerecording/TimerecordingController.php @@ -673,7 +673,19 @@ class TimerecordingController extends mfBaseController $start = "-"; $end = "-"; $day = $daysgerm[date("w", $timerecording->start)]; - $sum = $timerecording->days . " Tage"; + if ($timerecording->days > 0) { + if ($timerecording->days == 1) { + $sum = "+" . $timerecording->days . " Tag"; + } else { + $sum = "+" . $timerecording->days . " Tage"; + } + } else { + if ($timerecording->days == -1) { + $sum = $timerecording->days . " Tag"; + } else { + $sum = $timerecording->days . " Tage"; + } + } } if ($timerecording->timerecordingCategory->approval == 1 && $timerecording->approved == 0) { diff --git a/application/TimerecordingReport/TimerecordingReportController.php b/application/TimerecordingReport/TimerecordingReportController.php index 0c380fed5..892e725f9 100644 --- a/application/TimerecordingReport/TimerecordingReportController.php +++ b/application/TimerecordingReport/TimerecordingReportController.php @@ -264,7 +264,20 @@ class TimerecordingReportController extends mfBaseController $start = "-"; $end = "-"; $day = $daysgerm[date("w", $timerecording->start)]; - $sum = $timerecording->days . " Tage"; + if ($timerecording->days > 0) { + if ($timerecording->days == 1) { + $sum = "+" . $timerecording->days . " Tag"; + } else { + $sum = "+" . $timerecording->days . " Tage"; + } + } else { + if ($timerecording->days == -1) { + $sum = $timerecording->days . " Tag"; + } else { + $sum = $timerecording->days . " Tage"; + } + + } } if ($timerecording->timerecordingCategory->approval == 1 && $timerecording->approved == 0) { From 0480e1b59c56cdef0ac3f13d9018d7a14f9af19b Mon Sep 17 00:00:00 2001 From: Spitzer Daniel Date: Tue, 5 Mar 2024 10:09:49 +0100 Subject: [PATCH 11/11] =?UTF-8?q?Zeiterfassung=20Update=20=20*=20Neue=20mi?= =?UTF-8?q?gration=20f=C3=BCr=20Homeoffice/Urlaubs=C3=A4nderungen=20=20*?= =?UTF-8?q?=20Soll=20zeiten=20nun=20vom=20Startdatum=20abh=C3=A4ngig=20=20?= =?UTF-8?q?*=20Neue=20Summierung=20der=20Sollzeiten=20in=20der=20Personalv?= =?UTF-8?q?erwaltung=20=20*=20Urlaubstage=20werden=20nun=20Tage=20statt=20?= =?UTF-8?q?Stunden=20angezeigt=20(in=20Buchungen=20und=20Auswertungen)=20?= =?UTF-8?q?=20*=20Urlaube=20werden=20nun=20bis=201.1.2024=20ber=C3=BCcksic?= =?UTF-8?q?htigt=20=20*=20Homeoffice=20Flag=20nun=20m=C3=B6glich=20=20*=20?= =?UTF-8?q?Abwesenheitskalender=20Sichtbar=20f=C3=BCr=20alle=20=20*=20Neue?= =?UTF-8?q?r=20Buchungszeitraum=20f=C3=BCr=20Urlaubsgutschrift/Urlaubsmind?= =?UTF-8?q?erung?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/Timerecording/TimerecordingModel.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application/Timerecording/TimerecordingModel.php b/application/Timerecording/TimerecordingModel.php index ac35e39e9..202f7bf1c 100644 --- a/application/Timerecording/TimerecordingModel.php +++ b/application/Timerecording/TimerecordingModel.php @@ -173,10 +173,11 @@ class TimerecordingModel $endtime = $filter['endtime']; $id = $filter['id']; if (is_numeric($starttime) && is_numeric($endtime)) { - $where .= " AND (((`start` <= $starttime AND `end` > $starttime ) OR (`start` > $endtime AND `end` < $endtime) OR (`start` > $starttime AND `end` > $starttime AND `start` <= $endtime AND `end` <= $endtime) OR (`start` > $starttime AND `end` > $starttime AND `start` < $endtime AND `end` > $endtime) OR (`start` = $starttime AND `end` = $endtime )) OR ( `start` <= $starttime AND `end` IS NULL)) ORDER by user_id ASC"; if ($id && is_numeric($id)) { $where .= " AND `id` != $id"; } + $where .= " AND (((`start` <= $starttime AND `end` > $starttime ) OR (`start` > $endtime AND `end` < $endtime) OR (`start` > $starttime AND `end` > $starttime AND `start` <= $endtime AND `end` <= $endtime) OR (`start` > $starttime AND `end` > $starttime AND `start` < $endtime AND `end` > $endtime) OR (`start` = $starttime AND `end` = $endtime )) OR ( `start` <= $starttime AND `end` IS NULL)) ORDER by user_id ASC"; + //var_dump($where);exit; } }
    MitarbeiterMitarbeiter Datum Von Bis