Merge branch 'merge_FHC4_55354_55991_55992_60874_60876_60875_61229_61230_61231' into feature-63192/FHC4-Studierendenverwaltung_Semsterauswahl_fuer_mehrere_Tabs_anpassen

This commit is contained in:
Harald Bamberger
2025-08-01 12:24:02 +02:00
3 changed files with 48 additions and 20 deletions
@@ -75,8 +75,9 @@ class BetriebsmittelP extends FHCAPI_Controller
'required' => $this->p->t('ui', 'error_fieldRequired')
]);
$this->form_validation->set_rules('kaution', 'Kaution', 'numeric|less_than_equal_to[9999.99]', [
'numeric' => $this->p->t('ui', 'error_fieldNotNumeric')
$this->form_validation->set_rules('kaution', 'Kaution', 'callback_valid_number|callback_not_less_than_equal', [
'valid_number' => $this->p->t('ui', 'error_fieldNoValidNumber'),
'not_less_than_equal' => $this->p->t('ui', 'error_fieldLessThan1000'),
]);
$this->form_validation->set_rules('ausgegebenam', 'Ausgegeben am', 'required|is_valid_date', [
@@ -159,10 +160,6 @@ 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');
@@ -172,6 +169,7 @@ class BetriebsmittelP extends FHCAPI_Controller
$betriebsmittel_id = $this->input->post('betriebsmittel_id');
$anmerkung = $this->input->post('anmerkung');
$kaution = $this->input->post('kaution');
if($kaution) $kaution = str_replace(',', '.', $kaution);
$ausgegebenam = $this->input->post('ausgegebenam');
$retouram = $this->input->post('retouram');
$uid = $this->input->post('uid');
@@ -246,10 +244,6 @@ 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');
@@ -259,6 +253,7 @@ class BetriebsmittelP extends FHCAPI_Controller
$betriebsmittel_id = $this->input->post('betriebsmittel_id');
$anmerkung = $this->input->post('anmerkung');
$kaution = $this->input->post('kaution');
if($kaution) $kaution = str_replace(',', '.', $kaution);
$ausgegebenam = $this->input->post('ausgegebenam');
$retouram = $this->input->post('retouram');
@@ -391,6 +386,26 @@ class BetriebsmittelP extends FHCAPI_Controller
$this->terminateWithSuccess($data);
}
public function valid_number($number)
{
if(is_null($number)) return true;
$number = str_replace(',', '.', $number);
if (!is_numeric($number))
{
return false;
}
return true;
}
public function not_less_than_equal($number)
{
$number = str_replace(',', '.', $number);
if ($number < 1000)
return true;
return false;
}
}
@@ -290,12 +290,6 @@ export default {
this.formData.anmerkung = null;
this.formData.beschreibung = null;
this.statusNew = true;
},
//helper function: workaround to trigger validation if input is not a number
normalizeKaution() {
if (this.formData.kaution === null || this.formData.kaution === '') {
this.formData.kaution = 'xxx'
}
}
},
created() {
@@ -406,10 +400,9 @@ export default {
<div class="row mb-3">
<form-input
type="number"
type="text"
:label="$p.t('infocenter/kaution')"
name="kaution"
@blur="normalizeKaution"
v-model="formData.kaution"
>
</form-input>
+22 -2
View File
@@ -44600,12 +44600,12 @@ and represent the current state of research on the topic. The prescribed citatio
array(
'app' => 'core',
'category' => 'ui',
'phrase' => 'error_fieldLessThan10000',
'phrase' => 'error_fieldLessThan1000',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Das Eingabefeld {field} darf maximal 4-stellig sein.',
'text' => 'Das Eingabefeld {field} muss kleiner als 1000 sein.',
'description' => '',
'insertvon' => 'system'
),
@@ -44617,6 +44617,26 @@ and represent the current state of research on the topic. The prescribed citatio
)
)
),
array(
'app' => 'core',
'category' => 'ui',
'phrase' => 'error_fieldNoValidNumber',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Das Eingabefeld {field} muss eine gültige Zahl sein',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'The Input Field {field} has to be a valid number',
'description' => '',
'insertvon' => 'system'
)
)
),
// FHC-4 Finetuning END
);