mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-25 00:24:35 +00:00
fehler/issue monitoring: enabled resolving/producing by app only, improved error messages, code layout, removed error: fehler to produce is not defined in config
This commit is contained in:
@@ -61,14 +61,10 @@ class PlausicheckProducerLib
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->_ci->FehlerModel->addSelect('fehler_kurzbz');
|
||||
if (!isEmptyArray($this->_apps)) $this->_ci->FehlerModel->db->where_in('app', $this->_apps);
|
||||
$fehlerRes = $this->_ci->FehlerModel->load();
|
||||
// get fehler by apps
|
||||
$fehlerRes = $this->_ci->FehlerModel->getByApps($this->_apps);
|
||||
|
||||
if (hasData($fehlerRes))
|
||||
{
|
||||
$this->_fehlerKurzbz = array_column(getData($fehlerRes), 'fehler_kurzbz');
|
||||
}
|
||||
if (hasData($fehlerRes)) $this->_fehlerKurzbz = array_column(getData($fehlerRes), 'fehler_kurzbz');
|
||||
}
|
||||
|
||||
// get producer file paths for the fehler
|
||||
@@ -151,10 +147,10 @@ class PlausicheckProducerLib
|
||||
$mappingFehlerKurbz = array_keys($this->_fehlerLibMappings);
|
||||
|
||||
// check if all issues to produce could be found in database
|
||||
$notFoundFehlerKurzbz = array_diff($this->_fehlerKurzbz, $mappingFehlerKurbz);
|
||||
//~ $notFoundFehlerKurzbz = array_diff($this->_fehlerKurzbz, $mappingFehlerKurbz);
|
||||
|
||||
if (!isEmptyArray($notFoundFehlerKurzbz))
|
||||
$result->errors[] = error('Fehler to produce not defined in config: '.implode(', ', $notFoundFehlerKurzbz));
|
||||
//~ if (!isEmptyArray($notFoundFehlerKurzbz))
|
||||
//~ $result->errors[] = error('Fehler to produce not defined in config: '.implode(', ', $notFoundFehlerKurzbz));
|
||||
|
||||
foreach ($mappingFehlerKurbz as $fehler_kurzbz)
|
||||
{
|
||||
|
||||
@@ -20,18 +20,36 @@ class PlausicheckResolverLib
|
||||
private $_ci; // ci instance
|
||||
private $_extensionName; // name of extension
|
||||
private $_fehlercodes = []; // name of extension
|
||||
private $_apps = []; // apps for which issues should be resolved
|
||||
private $_codeLibMappings = []; // mappings for issues which explicitly defined resolver
|
||||
private $_defaultIssueParams = ['issue_id' => 'issue_id', 'issue_person_id' => 'person_id', 'issue_oe_kurzbz' => 'oe_kurzbz'];
|
||||
|
||||
public function __construct($params = null)
|
||||
{
|
||||
// set application(s))
|
||||
if (isset($params['apps']))
|
||||
{
|
||||
if (is_string($params['apps'])) $params['apps'] = [$params['apps']];
|
||||
if (is_array($params['apps'])) $this->_apps = $params['apps'];
|
||||
}
|
||||
|
||||
$this->_ci =& get_instance(); // get ci instance
|
||||
|
||||
// get all fehler to be produced (by kurzbz array or app)
|
||||
if (isset($params['fehlercodes']) && !isEmptyArray($params['fehlercodes']))
|
||||
{
|
||||
$this->_fehlercodes = $params['fehlercodes'];
|
||||
}
|
||||
elseif (isset($params['apps']) && !isEmptyArray($params['apps']))
|
||||
{
|
||||
$this->_ci->load->model('system/Fehler_model', 'FehlerModel');
|
||||
$fehlerRes = $this->_ci->FehlerModel->getByApps($this->_apps);
|
||||
|
||||
$this->_ci =& get_instance(); // get ci instance
|
||||
if (hasData($fehlerRes))
|
||||
{
|
||||
$this->_fehlercodes = array_column(getData($fehlerRes), 'fehlercode');
|
||||
}
|
||||
}
|
||||
|
||||
$this->_ci->load->library('IssuesLib');
|
||||
$this->_ci->load->library('ExtensionsLib');
|
||||
@@ -144,11 +162,11 @@ class PlausicheckResolverLib
|
||||
$result->infos = [];
|
||||
|
||||
// check if all issues to resolve could be found in database
|
||||
$mappingFehlerCodes = array_keys($this->_codeLibMappings);
|
||||
$notFoundFehlerCodes = array_diff($this->_fehlercodes, $mappingFehlerCodes);
|
||||
//~ $mappingFehlerCodes = array_keys($this->_codeLibMappings);
|
||||
//~ $notFoundFehlerCodes = array_diff($this->_fehlercodes, $mappingFehlerCodes);
|
||||
|
||||
if (!isEmptyArray($notFoundFehlerCodes))
|
||||
$result->errors[] = error('Fehler to resolve not defined in config: '.implode(', ', $notFoundFehlerCodes));
|
||||
//~ if (!isEmptyArray($notFoundFehlerCodes))
|
||||
//~ $result->errors[] = error('Fehler to resolve not defined in config: '.implode(', ', $notFoundFehlerCodes));
|
||||
|
||||
foreach ($openIssues as $issue)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user