Tab Betriebsmittel: change type of field Kaution to number, add validation if numeric

This commit is contained in:
ma0068
2025-06-16 16:01:41 +02:00
parent 5140d9de31
commit cb2ed4696c
2 changed files with 17 additions and 1 deletions
@@ -158,6 +158,11 @@ class BetriebsmittelP extends FHCAPI_Controller
], [
'uid_in_person' => $this->p->t('person', 'error_uidNotInPerson')
]);
$this->form_validation->set_rules('kaution', 'Kaution', 'numeric', [
'numeric' => $this->p->t('ui', 'error_fieldNotNumeric', ['field' => 'Kaution'])
]);
$this->validateNewOrUpdate();
$betriebsmitteltyp = $this->input->post('betriebsmitteltyp');
@@ -241,6 +246,10 @@ class BetriebsmittelP extends FHCAPI_Controller
public function updateBetriebsmittel($betriebsmittelperson_id)
{
$this->form_validation->set_rules('kaution', 'Kaution', 'numeric', [
'numeric' => $this->p->t('ui', 'error_fieldNotNumeric', ['field' => 'Kaution'])
]);
$this->validateNewOrUpdate();
$betriebsmitteltyp = $this->input->post('betriebsmitteltyp');