mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 00:12:15 +00:00
Merge branch 'feature-69877/StudVw_Status_GrundAndAnmerkungEditable'
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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: `
|
||||
<bs-modal class="stv-status-modal" ref="modal" dialog-class="modal-dialog-scrollable">
|
||||
@@ -220,7 +206,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 +339,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