From eccd827c716afea1b5d0a16050399df39827c419 Mon Sep 17 00:00:00 2001 From: ma0068 Date: Fri, 15 Nov 2024 11:14:58 +0100 Subject: [PATCH] adaptions and additions cleanup tasks according to task 54312 --- application/config/stv.php | 28 +- .../api/frontend/v1/stv/Address.php | 6 +- .../api/frontend/v1/stv/Kontakt.php | 93 +++-- application/core/Notiz_Controller.php | 1 + public/js/api/notiz/person.js | 8 +- public/js/api/stv/kontakt.js | 1 - public/js/api/stv/prestudent.js | 28 +- public/js/api/stv/status.js | 21 +- .../Betriebsmittel/Betriebsmittel.js | 12 + public/js/components/Notiz/Notiz.js | 43 ++- .../js/components/Stv/Studentenverwaltung.js | 2 - .../Studentenverwaltung/Details/Details.js | 40 +- .../Details/Kontakt/Address.js | 105 ++--- .../Details/Kontakt/Bankaccount.js | 37 +- .../Details/Kontakt/Contact.js | 20 +- .../Studentenverwaltung/Details/Prestudent.js | 2 +- .../Details/Prestudent/MultiStatus.js | 18 +- system/phrasesupdate.php | 361 ++++++++++++++++++ 18 files changed, 634 insertions(+), 192 deletions(-) diff --git a/application/config/stv.php b/application/config/stv.php index 8b7792e83..78613cd40 100644 --- a/application/config/stv.php +++ b/application/config/stv.php @@ -13,16 +13,30 @@ $config['tabs'] = //all fields can be configured to be hidden, see class attribute stv-details-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 +]; + +// List of fields to show when ZGV_DOKTOR_ANZEIGEN is defined +$fieldsZgvDoktor = ['zgvdoktorort', 'zgvdoktordatum', 'zgvdoktornation', 'zgvdoktor_erfuellt', 'zgvdoktor_code']; + +// List of fields to show when ZGV_ERFUELLT_ANZEIGEN is defined +$fieldsZgvErfuellt = ['zgv_erfuellt', 'zgvmas_erfuellt','zgvdoktor_erfuellt']; + +//order important: to show zgf_erfuellt_doktor just in case visibility of doktor is true +if (!defined('ZGV_ERFUELLT_ANZEIGEN') || !ZGV_ERFUELLT_ANZEIGEN) { + $config['tabs']['prestudent']['hiddenFields'] = array_merge( + $config['tabs']['prestudent']['hiddenFields'], $fieldsZgvErfuellt + ); +} + +if (!defined('ZGV_DOKTOR_ANZEIGEN') || !ZGV_DOKTOR_ANZEIGEN) { + $config['tabs']['prestudent']['hiddenFields'] = array_merge( + $config['tabs']['prestudent']['hiddenFields'], + $fieldsZgvDoktor + ); +} diff --git a/application/controllers/api/frontend/v1/stv/Address.php b/application/controllers/api/frontend/v1/stv/Address.php index 48a3a3aa0..324e306f3 100644 --- a/application/controllers/api/frontend/v1/stv/Address.php +++ b/application/controllers/api/frontend/v1/stv/Address.php @@ -47,17 +47,13 @@ class Address extends FHCAPI_Controller public function getPlaces($plz = null) { - //TODO(Manu) check with Chris - if (!$plz){ - $plz = $this->input->post('plz'); - } $this->load->model('codex/Gemeinde_model', 'GemeindeModel'); $this->load->library('form_validation'); $this->form_validation->set_data(['address.plz' => $plz]); - $this->form_validation->set_rules('address.plz', 'PLZ', 'numeric|less_than[10000]'); + $this->form_validation->set_rules('address.plz', 'PLZ', 'required|numeric|less_than[10000]'); if (!$this->form_validation->run()) $this->terminateWithValidationErrors($this->form_validation->error_array()); diff --git a/application/controllers/api/frontend/v1/stv/Kontakt.php b/application/controllers/api/frontend/v1/stv/Kontakt.php index 1bc751a27..f02073e2b 100644 --- a/application/controllers/api/frontend/v1/stv/Kontakt.php +++ b/application/controllers/api/frontend/v1/stv/Kontakt.php @@ -97,9 +97,6 @@ class Kontakt extends FHCAPI_Controller || $this->router->method == 'deleteContact' || $this->router->method == 'deleteBankverbindung' ) { - - //TODO(manu) build all new with postparamater - if($this->input->post('address_id')) $id = $this->input->post('address_id'); if($this->input->post('adresse_id')) @@ -109,11 +106,6 @@ class Kontakt extends FHCAPI_Controller if($this->input->post('kontakt_id')) $id = $this->input->post('kontakt_id'); - //$id = current(array_slice($this->uri->rsegments, 2)); - // $id = $this->input->post('address_id') || $this->input->post('adresse_id'); - //$id: no more uri parameter - // $this->terminateWithError($this->router->method, self::ERROR_TYPE_GENERAL); - $model = 'person/Adresse_model'; if ($this->router->method == 'loadContact' || $this->router->method == 'updateContact' @@ -140,7 +132,12 @@ class Kontakt extends FHCAPI_Controller } public function getAdressen($person_id) { - $this->AdresseModel->addSelect('public.tbl_adresse.*'); + $this->AdresseModel->addSelect("public.tbl_adresse.*, + TO_CHAR (CASE + WHEN public.tbl_adresse.updateamum >= public.tbl_adresse.insertamum + THEN public.tbl_adresse.updateamum + ELSE public.tbl_adresse.insertamum + END::timestamp, 'DD.MM.YYYY HH24:MI:SS') AS lastUpdate"); $this->AdresseModel->addSelect('t.*'); $this->AdresseModel->addSelect('f.firma_id'); $this->AdresseModel->addSelect('f.name as firmenname'); @@ -158,15 +155,19 @@ class Kontakt extends FHCAPI_Controller public function addNewAddress($person_id) { - $this->form_validation->set_rules('plz', 'PLZ', 'required|numeric', [ + $this->form_validation->set_data(['address.plz' => $_POST['plz']]); + + $this->form_validation->set_rules('address.plz', 'PLZ', 'required|numeric', [ 'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'PLZ']), 'numeric' => $this->p->t('ui', 'error_fieldNotNumeric', ['field' => 'PLZ']) ]); - if(isset($_POST['gemeinde']) && isset($_POST['ort'])) - $this->form_validation->set_rules('plz', 'Postleitzahl', 'callback_validateLocationCombination', [ - 'validateLocationCombination' => $this->p->t('ui', 'error_location_combination') - ]); + if(isset($_POST['gemeinde']) && isset($_POST['ort']) && isset($_POST['nation']) && $_POST['nation'] == 'A') + { + $this->form_validation->set_rules('address.plz', 'Postleitzahl', 'callback_validateLocationCombination', [ + 'validateLocationCombination' => $this->p->t('ui', 'error_location_combination') + ]); + } if ($this->form_validation->run() == false) { @@ -211,28 +212,30 @@ class Kontakt extends FHCAPI_Controller ] ); - if (isError($result)) - { - return $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL); - } - return $this->outputJsonSuccess(true); + $data = $this->getDataOrTerminateWithError($result); + + $this->terminateWithSuccess($data); } public function updateAddress() { - //TODO(Manu) rename all to same $address_id = $this->input->post('adresse_id'); + $this->form_validation->set_data(['address.plz' => $_POST['plz']]); + $uid = getAuthUID(); - $this->form_validation->set_rules('plz', 'PLZ', 'required|numeric', [ + + $this->form_validation->set_rules('address.plz', 'PLZ', 'required|numeric', [ 'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'PLZ']), 'numeric' => $this->p->t('ui', 'error_fieldNotNumeric', ['field' => 'PLZ']) ]); - if(isset($_POST['gemeinde']) && isset($_POST['ort'])) - $this->form_validation->set_rules('plz', 'Postleitzahl', 'callback_validateLocationCombination', [ + if(isset($_POST['gemeinde']) && isset($_POST['ort']) && isset($_POST['nation']) && ($_POST['nation'] == 'A')) + { + $this->form_validation->set_rules('address.plz', 'Postleitzahl', 'callback_validateLocationCombination', [ 'validateLocationCombination' => $this->p->t('ui', 'error_location_combination') ]); + } if ($this->form_validation->run() == false) { @@ -275,7 +278,7 @@ class Kontakt extends FHCAPI_Controller 'strasse' => $strasse, 'updatevon' => $uid, 'updateamum' => date('c'), - 'plz' => $_POST['plz'], + 'plz' => $_POST['address']['plz'], 'ort' => $ort, 'gemeinde' => $gemeinde, 'nation' => $nation, @@ -290,11 +293,9 @@ class Kontakt extends FHCAPI_Controller ] ); - if (isError($result)) - { - return $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL); - } - return $this->outputJsonSuccess(true); + $data = $this->getDataOrTerminateWithError($result); + + $this->terminateWithSuccess($data); } public function loadAddress() @@ -328,9 +329,7 @@ class Kontakt extends FHCAPI_Controller public function deleteAddress() { - //TODO(Manu) rename all to same $adresse_id = $this->input->post('address_id'); - // return $this->terminateWithError($adresse_id, self::ERROR_TYPE_GENERAL); $this->load->model('person/Adresse_model', 'AdresseModel'); $result = $this->AdresseModel->load([ @@ -390,10 +389,10 @@ class Kontakt extends FHCAPI_Controller $this->load->model('organisation/standort_model', 'StandortModel'); $result = $this->StandortModel->searchStandorte($searchString); - if (isError($result)) { - $this->terminateWithError($result, self::ERROR_TYPE_GENERAL); - } - $this->terminateWithSuccess($result ?: []); + + $data = $this->getDataOrTerminateWithError($result); + + $this->terminateWithSuccess($data); } public function getStandorteByFirma($firma_id) @@ -573,11 +572,9 @@ class Kontakt extends FHCAPI_Controller ] ); - if (isError($result)) - { - return $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL); - } - return $this->outputJsonSuccess(true); + $data = $this->getDataOrTerminateWithError($result); + + $this->terminateWithSuccess($data); } public function deleteContact() @@ -660,11 +657,9 @@ class Kontakt extends FHCAPI_Controller 'orgform_kurzbz' => $orgform_kurzbz ] ); - if (isError($result)) - { - return $this->terminateWithError($result, self::ERROR_TYPE_GENERAL); - } - return $this->outputJsonSuccess(true); + $data = $this->getDataOrTerminateWithError($result); + + $this->terminateWithSuccess($data); } public function loadBankverbindung() @@ -738,11 +733,9 @@ class Kontakt extends FHCAPI_Controller ] ); - if (isError($result)) - { - return $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL); - } - return $this->outputJsonSuccess(true); + $data = $this->getDataOrTerminateWithError($result); + + $this->terminateWithSuccess($data); } public function deleteBankverbindung() diff --git a/application/core/Notiz_Controller.php b/application/core/Notiz_Controller.php index 05f70ee85..472ac7669 100644 --- a/application/core/Notiz_Controller.php +++ b/application/core/Notiz_Controller.php @@ -309,6 +309,7 @@ abstract class Notiz_Controller extends FHCAPI_Controller } //update(1) loading all dms-entries with this notiz_id + $dms_id_arr = []; $this->load->model('person/Notizdokument_model', 'NotizdokumentModel'); $this->NotizdokumentModel->addJoin('campus.tbl_dms_version', 'dms_id'); diff --git a/public/js/api/notiz/person.js b/public/js/api/notiz/person.js index de351b68b..04812eacc 100644 --- a/public/js/api/notiz/person.js +++ b/public/js/api/notiz/person.js @@ -5,8 +5,8 @@ export default { getUid(){ return this.$fhcApi.get('api/frontend/v1/notiz/notizPerson/getUid/'); }, - addNewNotiz(id, formData) { - return this.$fhcApi.post('api/frontend/v1/notiz/notizPerson/addNewNotiz/' + id, + addNewNotiz(form, id, formData) { + return this.$fhcApi.post(form,'api/frontend/v1/notiz/notizPerson/addNewNotiz/' + id, formData ); }, @@ -27,8 +27,8 @@ export default { id }); }, - updateNotiz(notiz_id, formData){ - return this.$fhcApi.post('api/frontend/v1/notiz/notizPerson/updateNotiz/' + notiz_id, + updateNotiz(form, notiz_id, formData){ + return this.$fhcApi.post(form,'api/frontend/v1/notiz/notizPerson/updateNotiz/' + notiz_id, formData ); }, diff --git a/public/js/api/stv/kontakt.js b/public/js/api/stv/kontakt.js index 8a309564c..f76c9b5cb 100644 --- a/public/js/api/stv/kontakt.js +++ b/public/js/api/stv/kontakt.js @@ -1,5 +1,4 @@ export default { - //TODO(Manu) check if tabulatorConfig use here like in konto.js //------------- address.js----------- getAdressen (url, config, params){ return this.$fhcApi.get('api/frontend/v1/stv/kontakt/getAdressen/' + params.id); diff --git a/public/js/api/stv/prestudent.js b/public/js/api/stv/prestudent.js index dd90880c5..b58f8eda1 100644 --- a/public/js/api/stv/prestudent.js +++ b/public/js/api/stv/prestudent.js @@ -39,24 +39,38 @@ export default { }, //------------- MultiStatus.js------------------------------------------------------ - getHistoryPrestudent (url, config, params){ return this.$fhcApi.get('api/frontend/v1/stv/status/getHistoryPrestudent/' + params.id); }, getMaxSem(studiengang_kzs) { return this.$fhcApi.post('api/frontend/v1/stv/status/getMaxSemester/', {studiengang_kzs}); }, - advanceStatus(status_id) { - return this.$fhcApi.post('api/frontend/v1/stv/status/advanceStatus/' + Object.values(status_id).join('/')); + advanceStatus({prestudent_id, status_kurzbz, studiensemester_kurzbz, ausbildungssemester}) { + return this.$fhcApi.post('api/frontend/v1/stv/status/advanceStatus/' + + prestudent_id + '/' + + status_kurzbz + '/' + + studiensemester_kurzbz + '/' + + ausbildungssemester + ); }, - confirmStatus(status_id) { - return this.$fhcApi.post('api/frontend/v1/stv/status/confirmStatus/' + Object.values(status_id).join('/')); + confirmStatus({prestudent_id, status_kurzbz, studiensemester_kurzbz, ausbildungssemester}) { + return this.$fhcApi.post('api/frontend/v1/stv/status/confirmStatus/' + + prestudent_id + '/' + + status_kurzbz + '/' + + studiensemester_kurzbz + '/' + + ausbildungssemester + ); }, isLastStatus(id) { return this.$fhcApi.get('api/frontend/v1/stv/status/isLastStatus/' + id); }, - deleteStatus(status_id) { - return this.$fhcApi.post('api/frontend/v1/stv/status/deleteStatus/' + Object.values(status_id).join('/')); + deleteStatus({prestudent_id, status_kurzbz, studiensemester_kurzbz, ausbildungssemester}) { + return this.$fhcApi.post('api/frontend/v1/stv/status/deleteStatus/' + + prestudent_id + '/' + + status_kurzbz + '/' + + studiensemester_kurzbz + '/' + + ausbildungssemester + ); }, getLastBismeldestichtag() { return this.$fhcApi.get('api/frontend/v1/stv/status/getLastBismeldestichtag/'); diff --git a/public/js/api/stv/status.js b/public/js/api/stv/status.js index 20b59c8de..a2a143f65 100644 --- a/public/js/api/stv/status.js +++ b/public/js/api/stv/status.js @@ -7,11 +7,24 @@ export default { data ); }, - loadStatus(status_id) { - return this.$fhcApi.post('api/frontend/v1/stv/status/loadStatus/' + Object.values(status_id).join('/')); + loadStatus({prestudent_id, status_kurzbz, studiensemester_kurzbz, ausbildungssemester}) { + return this.$fhcApi.post( + 'api/frontend/v1/stv/status/loadStatus/' + + prestudent_id + '/' + + status_kurzbz + '/' + + studiensemester_kurzbz + '/' + + ausbildungssemester + ); }, - updateStatus(status_id, data) { - return this.$fhcApi.post('api/frontend/v1/stv/status/updateStatus/' + Object.values(status_id).join('/'), data); + updateStatus({prestudent_id, status_kurzbz, studiensemester_kurzbz, ausbildungssemester}, data) { + return this.$fhcApi.post( + 'api/frontend/v1/stv/status/updateStatus/' + + prestudent_id + '/' + + status_kurzbz + '/' + + studiensemester_kurzbz + '/' + + ausbildungssemester, + data + ); }, getStudienplaene(prestudent_id) { return this.$fhcApi.get('api/frontend/v1/stv/prestudent/getStudienplaene/' + prestudent_id); diff --git a/public/js/components/Betriebsmittel/Betriebsmittel.js b/public/js/components/Betriebsmittel/Betriebsmittel.js index 3849578ea..a9468ccb5 100644 --- a/public/js/components/Betriebsmittel/Betriebsmittel.js +++ b/public/js/components/Betriebsmittel/Betriebsmittel.js @@ -142,6 +142,18 @@ export default { cm.getColumnByField('format_ausgabe').component.updateDefinition({ title: this.$p.t('wawi', 'ausgabedatum') }); + cm.getColumnByField('betriebsmittel_id').component.updateDefinition({ + title: this.$p.t('ui', 'betriebsmittel_id') + }); + cm.getColumnByField('betriebsmittelperson_id').component.updateDefinition({ + title: this.$p.t('ui', 'betriebsmittelperson_id') + }); + cm.getColumnByField('person_id').component.updateDefinition({ + title: this.$p.t('person', 'person_id') + }); + cm.getColumnByField('uid').component.updateDefinition({ + title: this.$p.t('person', 'uid') + }); } } ], diff --git a/public/js/components/Notiz/Notiz.js b/public/js/components/Notiz/Notiz.js index 18d483985..b017b830b 100644 --- a/public/js/components/Notiz/Notiz.js +++ b/public/js/components/Notiz/Notiz.js @@ -161,7 +161,7 @@ export default { event: 'tableBuilt', handler: async () => { - await this.$p.loadCategory(['notiz', 'global']); + await this.$p.loadCategory(['notiz', 'global', 'ui']); let cm = this.$refs.table.tabulator.columnManager; @@ -202,18 +202,21 @@ export default { visible: this.showVariables.showLastupdate }); cm.getColumnByField('notiz_id').component.updateDefinition({ - visible: this.showVariables.showNotiz_id + visible: this.showVariables.showNotiz_id, + title: this.$p.t('ui', 'notiz_id') }); cm.getColumnByField('notizzuordnung_id').component.updateDefinition({ - visible: this.showVariables.showNotizzuordnung_id + visible: this.showVariables.showNotizzuordnung_id, + title: this.$p.t('ui', 'notizzuordnung_id') }); cm.getColumnByField('type_id').component.updateDefinition({ - visible: this.showVariables.showType_id + visible: this.showVariables.showType_id, + title: this.$p.t('ui', 'type_id') }); cm.getColumnByField('id').component.updateDefinition({ - visible: this.showVariables.showId + visible: this.showVariables.showId, + title: this.$p.t('ui', 'extension_id') }); - } } ], @@ -302,7 +305,8 @@ export default { formData.append('data', JSON.stringify(this.notizData)); Object.entries(this.notizData.anhang).forEach(([k, v]) => formData.append(k, v)); - return this.endpoint.addNewNotiz(this.id, formData) + //TODO(Manu) formvalidation: inform not working with tinymce textarea + return this.endpoint.addNewNotiz(this.$refs.formNotiz, this.id, formData) .then(response => { this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave')); this.resetFormData(); @@ -318,7 +322,7 @@ export default { }, deleteNotiz(notiz_id) { return this.endpoint.deleteNotiz(notiz_id, this.typeId, this.id) - //return this.$fhcApi.post(this.endpoint + 'deleteNotiz/', this.param) + //return this.eost(this.endpoint + 'deleteNotiz/', this.param) .then(result => { this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successDelete')); this.$refs.deleteNotizModal.hide(); @@ -354,7 +358,8 @@ export default { formData.append('data', JSON.stringify(this.notizData)); Object.entries(this.notizData.anhang).forEach(([k, v]) => formData.append(k, v)); - return this.endpoint.updateNotiz(notiz_id, formData) + //TODO(Manu) formvalidation: inform not working with tinymce textarea + return this.endpoint.updateNotiz(this.$refs.formNotiz, notiz_id, formData) .then(response => { this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave')); this.resetFormData(); @@ -372,7 +377,9 @@ export default { this.$refs.table.reloadTable(); }, resetFormData() { - this.$refs.formc.reset(); + //TODO(Manu) check ref, needed here? + //this.$refs.formNotiz.reset(); + //this.$refs.formc.reset(); this.notizData = { typeId: this.typeId, titel: null, @@ -521,7 +528,7 @@ export default {
-
+

