mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 12:19:28 +00:00
- make button edit editable
- set field anmerkung editable (like statusgrund and statusgrund) - refactor function updateStatus to skip validation - change phrases
This commit is contained in:
@@ -206,6 +206,7 @@ class Status extends FHCAPI_Controller
|
||||
$datum_string = date('c');
|
||||
$datum = new DateTime($datum_string);
|
||||
|
||||
|
||||
//Form Validation
|
||||
$this->load->library('form_validation');
|
||||
|
||||
@@ -1088,7 +1089,7 @@ class Status extends FHCAPI_Controller
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function updateStatus($prestudent_id, $status_kurzbz, $key_studiensemester_kurzbz, $key_ausbildungssemester)
|
||||
public function updateStatus($prestudent_id, $status_kurzbz, $key_studiensemester_kurzbz, $key_ausbildungssemester, $hasCriticalChangesBis=false)
|
||||
{
|
||||
$result = $this->PrestudentstatusModel->load([
|
||||
$key_ausbildungssemester,
|
||||
@@ -1130,14 +1131,22 @@ class Status extends FHCAPI_Controller
|
||||
]
|
||||
);
|
||||
|
||||
$hasCriticalChangesBis = filter_var($hasCriticalChangesBis, FILTER_VALIDATE_BOOLEAN);
|
||||
|
||||
$this->form_validation->set_rules(
|
||||
'datum',
|
||||
$this->p->t('global', 'datum'),
|
||||
[
|
||||
'is_valid_date',
|
||||
['meldestichtag_not_exceeded', function ($value) use ($isBerechtigtNoStudstatusCheck) {
|
||||
['meldestichtag_not_exceeded', function ($value) use ($isBerechtigtNoStudstatusCheck, $hasCriticalChangesBis){
|
||||
if ($isBerechtigtNoStudstatusCheck)
|
||||
return true; // Skip if access right says so
|
||||
{
|
||||
return true; // Skip if access right says so*/
|
||||
}
|
||||
if (!$hasCriticalChangesBis) {
|
||||
return true; // Skip if no critical changes were made
|
||||
}
|
||||
|
||||
if (!$value)
|
||||
return true; // Error will be handled by the required statement above
|
||||
|
||||
|
||||
@@ -39,14 +39,17 @@ export default {
|
||||
status_kurzbz,
|
||||
studiensemester_kurzbz,
|
||||
ausbildungssemester
|
||||
}, params) {
|
||||
}, params, hasCriticalChangesBis) {
|
||||
console.log("hasCriticalChangesBis " + hasCriticalChangesBis);
|
||||
return {
|
||||
|
||||
method: 'post',
|
||||
url: 'api/frontend/v1/stv/status/updateStatus/'
|
||||
+ prestudent_id + '/'
|
||||
+ status_kurzbz + '/'
|
||||
+ studiensemester_kurzbz + '/'
|
||||
+ ausbildungssemester,
|
||||
+ ausbildungssemester + '/'
|
||||
+ hasCriticalChangesBis,
|
||||
params
|
||||
};
|
||||
},
|
||||
|
||||
@@ -207,8 +207,8 @@ export default{
|
||||
button.addEventListener('click', () =>
|
||||
this.actionEditStatus(data.status_kurzbz, data.studiensemester_kurzbz, data.ausbildungssemester)
|
||||
);
|
||||
if (this.dataMeldestichtag && this.dataMeldestichtag > data.datum && !this.hasPermissionToSkipStatusCheck)
|
||||
button.disabled = true;
|
||||
/* if (this.dataMeldestichtag && this.dataMeldestichtag > data.datum && !this.hasPermissionToSkipStatusCheck)
|
||||
button.disabled = true;*/
|
||||
container.append(button);
|
||||
|
||||
button = document.createElement('button');
|
||||
|
||||
@@ -64,7 +64,9 @@ export default{
|
||||
'Unterbrecher',
|
||||
'Diplomand',
|
||||
'Incoming'
|
||||
]
|
||||
],
|
||||
original: {},
|
||||
hasCriticalChangesBis: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -136,6 +138,7 @@ export default{
|
||||
this.statusNew = false;
|
||||
this.formData = result.data;
|
||||
this.originalDatum = new Date(result.data.datum);
|
||||
this.original = { ...this.formData};
|
||||
return prestudent;
|
||||
})
|
||||
.then(this.loadStudienplaeneAndSetPrestudent)
|
||||
@@ -157,7 +160,7 @@ export default{
|
||||
},
|
||||
editStatus() {
|
||||
this.$refs.form
|
||||
.call(ApiStvStatus.updateStatus(this.statusId, this.formData))
|
||||
.call(ApiStvStatus.updateStatus(this.statusId, this.formData, this.hasCriticalChangesBis))
|
||||
.then(result => {
|
||||
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
|
||||
this.$reloadList();
|
||||
@@ -179,30 +182,59 @@ export default{
|
||||
.then(result => this.mischform = result.data.mischform);
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
// watching all disabled fields
|
||||
"formData.status_kurzbz"(newVal) {
|
||||
if (newVal !== this.original.status_kurzbz) {
|
||||
this.hasCriticalChangesBis = true;
|
||||
}
|
||||
},
|
||||
/* "formData.studiensemester_kurzbz"(newVal) {
|
||||
if (newVal !== this.original.studiensemester_kurzbz) {
|
||||
this.hasCriticalChangesBis = true;
|
||||
}
|
||||
},*/
|
||||
"formData.orgform_kurzbz"(newVal) {
|
||||
if (newVal !== this.original.orgform_kurzbz) {
|
||||
this.hasCriticalChangesBis = true;
|
||||
}
|
||||
},
|
||||
"formData.datum"(newVal) {
|
||||
if (newVal !== this.original.datum) {
|
||||
this.hasCriticalChangesBis = true;
|
||||
}
|
||||
},
|
||||
"formData.bestaetigtam"(newVal) {
|
||||
if (newVal !== this.original.bestaetigtam) {
|
||||
this.hasCriticalChangesBis = true;
|
||||
}
|
||||
},
|
||||
"formData.bewerbung_abgeschicktamum"(newVal) {
|
||||
if (newVal !== this.original.bestaetigtam) {
|
||||
this.hasCriticalChangesBis = true;
|
||||
}
|
||||
},
|
||||
"formData.studienplan_id"(newVal) {
|
||||
if (newVal !== this.original.studienplan_id) {
|
||||
this.hasCriticalChangesBis = true;
|
||||
}
|
||||
},
|
||||
"formData.rt_stufe"(newVal) {
|
||||
if (newVal !== this.original.rt_stufe) {
|
||||
this.hasCriticalChangesBis = true;
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.$api
|
||||
.call(ApiStvStatus.getStatusgruende())
|
||||
.then(result => this.statusgruende = result.data)
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
|
||||
//TODO(Manu) check why it is/was hard coded
|
||||
this.$api
|
||||
.call(ApiStvStatus.getStati())
|
||||
.then(result => this.stati = result.data)
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
/* this.stati = [
|
||||
{ status_kurzbz: 'Interessent', bezeichnung: 'Interessent'},
|
||||
{ status_kurzbz: 'Bewerber', bezeichnung: 'Bewerber'},
|
||||
{ status_kurzbz: 'Aufgenommener', bezeichnung: 'Aufgenommener'},
|
||||
{ status_kurzbz: 'Student', bezeichnung: 'Student'},
|
||||
{ status_kurzbz: 'Unterbrecher', bezeichnung: 'Unterbrecher'},
|
||||
{ status_kurzbz: 'Diplomand', bezeichnung: 'Diplomand'},
|
||||
{ status_kurzbz: 'Incoming', bezeichnung: 'Incoming'},
|
||||
{ status_kurzbz: 'Absolvent', bezeichnung: 'Absolvent'},
|
||||
{ status_kurzbz: 'Abbrecher', bezeichnung: 'Abbrecher'},
|
||||
{ status_kurzbz: 'Abgewiesener', bezeichnung: 'Abgewiesener'},
|
||||
{ status_kurzbz: 'Wartender', bezeichnung: 'Wartender'}
|
||||
];*/
|
||||
},
|
||||
template: `
|
||||
<bs-modal class="stv-status-modal" ref="modal" dialog-class="modal-dialog-scrollable">
|
||||
@@ -220,7 +252,7 @@ export default{
|
||||
<p v-if="bisLocked && isStatusBeforeStudent">
|
||||
<b>{{$p.t('bismeldestichtag', 'info_MeldestichtagStatusgrundSemester')}}</b>
|
||||
</p>
|
||||
|
||||
|
||||
<form-input
|
||||
container-class="mb-3"
|
||||
type="select"
|
||||
@@ -353,7 +385,6 @@ export default{
|
||||
v-model="formData.anmerkung"
|
||||
name="anmerkung"
|
||||
:label="$p.t('global/anmerkung')"
|
||||
:disabled="bisLocked"
|
||||
>
|
||||
</form-input>
|
||||
<form-input
|
||||
|
||||
@@ -41300,13 +41300,13 @@ array(
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Meldestichtag erreicht - ausschließlich Bearbeiten Statusgrund möglich',
|
||||
'text' => 'Meldestichtag erreicht - ausschließlich Bearbeiten Statusgrund und Anmerkung möglich',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'Reporting deadline reached - only editing status reason possible',
|
||||
'text' => 'Reporting deadline reached - only editing status reason and note possible',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
@@ -41320,13 +41320,13 @@ array(
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Meldestichtag erreicht - Bearbeiten Ausbildungssemester und Statusgrund möglich',
|
||||
'text' => 'Meldestichtag erreicht - Bearbeiten Ausbildungssemester, Statusgrund und Anmerkung möglich',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'Edit education semester and status reason possible',
|
||||
'text' => 'Edit education semester, status reason and note possible',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user