Ferien: bugfix permission check (is_valid_date), added phrases

This commit is contained in:
Alexei Karpenko
2026-03-11 17:09:30 +01:00
parent cdcc734401
commit a68b730ce0
4 changed files with 311 additions and 8 deletions
@@ -72,10 +72,10 @@ class Ferien extends FHCAPI_Controller
$filterVonDatum = $this->input->get('filterVonDatum');
$filterBisDatum = $this->input->get('filterBisDatum');
if (isset($filterVonDatum) && !isValidDate($filterVonDatum))
if (isset($filterVonDatum) && !is_valid_date($filterVonDatum))
return $this->terminateWithError($this->p->t('ui', 'error_invalid_date'), self::ERROR_TYPE_GENERAL);
if (isset($filterBisDatum) && !isValidDate($filterBisDatum))
if (isset($filterBisDatum) && !is_valid_date($filterBisDatum))
return $this->terminateWithError($this->p->t('ui', 'error_invalid_date'), self::ERROR_TYPE_GENERAL);
$this->FerienModel->addSelect(
@@ -158,10 +158,10 @@ class Ferien extends FHCAPI_Controller
if (!isset($oe_kurzbz) || isEmptyString($oe_kurzbz))
return $this->terminateWithError($this->p->t('ferien', 'error_missingId', ['id' => 'Organisationseinheit']));
if (isset($vondatum) && !isValidDate($vondatum))
if (isset($vondatum) && !is_valid_date($vondatum))
return $this->terminateWithError($this->p->t('ui', 'error_invalid_date'), self::ERROR_TYPE_GENERAL);
if (isset($bisdatum) && !isValidDate($bisdatum))
if (isset($bisdatum) && !is_valid_date($bisdatum))
return $this->terminateWithError($this->p->t('ui', 'error_invalid_date'), self::ERROR_TYPE_GENERAL);
// get Studiengang from Oe
@@ -320,7 +320,7 @@ class Ferien extends FHCAPI_Controller
$this->FerienModel->addSelect('ferien_id');
$result = $this->FerienModel->load($ferien_id);
if (!hasData($result)) return $this->terminateWithError($this->p->t('ferien', 'error_missingId', ['ferien_id' => $ferien_id]));
if (!hasData($result)) return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['ferien_id' => $ferien_id]));
$result = $this->getDataOrTerminateWithError($this->FerienModel->delete($ferien_id));
@@ -158,7 +158,7 @@ export default {
let cm = this.$refs.table.tabulator.columnManager;
cm.getColumnByField('ferien_id').component.updateDefinition({
title: this.$p.t('ferien', 'ferien_id'),
title: this.$p.t('ferien', 'ferienId'),
});
cm.getColumnByField('vondatum').component.updateDefinition({
title: this.$p.t('ferien', 'vondatum'),
@@ -169,6 +169,27 @@ export default {
cm.getColumnByField('bezeichnung').component.updateDefinition({
title: this.$p.t('global', 'bezeichnung'),
});
cm.getColumnByField('oe_kurzbz').component.updateDefinition({
title: this.$p.t('ferien', 'oeKurzbezeichnung'),
});
cm.getColumnByField('oe_bezeichnung').component.updateDefinition({
title: this.$p.t('ferien', 'oeBezeichnung'),
});
cm.getColumnByField('studienplan_bezeichnung').component.updateDefinition({
title: this.$p.t('ferien', 'studienplanBezeichnung'),
});
cm.getColumnByField('ferientyp_kurzbz').component.updateDefinition({
title: this.$p.t('ferien', 'ferientypKurzbz'),
});
cm.getColumnByField('mitarbeiterrelevant').component.updateDefinition({
title: this.$p.t('ferien', 'mitarbeiterrelevant'),
});
cm.getColumnByField('studierendenrelevant').component.updateDefinition({
title: this.$p.t('ferien', 'studierendenrelevant'),
});
cm.getColumnByField('lehre').component.updateDefinition({
title: this.$p.t('ferien', 'lehrePlanbar'),
});
cm.getColumnByField('actions').component.updateDefinition({
title: this.$p.t('global', 'aktionen')
});
@@ -144,7 +144,7 @@ export default {
type="select"
v-model="data.oe_kurzbz"
name="oe_kurzbz"
:label="$p.t('lehre/organisationseinheit')"
:label="$p.t('ferien/organisationseinheit')"
@change="getStudienplaene"
>
<option v-for="oe in oeList" :key="oe.oe_kurzbz" :value="oe.oe_kurzbz">
@@ -156,7 +156,7 @@ export default {
type="select"
v-model="data.studienplan_id"
name="studienplan_id"
:label="$p.t('lehre/studienplan')"
:label="$p.t('ferien/studienplan')"
>
<option :value="null">-- {{ $p.t('ui/keineAuswahl') }} --</option>
<option v-for="studienplan in studienplaeneList" :key="studienplan.studienplan_id" :value="studienplan.studienplan_id">
+282
View File
@@ -56948,6 +56948,288 @@ I have been informed that I am under no obligation to consent to the transmissio
)
),
// ### Refactor Messages END
// ### Ferien START
array(
'app' => 'core',
'category' => 'ferien',
'phrase' => 'ferienId',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Ferien Id',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Holiday Id',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'ferien',
'phrase' => 'vondatum',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Datum von',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'From date',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'ferien',
'phrase' => 'bisdatum',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Datum bis',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'To date',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'ferien',
'phrase' => 'organisationseinheit',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => "Organisationseinheit",
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => "Organisational unit",
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'ferien',
'phrase' => 'oeKurzbezeichnung',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => "Organisationseinheit Kurzbezeichung",
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => "Organisational unit short name",
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'ferien',
'phrase' => 'oeBezeichnung',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Organisationseinheit Bezeichnung',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Organizational unit name',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'ferien',
'phrase' => 'studienplan',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Studienplan',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Study plan',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'ferien',
'phrase' => 'studienplanBezeichnung',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Studienplan Bezeichnung',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Study plan name',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'ferien',
'phrase' => 'ferientypKurzbz',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Ferientyp Bezeichnung',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Holiday type name',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'ferien',
'phrase' => 'mitarbeiterrelevant',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Mitarbeiterrelevant',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Employee relevant',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'ferien',
'phrase' => 'studierendenrelevant',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Studierendenrelevant',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Student relevant',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'ferien',
'phrase' => 'lehrePlanbar',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Lehre planbar',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Classes assignable',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'ferien',
'phrase' => 'ferien_edit',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'edit holidays',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Ferien bearbeiten',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'ui',
'phrase' => 'keineAuswahl',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'keine Auswahl',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'no selection',
'description' => '',
'insertvon' => 'system'
)
)
),
// ### Ferien END
);