diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 8d03b247f..7be4826c9 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -151,6 +151,7 @@ class InfoCenter extends Auth_Controller 'getAbsageData' => 'infocenter:r', 'saveAbsageForAll' => 'infocenter:rw', 'deleteDoc' => 'infocenter:rw', + 'getStudienartData' => 'infocenter:rw' ) ); @@ -167,6 +168,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'); @@ -328,12 +330,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(); @@ -2242,18 +2245,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 @@