diff --git a/application/controllers/components/stv/Config.php b/application/controllers/components/stv/Config.php index efc93e3d8..5c6b52c9c 100644 --- a/application/controllers/components/stv/Config.php +++ b/application/controllers/components/stv/Config.php @@ -19,18 +19,22 @@ class Config extends FHC_Controller 'title' => 'Details', 'component' => './Stv/Studentenverwaltung/Details/Details.js' ]; + $result['notizen'] = [ + 'title' => 'Notizen', + 'component' => './Stv/Studentenverwaltung/Details/Notizen.js' + ]; $result['kontakt'] = [ 'title' => 'Kontakt', 'component' => './Stv/Studentenverwaltung/Details/Kontakt.js' ]; + $result['prestudent'] = [ + 'title' => 'PreStudentIn', + 'component' => './Stv/Studentenverwaltung/Details/Prestudent.js' + ]; $result['noten'] = [ 'title' => 'Noten', 'component' => './Stv/Studentenverwaltung/Details/Noten.js' ]; - $result['notizen'] = [ - 'title' => 'Notizen', - 'component' => './Stv/Studentenverwaltung/Details/Notizen.js' - ]; Events::trigger('stv_conf_student', function & () use (&$result) { return $result; diff --git a/application/controllers/components/stv/Prestudent.php b/application/controllers/components/stv/Prestudent.php new file mode 100644 index 000000000..c045a4be2 --- /dev/null +++ b/application/controllers/components/stv/Prestudent.php @@ -0,0 +1,110 @@ +load->library('AuthLib'); + $this->load->library('VariableLib', ['uid' => getAuthUID()]); + + // Load language phrases + /* $this->loadPhrases([ + 'ui' + ]);*/ + } + + public function get($prestudent_id) + { + $this->load->model('crm/Prestudent_model', 'PrestudentModel'); + + $this->PrestudentModel->addSelect('*'); + $result = $this->PrestudentModel->loadWhere(['prestudent_id' => $prestudent_id]); + + if (isError($result)) { + $this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR); + $this->outputJson(getError($result)); + } elseif (!hasData($result)) { + $this->output->set_status_header(REST_Controller::HTTP_NOT_FOUND); + $this->outputJson('NOT FOUND'); + } else { + $this->outputJson(current(getData($result))); + } + } + + public function getBezeichnungZgv(){ + $this->load->model('codex/Zgv_model', 'ZgvModel'); + + $this->ZgvModel->addOrder('zgv_code'); + + $result = $this->ZgvModel->load(); + if (isError($result)) { + $this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR); + } + $this->outputJson($result); + } + + public function getAusbildung(){ + $this->load->model('codex/Ausbildung_model', 'AusbildungModel'); + + $this->AusbildungModel->addOrder('ausbildungcode'); + + $result = $this->AusbildungModel->load(); + if (isError($result)) { + $this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR); + } + $this->outputJson($result); + } + + public function getAufmerksamdurch(){ + $this->load->model('codex/Aufmerksamdurch_model', 'AufmerksamdurchModel'); + + $this->AufmerksamdurchModel->addOrder('aufmerksamdurch_kurzbz'); + + $result = $this->AufmerksamdurchModel->load(); + if (isError($result)) { + $this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR); + } + $this->outputJson($result); + } + + public function getBerufstaetigkeit(){ + $this->load->model('codex/Berufstaetigkeit_model', 'BerufstaetigkeitModel'); + + $this->BerufstaetigkeitModel->addOrder('berufstaetigkeit_code'); + + $result = $this->BerufstaetigkeitModel->load(); + if (isError($result)) { + $this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR); + } + $this->outputJson($result); + } + + public function getTypenStg(){ + $this->load->model('organisation/Studiengangstyp_model', 'StudiengangstypModel'); + + $this->StudiengangstypModel->addOrder('typ'); + + $result = $this->StudiengangstypModel->load(); + if (isError($result)) { + $this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR); + } + $data = $result->retval; + + //filter NullValues + $filteredData = array_filter($data, function ($entry) { + return $entry->bezeichnung !== null; + }); + $result->retval = $filteredData; + + $this->outputJson($result); + } + + +} \ No newline at end of file diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Prestudent.js b/public/js/components/Stv/Studentenverwaltung/Details/Prestudent.js index e69de29bb..e1c6a1ccd 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Prestudent.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Prestudent.js @@ -0,0 +1,338 @@ +import {CoreRESTClient} from '../../../../RESTClient.js'; +import FormForm from '../../../Form/Form.js'; +import FormInput from '../../../Form/Input.js'; + +export default { + components: { + CoreRESTClient, + FormForm, + FormInput + }, + inject: { + lists: { + from: 'lists' + } + }, + props: { + modelValue: Object + }, + data(){ + return { + data: [], + listZgvs: [], + listStgs: [], + listAusbildung: [], + listAufmerksamdurch: [], + listBerufe: [], + listStgTyp: [], + listFoerderrelevant: [] + }; + }, + methods: { + loadData(prestudent_id){ + console.log("prestudent_id: " + prestudent_id); + return CoreRESTClient.get('components/stv/Zusatzfelder/loadData/' + prestudent_id) + .then( + result => { + if(result) + this.data = result.data.retval; + else + { + this.data = []; + this.$fhcAlert.alertError('Keine Prestudent_id ' + prestudent_id + ' gefunden'); + } + return result; + } + ); + }, + updatePrestudent() { + CoreRESTClient + .get('components/stv/Prestudent/get/' + this.modelValue.prestudent_id) + .then(result => result.data) + .then(result => { + this.data = result; + console.log(result); + }) + .catch(this.$fhcAlert.handleSystemError); + }, + }, + created() { + this.updatePrestudent(); + CoreRESTClient + .get('components/stv/Prestudent/getBezeichnungZGV') + .then(result => CoreRESTClient.getData(result.data) || []) + .then(result => { + this.listZgvs = result; + }) + .catch(this.$fhcAlert.handleSystemError); + CoreRESTClient + .get('components/stv/Lists/getStgs') + .then(result => CoreRESTClient.getData(result.data) || []) + .then(result => { + this.listStgs = result; + }) + .catch(this.$fhcAlert.handleSystemError); + CoreRESTClient + .get('components/stv/Prestudent/getAusbildung') + .then(result => CoreRESTClient.getData(result.data) || []) + .then(result => { + this.listAusbildung = result; + }) + .catch(this.$fhcAlert.handleSystemError); + CoreRESTClient + .get('components/stv/Prestudent/getAufmerksamdurch') + .then(result => CoreRESTClient.getData(result.data) || []) + .then(result => { + this.listAufmerksamdurch = result; + }) + .catch(this.$fhcAlert.handleSystemError); + CoreRESTClient + .get('components/stv/Prestudent/getBerufstaetigkeit') + .then(result => CoreRESTClient.getData(result.data) || []) + .then(result => { + this.listBerufe = result; + }) + .catch(this.$fhcAlert.handleSystemError); + CoreRESTClient + .get('components/stv/Prestudent/getTypenStg') + .then(result => CoreRESTClient.getData(result.data) || []) + .then(result => { + this.listStgTyp = result; + }) + .catch(this.$fhcAlert.handleSystemError); + }, + template: ` +
+ + +
+ Zugangsvoraussetzungen für {{modelValue.nachname}} {{modelValue.vorname}} + +
+ + + + +
+
+ + + + + + + + + + + +
+
+ + + + + + + + + + + +
+ +
+
+ PrestudentIn + +
+ + + + + + + + + +
+ +
+ + + + + + +
+ +
+ + +
+ + +
+
+ + +
+ + + + + + + +
+ +
+ +
+ +
+ {{modelValue}} +
+ {{data}} +
+ {{listStgTyp}} + + +
+ ` +}; \ No newline at end of file