From 6337869098d71547f4fc85535ec6bf232b81d94e Mon Sep 17 00:00:00 2001 From: ma0068 Date: Wed, 22 Oct 2025 10:23:24 +0200 Subject: [PATCH] new Multitab CombinePeople, start Function --- application/config/stv.php | 1 + .../api/frontend/v1/stv/Config.php | 4 ++ .../Details/CombinePeople.js | 57 +++++++++++++++++++ system/phrasesupdate.php | 22 ++++++- 4 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 public/js/components/Stv/Studentenverwaltung/Details/CombinePeople.js diff --git a/application/config/stv.php b/application/config/stv.php index 42afc318c..d6d06f44e 100644 --- a/application/config/stv.php +++ b/application/config/stv.php @@ -111,5 +111,6 @@ $config['students_tab_order'] = [ 'status', 'groups', 'finalexam', + 'combinePeople', 'archive', ]; diff --git a/application/controllers/api/frontend/v1/stv/Config.php b/application/controllers/api/frontend/v1/stv/Config.php index d52016943..20e43d23a 100644 --- a/application/controllers/api/frontend/v1/stv/Config.php +++ b/application/controllers/api/frontend/v1/stv/Config.php @@ -228,6 +228,10 @@ class Config extends FHCAPI_Controller 'showEdit' => $this->permissionlib->isBerechtigt('admin') ] ]; + $result['combinePeople'] = [ + 'title' => $this->p->t('stv', 'tab_combine_people'), + 'component' => './Stv/Studentenverwaltung/Details/CombinePeople.js', + ]; Events::trigger('stv_conf_students', function & () use (&$result) { return $result; diff --git a/public/js/components/Stv/Studentenverwaltung/Details/CombinePeople.js b/public/js/components/Stv/Studentenverwaltung/Details/CombinePeople.js new file mode 100644 index 000000000..4374687fe --- /dev/null +++ b/public/js/components/Stv/Studentenverwaltung/Details/CombinePeople.js @@ -0,0 +1,57 @@ +export default { + name: "TabCombinePeople", + inject: { + cisRoot: { + from: 'cisRoot' + }, + }, + props: { + modelValue: Object, + }, + computed: { + personIds(){ + if (this.modelValue.person_id) { + return [this.modelValue.person_id]; + } + return this.modelValue.map(e => e.person_id); + } + }, + methods: { + combinePeople(){ + + let person1_id = this.personIds[0]; + let person2_id = this.personIds[1]; + + if(person1_id == person2_id) { + return this.$fhcAlert.alertError("gleiche Person, keine Zusammenlegeung möglich"); + } + + let linkCombinePeople = this.cisRoot + 'vilesci/stammdaten/personen_wartung.php?person_id_1=' + person1_id + '&person_id_2='+ person2_id; + + console.log(linkCombinePeople); + window.open(linkCombinePeople, '_blank'); + + + } + }, + data(){ + return {} + }, + template: /*html*/ ` +
+

Personen zusammenlegen

+ + {{personIds}} + +
+ +

+ +

+

+ ungültige Anzahl: {{this.modelValue.length}} +

+
+
+ ` + }; \ No newline at end of file diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 5d3833dc9..d931f85c2 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -49982,7 +49982,27 @@ I have been informed that I am under no obligation to consent to the transmissio 'insertvon' => 'system' ) ) - ) + ), + array( + 'app' => 'core', + 'category' => 'stv', + 'phrase' => 'tab_combine_people', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Personen zusammenlegen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Combine People', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), );