issue konfiguration: added phrases, bugfix displaying correct configuration for correct app

This commit is contained in:
KarpAlex
2023-05-22 00:20:01 +02:00
parent 186412144d
commit 0d6ad6aab0
2 changed files with 308 additions and 10 deletions
@@ -32,11 +32,9 @@ class IssuesKonfiguration extends Auth_Controller
$this->loadPhrases(
array(
//~ 'global',
'global',
'ui',
'filter',
//~ 'lehre',
//~ 'person',
'fehlermonitoring'
)
);
@@ -85,13 +83,13 @@ class IssuesKonfiguration extends Auth_Controller
? $this->FehlerkonfigurationstypModel->load()
: $this->FehlerkonfigurationstypModel->loadWhere(array('app' => $app));
if (isError($konfRes)) $this->terminateWithJsonError($this->p->t('fehlermonitoring', 'fehlerKonfigurationstypenLaden'));
if (isError($konfRes)) $this->terminateWithJsonError($this->p->t('fehlermonitoring', 'fehlerFehlerKonfigurationLaden'));
// get all Fehler, optionally filtered by app
$params = array('fehlercode_extern' => null);
$this->FehlerModel->addSelect('fehlercode, fehler_kurzbz, fehlertyp_kurzbz, fehlertext');
$this->FehlerModel->addOrder('fehlercode');
if (isEmptyString($app)) $params['app'] = $app;
if (!isEmptyString($app)) $params['app'] = $app;
$fehlerRes = $this->FehlerModel->loadWhere($params);
if (isError($fehlerRes)) $this->terminateWithJsonError($this->p->t('fehlermonitoring', 'fehlerFehlerLaden'));
@@ -121,7 +119,7 @@ class IssuesKonfiguration extends Auth_Controller
// check if all params passed
if (isEmptyString($konfigurationstyp_kurzbz)) $this->terminateWithJsonError($this->p->t('fehlermonitoring', 'ungueltigerKonfigurationstyp'));
if (isEmptyString($fehlercode)) $this->terminateWithJsonError($this->p->t('fehlermonitoring', 'ungueltigerFehlercode'));
if (isEmptyString($fehlercode)) $this->terminateWithJsonError($this->p->t('fehlermonitoring', 'fehlercodeFehlt'));
// separate by semicolon if multiple values passed
$konfigurationsWert = explode(';', $konfigurationsWert);
@@ -153,7 +151,7 @@ class IssuesKonfiguration extends Auth_Controller
default:
$valid = is_string($konfWert) && preg_match('/^[A-Za-z0-9_]+$/', $konfWert);
}
if (!$valid) $this->terminateWithJsonError($this->p->t('fehlermonitoring', 'ungueltigerKonfigurationswert', $konfigurationsdatentyp));
if (!$valid) $this->terminateWithJsonError($this->p->t('fehlermonitoring', 'ungueltigerKonfigurationswert', array($konfigurationsdatentyp)));
}
}
@@ -180,7 +178,7 @@ class IssuesKonfiguration extends Auth_Controller
if (!is_array($existingKonf)) $existingKonf = array($existingKonf);
$newKonf = json_encode(array_values(array_unique(array_merge($existingKonf, $konfigurationsWert))));
if (!$newKonf) $this->terminateWithJsonError($this->p->t('fehlermonitoring', 'fehlerJsonKodierung'));
if (!$newKonf) $this->terminateWithJsonError("error when encoding JSON");
$result = $this->FehlerkonfigurationModel->update(
array('konfigurationstyp_kurzbz' => $konfigurationstyp_kurzbz, 'fehlercode' => $fehlercode),
@@ -190,7 +188,7 @@ class IssuesKonfiguration extends Auth_Controller
else // if no konfiguration exists, add new konfiguration entry
{
$newKonf = json_encode($konfigurationsWert);
if (!$newKonf) $this->terminateWithJsonError($this->p->t('fehlermonitoring', 'fehlerJsonKodierung'));
if (!$newKonf) $this->terminateWithJsonError("error when encoding JSON");
$result = $this->FehlerkonfigurationModel->insert(
array(
@@ -218,7 +216,7 @@ class IssuesKonfiguration extends Auth_Controller
if (isEmptyString($konfigurationstyp_kurzbz)) $this->terminateWithJsonError($this->p->t('fehlermonitoring', 'ungueltigerKonfigurationstyp'));
// check if fehlercode correctly passed
if (isEmptyString($fehlercode)) $this->terminateWithJsonError($this->p->t('fehlermonitoring', 'ungueltigerFehlercode'));
if (isEmptyString($fehlercode)) $this->terminateWithJsonError($this->p->t('fehlermonitoring', 'fehlercodeFehlt'));
$this->outputJson(
$this->FehlerkonfigurationModel->delete(
+300
View File
@@ -17823,6 +17823,306 @@ array(
)
)
),
array(
'app' => 'core',
'category' => 'fehlermonitoring',
'phrase' => 'fehlerFehlerKonfigurationLaden',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Fehler beim Laden der Fehlerkonfiguration',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Error when loading error configuration',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'fehlermonitoring',
'phrase' => 'fehlerFehlerLaden',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Fehler beim Laden der Fehler',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Error when loading errors',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'fehlermonitoring',
'phrase' => 'ungueltigerKonfigurationstyp',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Ungültiger Konfigurationstyp',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Invalid configuration type',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'fehlermonitoring',
'phrase' => 'ungueltigerKonfigurationswert',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Ungültiger Konfigurationswert für Datentyp {0}, Sonderzeichen nicht erlaubt',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Invalid configuration value for data type {1}, special characters not allowed',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'fehlermonitoring',
'phrase' => 'fehlerKonfiguration',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Fehler Konfiguration',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Error configuration',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'fehlermonitoring',
'phrase' => 'konfigurationstyp',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Konfigurationstyp',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'configuration type',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'fehlermonitoring',
'phrase' => 'konfigurationswert',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Konfigurationswert',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'configuration value',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'fehlermonitoring',
'phrase' => 'konfigurationswertPlatzhalter',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'wert1;wert2;wert3',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'value1;value2;value3',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'fehlermonitoring',
'phrase' => 'konfigurationswertZuweisen',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Konfigurationswert(e) zuweisen',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Assign configuration value(s)',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'fehlermonitoring',
'phrase' => 'konfigurationsbeschreibung',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Konfigurationsbeschreibung',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Configuration description',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'fehlermonitoring',
'phrase' => 'konfigurationsdatentyp',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Konfigurationsdatentyp',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Configuration data type',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'fehlermonitoring',
'phrase' => 'konfigurationGespeichert',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Konfiguration gespeichert',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Configuration saved',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'fehlermonitoring',
'phrase' => 'konfigurationGespeichertFehler',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Fehler beim Speichern der Konfiguration',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Error when saving configuration',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'fehlermonitoring',
'phrase' => 'konfigurationGeloescht',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Konfiguration gelöscht',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Deleted configuration',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'fehlermonitoring',
'phrase' => 'konfigurationGeloeschtFehler',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Fehler beim Löschen der Konfiguration',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Error when deleting configuration',
'description' => '',
'insertvon' => 'system'
)
)
),
);