diff --git a/application/controllers/crm/Statusgrund.php b/application/controllers/crm/Statusgrund.php
index 690e830c1..cc5b0cb7f 100644
--- a/application/controllers/crm/Statusgrund.php
+++ b/application/controllers/crm/Statusgrund.php
@@ -65,7 +65,8 @@ class Statusgrund extends Auth_Controller
public function editGrund($statusgrund_id, $update = null)
{
- $statusGrund = $this->StatusgrundModel->load($statusgrund_id);
+ $this->StatusgrundModel->addJoin('public.tbl_status_grund_status', 'statusgrund_id');
+ $statusGrund = $this->StatusgrundModel->load(array('public.tbl_status_grund.statusgrund_id' => $statusgrund_id));
if ($statusGrund->error)
{
show_error(getError($statusGrund));
diff --git a/include/statusgrund.class.php b/include/statusgrund.class.php
index 1ffe8cac9..42fd55e61 100644
--- a/include/statusgrund.class.php
+++ b/include/statusgrund.class.php
@@ -105,7 +105,8 @@ class statusgrund extends basis_db
$qry = "
SELECT
statusgrund.*,
- statusgrund.".$bezeichnung_mehrsprachig.",".$beschreibung."
+ statusgrund.".$bezeichnung_mehrsprachig.",".$beschreibung.",
+ statusgrundstatus.status_kurzbz
FROM
public.tbl_status_grund statusgrund
JOIN public.tbl_status_grund_status statusgrundstatus ON statusgrund.statusgrund_id = statusgrundstatus.statusgrund_id
diff --git a/system/dbupdate_3.4.php b/system/dbupdate_3.4.php
index 5df6684e6..736274502 100644
--- a/system/dbupdate_3.4.php
+++ b/system/dbupdate_3.4.php
@@ -349,7 +349,8 @@ $tabellen=array(
"public.tbl_rt_person" => array("rt_person_id","person_id","rt_id","studienplan_id","anmeldedatum","teilgenommen","ort_kurzbz","punkte","insertamum","insertvon","updateamum","updatevon"),
"public.tbl_rt_studienplan" => array("reihungstest_id","studienplan_id"),
"public.tbl_status" => array("status_kurzbz","beschreibung","anmerkung","ext_id","bezeichnung_mehrsprachig"),
- "public.tbl_status_grund" => array("statusgrund_id","status_kurzbz","aktiv","bezeichnung_mehrsprachig","beschreibung","statusgrund_kurzbz"),
+ "public.tbl_status_grund" => array("statusgrund_id","aktiv","bezeichnung_mehrsprachig","beschreibung","statusgrund_kurzbz"),
+ "public.tbl_status_grund_status" => array("statusgrund_id","status_kurzbz"),
"public.tbl_semesterwochen" => array("semester","studiengang_kz","wochen"),
"public.tbl_service" => array("service_id", "bezeichnung","beschreibung","ext_id","oe_kurzbz","content_id","design_uid","betrieb_uid","operativ_uid","servicekategorie_kurzbz"),
"public.tbl_servicekategorie" => array("servicekategorie_kurzbz", "bezeichnung","sort"),
diff --git a/system/dbupdate_3.4/40431_statusgrund_tabelle_zuordnung_zu_status.php b/system/dbupdate_3.4/40431_statusgrund_tabelle_zuordnung_zu_status.php
index 04ecde908..d23635ce2 100644
--- a/system/dbupdate_3.4/40431_statusgrund_tabelle_zuordnung_zu_status.php
+++ b/system/dbupdate_3.4/40431_statusgrund_tabelle_zuordnung_zu_status.php
@@ -21,12 +21,20 @@ if (!$result = @$db->db_query('SELECT 1 FROM public.tbl_status_grund_status LIMI
INSERT INTO public.tbl_status_grund_status (status_kurzbz, statusgrund_id)
SELECT status_kurzbz, statusgrund_id FROM public.tbl_status_grund;
-
- /*ALTER TABLE public.tbl_status_grund DROP COLUMN status_kurzbz;*/
';
if(!$db->db_query($qry))
echo 'public.tbl_status_grund_status: '.$db->db_last_error().'
';
else
+ {
echo 'public.tbl_status_grund_status: Tabelle hinzugefuegt
';
+
+ $qryDrop = "ALTER TABLE public.tbl_status_grund DROP COLUMN status_kurzbz;";
+
+ if(!$db->db_query($qryDrop))
+ echo 'public.tbl_status_grund: '.$db->db_last_error().'
';
+ else
+ echo 'public.tbl_status_grund: Spalte status_kurzbz entfernt.
';
+ }
+
}
\ No newline at end of file