mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-21 08:52:21 +00:00
Autocomplete Add-Button Finish
This commit is contained in:
@@ -564,11 +564,10 @@ class Studiengang_model extends DB_Model
|
||||
$this->db->where($this->dbTable . ".aktiv", true);
|
||||
|
||||
if ($not_antrag_typ !== null && is_array($not_antrag_typ)) {
|
||||
$this->addJoin('campus.tbl_studierendenantrag a', 'a.prestudent_id=p.prestudent_id', 'LEFT');
|
||||
$this->db->group_start();
|
||||
$this->db->where_not_in('a.typ', $not_antrag_typ);
|
||||
$this->db->or_where('a.typ IS NULL');
|
||||
$this->db->group_end();
|
||||
foreach($not_antrag_typ as $k => $v)
|
||||
$not_antrag_typ[$k] = $this->db->escape($v);
|
||||
$this->addJoin('campus.tbl_studierendenantrag a', 'a.prestudent_id=p.prestudent_id and a.typ in ('. implode(',', $not_antrag_typ ).')', 'LEFT');
|
||||
$this->db->where('a.typ IS NULL');
|
||||
}
|
||||
|
||||
if ($query) {
|
||||
|
||||
+1
-1
@@ -422,7 +422,7 @@
|
||||
"nategood/httpful": "0.2.*",
|
||||
"netcarver/textile": "3.7.*",
|
||||
"nicolaskruchten/pivottable": "2.23.0",
|
||||
"npm-asset/primevue": "3.15.*",
|
||||
"npm-asset/primevue": "3.29.*",
|
||||
"npm-asset/primeicons": "5.0.0",
|
||||
|
||||
"olifolkerd/tabulator4": "4.9.*",
|
||||
|
||||
@@ -5,4 +5,4 @@ const app = Vue.createApp({
|
||||
StudierendenantragLeitung
|
||||
}
|
||||
});
|
||||
app.use(primevue.config.default).mount('#wrapper');
|
||||
app.use(primevue.config.default,{zIndex: {overlay: 9999}}).mount('#wrapper');
|
||||
|
||||
@@ -21,21 +21,16 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
newUrl() {
|
||||
return FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + '/lehre/Studierendenantrag/abmeldung/' + this.student;
|
||||
return FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + '/lehre/Studierendenantrag/abmeldung/' + this.student.prestudent_id;
|
||||
},
|
||||
students() {
|
||||
return this.data.sort(
|
||||
(a, b) => a.nachname == b.nachname ?
|
||||
(
|
||||
a.vorname == b.vorname ?
|
||||
a.bezeichnung > b.bezeichnung :
|
||||
a.vorname > b.vorname
|
||||
) :
|
||||
a.nachname > b.nachname
|
||||
return this.data.map((current)=>
|
||||
{
|
||||
current.name = current.nachname.toUpperCase() + " " + current.vorname + " (" + current.bezeichnung + ")";
|
||||
return current;
|
||||
}).sort(
|
||||
(a, b) => a.name > b.name ? 1 : -1
|
||||
);
|
||||
},
|
||||
hasNoData() {
|
||||
return !Object.values(this.data).length;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -47,9 +42,8 @@ export default {
|
||||
}), {
|
||||
dialogClass: 'modal-fullscreen'
|
||||
}, this.p.t('studierendenantrag', 'antrag_header')).then(() => {
|
||||
this.data = [];
|
||||
this.loadSelects();
|
||||
this.$emit('reload');
|
||||
this.student = '';
|
||||
});
|
||||
},
|
||||
loadData(evt) {
|
||||
@@ -68,25 +62,6 @@ export default {
|
||||
return result;
|
||||
}
|
||||
);
|
||||
},
|
||||
loadSelects() {
|
||||
if (this.hasNoData) {
|
||||
return axios.post(
|
||||
FHC_JS_DATA_STORAGE_OBJECT.app_root +
|
||||
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
|
||||
'/components/Antrag/Abmeldung/getStudiengaengeAssistenz/',
|
||||
{query: 'felix'}
|
||||
).then(
|
||||
result => {
|
||||
if (result.data.error) {
|
||||
BsAlert.popup(result.data.retval, {dialogClass: 'alert alert-danger'});
|
||||
} else {
|
||||
this.data = result.data.retval;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
template: `
|
||||
@@ -105,38 +80,31 @@ export default {
|
||||
<div class="modal-body">
|
||||
<label for="newAntragModalAutoComplete">{{p.t('person','studentIn')}}</label>
|
||||
<!-- TODO(chris): IMPLEMENT!! -->
|
||||
<auto-complete
|
||||
v-model="student"
|
||||
:suggestions="data"
|
||||
@complete="loadData"
|
||||
inputId="newAntragModalAutoComplete"
|
||||
dropdown
|
||||
>
|
||||
<template #option="slotProps">
|
||||
<div>
|
||||
{{slotProps.nachname}} {{slotProps.vorname}} ({{slotProps.bezeichnung}}) [{{slotProps.prestudent_id}}]
|
||||
</div>
|
||||
</template>
|
||||
</auto-complete>
|
||||
<!--div v-if="hasNoData">
|
||||
loading...
|
||||
<div>
|
||||
<auto-complete
|
||||
class="w-100"
|
||||
v-model="student"
|
||||
:suggestions="students"
|
||||
optionLabel = "name"
|
||||
@complete="loadData"
|
||||
inputId="newAntragModalAutoComplete"
|
||||
dropdown
|
||||
>
|
||||
<template #option="slotProps">
|
||||
<div :title="slotProps.option.prestudent_id">
|
||||
{{slotProps.option.name}}
|
||||
</div>
|
||||
</template>
|
||||
</auto-complete>
|
||||
</div>
|
||||
<div v-else class="mb-3">
|
||||
<label for="newAntragModalStudent">{{p.t('person','studentIn')}}</label>
|
||||
<select id="newAntragModalStudent" class="form-select" v-model="student">
|
||||
<option v-for="item in students" :value="item.prestudent_id" :key="item.prestudent_id">
|
||||
{{item.nachname}} {{item.vorname}} ({{item.bezeichnung}}) [{{item.prestudent_id}}]
|
||||
</option>
|
||||
</select>
|
||||
</div-->
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a :href="newUrl"
|
||||
<button
|
||||
class="btn btn-primary"
|
||||
target="_blank"
|
||||
:disabled="!this.student"
|
||||
@click.prevent="openForm">
|
||||
{{p.t('studierendenantrag','btn_create')}}
|
||||
</a>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user