From 511864da0c7c822e5af668606190dd360cc10b20 Mon Sep 17 00:00:00 2001 From: Manuela Thamer Date: Fri, 2 Oct 2026 16:03:38 +0200 Subject: [PATCH] remove Left join, add an current($data), getting orgform elsewhere || empty --- .../controllers/api/frontend/v1/stv/Status.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/application/controllers/api/frontend/v1/stv/Status.php b/application/controllers/api/frontend/v1/stv/Status.php index 3c0a639cd..326d0b1bb 100644 --- a/application/controllers/api/frontend/v1/stv/Status.php +++ b/application/controllers/api/frontend/v1/stv/Status.php @@ -1625,7 +1625,6 @@ class Status extends FHCAPI_Controller $oldstatus = current($oldstatus); - $authUID = getAuthUID(); $now = date('c'); @@ -1663,7 +1662,6 @@ class Status extends FHCAPI_Controller $this->getDataOrTerminateWithError($result); - //Send Message $this->load->model('crm/Prestudent_model', 'PrestudentModel'); @@ -1671,18 +1669,21 @@ class Status extends FHCAPI_Controller $this->PrestudentModel->addSelect('stg.oe_kurzbz'); $this->PrestudentModel->addSelect('stg.bezeichnung AS stg_bezeichnung'); $this->PrestudentModel->addSelect('stg.email AS stg_email'); - $this->PrestudentModel->addSelect('plan.orgform_kurzbz'); +// $this->PrestudentModel->addSelect('plan.orgform_kurzbz'); $this->PrestudentModel->addSelect('typ.bezeichnung AS typ_bezeichnung'); $this->PrestudentModel->addJoin('public.tbl_person p', 'person_id'); $this->PrestudentModel->addJoin('public.tbl_studiengang stg', 'studiengang_kz'); $this->PrestudentModel->addJoin('public.tbl_studiengangstyp typ', 'typ'); - $this->PrestudentModel->addJoin('public.tbl_studienplan plan', 'studienplan_id', 'LEFT'); +// $this->PrestudentModel->addJoin('public.tbl_studienplan plan', 'studienplan_id', 'LEFT'); $result = $this->PrestudentModel->load($prestudent_id); $studentdata = $this->getDataOrTerminateWithError($result); + $studentdata = current($studentdata); + $orgform = $oldstatus->orgform_kurzbz || ''; + //TODO(Manu) test mail and check if orgform_kurzbz is necessary $this->load->library('MessageLib'); $result = $this->messagelib->sendMessageUserTemplate( $studentdata->person_id, // receiversPersonId @@ -1693,7 +1694,8 @@ class Status extends FHCAPI_Controller 'nachname' => $studentdata->nachname, 'typ' => $studentdata->typ_bezeichnung, 'studiengang' => $studentdata->stg_bezeichnung, - 'orgform' => $studentdata->orgform_kurzbz ?: $oldstatus->orgform_kurzbz, + // 'orgform' => $studentdata->orgform_kurzbz ?: $oldstatus->orgform_kurzbz, + 'orgform' => $orgform, 'stgMail' => $studentdata->stg_email ], // parseData null, // orgform @@ -1704,7 +1706,6 @@ class Status extends FHCAPI_Controller true // multiPartMime ); - $this->terminateWithSuccess(true); }