From 35e2a47fea240edd46229b8213fe5272cefaa3e2 Mon Sep 17 00:00:00 2001 From: Daniel Spitzer Date: Tue, 20 Aug 2024 11:20:17 +0200 Subject: [PATCH] =?UTF-8?q?Zeiterfassung=20Feature=20=20*=20Feature=20Upda?= =?UTF-8?q?te=20Reporting:=20nach=20Datum=20zwischen=20einer=20Zeitraumsbu?= =?UTF-8?q?chung=20kann=20nun=20gesucht=20werden=20=20*=20Bugfix=20Kranken?= =?UTF-8?q?st=C3=A4nde=20werden=20nun=20in=20den=20richtigen=20Zeitr=C3=A4?= =?UTF-8?q?umen=20dargestellt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TimerecordingReportController.php | 29 +++++++++++++++---- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/application/TimerecordingReport/TimerecordingReportController.php b/application/TimerecordingReport/TimerecordingReportController.php index 0f45e3353..894d02267 100644 --- a/application/TimerecordingReport/TimerecordingReportController.php +++ b/application/TimerecordingReport/TimerecordingReportController.php @@ -2,7 +2,8 @@ class TimerecordingReportController extends mfBaseController { -private $holidays ; + private $holidays; + protected function init() { $this->needlogin = true; @@ -14,7 +15,7 @@ private $holidays ; if (!$me->is(["employee"])) { $this->redirect("Dashboard"); } - $this->holidays=TimerecordingHolidayModel::getAll(); + $this->holidays = TimerecordingHolidayModel::getAll(); } protected function indexAction() @@ -153,6 +154,7 @@ private $holidays ; $timerecordings = TimerecordingModel::search($searchArray); $responsecount = count($timerecordings); foreach ($timerecordings as $timerecording): + $hiderecording = 0; $state = ""; $enddate = ""; $sum = "-"; @@ -171,7 +173,7 @@ private $holidays ; $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 + 7200); $start = "-"; @@ -193,7 +195,11 @@ private $holidays ; $savecounter = 0; $sumdays = 0; // echo $starttimecalc."
"; + $hidedate = ""; + $hcounter = 0; for ($i = $starttimecalc; $i <= $endtimecalc; $i = $i + 86400) { + $hidedate .= date("d.m.Y", $i) . " "; + $holidaycounter = $workingHours[$timerecording->user_id][date("w", $i)]; $daycheck = date("Y-m-d", $i); if (!$holiDay[$daycheck]) { @@ -208,7 +214,10 @@ private $holidays ; die(); } $savecounter++; + $hcounter++; } + $hidedate .= ""; + $date = date("d.m.", $timerecording->start) . " - " . $daysgerm[date("w", $timerecording->end)] . " " . date("d.m.Y", $timerecording->end) . $hidedate; $seconds = $summcounter; $minutes = floor(($seconds % 3600) / 60); $hours = floor($seconds / 3600); @@ -220,7 +229,7 @@ private $holidays ; } } 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"); @@ -244,7 +253,10 @@ private $holidays ; $summcounter = 0; $savecounter = 0; // echo $starttimecalc."
"; + $hidedate = ""; + $hcounter = 0; for ($i = $starttimecalc; $i <= $endtimecalc; $i = $i + 86400) { + $hidedate .= date("d.m.Y", $i) . " "; $holidaycounter = $workingHours[$timerecording->user_id][date("w", $i)]; $daycheck = date("Y-m-d", $i); if (!$holiDay[$daycheck]) { @@ -256,6 +268,12 @@ private $holidays ; die(); } $savecounter++; + $hcounter++; + } + $hidedate .= ""; + $date = date("d.m.Y", $timerecording->start) . " - " . $daysgerm[date("w", time())] . " " . date("d.m.Y", time()) . $hidedate;; + if ($timerecording->start > $lastdate) { + $hiderecording = 1; } $seconds = $summcounter; $minutes = floor(($seconds % 3600) / 60); @@ -357,6 +375,7 @@ private $holidays ; $edit .= ''; endif; if ($datatype == 3 && ($timerecording->timerecordingCategory->hourday == 1 || $timerecording->timerecordingCategory->hourday == 7 || $timerecording->timerecordingCategory->hourday == 5)) { + } else if ($hiderecording == 1) { } else { if (!$enddatecend) { $enddatecend = $enddate; @@ -599,7 +618,7 @@ private $holidays ; if ($oldday != date('Y-m-d', $timerecording->start)) { if ($homeoffice == 1) { - $homeofficesum ++; + $homeofficesum++; $homeoffice = false; } $homeoffice = false;