added Plausicheck CORE_STUDENTSTATUS_0015 for finding persons without Konto Buchungen (charges), Plausichecks GUI: generic plausicheck error text is displayed if not defined erroroccured, instead of success message

This commit is contained in:
KarpAlex
2023-02-20 11:40:55 +01:00
parent de81a5abbd
commit 88dee31289
7 changed files with 160 additions and 4 deletions
@@ -44,6 +44,7 @@ class IssueResolver extends IssueResolver_Controller
'CORE_STUDENTSTATUS_0012' => 'CORE_STUDENTSTATUS_0012',
'CORE_STUDENTSTATUS_0013' => 'CORE_STUDENTSTATUS_0013',
'CORE_STUDENTSTATUS_0014' => 'CORE_STUDENTSTATUS_0014',
'CORE_STUDENTSTATUS_0015' => 'CORE_STUDENTSTATUS_0015',
'CORE_PERSON_0001' => 'CORE_PERSON_0001',
'CORE_PERSON_0002' => 'CORE_PERSON_0002',
'CORE_PERSON_0003' => 'CORE_PERSON_0003',
@@ -4,6 +4,8 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
class Plausichecks extends Auth_Controller
{
const GENERIC_ISSUE_OCCURED_TEXT = 'Issue aufgetreten';
public function __construct()
{
parent::__construct(
@@ -78,20 +80,27 @@ class Plausichecks extends Auth_Controller
// optionally replace fehler parameters in text, output the fehlertext
if (hasData($fehlerRes))
{
// use issue fehler text from database if present
$fehlerText = getData($fehlerRes)[0]->fehlertext;
if (!isEmptyArray($fehlertext_params))
{
// replace placeholder with params, if present
if (count($fehlertext_params) != substr_count($fehlerText, '%s'))
$this->terminateWithJsonError('Wrong number of parameters for Fehlertext, fehler_kurzbz ' . $fehler_kurzbz);
$fehlerText = vsprintf($fehlerText, $fehlertext_params);
}
if (isset($person_id)) $fehlerText .= "; person_id: $person_id";
if (isset($oe_kurzbz)) $fehlerText .= "; oe_kurzbz: $oe_kurzbz";
$issueTexts[$fehler_kurzbz][] = $fehlerText;
}
else // if no issue text found, use generic text
{
$fehlerText = self::GENERIC_ISSUE_OCCURED_TEXT;
}
// add generic parameters to issue text
if (isset($person_id)) $fehlerText .= "; person_id: $person_id";
if (isset($oe_kurzbz)) $fehlerText .= "; oe_kurzbz: $oe_kurzbz";
$issueTexts[$fehler_kurzbz][] = $fehlerText;
}
}
}