- 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:
ma0068
2025-12-12 13:04:58 +01:00
parent 994d523258
commit 431ae8ddac
5 changed files with 72 additions and 29 deletions
@@ -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