new workflow Terminate of Studierendenantrag

- DB Update for new studierendenantrag_statustyp with studierendenantrag_statustyp_kurzbz = 'Storniert'
- new permission student/studierendenantrag
- possibility to set status to Terminated in case of new permission
This commit is contained in:
ma0068
2026-06-01 14:10:14 +02:00
parent cb7a0f7669
commit 7858d90d12
11 changed files with 234 additions and 7 deletions
@@ -45,7 +45,8 @@ class Leitung extends FHCAPI_Controller
'unpauseAntrag' => ['student/antragfreigabe:w', 'student/studierendenantrag:w'],
'objectAntrag' => ['student/antragfreigabe:w', 'student/studierendenantrag:w'],
'approveObjection' => ['student/antragfreigabe:w', 'student/studierendenantrag:w'],
'denyObjection' => ['student/antragfreigabe:w', 'student/studierendenantrag:w']
'denyObjection' => ['student/antragfreigabe:w', 'student/studierendenantrag:w'],
'terminateAntrag' => ['student/antragstornieren:w']
]);
// Libraries
@@ -426,4 +427,37 @@ class Leitung extends FHCAPI_Controller
return $this->terminateWithSuccess($studierendenantrag_id);
}
public function terminateAntrag()
{
$this->load->library('form_validation');
$this->form_validation->set_rules(
'studierendenantrag_id',
'Studierenden Antrag',
[
'required',
['isEntitledToTerminateAntrag', [$this->antraglib, 'isEntitledToTerminateAntrag']],
['antragCanBeTerminated', [$this->antraglib, 'antragCanBeTerminated']]
],
[
'isEntitledToUnpauseAntrag' => $this->p->t('studierendenantrag', 'error_no_right'),
'antragCanBeTerminated' => $this->p->t(
'studierendenantrag',
'error_not_terminated',
['id' => $this->input->post('studierendenantrag_id')]
)
]
);
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
$studierendenantrag_id = $this->input->post('studierendenantrag_id');
$result = $this->antraglib->terminateAntrag($studierendenantrag_id, getAuthUID());
$this->getDataOrTerminateWithError($result);
return $this->terminateWithSuccess($studierendenantrag_id);
}
}
@@ -86,9 +86,12 @@ class Studierendenantrag extends FHC_Controller
$stgA = $this->permissionlib->getSTG_isEntitledFor('student/studierendenantrag') ?: [];
$permissionTerminateAntrag = $this->permissionlib->isBerechtigt('student/antragstornieren');
$this->load->view('lehre/Antrag/Leitung/List', [
'stgA' => $stgA,
'stgL' => $stgL
'stgL' => $stgL,
'permissionTerminateAntrag' => $permissionTerminateAntrag
]);
}