diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 76011dc04..124723aa5 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -142,7 +142,8 @@ class InfoCenter extends Auth_Controller 'getStudienjahrEnd' => array('infocenter:r', 'lehre/zgvpruefung:r'), 'setNavigationMenuArrayJson' => 'infocenter:r', 'getAbsageData' => 'infocenter:r', - 'saveAbsageForAll' => 'infocenter:rw' + 'saveAbsageForAll' => 'infocenter:rw', + 'getStudienartData' => 'infocenter:rw' ) ); @@ -159,6 +160,7 @@ class InfoCenter extends Auth_Controller $this->load->model('system/Message_model', 'MessageModel'); $this->load->model('system/Filters_model', 'FiltersModel'); $this->load->model('system/PersonLock_model', 'PersonLockModel'); + $this->load->model('organisation/Studiengang_model', 'StudiengangModel'); // Loads libraries $this->load->library('PersonLogLib'); @@ -320,12 +322,13 @@ class InfoCenter extends Auth_Controller $this->DokumentModel->addOrder('bezeichnung'); $dokumentdata = array('dokumententypen' => (getData($this->DokumentModel->load()))); - + $studienArtBerechtigung = array('studienArtBerechtigung' => array_column($this->getStudienArtBerechtigung(), 'typ')); $data = array_merge( $persondata, $prestudentdata, $dokumentdata, - $duplicate + $duplicate, + $studienArtBerechtigung ); $data[self::FHC_CONTROLLER_ID] = $this->getControllerId(); @@ -2194,18 +2197,36 @@ class InfoCenter extends Auth_Controller public function getAbsageData() { - $this->load->model('organisation/Studiengang_model', 'StudiengangModel'); + $studiengang_kz_all = $this->permissionlib->getSTG_isEntitledFor('infocenter'); + $stg_typ = $this->StudiengangModel->getStudiengangTyp($studiengang_kz_all, ['b', 'm']); - $statusgruende = $this->StatusgrundModel->getStatus(self::ABGEWIESENERSTATUS, true)->retval; - $studienSemester = $this->variablelib->getVar('infocenter_studiensemester'); - $studiengaenge = $this->StudiengangModel->getStudiengaengeWithOrgForm(['b', 'm'], $studienSemester); + if (hasData($stg_typ)) + { + $stg_typ = getData($stg_typ); + $statusgruende = $this->StatusgrundModel->getStatus(self::ABGEWIESENERSTATUS, true)->retval; + $studienSemester = $this->variablelib->getVar('infocenter_studiensemester'); + $studiengaenge = $this->StudiengangModel->getStudiengaengeWithOrgForm(array_column($stg_typ, 'typ'), $studienSemester); - $data = array ( - 'statusgruende' => $statusgruende, - 'studiengaenge' => $studiengaenge->retval - ); + $data = array ( + 'statusgruende' => $statusgruende, + 'studiengaenge' => $studiengaenge->retval + ); - $this->outputJsonSuccess($data); + $this->outputJsonSuccess($data); + } + else + $this->outputJsonSuccess(null); + } + + public function getStudienArtBerechtigung() + { + $studiengang_kz_all = $this->permissionlib->getSTG_isEntitledFor('infocenter'); + $stg_typ = $this->StudiengangModel->getStudiengangTyp($studiengang_kz_all, ['b', 'm', 'l']); + return getData($stg_typ); + } + public function getStudienartData() + { + $this->outputJsonSuccess($this->getStudienArtBerechtigung()); } public function saveAbsageForAll() diff --git a/application/models/organisation/Studiengang_model.php b/application/models/organisation/Studiengang_model.php index 0d0c248a6..e848cb4c2 100644 --- a/application/models/organisation/Studiengang_model.php +++ b/application/models/organisation/Studiengang_model.php @@ -507,4 +507,14 @@ class Studiengang_model extends DB_Model return $this->execQuery($query, array($typ, $semester)); } + + public function getStudiengangTyp($studiengang_kz, $typ) + { + $query = "SELECT DISTINCT(sgt.*) + FROM tbl_studiengangstyp sgt JOIN tbl_studiengang sg on sgt.typ = sg.typ + WHERE studiengang_kz IN ? and sgt.typ IN ?"; + + return $this->execQuery($query, array($studiengang_kz, $typ)); + + } } diff --git a/application/views/system/infocenter/zgvpruefungen.php b/application/views/system/infocenter/zgvpruefungen.php index 253145557..aed8659cd 100644 --- a/application/views/system/infocenter/zgvpruefungen.php +++ b/application/views/system/infocenter/zgvpruefungen.php @@ -124,6 +124,32 @@