diff --git a/application/config/stv.php b/application/config/stv.php new file mode 100644 index 000000000..6296e8e6b --- /dev/null +++ b/application/config/stv.php @@ -0,0 +1,22 @@ + [ + + //all fields can be configured to be hidden, see class attribute stv-prestudent-prestudent-name for name + 'hiddenFields' => [ + + //corresponding to config-entry 'ZGV_DOKTOR_ANZEIGEN' in global.config + 'zgvdoktor_code', 'zgvdoktorort', 'zgvdoktordatum', 'zgvdoktornation', 'zgvdoktor_erfuellt', + + //corresponding to config-entry 'ZGV_ERFUELLT_ANZEIGEN' in global.config + 'zgv_erfuellt', 'zgvmas_erfuellt','zgvdoktor_erfuellt', + + //propably used by FH-Communities + 'aufnahmeschluessel', 'standort_code', 'facheinschlaegigBerufstaetig' + + ], + 'hideUDFs' => false + ] +]; \ No newline at end of file diff --git a/application/controllers/api/frontend/v1/stv/Config.php b/application/controllers/api/frontend/v1/stv/Config.php index c28c49485..97477fca7 100644 --- a/application/controllers/api/frontend/v1/stv/Config.php +++ b/application/controllers/api/frontend/v1/stv/Config.php @@ -46,11 +46,16 @@ class Config extends FHCAPI_Controller 'stv', 'konto' ]); + + // Load Config + $this->load->config('stv'); } public function student() { $result = []; + $config = $this->config->item('tabs'); + $result['details'] = [ 'title' => $this->p->t('stv', 'tab_details'), 'component' => './Stv/Studentenverwaltung/Details/Details.js' @@ -69,7 +74,8 @@ class Config extends FHCAPI_Controller ]; $result['prestudent'] = [ 'title' => $this->p->t('stv', 'tab_prestudent'), - 'component' => './Stv/Studentenverwaltung/Details/Prestudent.js' + 'component' => './Stv/Studentenverwaltung/Details/Prestudent.js', + 'config' => $config['prestudent'] ]; $result['status'] = [ 'title' => 'Status', diff --git a/application/controllers/api/frontend/v1/stv/Prestudent.php b/application/controllers/api/frontend/v1/stv/Prestudent.php index ef9aeb111..0b06b9667 100644 --- a/application/controllers/api/frontend/v1/stv/Prestudent.php +++ b/application/controllers/api/frontend/v1/stv/Prestudent.php @@ -19,6 +19,7 @@ class Prestudent extends FHCAPI_Controller 'getAufmerksamdurch' => ['admin:r', 'assistenz:r'], 'getBerufstaetigkeit' => ['admin:r', 'assistenz:r'], 'getTypenStg' => ['admin:r', 'assistenz:r'], + 'getBisstandort' => ['admin:r', 'assistenz:r'], 'getStudienplaene' => ['admin:r', 'assistenz:r'], 'getStudiengang' => ['admin:r', 'assistenz:r'] ]); @@ -265,6 +266,17 @@ class Prestudent extends FHCAPI_Controller return $this->terminateWithSuccess(getData($result) ?: []); } + public function getBisstandort() + { + $this->load->model('codex/Bisstandort_model', 'BisstandortModel'); + + $result = $this->BisstandortModel->load(); + if (isError($result)) { + $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL); + } + return $this->terminateWithSuccess(getData($result) ?: []); + } + public function getStudienplaene($prestudent_id) { $this->load->model('organisation/Studienplan_model', 'StudienplanModel'); diff --git a/application/models/codex/Bisstandort_model.php b/application/models/codex/Bisstandort_model.php new file mode 100644 index 000000000..9c7e9e45b --- /dev/null +++ b/application/models/codex/Bisstandort_model.php @@ -0,0 +1,14 @@ +dbTable = 'bis.tbl_bisstandort'; + $this->pk = 'standort_code'; + } +} diff --git a/application/views/Studentenverwaltung.php b/application/views/Studentenverwaltung.php index 2d0d22346..c8d9dc3f7 100644 --- a/application/views/Studentenverwaltung.php +++ b/application/views/Studentenverwaltung.php @@ -34,8 +34,10 @@ !defined('GENERATE_ALIAS_STUDENT') ? true : GENERATE_ALIAS_STUDENT, - 'showZgvDoktor' => !defined('ZGV_DOKTOR_ANZEIGEN') ? false : ZGV_DOKTOR_ANZEIGEN, - 'showZgvErfuellt' => !defined('ZGV_ERFUELLT_ANZEIGEN') ? false : ZGV_ERFUELLT_ANZEIGEN + + //replaced by possibility to hide each formular field via config stv.php + #'showZgvDoktor' => !defined('ZGV_DOKTOR_ANZEIGEN') ? false : ZGV_DOKTOR_ANZEIGEN, + #'showZgvErfuellt' => !defined('ZGV_ERFUELLT_ANZEIGEN') ? false : ZGV_ERFUELLT_ANZEIGEN ]; ?> diff --git a/public/js/api/stv/prestudent.js b/public/js/api/stv/prestudent.js index 4e97759f4..dd90880c5 100644 --- a/public/js/api/stv/prestudent.js +++ b/public/js/api/stv/prestudent.js @@ -1,5 +1,43 @@ export default { +//------------- Prestudent.js------------------------------------------------------ + + get(prestudent_id){ + return this.$fhcApi.post('api/frontend/v1/stv/prestudent/get/' + prestudent_id); + }, + updatePrestudent(prestudent_id, data){ + return this.$fhcApi.post('api/frontend/v1/stv/prestudent/updatePrestudent/' + prestudent_id, + data + ); + }, + getBezeichnungZGV() { + return this.$fhcApi.get('api/frontend/v1/stv/prestudent/getBezeichnungZGV/'); + }, + getBezeichnungMZgv() { + return this.$fhcApi.get('api/frontend/v1/stv/prestudent/getBezeichnungMZgv/'); + }, + getBezeichnungDZgv() { + return this.$fhcApi.get('api/frontend/v1/stv/prestudent/getBezeichnungDZgv/'); + }, + getStgs() { + return this.$fhcApi.get('api/frontend/v1/stv/lists/getStgs/'); + }, + getAusbildung() { + return this.$fhcApi.get('api/frontend/v1/stv/prestudent/getAusbildung/'); + }, + getAufmerksamdurch() { + return this.$fhcApi.get('api/frontend/v1/stv/prestudent/getAufmerksamdurch/'); + }, + getBerufstaetigkeit() { + return this.$fhcApi.get('api/frontend/v1/stv/prestudent/getBerufstaetigkeit/'); + }, + getTypenStg() { + return this.$fhcApi.get('api/frontend/v1/stv/prestudent/getTypenStg/'); + }, + getBisstandort() { + return this.$fhcApi.get('api/frontend/v1/stv/prestudent/getBisstandort/'); + }, + //------------- MultiStatus.js------------------------------------------------------ getHistoryPrestudent (url, config, params){ diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Prestudent.js b/public/js/components/Stv/Studentenverwaltung/Details/Prestudent.js index e6db926cc..46edeaaf9 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Prestudent.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Prestudent.js @@ -15,14 +15,6 @@ export default { lists: { from: 'lists' }, - showZgvErfuellt: { - from: 'configShowZgvErfuellt', - default: false - }, - showZgvDoktor: { - from: 'configShowZgvDoktor', - default: false - }, hasPrestudentPermission: { from: 'hasPrestudentPermission', default: false @@ -41,6 +33,10 @@ export default { }, props: { modelValue: Object, + config: { + type: Object, + default: {} + } }, data() { return { @@ -58,6 +54,7 @@ export default { { text: 'Nein', value: false } ], listStgTyp: [], + listBisStandort: [], initialFormData: {}, deltaArray: {}, actionUpdate: false @@ -91,8 +88,7 @@ export default { methods: { loadPrestudent() { - this.$fhcApi - .get('api/frontend/v1/stv/prestudent/get/' + this.modelValue.prestudent_id) + return this.$fhcApi.factory.stv.prestudent.get(this.modelValue.prestudent_id) .then(result => result.data) .then(result => { this.data = result; @@ -105,8 +101,7 @@ export default { this.initialFormData = {...(this.initialFormData || {}), ...udfs}; }, updatePrestudent(){ - this.$refs.form - .post('api/frontend/v1/stv/prestudent/updatePrestudent/' + this.modelValue.prestudent_id, this.deltaArray) + return this.$fhcApi.factory.stv.prestudent.updatePrestudent(this.modelValue.prestudent_id, this.deltaArray) .then(response => { this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave')); this.deltaArray = []; @@ -120,62 +115,60 @@ export default { }, created() { this.loadPrestudent(); - this.$fhcApi - .get('api/frontend/v1/stv/prestudent/getBezeichnungZGV') + this.$fhcApi.factory.stv.prestudent.getBezeichnungZGV() .then(result => result.data) .then(result => { this.listZgvs = result; }) .catch(this.$fhcAlert.handleSystemError); - this.$fhcApi - .get('api/frontend/v1/stv/prestudent/getBezeichnungMZgv') + this.$fhcApi.factory.stv.prestudent.getBezeichnungMZgv() .then(result => result.data) .then(result => { this.listZgvsmaster = result; }) .catch(this.$fhcAlert.handleSystemError); - this.$fhcApi - .get('api/frontend/v1/stv/prestudent/getBezeichnungDZgv') + this.$fhcApi.factory.stv.prestudent.getBezeichnungDZgv() .then(result => result.data) .then(result => { this.listZgvsdoktor = result; }) .catch(this.$fhcAlert.handleSystemError); - this.$fhcApi - .get('api/frontend/v1/stv/lists/getStgs') + this.$fhcApi.factory.stv.prestudent.getStgs() .then(result => result.data) .then(result => { this.listStgs = result; }) .catch(this.$fhcAlert.handleSystemError); - this.$fhcApi - .get('api/frontend/v1/stv/prestudent/getAusbildung') + this.$fhcApi.factory.stv.prestudent.getAusbildung() .then(result => result.data) .then(result => { this.listAusbildung = result; }) .catch(this.$fhcAlert.handleSystemError); - this.$fhcApi - .get('api/frontend/v1/stv/prestudent/getAufmerksamdurch') + this.$fhcApi.factory.stv.prestudent.getAufmerksamdurch() .then(result => result.data) .then(result => { this.listAufmerksamdurch = result; }) .catch(this.$fhcAlert.handleSystemError); - this.$fhcApi - .get('api/frontend/v1/stv/prestudent/getBerufstaetigkeit') + this.$fhcApi.factory.stv.prestudent.getBerufstaetigkeit() .then(result => result.data) .then(result => { this.listBerufe = result; }) .catch(this.$fhcAlert.handleSystemError); - this.$fhcApi - .get('api/frontend/v1/stv/prestudent/getTypenStg') + this.$fhcApi.factory.stv.prestudent.getTypenStg() .then(result => result.data) .then(result => { this.listStgTyp = result; }) .catch(this.$fhcAlert.handleSystemError); + this.$fhcApi.factory.stv.prestudent.getBisstandort() + .then(result => result.data) + .then(result => { + this.listBisStandort = result; + }) + .catch(this.$fhcAlert.handleSystemError); }, template: `
@@ -187,7 +180,8 @@ export default { {{$p.t('lehre', 'title_zgv')}} {{modelValue.nachname}} {{modelValue.vorname}}
{{zgv.zgv_bez}}
{{mzgv.zgvmas_bez}}
-
+
{{zgv.zgvdoktor_bez}}
-
+
-
+
PrestudentIn
{{adurch.beschreibung}} {{beruf.berufstaetigkeit_bez}}
- ` + /* TODO(chris): Ausgeblendet für Testing
- - - + +
- */` - +
- + - +
- ` + /* TODO(chris): Ausgeblendet für Testing + - */`
- + +
diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Prestudent/MultiStatus.js b/public/js/components/Stv/Studentenverwaltung/Details/Prestudent/MultiStatus.js index 6935810b1..1c2c37ec6 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Prestudent/MultiStatus.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Prestudent/MultiStatus.js @@ -154,6 +154,7 @@ export default{ layoutColumnsOnNewData: false, height: 'auto', selectable: false, + //TODO(Manu) define Persistence Id to avoid empty result array if sort index not corresponding }, tabulatorEvents: [ {