Zeiterfassung

Update:
* Abwesenheitskalender geht nun 3 Jahre in die Zukunft
This commit is contained in:
Daniel Spitzer
2024-11-19 09:27:05 +01:00
parent 20fa3f9df9
commit 6e970adac7
2 changed files with 17 additions and 5 deletions

View File

@@ -38,11 +38,17 @@ class TimerecordingReportController extends mfBaseController
$dataweek = $this->request->dataweek;
$datamonth = $this->request->datamonth;
$datayear = $this->request->datayear;
$calendar = $this->request->calendar;
if ($calendar) {
$calendar = 1;
} else {
$calendar = 0;
}
$data = [];
switch ($do) {
case "getTimerecordings":
$return = $this->getTimerecordingsApi($datatype, $dataweek, $datamonth, $datayear);
$return = $this->getTimerecordingsApi($datatype, $dataweek, $datamonth, $datayear, $calendar);
break;
case "getTimerecordingsTimes":
$return = $this->getTimerecordingsTimes($datatype, $dataweek, $datamonth, $datayear);
@@ -60,7 +66,8 @@ class TimerecordingReportController extends mfBaseController
$this->returnJson($data);
}
public function getTimerecordingsApi($datatype, $dataweek, $datamonth, $datayear)
public
function getTimerecordingsApi($datatype, $dataweek, $datamonth, $datayear, $calendar = 0)
{
$mustSeconds = 0;
$isSeconds = 0;
@@ -131,6 +138,9 @@ class TimerecordingReportController 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');
if ($calendar == "1") {
$lastdate = strtotime(" +3 years", $lastdate);
}
$searchArray = ['start' => $firstdate, 'end' => $lastdate];
$timestamp = $firstdate;