Optionaler Grund bei Einspruch ablehnen

This commit is contained in:
cgfhtw
2023-07-25 13:42:38 +02:00
parent 8c98cea114
commit 7239113847
5 changed files with 92 additions and 44 deletions
@@ -190,8 +190,9 @@ class Leitung extends FHC_Controller
}
$studierendenantrag_id = $this->input->post('studierendenantrag_id');
$grund = $this->input->post('grund');
$result = $this->antraglib->denyObjectionAbmeldung($studierendenantrag_id, getAuthUID());
$result = $this->antraglib->denyObjectionAbmeldung($studierendenantrag_id, getAuthUID(), $grund);
if (isError($result))
return $this->outputJsonError(['studierendenantrag_id' => getError($result)]);
+3 -1
View File
@@ -259,7 +259,6 @@ class AntragLib
*/
public function denyObjectionAbmeldung($studierendenantrag_id, $insertvon, $grund = null)
{
// TODO(chris): grund?
$result = $this->_ci->StudierendenantragModel->load($studierendenantrag_id);
if (isError($result))
{
@@ -282,6 +281,9 @@ class AntragLib
$status = current(getData($result));
if ($grund)
$grund = $this->_ci->p->t('studierendenantrag', 'mail_part_grund', ['grund' => $grund]);
$result = $this->_ci->StudierendenantragstatusModel->insert([
'studierendenantrag_id' => $studierendenantrag_id,
'studierendenantrag_statustyp_kurzbz' => Studierendenantragstatus_model::STATUS_OBJECTION_DENIED,
@@ -123,30 +123,30 @@ export default {
},
actionReject(evt, gruende) {
var antraege = evt || this.selectedData;
if(!gruende)
{
if (!gruende)
gruende = [];
}
var currentAntrag = antraege.pop();
if(currentAntrag)
GrundPopup.popup(this.p.t('studierendenantrag', 'title_grund', {id: currentAntrag.studierendenantrag_id})).then(result =>
{
currentAntrag.grund = result[0];
gruende.push(currentAntrag);
if(result[1])
{
while (antraege.length)
if (currentAntrag) {
GrundPopup
.popup(this.p.t('studierendenantrag', 'title_grund', {id: currentAntrag.studierendenantrag_id}), {
countRemaining: antraege.length
})
.then(result => {
currentAntrag.grund = result[0];
gruende.push(currentAntrag);
if (result[1])
{
currentAntrag = antraege.pop();
currentAntrag.grund = result[0];
gruende.push(currentAntrag);
while (antraege.length)
{
currentAntrag = antraege.pop();
currentAntrag.grund = result[0];
gruende.push(currentAntrag);
}
}
}
this.actionReject(antraege, gruende);
})
.catch(() => {});
else
{
this.actionReject(antraege, gruende);
})
.catch(() => {});
} else {
this.$refs.loader.show();
axios
.all(
@@ -206,22 +206,47 @@ export default {
},
actionoObjectionDeny(evt, gruende) {
var antraege = evt || this.selectedData;
this.$refs.loader.show();
axios
.all(
antraege.map(
antrag => axios.post(
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
'/components/Antrag/Leitung/objectionDeny/',
{
studierendenantrag_id: antrag.studierendenantrag_id
if (!gruende)
gruende = [];
var currentAntrag = antraege.pop();
if (currentAntrag) {
GrundPopup
.popup(this.p.t('studierendenantrag', 'title_grund', {id: currentAntrag.studierendenantrag_id}), {
countRemaining : antraege.length,
optional: true
})
.then(result => {
currentAntrag.grund = result[0];
gruende.push(currentAntrag);
if (result[1]) {
while (antraege.length) {
currentAntrag = antraege.pop();
currentAntrag.grund = result[0];
gruende.push(currentAntrag);
}
}
this.actionoObjectionDeny(antraege, gruende);
})
.catch(() => {});
} else {
this.$refs.loader.show();
axios
.all(
gruende.map(
antrag => axios.post(
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
'/components/Antrag/Leitung/objectionDeny/',
{
studierendenantrag_id: antrag.studierendenantrag_id,
grund: antrag.grund
}
)
)
)
)
.then(this.showValidation)
.catch(this.showError);
.then(this.showValidation)
.catch(this.showError);
}
},
actionObjectionApprove(evt, gruende) {
var antraege = evt || this.selectedData;
@@ -9,7 +9,9 @@ export default {
],
props: {
placeholder: String,
default: String
default: String,
countRemaining: Number,
optional: Boolean
},
data: () => ({
value: '',
@@ -18,15 +20,13 @@ export default {
isInvalid: false
}),
methods: {
submit(){
if(!this.value) {
submit() {
if (!this.value && !this.optional) {
this.isInvalid = true;
}
else {
} else {
this.result = [this.value, this.check];
this.hide();
}
return
}
},
created() {
@@ -49,12 +49,12 @@ export default {
{{p.t('kvp','new.error.required')}}
</div>
</div>
<div class="form-check">
</template>
<template v-slot:footer>
<div v-if="countRemaining > 0" class="form-check flex-grow-1">
<input ref="check" type="checkbox" class="form-check-input" id="cbid" v-model="check">
<label class="form-check-label" for="cbid">{{p.t('studierendenantrag','fuer_alle_uebernehmen')}}</label>
</div>
</template>
<template v-slot:footer>
<button type="button" class="btn btn-primary" @click="submit">{{p.t('ui','ok')}}</button>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{{p.t('ui','cancel')}}</button>
</template>
+20
View File
@@ -20666,6 +20666,26 @@ array(
)
)
),
array(
'app' => 'core',
'category' => 'studierendenantrag',
'phrase' => 'mail_part_grund',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => '<h4>Grund:</h4><p>{grund}</p>',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => '<h4>Reason:</h4><p>{grund}</p>',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'studierendenantrag',