From afb8011347ab9edaa9e0c3f82f68fd399f96cd36 Mon Sep 17 00:00:00 2001 From: ma0068 Date: Thu, 13 Aug 2026 12:57:49 +0200 Subject: [PATCH] bugfix manual rebuilding of Tag ZGV Missing --- .../libraries/tags/CoreMissingZgvTagLib.php | 42 ++++--------------- 1 file changed, 8 insertions(+), 34 deletions(-) diff --git a/application/libraries/tags/CoreMissingZgvTagLib.php b/application/libraries/tags/CoreMissingZgvTagLib.php index 967c80efe..2d5df0ffc 100644 --- a/application/libraries/tags/CoreMissingZgvTagLib.php +++ b/application/libraries/tags/CoreMissingZgvTagLib.php @@ -29,24 +29,6 @@ class CoreMissingZgvTagLib $this->ci->PrestudentModel->addJoin('public.tbl_benutzer bn', 'person_id'); $this->ci->PrestudentModel->addJoin('public.tbl_studiengang', 'studiengang_kz'); -/* $result = $this->ci->PrestudentModel-> loadWhere(array( - 'bn.aktiv' => true, //check if necessary - 'zgvdatum' => null, - 'typ' => 'b', - 'studiensemester_kurzbz' => $semester - )); */ - -/* $result = $this->ci->PrestudentModel-> loadWhere(array( - 'bn.aktiv' => true, //check if necessary - 'zgvmadatum' => null, - 'typ' => 'm', - 'studiensemester_kurzbz' => $semester - ));*/ - - $this->ci->PrestudentModel->addJoin('public.tbl_prestudentstatus', 'prestudent_id'); - $this->ci->PrestudentModel->addJoin('public.tbl_benutzer bn', 'person_id'); - $this->ci->PrestudentModel->addJoin('public.tbl_studiengang', 'studiengang_kz'); - $this->ci->PrestudentModel->db->group_start(); $this->ci->PrestudentModel->db->where('zgvdatum', null); @@ -89,26 +71,17 @@ class CoreMissingZgvTagLib $semester = $params['studiensemester_kurzbz']; $prestudent_id = $params['id']; + $this->ci->PrestudentModel->addSelect('prestudent_id'); + $this->ci->PrestudentModel->addSelect('start as von'); + $this->ci->PrestudentModel->addSelect('ende as bis'); $this->ci->PrestudentModel->addJoin('public.tbl_prestudentstatus', 'prestudent_id'); + + //add studiensemester also here for manual rebuild + $this->ci->PrestudentModel->addJoin('public.tbl_studiensemester', 'studiensemester_kurzbz'); + $this->ci->PrestudentModel->addJoin('public.tbl_benutzer bn', 'person_id'); $this->ci->PrestudentModel->addJoin('public.tbl_studiengang', 'studiengang_kz'); -/* $result = $this->ci->PrestudentModel->loadWhere(array( - 'bn.aktiv' => true, //check if necessary - 'zgvdatum' => null, - 'typ' => 'b', - 'studiensemester_kurzbz' => $semester, - 'prestudent_id' => $prestudent_id - )); */ - -/* $result = $this->ci->PrestudentModel->loadWhere(array( - 'bn.aktiv' => true, //check if necessary - 'zgvmadatum' => null, - 'typ' => 'm', - 'studiensemester_kurzbz' => $semester, - 'prestudent_id' => $prestudent_id - ));*/ - $this->ci->PrestudentModel->db->group_start(); $this->ci->PrestudentModel->db->where('zgvdatum', null); @@ -120,6 +93,7 @@ class CoreMissingZgvTagLib $this->ci->PrestudentModel->db->group_end(); $this->ci->PrestudentModel->db->group_end(); + $this->ci->PrestudentModel->db->limit(1); $result = $this->ci->PrestudentModel-> loadWhere(array( 'bn.aktiv' => true,