mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-04 05:39:28 +00:00
Merge branch 'feature-68298/Tempus_Grundstruktur' into feature-68298/Tempus_Grundstruktur-tests
This commit is contained in:
@@ -203,21 +203,10 @@ class Kalender extends FHCAPI_Controller
|
||||
$updateFields = $this->_checkUpdate($this->_ci->input->post('updatedInfos', TRUE));
|
||||
$kalender_id = $this->_ci->input->post('kalender_id', TRUE);
|
||||
|
||||
if (isset($updateFields->ort_kurzbz) && !isEmptyString($updateFields->ort_kurzbz))
|
||||
{
|
||||
$result = $this->_ci->kalenderlib->updateOrt($kalender_id, $updateFields->ort_kurzbz);
|
||||
$result = $this->_ci->kalenderlib->updateKalenderEvent($kalender_id, $updateFields->ort_kurzbz ?? null, $updateFields->start_time ?? null, $updateFields->end_time ?? null);
|
||||
|
||||
if (isError($result))
|
||||
$this->terminateWithError(getError($result));
|
||||
}
|
||||
|
||||
if (isset($updateFields->start_time) || isset($updateFields->end_time))
|
||||
{
|
||||
$result = $this->_ci->kalenderlib->updateZeit($kalender_id, $updateFields->start_time, $updateFields->end_time);
|
||||
|
||||
if (isError($result))
|
||||
$this->terminateWithError(getError($result));
|
||||
}
|
||||
if (isError($result))
|
||||
$this->terminateWithError(getError($result));
|
||||
|
||||
$this->terminateWithSuccess('Erfolgreich');
|
||||
}
|
||||
|
||||
@@ -611,6 +611,28 @@ class KalenderLib
|
||||
);
|
||||
}
|
||||
|
||||
public function updateKalenderEvent($kalender_id, $ort_kurzbz = null, $start_time = null, $end_time = null)
|
||||
{
|
||||
if (!is_null($ort_kurzbz) && !isEmptyString($ort_kurzbz))
|
||||
{
|
||||
$result = $this->updateOrt($kalender_id, $ort_kurzbz);
|
||||
if (isError($result)) return $result;
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
$kalender_id = (getData($result)['kalender_id']) ?? getData($result);
|
||||
}
|
||||
}
|
||||
|
||||
if (!is_null($start_time) || !is_null($end_time))
|
||||
{
|
||||
$result = $this->updateZeit($kalender_id, $start_time, $end_time);
|
||||
if (isError($result)) return $result;
|
||||
}
|
||||
|
||||
return success('Erfolgreich');
|
||||
}
|
||||
|
||||
public function updateZeit($kalender_id, $start_date, $end_date)
|
||||
{
|
||||
$entryResult = $this->_loadKalenderEntry($kalender_id);
|
||||
|
||||
Reference in New Issue
Block a user