diff --git a/application/controllers/api/frontend/v1/stv/Status.php b/application/controllers/api/frontend/v1/stv/Status.php index 36d445fc6..09a9f18b1 100644 --- a/application/controllers/api/frontend/v1/stv/Status.php +++ b/application/controllers/api/frontend/v1/stv/Status.php @@ -1078,6 +1078,24 @@ class Status extends FHCAPI_Controller $this->terminateWithSuccess(true); } + protected function checkForCriticalChangesBis($oldstatus) + { + $changedFields = array(); + $allowedFields = array('anmerkung', 'statusgrund_id'); + $oldstatus_array = get_object_vars($oldstatus); + foreach($oldstatus_array as $key => $oldValue) + { + $newValue = $this->input->post($key); + if( $newValue !== $oldValue ) + { + $changedFields[] = $key; + } + } + $criticalFieldsChanged = array_diff($changedFields, $allowedFields); + $hasCriticalChangesBis = count($criticalFieldsChanged) > 0 ? true : false; + return $hasCriticalChangesBis; + } + /** * Updates a status entry * @@ -1102,6 +1120,7 @@ class Status extends FHCAPI_Controller $oldstatus = current($oldstatus); + $hasCriticalChangesBis = $this->checkForCriticalChangesBis($oldstatus); $isBerechtigtNoStudstatusCheck = $this->permissionlib->isBerechtigt('student/keine_studstatuspruefung'); $isBerechtigtBasisPrestudentstatus = $this->permissionlib->isBerechtigt('basis/prestudentstatus'); @@ -1112,7 +1131,6 @@ class Status extends FHCAPI_Controller $ausbildungssemester = $this->input->post('ausbildungssemester') ?: $oldstatus->ausbildungssemester; $datum = $this->input->post('datum') ?: $oldstatus->datum; - //Form Validation $this->load->library('form_validation'); @@ -1135,9 +1153,15 @@ class Status extends FHCAPI_Controller $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 diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Prestudent/MultiStatus.js b/public/js/components/Stv/Studentenverwaltung/Details/Prestudent/MultiStatus.js index 4b92df109..e67f19ccf 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Prestudent/MultiStatus.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Prestudent/MultiStatus.js @@ -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'); diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Status/Modal.js b/public/js/components/Stv/Studentenverwaltung/Details/Status/Modal.js index 8b0252be8..7507b0ebd 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Status/Modal.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Status/Modal.js @@ -185,24 +185,10 @@ export default{ .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: ` @@ -220,7 +206,7 @@ export default{

{{$p.t('bismeldestichtag', 'info_MeldestichtagStatusgrundSemester')}}

- + 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' )