new Multitab CombinePeople, start Function

This commit is contained in:
ma0068
2025-10-22 10:23:24 +02:00
parent 4495632393
commit 6337869098
4 changed files with 83 additions and 1 deletions
+1
View File
@@ -111,5 +111,6 @@ $config['students_tab_order'] = [
'status',
'groups',
'finalexam',
'combinePeople',
'archive',
];
@@ -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;
@@ -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*/ `
<div class="stv-details-combine-people h-100 pb-3">
<h4>Personen zusammenlegen</h4>
{{personIds}}
<div v-if="this.modelValue.length">
<p v-if="this.modelValue.length == 2">
<button class="btn btn-primary" @click="combinePeople"> Zusammenlegen</button>
</p>
<p v-else">
ungültige Anzahl: {{this.modelValue.length}}
</p>
</div>
</div>
`
};
+21 -1
View File
@@ -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'
)
)
),
);