@@ -645,7 +652,7 @@ export default { - +
@@ -685,7 +692,7 @@ export default {

{{$p.t('notiz','notiz_edit')}} [{{notizData.typeId}}]

--> -
+

{{$p.t('notiz','notiz_new')}} [{{notizData.typeId}}]

{{$p.t('notiz','notiz_edit')}} [{{notizData.typeId}}]

@@ -843,7 +850,7 @@ export default {

{{notizData.lastupdate}}

- +
@@ -863,7 +870,7 @@ export default {
-
+

{{$p.t('notiz','notiz_new')}} [{{notizData.typeId}}]

{{$p.t('notiz','notiz_edit')}} [{{notizData.typeId}}]

@@ -1021,7 +1028,7 @@ export default {
- +
@@ -1062,7 +1069,7 @@ export default { diff --git a/public/js/components/Stv/Studentenverwaltung.js b/public/js/components/Stv/Studentenverwaltung.js index e2ca8e349..16b747ee5 100644 --- a/public/js/components/Stv/Studentenverwaltung.js +++ b/public/js/components/Stv/Studentenverwaltung.js @@ -45,8 +45,6 @@ export default { cisRoot: this.cisRoot, activeAddonBewerbung: this.activeAddons.split(';').includes('bewerbung'), configGenerateAlias: this.config.generateAlias, - configShowZgvDoktor: this.config.showZgvDoktor, - configShowZgvErfuellt: this.config.showZgvErfuellt, hasBpkPermission: this.permissions['student/bpk'], hasAliasPermission: this.permissions['student/alias'], hasPrestudentPermission: this.permissions['basis/prestudent'], diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Details.js b/public/js/components/Stv/Studentenverwaltung/Details/Details.js index 34ab779ac..39e674ff4 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Details.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Details.js @@ -45,21 +45,9 @@ export default { }, data() { return { - test: {udf_viaf: 'TEST'}, - familienstaende: { - "": "--keine Auswahl--", - "g": "geschieden", - "l": "ledig", - "v": "verheiratet", - "w": "verwitwet" - }, original: null, data: null, - changed: {}, - udfChanges: false, - studentIn: null, - gebDatumIsValid: false, - gebDatumIsInvalid: false + changed: {} } }, computed: { @@ -71,6 +59,15 @@ export default { }, noImageSrc() { return FHC_JS_DATA_STORAGE_OBJECT.app_root + 'skin/images/profilbild_dummy.jpg'; + }, + familienstaende() { + return { + "": "-- " + this.$p.t('fehlermonitoring', 'keineAuswahl') + " --", + "g": this.$p.t('person', 'geschieden'), + "l": this.$p.t('person', 'ledig'), + "v": this.$p.t('person', 'verheiratet'), + "w": this.$p.t('person', 'verwitwet'), + }; } }, watch: { @@ -78,7 +75,6 @@ export default { this.updateStudent(n); }, data: { - // TODO(chris): use @input instead? handler(n) { let res = {}; for (var k in this.original) { @@ -86,7 +82,6 @@ export default { if (new Date(this.original[k]).toString() != new Date(n[k]).toString()) res[k] = n[k]; } else { - // TODO(chris): null && ""? should there be an exception for this? if (this.original[k] !== n[k] && !(this.original[k] === null && n[k] === "")) res[k] = n[k]; } @@ -98,7 +93,6 @@ export default { }, methods: { updateStudent(n) { - // TODO(chris): move to fhcapi.factory return this.$fhcApi.factory.stv.details.get(n.prestudent_id) .then(result => { this.data = result.data; @@ -131,12 +125,10 @@ export default { created() { this.updateStudent(this.modelValue); }, - //TODO(chris): Phrasen - //TODO(chris): Geburtszeit? Anzahl der Kinder? template: `
- +
Person @@ -282,8 +274,7 @@ export default { v-model="data.geburtsnation" name="geburtsnation" > - - +
@@ -318,8 +309,7 @@ export default { v-model="data.staatsbuergerschaft" name="staatsbuergerschaft" > - - +
- Loading... + {{$p.t('ui', 'dropdownLoading')}}...
- Loading... + {{$p.t('ui', 'dropdownLoading')}}...
` diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Kontakt/Address.js b/public/js/components/Stv/Studentenverwaltung/Details/Kontakt/Address.js index d9cdc75b2..7a24c03ff 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Kontakt/Address.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Kontakt/Address.js @@ -62,7 +62,7 @@ export default{ {title:"Adresse_id", field:"adresse_id", visible:false}, {title:"Person_id", field:"person_id", visible:false}, {title:"Name", field:"name", visible:false}, - {title:"letzte Änderung", field:"updateamum", visible:false}, + {title:"letzte Änderung", field:"lastupdate", visible:false}, {title:"Rechnungsadresse", field:"rechnungsadresse", visible:false, formatter: (cell, formatterParams, onRendered) => { let output = cell.getValue() ? this.$p.t('ui','ja') : this.$p.t('ui','nein'); @@ -89,9 +89,14 @@ export default{ button.className = 'btn btn-outline-secondary btn-action'; button.innerHTML = ''; button.title = this.$p.t('person', 'adresse_delete'); - button.addEventListener('click', () => - this.actionDeleteAdress(cell.getData().adresse_id) - ); + + button.addEventListener('click', () => { + if (cell.getData().heimatadresse) + this.$fhcAlert.alertError(this.$p.t('person', 'error_deleteHomeAdress')); + else + this.actionDeleteAdress(cell.getData().adresse_id) + }); + container.append(button); return container; @@ -134,6 +139,9 @@ export default{ cm.getColumnByField('heimatadresse').component.updateDefinition({ title: this.$p.t('person', 'heimatadresse') }); + cm.getColumnByField('zustelladresse').component.updateDefinition({ + title: this.$p.t('person', 'zustelladresse') + }); cm.getColumnByField('co_name').component.updateDefinition({ title: this.$p.t('person', 'co_name') }); @@ -143,7 +151,7 @@ export default{ cm.getColumnByField('firmenname').component.updateDefinition({ title: this.$p.t('person', 'firma') }); - cm.getColumnByField('updateamum').component.updateDefinition({ + cm.getColumnByField('lastupdate').component.updateDefinition({ title: this.$p.t('notiz', 'letzte_aenderung') }); cm.getColumnByField('rechnungsadresse').component.updateDefinition({ @@ -152,6 +160,18 @@ export default{ cm.getColumnByField('anmerkung').component.updateDefinition({ title: this.$p.t('global', 'anmerkung') }); + cm.getColumnByField('firma_id').component.updateDefinition({ + title: this.$p.t('ui', 'firma_id') + }); + cm.getColumnByField('adresse_id').component.updateDefinition({ + title: this.$p.t('ui', 'adresse_id') + }); + cm.getColumnByField('person_id').component.updateDefinition({ + title: this.$p.t('person', 'person_id') + }); + cm.getColumnByField('actions').component.updateDefinition({ + title: this.$p.t('global', 'aktionen') + }); } } ], @@ -160,7 +180,9 @@ export default{ heimatadresse: true, rechnungsadresse: false, typ: 'h', - nation: 'A' + nation: 'A', + address: {plz: null}, + plz: null }, statusNew: true, places: [], @@ -201,37 +223,33 @@ export default{ this.loadAdress(adresse_id).then(() => { if(this.addressData.adresse_id) { - this.loadPlaces(this.addressData.plz); + this.addressData.address.plz = this.addressData.plz; + // delete this.addressData.plz; + this.loadPlaces(this.addressData.address.plz); this.$refs.adressModal.show(); } }); }, actionDeleteAdress(adresse_id) { - this.loadAdress(adresse_id).then(() => { - if(this.addressData.adresse_id) - if(this.addressData.heimatadresse) - this.$fhcAlert.alertError(this.$p.t('person', 'error_deleteHomeAdress')); - else { - this.$fhcAlert - .confirmDelete() - .then(result => result - ? adresse_id - : Promise.reject({handled: true})) - .then(this.deleteAddress) - .catch(this.$fhcAlert.handleSystemError); - } - }); + this.$fhcAlert + .confirmDelete() + .then(result => result + ? adresse_id + : Promise.reject({handled: true})) + .then(this.deleteAddress) + .catch(this.$fhcAlert.handleSystemError); }, addNewAddress(addressData) { - return this.$fhcApi.factory.stv.kontakt.addNewAddress(this.uid, this.addressData) + this.addressData.plz = this.addressData.address.plz; + return this.$refs.addressData.factory.stv.kontakt.addNewAddress(this.uid, this.addressData) .then(response => { this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave')); this.hideModal('adressModal'); this.resetModal(); }).catch(this.$fhcAlert.handleSystemError) .finally(() => { - window.scrollTo(0, 0); + //window.scrollTo(0, 0); this.reload(); }); }, @@ -242,13 +260,18 @@ export default{ this.statusNew = false; return this.$fhcApi.factory.stv.kontakt.loadAddress(adresse_id) .then(result => { - this.addressData = result.data; - return result; + this.addressData = result.data; + this.addressData.address = {}; + this.addressData.address.plz = this.addressData.plz || null; + // delete this.addressData.plz; + return result; }) .catch(this.$fhcAlert.handleSystemError); }, updateAddress(adresse_id) { - return this.$fhcApi.factory.stv.kontakt.updateAddress(adresse_id, + //TODO(Manu) buggy with relad, warning/error: e.element.after is not a function + this.addressData.plz = this.addressData.address.plz; + return this.$refs.addressData.factory.stv.kontakt.updateAddress(adresse_id, this.addressData ).then(response => { this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave')); @@ -256,7 +279,7 @@ export default{ this.resetModal(); }).catch(this.$fhcAlert.handleSystemError) .finally(() => { - window.scrollTo(0, 0); + //window.scrollTo(0, 0); this.reload(); }); }, @@ -271,23 +294,17 @@ export default{ }); }, loadPlaces() { - //TODO(Manu) check with chris if its okay without abortion controller -/* if (this.abortController.places) - this.abortController.places.abort();*/ - if (this.addressData.nation != 'A' || !this.addressData.plz) + if (this.abortController.places) + this.abortController.places.abort(); + if (this.addressData.nation != 'A' || !this.addressData.address.plz) return; - //this.abortController.places = new AbortController(); - return this.$fhcApi.factory.stv.kontakt.getPlaces(this.addressData.plz) + this.abortController.places = new AbortController(); + + return this.$refs.addressData.factory.stv.kontakt.getPlaces(this.addressData.address.plz) .then(result => { this.places = result.data; }); -/* .catch(error => { - if (error.code != "ERR_CANCELED") - window.setTimeout(this.loadPlaces, 100); - else - this.$fhcAlert.handleSystemError(error); - });*/ }, search(event) { return this.$fhcApi.factory.stv.kontakt.getFirmen(event.query) @@ -311,7 +328,7 @@ export default{ this.addressData.anmerkung = null; this.addressData.typ = 'h'; this.addressData.nation = 'A'; - this.addressData.plz = null; + this.addressData.address = {plz: null}; this.statusNew = true; }, @@ -388,9 +405,9 @@ export default{
@@ -418,6 +435,7 @@ export default{ v-else type="text" name="addressData.gemeinde" + :label="$p.t('person/gemeinde')" v-model="addressData.gemeinde" > @@ -444,6 +462,7 @@ export default{ v-else type="text" name="ort" + :label="$p.t('person/ort')" v-model="addressData.ort" > @@ -562,7 +581,7 @@ export default{ diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Kontakt/Bankaccount.js b/public/js/components/Stv/Studentenverwaltung/Details/Kontakt/Bankaccount.js index fbb9b4a8b..140104038 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Kontakt/Bankaccount.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Kontakt/Bankaccount.js @@ -36,10 +36,10 @@ export default{ let output; switch(cell.getValue()){ case "p": - output = "Privatkonto"; + output = this.$p.t('person', 'privatkonto'); break; case "f": - output = "Firmenkonto"; + output = this.$p.t('person', 'firmenkonto'); break; default: output = cell.getValue(); @@ -110,7 +110,6 @@ export default{ cm.getColumnByField('typ').component.updateDefinition({ title: this.$p.t('global', 'typ') }); - cm.getColumnByField('anschrift').component.updateDefinition({ title: this.$p.t('person', 'anschrift') }); @@ -120,10 +119,18 @@ export default{ cm.getColumnByField('blz').component.updateDefinition({ title: this.$p.t('person', 'blz') }); - cm.getColumnByField('verrechnung').component.updateDefinition({ title: this.$p.t('person', 'verrechnung') }); + cm.getColumnByField('person_id').component.updateDefinition({ + title: this.$p.t('person', 'person_id') + }); + cm.getColumnByField('bankverbindung_id').component.updateDefinition({ + title: this.$p.t('ui', 'bankverbindung_id') + }); + cm.getColumnByField('actions').component.updateDefinition({ + title: this.$p.t('global', 'aktionen') + }); } } ], @@ -153,18 +160,16 @@ export default{ }); }, actionDeleteBankverbindung(bankverbindung_id){ - this.loadBankverbindung(bankverbindung_id).then(() => { - this.$fhcAlert - .confirmDelete() - .then(result => result - ? bankverbindung_id - : Promise.reject({handled: true})) - .then(this.deleteBankverbindung) - .catch(this.$fhcAlert.handleSystemError); - }); + this.$fhcAlert + .confirmDelete() + .then(result => result + ? bankverbindung_id + : Promise.reject({handled: true})) + .then(this.deleteBankverbindung) + .catch(this.$fhcAlert.handleSystemError); }, addNewBankverbindung(bankverbindungData) { - return this.$fhcApi.factory.stv.kontakt.addNewBankverbindung(this.uid, this.bankverbindungData) + return this.$refs.bankverbindungData.factory.stv.kontakt.addNewBankverbindung(this.uid, this.bankverbindungData) .then(response => { this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave')); this.hideModal('bankverbindungModal'); @@ -186,7 +191,7 @@ export default{ .catch(this.$fhcAlert.handleSystemError); }, updateBankverbindung(bankverbindung_id){ - return this.$fhcApi.factory.stv.kontakt.updateBankverbindung(bankverbindung_id, + return this.$refs.bankverbindungData.factory.stv.kontakt.updateBankverbindung(bankverbindung_id, this.bankverbindungData) .then(response => { this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave')); @@ -234,7 +239,7 @@ export default{
- +