moved issue resolvers to #own resolvers folder, created first resolver CORE_INOUT_0007 for plausichecks

This commit is contained in:
KarpAlex
2022-10-03 19:25:32 +02:00
parent ae26c4d1ee
commit aee25c5252
17 changed files with 94 additions and 59 deletions
@@ -1077,7 +1077,7 @@ class PlausicheckLib
$qry = "
SELECT
DISTINCT pers.person_id
DISTINCT pers.person_id, status.studiensemester_kurzbz
FROM
public.tbl_prestudent pre
JOIN public.tbl_prestudentstatus status USING(prestudent_id)
@@ -4,6 +4,7 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
class PlausicheckProducerLib
{
const CI_LIBRARY_PATH = 'application/libraries';
const PLAUSI_ISSUES_FOLDER = 'issues/plausichecks';
const EXECUTE_PLAUSI_CHECK_METHOD_NAME = 'executePlausiCheck';
@@ -36,7 +37,7 @@ class PlausicheckProducerLib
'PrestudentStgUngleichStgStudienplan' => 'PrestudentStgUngleichStgStudienplan',
'StgPrestudentUngleichStgStudent' => 'StgPrestudentUngleichStgStudent',
'StudentstatusNachAbbrecher' => 'StudentstatusNachAbbrecher'
//'StudienplanUngueltig' => 'StudienplanUngueltig',
//'StudienplanUngueltig' => 'StudienplanUngueltig'
);
public function __construct()
@@ -59,8 +60,7 @@ class PlausicheckProducerLib
if (isEmptyString($studiensemester_kurzbz)) $studiensemester_kurzbz = $this->_currentStudiensemester;
// get path of library for issue to be produced
$issuesLibPath = DOC_ROOT . 'application/libraries/' . self::PLAUSI_ISSUES_FOLDER . '/';
//$issuesLibPath = base_url('application/libraries/' . self::PLAUSI_ISSUES_FOLDER . '/');
$issuesLibPath = DOC_ROOT . self::CI_LIBRARY_PATH . '/' . self::PLAUSI_ISSUES_FOLDER . '/';
$issuesLibFilePath = $issuesLibPath . $libName . '.php';
// check if library file exists
@@ -31,7 +31,7 @@ class IncomingHeimatNationOesterreich extends PlausiChecker
{
$results[] = array(
'person_id' => $person->person_id,
'resolution_params' => array('person_id' => $person->person_id)
'resolution_params' => array('person_id' => $person->person_id, 'studiensemester_kurzbz' => $studiensemester_kurzbz)
);
}
}
@@ -0,0 +1,33 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Incoming shouldn't have austrian home address.
*/
class CORE_INOUT_0007 implements IIssueResolvedChecker
{
public function checkIfIssueIsResolved($params)
{
if (!isset($params['person_id']) || !is_numeric($params['person_id']))
return error('Person Id missing, issue_id: '.$params['issue_id']);
if (!isset($params['studiensemester_kurzbz']) || isEmptyString($params['studiensemester_kurzbz']))
return error('Studiensemester missing, issue_id: '.$params['issue_id']);
$this->_ci =& get_instance(); // get code igniter instance
$this->_ci->load->library('issues/PlausicheckLib');
// check if issue persists
$checkRes = $this->_ci->plausichecklib->getIncomingHeimatNationOesterreich($params['studiensemester_kurzbz'], null, $params['person_id']);
if (isError($checkRes)) return $checkRes;
if (hasData($checkRes))
return success(false); // not resolved if issue is still present
else
return success(true); // resolved otherwise
}
}