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;