mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 00:12:15 +00:00
Merge branch 'feature-40728/Issues_logik_auslagern_in_eigene_library' into feature-39602/Fas_Statusbearbeitung_bei_Sperre
This commit is contained in:
@@ -412,6 +412,8 @@ class AntragJob extends JOB_Controller
|
||||
$this->StudierendenantragModel->addSelect('studiensemester_kurzbz');
|
||||
$this->StudierendenantragModel->addSelect('s.insertamum');
|
||||
$this->StudierendenantragModel->addSelect('s.insertvon');
|
||||
$this->StudierendenantragModel->addJoin('public.tbl_student pts', 'prestudent_id');
|
||||
$this->StudierendenantragModel->addSelect('pts.student_uid');
|
||||
|
||||
$this->StudierendenantragModel->db->where_in(
|
||||
'public.get_rolle_prestudent(prestudent_id, studiensemester_kurzbz)',
|
||||
@@ -484,7 +486,7 @@ class AntragJob extends JOB_Controller
|
||||
$person = current(getData($result));
|
||||
$email = $studiengang->email;
|
||||
$dataMail = array(
|
||||
'prestudent' => $antrag->prestudent_id,
|
||||
'prestudent' => 'UID: ' . $antrag->student_uid . ', PreStudentId: ' . $antrag->prestudent_id,
|
||||
'studiensemester' => $antrag->studiensemester_kurzbz,
|
||||
'name' => trim($person->vorname . ' '. $person->nachname),
|
||||
);
|
||||
|
||||
@@ -9,7 +9,7 @@ class IssueResolver extends IssueResolver_Controller
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
// set fehler codes which can be resolved by the job
|
||||
// set fehler codes which can be resolved by the job, with own resolver defined
|
||||
// structure: fehlercode => class (library) name for resolving
|
||||
$this->_codeLibMappings = array(
|
||||
'CORE_ZGV_0001' => 'CORE_ZGV_0001',
|
||||
@@ -30,7 +30,6 @@ class IssueResolver extends IssueResolver_Controller
|
||||
'CORE_STG_0002' => 'CORE_STG_0002',
|
||||
'CORE_STG_0003' => 'CORE_STG_0003',
|
||||
'CORE_STG_0004' => 'CORE_STG_0004',
|
||||
'CORE_STUDENTSTATUS_0001' => 'CORE_STUDENTSTATUS_0001',
|
||||
'CORE_STUDENTSTATUS_0002' => 'CORE_STUDENTSTATUS_0002',
|
||||
'CORE_STUDENTSTATUS_0003' => 'CORE_STUDENTSTATUS_0003',
|
||||
'CORE_STUDENTSTATUS_0004' => 'CORE_STUDENTSTATUS_0004',
|
||||
@@ -51,5 +50,11 @@ class IssueResolver extends IssueResolver_Controller
|
||||
'CORE_PERSON_0003' => 'CORE_PERSON_0003',
|
||||
'CORE_PERSON_0004' => 'CORE_PERSON_0004'
|
||||
);
|
||||
|
||||
// fehler which are resolved the same way as they are produced
|
||||
// structure: fehlercode => class (library) name for resolving
|
||||
$this->_codeProducerLibMappings = array(
|
||||
'CORE_STUDENTSTATUS_0001' => 'AbbrecherAktiv',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,14 +4,15 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class MigrateHourlyRate extends CLI_Controller
|
||||
{
|
||||
|
||||
CONST DEFAULT_OE = 'gst';
|
||||
CONST DEFAULT_DATE = '1970-01-01';
|
||||
CONST STUNDENSTAZTYP_LEHRE = 'lehre';
|
||||
CONST STUNDENSTAZTYP_KALKULATORISCH = 'kalkulatorisch';
|
||||
|
||||
private $OE_DEFAULT;
|
||||
private $_ci;
|
||||
|
||||
protected $configerrors;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
@@ -21,10 +22,37 @@ class MigrateHourlyRate extends CLI_Controller
|
||||
$this->load->model('codex/Bisverwendung_model', 'BisVerwendungModel');
|
||||
$this->load->model('person/Benutzerfunktion_model', 'BenutzerfunktionModel');
|
||||
$this->load->model('ressource/Stundensatz_model', 'StundensatzModel');
|
||||
|
||||
$this->load->config('migratecontract');
|
||||
|
||||
$this->OE_DEFAULT = $this->config->item('migratecontract_oe_default');
|
||||
$this->configerrors = array();
|
||||
}
|
||||
|
||||
public function checkConfig()
|
||||
{
|
||||
echo "OE_DEFAULT: " . $this->OE_DEFAULT . "\n";
|
||||
|
||||
$this->checkOE_DEFAULT();
|
||||
|
||||
if( count($this->configerrors) > 0 )
|
||||
{
|
||||
foreach($this->configerrors AS $configerror)
|
||||
{
|
||||
echo $configerror . "\n";
|
||||
}
|
||||
die("Fehler in der Konfiguration. Abbruch!\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "Konfiguration OK.\n";
|
||||
}
|
||||
}
|
||||
|
||||
public function index($user = null)
|
||||
{
|
||||
$this->checkConfig();
|
||||
|
||||
echo "Lehre Stundensaetze werden migriert.\n";
|
||||
$mitarbeiterResult = $this->_getMitarbeiterStunden($user);
|
||||
if (isError($mitarbeiterResult)) return $mitarbeiterResult;
|
||||
@@ -61,6 +89,18 @@ class MigrateHourlyRate extends CLI_Controller
|
||||
}
|
||||
}
|
||||
|
||||
protected function checkOE_DEFAULT()
|
||||
{
|
||||
$db = new DB_Model();
|
||||
$oesql = 'SELECT * FROM public.tbl_organisationseinheit WHERE oe_kurzbz = ?';
|
||||
$oeres = $db->execReadOnlyQuery($oesql, array($this->OE_DEFAULT));
|
||||
if( !hasData($oeres) )
|
||||
{
|
||||
$this->configerrors[] = 'Default Organisationseinheit: "'
|
||||
. $this->OE_DEFAULT . '" nicht gefunden.';
|
||||
}
|
||||
}
|
||||
|
||||
protected function checkIfSAPSyncTableExists()
|
||||
{
|
||||
$dbModel = new DB_Model();
|
||||
@@ -167,7 +207,7 @@ class MigrateHourlyRate extends CLI_Controller
|
||||
$unternehmenResult = $this->_findUnternehmen($mitarbeiter->uid, "'kstzuordnung', 'oezuordnung'");
|
||||
}
|
||||
|
||||
$unternehmen = self::DEFAULT_OE;
|
||||
$unternehmen = $this->OE_DEFAULT;
|
||||
|
||||
if (hasData($unternehmenResult))
|
||||
$unternehmen = getData($unternehmenResult)[0]->oe_kurzbz;
|
||||
|
||||
@@ -5,21 +5,18 @@
|
||||
*/
|
||||
abstract class IssueResolver_Controller extends JOB_Controller
|
||||
{
|
||||
const CI_PATH = 'application';
|
||||
const CI_LIBRARY_FOLDER = 'libraries';
|
||||
const EXTENSIONS_FOLDER = 'extensions';
|
||||
const ISSUE_RESOLVERS_FOLDER = 'issues/resolvers';
|
||||
const CHECK_ISSUE_RESOLVED_METHOD_NAME = 'checkIfIssueIsResolved';
|
||||
// mappings in form fehlercode -> resolverlibrary name, fehler which have explicit resolver class defined
|
||||
protected $_codeLibMappings = [];
|
||||
|
||||
protected $_codeLibMappings;
|
||||
// mappings in form fehlercode -> producer library name, fehler which are resolved the same way they are produced
|
||||
protected $_codeProducerLibMappings = [];
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
// pass extension name if calling from extension
|
||||
$this->load->model('system/Issue_model', 'IssueModel');
|
||||
|
||||
$this->load->library('IssuesLib');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -27,97 +24,29 @@ abstract class IssueResolver_Controller extends JOB_Controller
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
$this->load->library(
|
||||
'issues/PlausicheckResolverLib',
|
||||
[
|
||||
'extensionName' => $this->_extensionName ?? null,
|
||||
'codeLibMappings' => $this->_codeLibMappings,
|
||||
'codeProducerLibMappings' => $this->_codeProducerLibMappings
|
||||
]
|
||||
);
|
||||
|
||||
$this->logInfo("Issue resolve job started");
|
||||
|
||||
// load open issues with given errorcodes
|
||||
$openIssuesRes = $this->IssueModel->getOpenIssues(array_keys($this->_codeLibMappings));
|
||||
$openIssuesRes = $this->IssueModel->getOpenIssues(
|
||||
array_merge(array_keys($this->_codeLibMappings), array_keys($this->_codeProducerLibMappings))
|
||||
);
|
||||
|
||||
// log error if occured
|
||||
if (isError($openIssuesRes))
|
||||
{
|
||||
$this->logError(getError($openIssuesRes));
|
||||
}
|
||||
else
|
||||
{
|
||||
// log info if no data found
|
||||
if (!hasData($openIssuesRes))
|
||||
{
|
||||
$this->logInfo("No open issues found");
|
||||
}
|
||||
else
|
||||
{
|
||||
$openIssues = getData($openIssuesRes);
|
||||
$openIssues = hasData($openIssuesRes) ? getData($openIssuesRes) : [];
|
||||
|
||||
foreach ($openIssues as $issue)
|
||||
{
|
||||
// ignore if Fehlercode is not in libmappings (shouldn't be checked)
|
||||
if (!isset($this->_codeLibMappings[$issue->fehlercode])) continue;
|
||||
$result = $this->plausicheckresolverlib->resolvePlausicheckIssues($openIssues);
|
||||
|
||||
$libName = $this->_codeLibMappings[$issue->fehlercode];
|
||||
|
||||
// add person id and oe kurzbz automatically as params, merge it with additional params
|
||||
// decode bewerbung_parameter into assoc array
|
||||
$params = array_merge(
|
||||
array('issue_id' => $issue->issue_id, 'issue_person_id' => $issue->person_id, 'issue_oe_kurzbz' => $issue->oe_kurzbz),
|
||||
isset($issue->behebung_parameter) ? json_decode($issue->behebung_parameter, true) : array()
|
||||
);
|
||||
|
||||
// if called from extension (extension name set), path includes extension names
|
||||
$libRootPath = isset($this->_extensionName) ? self::EXTENSIONS_FOLDER . '/' . $this->_extensionName . '/' : '';
|
||||
|
||||
// path for loading issue library
|
||||
$issuesLibPath = $libRootPath . self::ISSUE_RESOLVERS_FOLDER . '/';
|
||||
|
||||
// file path of library for check if file exists
|
||||
$issuesLibFilePath = DOC_ROOT . self::CI_PATH
|
||||
. '/' . $libRootPath . self::CI_LIBRARY_FOLDER . '/' . self::ISSUE_RESOLVERS_FOLDER . '/' . $libName . '.php';
|
||||
|
||||
// check if library file exists
|
||||
if (!file_exists($issuesLibFilePath))
|
||||
{
|
||||
// log error and continue with next issue if not
|
||||
$this->logError("Issue library file " . $issuesLibFilePath . " does not exist");
|
||||
continue;
|
||||
}
|
||||
|
||||
// load library connected to fehlercode
|
||||
$this->load->library($issuesLibPath . $libName);
|
||||
|
||||
$lowercaseLibName = mb_strtolower($libName);
|
||||
|
||||
// check if method is defined in library class
|
||||
if (!is_callable(array($this->{$lowercaseLibName}, self::CHECK_ISSUE_RESOLVED_METHOD_NAME)))
|
||||
{
|
||||
// log error and continue with next issue if not
|
||||
$this->logError("Method " . self::CHECK_ISSUE_RESOLVED_METHOD_NAME . " is not defined in library $lowercaseLibName");
|
||||
continue;
|
||||
}
|
||||
|
||||
// call the function for checking for issue resolution
|
||||
$issueResolvedRes = $this->{$lowercaseLibName}->{self::CHECK_ISSUE_RESOLVED_METHOD_NAME}($params);
|
||||
|
||||
if (isError($issueResolvedRes))
|
||||
{
|
||||
$this->logError(getError($issueResolvedRes));
|
||||
}
|
||||
else
|
||||
{
|
||||
$issueResolvedData = getData($issueResolvedRes);
|
||||
|
||||
if ($issueResolvedData === true)
|
||||
{
|
||||
// set issue to resolved if needed
|
||||
$behobenRes = $this->issueslib->setBehoben($issue->issue_id, null);
|
||||
|
||||
if (isError($behobenRes))
|
||||
$this->logError(getError($behobenRes));
|
||||
else
|
||||
$this->logInfo("Issue " . $issue->issue_id . " successfully resolved");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// log if error, or log info if inserted new issue
|
||||
foreach ($result->errors as $error) $this->logError($error);
|
||||
foreach ($result->infos as $info) $this->logInfo($info);
|
||||
|
||||
$this->logInfo("Issue resolve job ended");
|
||||
}
|
||||
|
||||
@@ -5,61 +5,23 @@
|
||||
*/
|
||||
abstract class PlausiIssueProducer_Controller extends JOB_Controller
|
||||
{
|
||||
protected $_fehlerLibMappings;
|
||||
protected $_fehlerLibMappings = [];
|
||||
protected $_app;
|
||||
|
||||
public function __construct($app = null)
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
// pass extension name if calling from extension
|
||||
$extensionName = isset($this->_extensionName) ? $this->_extensionName : null;
|
||||
|
||||
// load libraries
|
||||
$this->load->library('issues/PlausicheckProducerLib', array('extensionName' => $extensionName, 'app' => $this->_app));
|
||||
$this->load->library('IssuesLib');
|
||||
}
|
||||
|
||||
protected function producePlausicheckIssues($params)
|
||||
{
|
||||
$this->load->library(
|
||||
'issues/PlausicheckProducerLib',
|
||||
['extensionName' => $this->_extensionName ?? null, 'app' => $this->_app, 'fehlerLibMappings' => $this->_fehlerLibMappings]
|
||||
);
|
||||
|
||||
$this->logInfo("Plausicheck issue producer job started");
|
||||
|
||||
// get the data returned by Plausicheck
|
||||
foreach ($this->_fehlerLibMappings as $fehler_kurzbz => $libName)
|
||||
{
|
||||
// execute the check
|
||||
$this->logInfo("Checking " . $fehler_kurzbz . "...");
|
||||
$plausicheckRes = $this->plausicheckproducerlib->producePlausicheckIssue(
|
||||
$libName,
|
||||
$fehler_kurzbz,
|
||||
$params
|
||||
);
|
||||
$result = $this->plausicheckproducerlib->producePlausicheckIssues($params);
|
||||
|
||||
if (isError($plausicheckRes)) $this->logError(getError($plausicheckRes));
|
||||
|
||||
if (hasData($plausicheckRes))
|
||||
{
|
||||
$plausicheckData = getData($plausicheckRes);
|
||||
|
||||
foreach ($plausicheckData as $plausiData)
|
||||
{
|
||||
// get the data needed for issue production
|
||||
$person_id = isset($plausiData['person_id']) ? $plausiData['person_id'] : null;
|
||||
$oe_kurzbz = isset($plausiData['oe_kurzbz']) ? $plausiData['oe_kurzbz'] : null;
|
||||
$fehlertext_params = isset($plausiData['fehlertext_params']) ? $plausiData['fehlertext_params'] : null;
|
||||
$resolution_params = isset($plausiData['resolution_params']) ? $plausiData['resolution_params'] : null;
|
||||
|
||||
// write the issue
|
||||
$addIssueRes = $this->issueslib->addFhcIssue($fehler_kurzbz, $person_id, $oe_kurzbz, $fehlertext_params, $resolution_params);
|
||||
|
||||
// log if error, or log info if inserted new issue
|
||||
if (isError($addIssueRes))
|
||||
$this->logError(getError($addIssueRes));
|
||||
elseif (hasData($addIssueRes) && is_integer(getData($addIssueRes)))
|
||||
$this->logInfo("Plausicheck issue " . $fehler_kurzbz . " successfully produced, person_id: " . $person_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
// log if error, or log info if inserted new issue
|
||||
foreach ($result->errors as $error) $this->logError($error);
|
||||
foreach ($result->infos as $info) $this->logInfo($info);
|
||||
|
||||
$this->logInfo("Plausicheck issue producer job stopped");
|
||||
}
|
||||
|
||||
@@ -246,7 +246,27 @@ class IssuesLib
|
||||
$fehlertext = vsprintf($fehlertextVorlage, $fehlertext_params);
|
||||
}
|
||||
|
||||
$openIssuesCountRes = $this->_ci->IssueModel->getOpenIssueCount($fehlercode, $person_id, $oe_kurzbz, $fehlercode_extern);
|
||||
if (isset($resolution_params))
|
||||
{
|
||||
if (is_array($resolution_params))
|
||||
{
|
||||
foreach ($resolution_params as $resolution_key => $resolution_param)
|
||||
{
|
||||
if (!is_string($resolution_key))
|
||||
return error("Invalid parameter for resolution, must be an associative array");
|
||||
}
|
||||
}
|
||||
else
|
||||
return error("Invalid parameters for resolution");
|
||||
}
|
||||
|
||||
$openIssuesCountRes = $this->_ci->IssueModel->getOpenIssueCount(
|
||||
$fehlercode,
|
||||
$person_id,
|
||||
$oe_kurzbz,
|
||||
$fehlercode_extern,
|
||||
$resolution_params
|
||||
);
|
||||
|
||||
if (hasData($openIssuesCountRes))
|
||||
{
|
||||
@@ -256,20 +276,6 @@ class IssuesLib
|
||||
|
||||
if ($openIssueCount == 0)
|
||||
{
|
||||
if (isset($resolution_params))
|
||||
{
|
||||
if (is_array($resolution_params))
|
||||
{
|
||||
foreach ($resolution_params as $resolution_key => $resolution_param)
|
||||
{
|
||||
if (!is_string($resolution_key))
|
||||
return error("Invalid parameter for resolution, must be an associative array");
|
||||
}
|
||||
}
|
||||
else
|
||||
return error("Invalid parameters for resolution");
|
||||
}
|
||||
|
||||
// insert new issue
|
||||
return $this->_ci->IssueModel->insert(
|
||||
array(
|
||||
|
||||
@@ -12,18 +12,25 @@ class PlausicheckProducerLib
|
||||
|
||||
private $_ci; // ci instance
|
||||
private $_extensionName; // name of extension
|
||||
private $_konfiguration = array(); // configuration parameters
|
||||
private $_konfiguration = []; // configuration parameters
|
||||
private $_fehlerLibMappings = []; // mappings of fehler and libraries for producing them
|
||||
private $_isForResolutionCheck = false; // mappings of fehler and libraries for producing them
|
||||
|
||||
public function __construct($params = null)
|
||||
{
|
||||
// set extension name if called from extension
|
||||
if (isset($params['extensionName'])) $this->_extensionName = $params['extensionName'];
|
||||
if (isset($params['fehlerLibMappings'])) $this->_fehlerLibMappings = $params['fehlerLibMappings'];
|
||||
if (isset($params['isForResolutionCheck'])) $this->_isForResolutionCheck = $params['isForResolutionCheck'];
|
||||
|
||||
// set application
|
||||
$app = isset($params['app']) ? $params['app'] : null;
|
||||
|
||||
$this->_ci =& get_instance(); // get ci instance
|
||||
|
||||
// load libraries
|
||||
$this->_ci->load->library('IssuesLib');
|
||||
|
||||
// load models
|
||||
$this->_ci->load->model('system/Fehlerkonfiguration_model', 'FehlerkonfigurationModel');
|
||||
|
||||
@@ -41,6 +48,52 @@ class PlausicheckProducerLib
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Produces multiple plausicheck issues at once and saved them to db.
|
||||
* @param array $params passed to each plausicheck
|
||||
* @return result object with occured error and info
|
||||
*/
|
||||
public function producePlausicheckIssues($params)
|
||||
{
|
||||
$result = new StdClass();
|
||||
$result->errors = [];
|
||||
$result->infos = [];
|
||||
|
||||
foreach ($this->_fehlerLibMappings as $fehler_kurzbz => $libName)
|
||||
{
|
||||
$plausicheckRes = $this->producePlausicheckIssue(
|
||||
$libName,
|
||||
$fehler_kurzbz,
|
||||
$params
|
||||
);
|
||||
|
||||
if (hasData($plausicheckRes))
|
||||
{
|
||||
$plausicheckData = getData($plausicheckRes);
|
||||
|
||||
foreach ($plausicheckData as $plausiData)
|
||||
{
|
||||
// get the data needed for issue production
|
||||
$person_id = isset($plausiData['person_id']) ? $plausiData['person_id'] : null;
|
||||
$oe_kurzbz = isset($plausiData['oe_kurzbz']) ? $plausiData['oe_kurzbz'] : null;
|
||||
$fehlertext_params = isset($plausiData['fehlertext_params']) ? $plausiData['fehlertext_params'] : null;
|
||||
$resolution_params = isset($plausiData['resolution_params']) ? $plausiData['resolution_params'] : null;
|
||||
|
||||
// write the issue
|
||||
$addIssueRes = $this->_ci->issueslib->addFhcIssue($fehler_kurzbz, $person_id, $oe_kurzbz, $fehlertext_params, $resolution_params);
|
||||
|
||||
// log if error, or log info if inserted new issue
|
||||
if (isError($addIssueRes))
|
||||
$result->errors[] = getError($addIssueRes);
|
||||
elseif (hasData($addIssueRes) && is_integer(getData($addIssueRes)))
|
||||
$result->infos[] = "Plausicheck issue " . $fehler_kurzbz . " successfully produced, person_id: " . $person_id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes plausicheck using a given library, returns the result.
|
||||
* @param $libName string name of library producing the issue
|
||||
@@ -66,7 +119,10 @@ class PlausicheckProducerLib
|
||||
$config = isset($this->_konfiguration[$fehler_kurzbz]) ? $this->_konfiguration[$fehler_kurzbz] : null;
|
||||
|
||||
// load library connected to fehlercode
|
||||
$this->_ci->load->library($issuesLibPath . $libName, $config);
|
||||
$this->_ci->load->library(
|
||||
$issuesLibPath . $libName,
|
||||
['configurationParams' => $config, 'isForResolutionCheck' => $this->_isForResolutionCheck]
|
||||
);
|
||||
|
||||
$lowercaseLibName = mb_strtolower($libName);
|
||||
|
||||
|
||||
@@ -0,0 +1,136 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class PlausicheckResolverLib
|
||||
{
|
||||
const CI_PATH = 'application';
|
||||
const CI_LIBRARY_FOLDER = 'libraries';
|
||||
const EXTENSIONS_FOLDER = 'extensions';
|
||||
const ISSUE_RESOLVERS_FOLDER = 'issues/resolvers';
|
||||
const CHECK_ISSUE_RESOLVED_METHOD_NAME = 'checkIfIssueIsResolved';
|
||||
|
||||
private $_ci; // ci instance
|
||||
private $_extensionName; // name of extension
|
||||
private $_codeLibMappings = []; // mappings for issues which explicitly defined resolver
|
||||
private $_codeProducerLibMappings = []; // mappings for issues which are resolved as produced
|
||||
|
||||
public function __construct($params = null)
|
||||
{
|
||||
// set extension name if called from extension
|
||||
if (isset($params['extensionName'])) $this->_extensionName = $params['extensionName'];
|
||||
if (isset($params['codeLibMappings'])) $this->_codeLibMappings = $params['codeLibMappings'];
|
||||
if (isset($params['codeProducerLibMappings'])) $this->_codeProducerLibMappings = $params['codeProducerLibMappings'];
|
||||
|
||||
$this->_ci =& get_instance(); // get ci instance
|
||||
|
||||
$this->_ci->load->library('IssuesLib');
|
||||
$this->_ci->load->library('issues/PlausicheckProducerLib', ['isForResolutionCheck' => true]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reseolves multiple plausicheck issues at once.
|
||||
* @param array $codeLibMappings contains fehler type to check and library responsible for check (fehlercode => libName)
|
||||
* @param array $openIssues passed issues to resolve
|
||||
* @return result object with occured error and info
|
||||
*/
|
||||
public function resolvePlausicheckIssues($openIssues)
|
||||
{
|
||||
$result = new StdClass();
|
||||
$result->errors = [];
|
||||
$result->infos = [];
|
||||
|
||||
foreach ($openIssues as $issue)
|
||||
{
|
||||
// add person id and oe kurzbz automatically as params, merge it with additional params
|
||||
// decode bewerbung_parameter into assoc array
|
||||
$params = array_merge(
|
||||
array('issue_id' => $issue->issue_id, 'issue_person_id' => $issue->person_id, 'issue_oe_kurzbz' => $issue->oe_kurzbz),
|
||||
isset($issue->behebung_parameter) ? json_decode($issue->behebung_parameter, true) : array()
|
||||
);
|
||||
|
||||
$issueResolved = false;
|
||||
|
||||
// ignore if Fehlercode is not in libmappings (shouldn't be checked)
|
||||
if (isset($this->_codeLibMappings[$issue->fehlercode]))
|
||||
{
|
||||
$libName = $this->_codeLibMappings[$issue->fehlercode];
|
||||
|
||||
// if called from extension (extension name set), path includes extension names
|
||||
$libRootPath = isset($this->_extensionName) ? self::EXTENSIONS_FOLDER . '/' . $this->_extensionName . '/' : '';
|
||||
|
||||
// path for loading issue library
|
||||
$issuesLibPath = $libRootPath . self::ISSUE_RESOLVERS_FOLDER . '/';
|
||||
|
||||
// file path of library for check if file exists
|
||||
$issuesLibFilePath = DOC_ROOT . self::CI_PATH
|
||||
. '/' . $libRootPath . self::CI_LIBRARY_FOLDER . '/' . self::ISSUE_RESOLVERS_FOLDER . '/' . $libName . '.php';
|
||||
|
||||
// check if library file exists
|
||||
if (!file_exists($issuesLibFilePath))
|
||||
{
|
||||
// log error and continue with next issue if not
|
||||
$result->errors[] = "Issue library file " . $issuesLibFilePath . " does not exist";
|
||||
continue;
|
||||
}
|
||||
|
||||
// load library connected to fehlercode
|
||||
$this->_ci->load->library($issuesLibPath . $libName);
|
||||
|
||||
$lowercaseLibName = mb_strtolower($libName);
|
||||
|
||||
// check if method is defined in library class
|
||||
if (!is_callable(array($this->_ci->{$lowercaseLibName}, self::CHECK_ISSUE_RESOLVED_METHOD_NAME)))
|
||||
{
|
||||
// log error and continue with next issue if not
|
||||
$result->errors[] = "Method " . self::CHECK_ISSUE_RESOLVED_METHOD_NAME . " is not defined in library $lowercaseLibName";
|
||||
continue;
|
||||
}
|
||||
|
||||
// call the function for checking for issue resolution
|
||||
$issueResolvedRes = $this->_ci->{$lowercaseLibName}->{self::CHECK_ISSUE_RESOLVED_METHOD_NAME}($params);
|
||||
|
||||
if (isError($issueResolvedRes))
|
||||
{
|
||||
$result->errors[] = getError($issueResolvedRes);
|
||||
}
|
||||
else
|
||||
{
|
||||
$issueResolved = getData($issueResolvedRes) === true;
|
||||
}
|
||||
}
|
||||
elseif (isset($this->_codeProducerLibMappings[$issue->fehlercode]))
|
||||
{
|
||||
$libName = $this->_codeProducerLibMappings[$issue->fehlercode];
|
||||
|
||||
$issueResolvedRes = $this->_ci->plausicheckproducerlib->producePlausicheckIssue(
|
||||
$libName,
|
||||
$issue->fehler_kurzbz,
|
||||
$params
|
||||
);
|
||||
|
||||
if (isError($issueResolvedRes))
|
||||
{
|
||||
$result->errors[] = getError($issueResolvedRes);
|
||||
}
|
||||
else
|
||||
{
|
||||
$issueResolved = !hasData($issueResolvedRes);
|
||||
}
|
||||
}
|
||||
|
||||
// set issue to resolved if needed
|
||||
if ($issueResolved)
|
||||
{
|
||||
$behobenRes = $this->_ci->issueslib->setBehoben($issue->issue_id, null);
|
||||
|
||||
if (isError($behobenRes))
|
||||
$result->errors[] = getError($behobenRes);
|
||||
else
|
||||
$result->infos[] = "Issue " . $issue->issue_id . " successfully resolved";
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
@@ -9,83 +9,21 @@ require_once('PlausiChecker.php');
|
||||
*/
|
||||
class AbbrecherAktiv extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
protected $_base_sql = "
|
||||
SELECT
|
||||
pre.person_id, pre.prestudent_id, stg.oe_kurzbz AS prestudent_stg_oe_kurzbz
|
||||
FROM
|
||||
public.tbl_prestudentstatus pre_status
|
||||
JOIN public.tbl_prestudent pre USING(prestudent_id)
|
||||
JOIN public.tbl_student student USING(prestudent_id)
|
||||
JOIN public.tbl_benutzer benutzer on(benutzer.uid=student.student_uid)
|
||||
JOIN public.tbl_studiengang stg ON pre.studiengang_kz = stg.studiengang_kz
|
||||
WHERE
|
||||
pre_status.status_kurzbz ='Abbrecher'
|
||||
AND benutzer.aktiv=true";
|
||||
|
||||
// get parameters from config
|
||||
$exkludierte_studiengang_kz = isset($this->_config['exkludierteStudiengaenge']) ? $this->_config['exkludierteStudiengaenge'] : null;
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->getAbbrecherAktiv($studiengang_kz, null, $exkludierte_studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudents = getData($prestudentRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $prestudent->person_id,
|
||||
'oe_kurzbz' => $prestudent->prestudent_stg_oe_kurzbz,
|
||||
'fehlertext_params' => array('prestudent_id' => $prestudent->prestudent_id),
|
||||
'resolution_params' => array('prestudent_id' => $prestudent->prestudent_id)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
|
||||
/**
|
||||
* Abbrecher cannot be active.
|
||||
* @param studiengang_kz int if check is to be executed for certain Studiengang
|
||||
* @param prestudent_id int if check is to be executed only for one prestudent
|
||||
* @param exkludierte_studiengang_kz array if certain Studiengänge have to be excluded from check
|
||||
* @return success with prestudents or error
|
||||
*/
|
||||
public function getAbbrecherAktiv($studiengang_kz = null, $prestudent_id = null, $exkludierte_studiengang_kz = null)
|
||||
{
|
||||
$params = array();
|
||||
|
||||
$qry = "
|
||||
SELECT
|
||||
pre.person_id, pre.prestudent_id, stg.oe_kurzbz AS prestudent_stg_oe_kurzbz
|
||||
FROM
|
||||
public.tbl_prestudentstatus pre_status
|
||||
JOIN public.tbl_prestudent pre USING(prestudent_id)
|
||||
JOIN public.tbl_student student USING(prestudent_id)
|
||||
JOIN public.tbl_benutzer benutzer on(benutzer.uid=student.student_uid)
|
||||
JOIN public.tbl_studiengang stg ON pre.studiengang_kz = stg.studiengang_kz
|
||||
WHERE
|
||||
pre_status.status_kurzbz ='Abbrecher'
|
||||
AND benutzer.aktiv=true";
|
||||
|
||||
if (isset($studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz = ?";
|
||||
$params[] = $studiengang_kz;
|
||||
}
|
||||
|
||||
if (isset($prestudent_id))
|
||||
{
|
||||
$qry .= " AND pre.prestudent_id = ?";
|
||||
$params[] = $prestudent_id;
|
||||
}
|
||||
|
||||
if (isset($exkludierte_studiengang_kz) && !isEmptyArray($exkludierte_studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz NOT IN ?";
|
||||
$params[] = $exkludierte_studiengang_kz;
|
||||
}
|
||||
|
||||
return $this->_db->execReadOnlyQuery($qry, $params);
|
||||
}
|
||||
protected $_config_params = ['exkludierteStudiengaenge' => " AND stg.studiengang_kz NOT IN ?"];
|
||||
protected $_params_for_checking = ['studiengang_kz' => " AND stg.studiengang_kz = ?", 'prestudent_id' => " AND pre.prestudent_id = ?"];
|
||||
protected $_fehlertext_params = ['prestudent_id'];
|
||||
protected $_resolution_params = ['prestudent_id'];
|
||||
}
|
||||
|
||||
@@ -6,15 +6,25 @@
|
||||
abstract class PlausiChecker
|
||||
{
|
||||
protected $_ci; // code igniter instance
|
||||
protected $_config; // configuration parameters for this plausicheck
|
||||
protected $_config; // all applicable configuration parameters for this plausicheck
|
||||
protected $_db; // database for queries
|
||||
|
||||
public function __construct($configurationParams = null)
|
||||
protected $_isForResolutionCheck;
|
||||
|
||||
protected $_config_params = []; // name of all config params which should be applied for this plausicheck, with sql [name] => [sql]
|
||||
protected $_params_for_checking = []; // name of all passed params for checking, with sql [name] => [sql]
|
||||
|
||||
protected $_fehlertext_params = []; // parameter names for fehlertext params used for this plausicheck
|
||||
protected $_resolution_params = []; // parameter names for resolution params used for this plausicheck
|
||||
|
||||
public function __construct($params = null)
|
||||
{
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
// set configuration
|
||||
$this->_config = $configurationParams;
|
||||
$this->_config = $params['configurationParams'] ?? [];
|
||||
|
||||
$this->_isForResolutionCheck = $params['isForResolutionCheck'] ?? false;
|
||||
|
||||
// get database for queries
|
||||
$this->_db = new DB_Model();
|
||||
@@ -25,5 +35,83 @@ abstract class PlausiChecker
|
||||
* @param $paramsForChecking array parameters needed for executing the check
|
||||
* @return array with objects which failed the plausi check
|
||||
*/
|
||||
abstract public function executePlausiCheck($paramsForChecking);
|
||||
public function executePlausiCheck($paramsForChecking)
|
||||
{
|
||||
$results = [];
|
||||
$params = [];
|
||||
$qry = $this->_base_sql;
|
||||
|
||||
if ($this->_isForResolutionCheck == true)
|
||||
{
|
||||
foreach ($this->_resolution_params as $resParam)
|
||||
{
|
||||
if (!isset($paramsForChecking[$resParam]))
|
||||
return error("$resParam missing".(isset($paramsForChecking['issue_id']) ? ", issue ID: ".$paramsForChecking['issue_id'] : ""));
|
||||
}
|
||||
}
|
||||
|
||||
// add config params to query
|
||||
if (isset($this->_config_params) && !isEmptyArray($this->_config_params))
|
||||
{
|
||||
foreach ($this->_config_params as $param_name => $param_sql)
|
||||
{
|
||||
if (isset($this->_config[$param_name]))
|
||||
{
|
||||
$qry .= $param_sql;
|
||||
$params[] = $this->_config[$param_name];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// add check params to query
|
||||
if (isset($this->_params_for_checking) && !isEmptyArray($this->_params_for_checking))
|
||||
{
|
||||
foreach ($this->_params_for_checking as $param_name => $param_sql)
|
||||
{
|
||||
if (isset($paramsForChecking[$param_name]))
|
||||
{
|
||||
$qry .= $param_sql;
|
||||
$params[] = $paramsForChecking[$param_name];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$result = $this->_db->execReadOnlyQuery($qry, $params);
|
||||
|
||||
if (isError($result)) return $result;
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
$data = getData($result);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($data as $d)
|
||||
{
|
||||
$fehlertext_params = [];
|
||||
$resolution_params = [];
|
||||
|
||||
// add params for error texts
|
||||
foreach ($this->_fehlertext_params as $param)
|
||||
{
|
||||
if (isset($d->{$param})) $fehlertext_params[$param] = $d->{$param};
|
||||
}
|
||||
|
||||
// add params for resolution of issue
|
||||
foreach ($this->_resolution_params as $param)
|
||||
{
|
||||
if (isset($d->{$param})) $resolution_params[$param] = $d->{$param};
|
||||
}
|
||||
|
||||
$results[] = array(
|
||||
'person_id' => $d->person_id,
|
||||
'oe_kurzbz' => $d->prestudent_stg_oe_kurzbz,
|
||||
'fehlertext_params' => $fehlertext_params,
|
||||
'resolution_params' => $resolution_params
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +29,9 @@ class Dienstverhaeltnis extends AbstractBestandteil {
|
||||
protected $updateamum;
|
||||
protected $updatevon;
|
||||
|
||||
protected $dvendegrund_kurzbz;
|
||||
protected $dvendegrund_anmerkung;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
@@ -49,6 +52,8 @@ class Dienstverhaeltnis extends AbstractBestandteil {
|
||||
isset($data->insertvon) && $this->setInsertvon($data->insertvon);
|
||||
isset($data->updateamum) && $this->setUpdateamum($data->updateamum);
|
||||
isset($data->updatevon) && $this->setUpdatevon($data->updatevon);
|
||||
isset($data->dvendegrund_kurzbz) && $this->setDvendegrund_kurzbz($data->dvendegrund_kurzbz);
|
||||
isset($data->dvendegrund_anmerkung) && $this->setDvendegrund_anmerkung($data->dvendegrund_anmerkung);
|
||||
$this->fromdb = false;
|
||||
}
|
||||
|
||||
@@ -64,7 +69,9 @@ class Dienstverhaeltnis extends AbstractBestandteil {
|
||||
'insertamum' => $this->getInsertamum(),
|
||||
'insertvon' => $this->getInsertvon(),
|
||||
'updateamum' => $this->getUpdateamum(),
|
||||
'updatevon' => $this->getUpdatevon()
|
||||
'updatevon' => $this->getUpdatevon(),
|
||||
'dvendegrund_kurzbz' => $this->getDvendegrund_kurzbz(),
|
||||
'dvendegrund_anmerkung' => $this->getDvendegrund_anmerkung()
|
||||
);
|
||||
|
||||
$tmp = array_filter($tmp, function($k) {
|
||||
@@ -139,6 +146,16 @@ EOTXT;
|
||||
return $this->updatevon;
|
||||
}
|
||||
|
||||
public function getDvendegrund_kurzbz()
|
||||
{
|
||||
return $this->dvendegrund_kurzbz;
|
||||
}
|
||||
|
||||
public function getDvendegrund_anmerkung()
|
||||
{
|
||||
return $this->dvendegrund_anmerkung;
|
||||
}
|
||||
|
||||
public function setDienstverhaeltnis_id($dienstverhaeltnis_id)
|
||||
{
|
||||
$this->markDirty('dienstverhaeltnis_id', $this->dienstverhaeltnis_id, $dienstverhaeltnis_id);
|
||||
@@ -214,6 +231,20 @@ EOTXT;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setDvendegrund_kurzbz($dvendegrund_kurzbz)
|
||||
{
|
||||
$this->markDirty('dvendegrund_kurzbz', $this->dvendegrund_kurzbz, $dvendegrund_kurzbz);
|
||||
$this->dvendegrund_kurzbz = $dvendegrund_kurzbz;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setDvendegrund_anmerkung($dvendegrund_anmerkung)
|
||||
{
|
||||
$this->markDirty('dvendegrund_anmerkung', $this->dvendegrund_anmerkung, $dvendegrund_anmerkung);
|
||||
$this->dvendegrund_anmerkung = $dvendegrund_anmerkung;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function validate() {
|
||||
//do Validation here
|
||||
$ci = get_instance();
|
||||
|
||||
@@ -435,7 +435,7 @@ class VertragsbestandteilLib
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function endDienstverhaeltnis(Dienstverhaeltnis $dv, $enddate)
|
||||
public function endDienstverhaeltnis(Dienstverhaeltnis $dv, $enddate, $dvendegrund_kurzbz=null, $dvendegrund_anmerkung=null)
|
||||
{
|
||||
if( $dv->getBis() !== null && $dv->getBis() < $enddate )
|
||||
{
|
||||
@@ -460,6 +460,14 @@ class VertragsbestandteilLib
|
||||
$this->endVertragsbestandteil($vb, $enddate);
|
||||
}
|
||||
|
||||
if( $dvendegrund_kurzbz !== null )
|
||||
{
|
||||
$dv->setDvendegrund_kurzbz($dvendegrund_kurzbz);
|
||||
}
|
||||
if( $dvendegrund_anmerkung !== null )
|
||||
{
|
||||
$dv->setDvendegrund_anmerkung($dvendegrund_anmerkung);
|
||||
}
|
||||
$dv->setBis($enddate);
|
||||
$this->updateDienstverhaeltnis($dv);
|
||||
|
||||
|
||||
@@ -188,4 +188,20 @@ class Organisationseinheit_model extends DB_Model
|
||||
}
|
||||
return $this->loadWhere($condition);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get OEs by eventQuery string. Use with autocomplete event queries.
|
||||
* @param $eventQuery String
|
||||
* @return array
|
||||
*/
|
||||
public function getAutocompleteSuggestions($eventQuery)
|
||||
{
|
||||
$this->addSelect('oe_kurzbz');
|
||||
$this->addSelect('organisationseinheittyp_kurzbz, oe_kurzbz, bezeichnung, aktiv, lehre');
|
||||
$this->addOrder('organisationseinheittyp_kurzbz, bezeichnung');
|
||||
|
||||
return $this->loadWhere("
|
||||
oe_kurzbz ILIKE '%". $this->escapeLike($eventQuery). "%'
|
||||
");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,13 +22,23 @@ class Issue_model extends DB_Model
|
||||
*/
|
||||
public function getOpenIssues($fehlercodes, $person_id = null, $oe_kurzbz = null, $fehlercode_extern = null)
|
||||
{
|
||||
$params = array($fehlercodes);
|
||||
$params = array();
|
||||
// issue exists for a fehlercode (or fehlercode_extern), person_id, oe_kurzbz, if not verarbeitet yet
|
||||
$qry = 'SELECT issue_id, fehlercode, inhalt, fehlercode_extern, inhalt_extern, person_id, oe_kurzbz,
|
||||
behebung_parameter, datum, verarbeitetvon, verarbeitetamum
|
||||
FROM system.tbl_issue
|
||||
WHERE fehlercode IN ?
|
||||
AND verarbeitetamum IS NULL';
|
||||
$qry = 'SELECT
|
||||
iss.issue_id, iss.fehlercode, fe.fehler_kurzbz, iss.inhalt, iss.fehlercode_extern,
|
||||
iss.inhalt_extern, iss.person_id, iss.oe_kurzbz, iss.behebung_parameter,
|
||||
iss.datum, iss.verarbeitetvon, iss.verarbeitetamum
|
||||
FROM
|
||||
system.tbl_issue iss
|
||||
JOIN system.tbl_fehler fe USING (fehlercode)
|
||||
WHERE
|
||||
verarbeitetamum IS NULL';
|
||||
|
||||
if (!isEmptyArray($fehlercodes))
|
||||
{
|
||||
$qry .= ' AND fehlercode IN ?';
|
||||
$params[] = $fehlercodes;
|
||||
}
|
||||
|
||||
if (!isEmptyString($fehlercode_extern))
|
||||
{
|
||||
@@ -59,7 +69,7 @@ class Issue_model extends DB_Model
|
||||
* @param string $fehlercode_extern if provided, only issues with this external fehlercode are counted (for identifying issues from external systems).
|
||||
* @return Object success with number of issues or error
|
||||
*/
|
||||
public function getOpenIssueCount($fehlercode, $person_id = null, $oe_kurzbz = null, $fehlercode_extern = null)
|
||||
public function getOpenIssueCount($fehlercode, $person_id = null, $oe_kurzbz = null, $fehlercode_extern = null, $behebung_parameter = null)
|
||||
{
|
||||
$params = array($fehlercode);
|
||||
// issue exists for a fehlercode (or fehlercode_extern), person_id, oe_kurzbz, if not verarbeitet yet
|
||||
@@ -85,6 +95,19 @@ class Issue_model extends DB_Model
|
||||
$params[] = $oe_kurzbz;
|
||||
}
|
||||
|
||||
if (isset($behebung_parameter) && !isEmptyArray($behebung_parameter))
|
||||
{
|
||||
// convert array to JSON string for postgres
|
||||
$behebung_parameter_string = json_encode($behebung_parameter);
|
||||
|
||||
if ($behebung_parameter_string)
|
||||
{
|
||||
// check if jsonb value is equal to the passed parameters array (if value contains array and array contains value)
|
||||
$qry .= ' AND behebung_parameter @> ? AND behebung_parameter <@ ?';
|
||||
$params = array_merge($params, array($behebung_parameter_string, $behebung_parameter_string));
|
||||
}
|
||||
}
|
||||
|
||||
return $this->execQuery($qry, $params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,9 +31,13 @@ class Dienstverhaeltnis_model extends DB_Model
|
||||
org.bezeichnung oe_bezeichnung,
|
||||
dv.von,
|
||||
dv.bis,
|
||||
dv.dvendegrund_kurzbz,
|
||||
dv.dvendegrund_anmerkung,
|
||||
dv.vertragsart_kurzbz,
|
||||
dv.updateamum,
|
||||
dv.updatevon
|
||||
dv.updatevon,
|
||||
dv.dvendegrund_kurzbz,
|
||||
dv.dvendegrund_anmerkung
|
||||
FROM tbl_mitarbeiter
|
||||
JOIN tbl_benutzer ON tbl_mitarbeiter.mitarbeiter_uid::text = tbl_benutzer.uid::text
|
||||
JOIN tbl_person USING (person_id)
|
||||
|
||||
@@ -127,6 +127,11 @@
|
||||
generateJSsInclude('vendor/npm-asset/primevue/autocomplete/autocomplete.min.js');
|
||||
generateJSsInclude('vendor/npm-asset/primevue/overlaypanel/overlaypanel.min.js');
|
||||
generateJSsInclude('vendor/npm-asset/primevue/datatable/datatable.min.js');
|
||||
// TODO check ob notwendig
|
||||
generateJSsInclude('vendor/npm-asset/primevue/toast/toast.min.js');
|
||||
generateJSsInclude('vendor/npm-asset/primevue/toastservice/toastservice.min.js');
|
||||
generateJSsInclude('vendor/npm-asset/primevue/confirmdialog/confirmdialog.min.js');
|
||||
generateJSsInclude('vendor/npm-asset/primevue/confirmationservice/confirmationservice.min.js');
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -270,7 +270,7 @@ if (isset($_POST['titel']))
|
||||
foreach($addon_obj->result as $addon)
|
||||
{
|
||||
if(file_exists('../../../addons/'.$addon->kurzbz.'/cis/init.js.php'))
|
||||
echo '<script type="application/x-javascript" src="../../../addons/'.$addon->kurzbz.'/cis/init.js.php" ></script>';
|
||||
echo '<script type="application/x-javascript" src="../../../addons/'.$addon->kurzbz.'/cis/init.js.php"></script>';
|
||||
}
|
||||
|
||||
// Wenn Seite fertig geladen ist Addons aufrufen
|
||||
|
||||
@@ -122,7 +122,7 @@ echo "<?xml-stylesheet href=\"".APP_ROOT."content/bindings.css\" type=\"text/css
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="lehrveranstaltung-noten-tree-verband" label="Verband" flex="2" hidden="true" persist="hidden, width, ordinal"
|
||||
class="sortDirectionIndicator"
|
||||
sort="rdf:http://www.technikum-wien.at/zeugnisnote/rdf#verband" />
|
||||
sort="rdf:http://www.technikum-wien.at/zeugnisnote/rdf#verband" />
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="lehrveranstaltung-noten-tree-studiengang_kz_lv" label="LehrveranstaltungStudiengang_kz" flex="1" hidden="true" persist="hidden, width, ordinal"
|
||||
class="sortDirectionIndicator"
|
||||
@@ -299,7 +299,7 @@ if(defined('FAS_GESAMTNOTE_PRUEFUNGSHONORAR') && FAS_GESAMTNOTE_PRUEFUNGSHONORAR
|
||||
<hbox>
|
||||
<label value="MitarbeiterIn" control="lehrveranstaltung-noten-pruefung-menulist-mitarbeiter"/>
|
||||
<menulist id="lehrveranstaltung-noten-pruefung-menulist-mitarbeiter"
|
||||
datasources="'.APP_ROOT.'rdf/mitarbeiter.rdf.php" flex="1"
|
||||
datasources="'.APP_ROOT.'rdf/mitarbeiter.rdf.php?aktiv=true" flex="1"
|
||||
ref="http://www.technikum-wien.at/mitarbeiter/_alle"
|
||||
minwidth="250"
|
||||
>
|
||||
|
||||
@@ -137,7 +137,7 @@ echo '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>';
|
||||
<treecell label="rdf:http://www.technikum-wien.at/abschlusspruefung/rdf#pruefer1_nachname" />
|
||||
<treecell label="rdf:http://www.technikum-wien.at/abschlusspruefung/rdf#pruefer2_nachname" />
|
||||
<treecell label="rdf:http://www.technikum-wien.at/abschlusspruefung/rdf#pruefer3_nachname" />
|
||||
<treecell label="rdf:http://www.technikum-wien.at/abschlusspruefung/rdf#abschlussbeurteilung_kurzbz" />
|
||||
<treecell label="rdf:http://www.technikum-wien.at/abschlusspruefung/rdf#abschlussbeurteilung_bezeichnung" />
|
||||
<treecell label="rdf:http://www.technikum-wien.at/abschlusspruefung/rdf#datum" />
|
||||
<treecell label="rdf:http://www.technikum-wien.at/abschlusspruefung/rdf#uhrzeit" />
|
||||
<treecell label="rdf:http://www.technikum-wien.at/abschlusspruefung/rdf#freigabedatum" />
|
||||
|
||||
@@ -317,7 +317,7 @@ class mitarbeiter extends benutzer
|
||||
* gibt array mit allen Mitarbeitern zurueck
|
||||
* @return array mit Mitarbeitern
|
||||
*/
|
||||
public function getMitarbeiter($lektor=true,$fixangestellt=null,$stg_kz=null)
|
||||
public function getMitarbeiter($lektor=true,$fixangestellt=null,$stg_kz=null, $aktiv=null)
|
||||
{
|
||||
$sql_query='SELECT DISTINCT campus.vw_mitarbeiter.uid, titelpre, titelpost, vorname, vornamen, wahlname, nachname, gebdatum, gebort, gebzeit, anmerkung, aktiv,
|
||||
homepage, campus.vw_mitarbeiter.updateamum, campus.vw_mitarbeiter.updatevon, personalnummer, kurzbz, lektor, fixangestellt, standort_id, telefonklappe FROM campus.vw_mitarbeiter
|
||||
@@ -346,6 +346,14 @@ class mitarbeiter extends benutzer
|
||||
$sql_query.=" AND oe_kurzbz=".$this->db_add_param($stg->oe_kurzbz);
|
||||
}
|
||||
|
||||
if(!is_null($aktiv))
|
||||
{
|
||||
$sql_query.=' AND';
|
||||
if (!$aktiv)
|
||||
$sql_query.=' NOT';
|
||||
$sql_query.=' aktiv';
|
||||
}
|
||||
|
||||
$sql_query.=' ORDER BY nachname, vornamen, kurzbz;';
|
||||
|
||||
if(!$this->db_query($sql_query))
|
||||
|
||||
@@ -382,7 +382,7 @@ class projekt extends basis_db
|
||||
JOIN fue.tbl_projekt_ressource USING(ressource_id)
|
||||
JOIN fue.tbl_projekt USING(projekt_kurzbz)
|
||||
WHERE (beginn<=now() or beginn is null)
|
||||
AND (ende + interval '1 month 1 day' >=now() OR ende is null)
|
||||
AND (ende + interval '2 month 1 day' >=now() OR ende is null)
|
||||
AND
|
||||
(
|
||||
mitarbeiter_uid=" . $this->db_add_param($mitarbeiter_uid) . " OR
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
}
|
||||
|
||||
.tabulator-cell .btn {
|
||||
padding: 0 .5rem;
|
||||
max-height: 22px;
|
||||
min-width: 30px;
|
||||
padding: 0 .7rem;
|
||||
min-height: 25px;
|
||||
min-width: 25px;
|
||||
}
|
||||
|
||||
@@ -160,12 +160,12 @@ export default {
|
||||
},
|
||||
modelValueCmp: {
|
||||
get() {
|
||||
if (this.$attrs.modelValue === undefined)
|
||||
if (!this.$attrs.hasOwnProperty('modelValue'))
|
||||
return this.modelValueDummy;
|
||||
return this.$attrs.modelValue;
|
||||
},
|
||||
set(v) {
|
||||
if (this.$attrs.modelValue === undefined)
|
||||
if (!this.$attrs.hasOwnProperty('modelValue'))
|
||||
this.modelValueDummy = v;
|
||||
this.$emit('update:modelValue', v);
|
||||
}
|
||||
@@ -236,12 +236,13 @@ export default {
|
||||
},
|
||||
template: `
|
||||
<component :is="!hasContainer ? 'FhcFragment' : 'div'" class="position-relative" :class="autoContainerClass">
|
||||
<label v-if="$attrs.label && lcType != 'radio' && lcType != 'checkbox'" :for="idCmp">{{$attrs.label}}</label>
|
||||
<label v-if="$attrs.label && lcType != 'radio' && lcType != 'checkbox'" :class="!noAutoClass && 'form-label'" :for="idCmp">{{$attrs.label}}</label>
|
||||
<input v-if="tag == 'input'" :type="lcType" ref="input" v-model="modelValueCmp" v-bind="$attrs" :id="idCmp" :name="name" :class="validationClass" :modelValue="undefined" @input="clearValidationForThisName(); $emit('input', $event)">
|
||||
<textarea v-else-if="tag == 'textarea'" ref="input" v-model="modelValueCmp" v-bind="$attrs" :id="idCmp" :name="name" :class="validationClass" :modelValue="undefined" @input="clearValidationForThisName(); $emit('input', $event)"></textarea>
|
||||
<select v-else-if="tag == 'select'" ref="input" v-model="modelValueCmp" v-bind="$attrs" :id="idCmp" :name="name" :class="validationClass" :modelValue="undefined" @input="clearValidationForThisName(); $emit('input', $event)">
|
||||
<slot></slot>
|
||||
</select>
|
||||
|
||||
<component
|
||||
v-else-if="tag == 'VueDatePicker'"
|
||||
ref="input"
|
||||
@@ -272,6 +273,17 @@ export default {
|
||||
@update:model-value="clearValidationForThisName"
|
||||
>
|
||||
<slot></slot>
|
||||
<template #chip="data"><slot name="chip" v-bind="data"></slot></template>
|
||||
<template #header="data"><slot name="header" v-bind="data"></slot></template>
|
||||
<template #footer="data"><slot name="footer" v-bind="data"></slot></template>
|
||||
<template #option="data"><slot name="option" v-bind="data"></slot></template>
|
||||
<template #optiongroup="data"><slot name="optiongroup" v-bind="data"></slot></template>
|
||||
<template #content="data"><slot name="content" v-bind="data"></slot></template>
|
||||
<template #loader="data"><slot name="loader" v-bind="data"></slot></template>
|
||||
<template #empty="data"><slot name="empty" v-bind="data"></slot></template>
|
||||
<template #dropdownicon="data"><slot name="dropdownicon" v-bind="data"></slot></template>
|
||||
<template #removetokenicon="data"><slot name="removetokenicon" v-bind="data"></slot></template>
|
||||
<template #loadingicon="data"><slot name="loadingicon" v-bind="data"></slot></template>
|
||||
</component>
|
||||
<component
|
||||
v-else-if="tag == 'UploadDms'"
|
||||
|
||||
@@ -75,7 +75,7 @@ export default {
|
||||
|
||||
tabs[key] = {
|
||||
component: Vue.markRaw(Vue.defineAsyncComponent(() => import(item.component))),
|
||||
title: item.title || key,
|
||||
title: Vue.computed(() => item.title || key),
|
||||
config: item.config,
|
||||
key
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
import {CoreRESTClient} from '../../RESTClient.js';
|
||||
|
||||
//
|
||||
//
|
||||
const CORE_FILTER_CMPT_TIMEOUT = 7000;
|
||||
|
||||
/**
|
||||
|
||||
@@ -62,7 +62,11 @@ export const CoreFilterCmpt = {
|
||||
newBtnShow: Boolean,
|
||||
newBtnClass: [String, Array, Object],
|
||||
newBtnDisabled: Boolean,
|
||||
newBtnLabel: String
|
||||
newBtnLabel: String,
|
||||
uniqueId: String,
|
||||
// TODO soll im master kommen?
|
||||
idField: String,
|
||||
parentIdField: String
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
@@ -209,6 +213,13 @@ export const CoreFilterCmpt = {
|
||||
|
||||
if (tabulatorOptions.columns && tabulatorOptions.columns.filter(el => el.formatter == 'rowSelection').length)
|
||||
this.tabulatorHasSelector = true;
|
||||
// TODO check ob im core bleiben soll
|
||||
if (this.idField) {
|
||||
// enable nested tabulator if parent Id given
|
||||
if (this.parentIdField) tabulatorOptions.dataTree = true;
|
||||
// set tabulator index
|
||||
tabulatorOptions.index = this.idField;
|
||||
}
|
||||
|
||||
// Start the tabulator with the build options
|
||||
this.tabulator = new Tabulator(
|
||||
@@ -226,6 +237,33 @@ export const CoreFilterCmpt = {
|
||||
this.tabulator.on("rowSelectionChanged", data => {
|
||||
this.selectedData = data;
|
||||
});
|
||||
// TODO check ob im core so bleiben soll
|
||||
// if nested tabulator, restructure data
|
||||
if (this.parentIdField && this.idField) {
|
||||
this.tabulator.on("dataLoading", data => {
|
||||
let toDelete = [];
|
||||
|
||||
// loop through all data
|
||||
for (let childIdx = 0; childIdx < data.length; childIdx++)
|
||||
{
|
||||
let child = data[childIdx];
|
||||
|
||||
// if it has parent id, it is a child
|
||||
if (child[this.parentIdField])
|
||||
{
|
||||
// append the child on the right place. If parent found, mark original sw child on 0 level for deleting
|
||||
if (this.appendChild(data, child)) toDelete.push(childIdx);
|
||||
}
|
||||
}
|
||||
|
||||
// delete the marked children from 0 level
|
||||
for (let counter = 0; counter < toDelete.length; counter++)
|
||||
{
|
||||
// decrease index by counter as index of data array changes after every deletion
|
||||
data.splice(toDelete[counter] - counter, 1);
|
||||
}
|
||||
});
|
||||
}
|
||||
if (this.tableOnly) {
|
||||
this.tabulator.on('tableBuilt', () => {
|
||||
const cols = this.tabulator.getColumns();
|
||||
@@ -406,6 +444,9 @@ export const CoreFilterCmpt = {
|
||||
apiFunctionParameters.filterUniqueId = FHC_JS_DATA_STORAGE_OBJECT.called_path + "/" + FHC_JS_DATA_STORAGE_OBJECT.called_method;
|
||||
apiFunctionParameters.filterType = this.filterType;
|
||||
|
||||
if (this.uniqueId)
|
||||
apiFunctionParameters.filterUniqueId += '_' + this.uniqueId;
|
||||
|
||||
// Assign parameters to the FetchCmpt binded properties
|
||||
this.fetchCmptApiFunctionParams = apiFunctionParameters;
|
||||
// Assign data fetch callback to the FetchCmpt binded properties
|
||||
@@ -484,6 +525,36 @@ export const CoreFilterCmpt = {
|
||||
},
|
||||
this.getFilter
|
||||
);
|
||||
},
|
||||
// TODO check ob im core so bleiben soll
|
||||
// append child to it's parent
|
||||
appendChild(data, child) {
|
||||
// get parent id
|
||||
let parentId = child[this.parentIdField];
|
||||
|
||||
// loop thorugh all data
|
||||
for (let parentIdx = 0; parentIdx < data.length; parentIdx++)
|
||||
{
|
||||
let parent = data[parentIdx];
|
||||
|
||||
// if it's the parent
|
||||
if (parent[this.idField] == parentId)
|
||||
{
|
||||
// create children array if not done yet
|
||||
if (!parent._children) parent._children = [];
|
||||
|
||||
// if child is not included in children array, append the child
|
||||
if (!parent._children.includes(child)) parent._children.push(child);
|
||||
|
||||
// parent found
|
||||
return true;
|
||||
}
|
||||
// search children for parents
|
||||
else if (parent._children) this.appendChild(parent._children, child);
|
||||
}
|
||||
|
||||
// parent not found
|
||||
return false;
|
||||
}
|
||||
},
|
||||
beforeCreate() {
|
||||
@@ -512,7 +583,7 @@ export const CoreFilterCmpt = {
|
||||
|
||||
<div class="row" v-if="title != null && title != ''">
|
||||
<div class="col-lg-12">
|
||||
<h3 class="page-header">
|
||||
<h3 class="page-header mt-1 mb-4">
|
||||
{{ title }}
|
||||
</h3>
|
||||
</div>
|
||||
@@ -521,7 +592,7 @@ export const CoreFilterCmpt = {
|
||||
<div :id="'filterCollapsables' + idExtra">
|
||||
|
||||
<div class="d-flex flex-row justify-content-between flex-wrap">
|
||||
<div v-if="newBtnShow || reload || $slots.actions" class="d-flex gap-2 align-items-baseline flex-wrap">
|
||||
<div v-if="newBtnShow || reload || $slots.search || $slots.actions" class="d-flex gap-2 align-items-baseline flex-wrap">
|
||||
<button v-if="newBtnShow" class="btn btn-primary" :class="newBtnClass" :title="newBtnLabel ? undefined : 'New'" :aria-label="newBtnLabel ? undefined : 'New'" @click="$emit('click:new', $event)" :disabled="newBtnDisabled">
|
||||
<span class="fa-solid fa-plus" aria-hidden="true"></span>
|
||||
{{ newBtnLabel }}
|
||||
@@ -529,8 +600,9 @@ export const CoreFilterCmpt = {
|
||||
<button v-if="reload" class="btn btn-outline-secondary" aria-label="Reload" @click="reloadTable">
|
||||
<span class="fa-solid fa-rotate-right" aria-hidden="true"></span>
|
||||
</button>
|
||||
<span v-if="$slots.actions && tabulatorHasSelector">Mit {{selectedData.length}} ausgewählten: </span>
|
||||
<span v-if="$slots.actions && tabulatorHasSelector">Mit {{selectedData.length}} ausgewählten:</span>
|
||||
<slot name="actions" v-bind="tabulatorHasSelector ? selectedData : []"></slot>
|
||||
<slot name="search"></slot>
|
||||
</div>
|
||||
<div class="d-flex gap-1 align-items-baseline flex-grow-1 justify-content-end">
|
||||
<span v-if="!tableOnly">[ {{ filterName }} ]</span>
|
||||
|
||||
@@ -343,7 +343,7 @@ if ($xmlformat=='rdf')
|
||||
$rdf_url='http://www.technikum-wien.at/abschlusspruefung';
|
||||
function draw_content($row)
|
||||
{
|
||||
global $rdf_url, $datum_obj;
|
||||
global $rdf_url, $datum_obj, $abschlussbeurteilung_arr;
|
||||
$vorsitz = '';
|
||||
$pruefer1= '';
|
||||
$pruefer2= '';
|
||||
@@ -380,6 +380,7 @@ if ($xmlformat=='rdf')
|
||||
<ABSCHLUSSPRUEFUNG:pruefer3><![CDATA['.$row->pruefer3.']]></ABSCHLUSSPRUEFUNG:pruefer3>
|
||||
<ABSCHLUSSPRUEFUNG:pruefer3_nachname><![CDATA['.$pruefer3.']]></ABSCHLUSSPRUEFUNG:pruefer3_nachname>
|
||||
<ABSCHLUSSPRUEFUNG:abschlussbeurteilung_kurzbz><![CDATA['.$row->abschlussbeurteilung_kurzbz.']]></ABSCHLUSSPRUEFUNG:abschlussbeurteilung_kurzbz>
|
||||
<ABSCHLUSSPRUEFUNG:abschlussbeurteilung_bezeichnung><![CDATA['.($row->abschlussbeurteilung_kurzbz!=''?$abschlussbeurteilung_arr[$row->abschlussbeurteilung_kurzbz]:'').']]></ABSCHLUSSPRUEFUNG:abschlussbeurteilung_bezeichnung>
|
||||
<ABSCHLUSSPRUEFUNG:notekommpruef><![CDATA['.$row->note.']]></ABSCHLUSSPRUEFUNG:notekommpruef>
|
||||
<ABSCHLUSSPRUEFUNG:akadgrad_id><![CDATA['.$row->akadgrad_id.']]></ABSCHLUSSPRUEFUNG:akadgrad_id>
|
||||
<ABSCHLUSSPRUEFUNG:datum><![CDATA['.$datum_obj->convertISODate($row->datum).']]></ABSCHLUSSPRUEFUNG:datum>
|
||||
|
||||
@@ -55,6 +55,11 @@ if (isset($_GET['stg_kz']))
|
||||
else
|
||||
$stg_kz=null;
|
||||
|
||||
if (isset($_GET['aktiv']))
|
||||
$aktiv=$_GET['aktiv'];
|
||||
else
|
||||
$aktiv=null;
|
||||
|
||||
if (isset($_GET['fachbereich_id']))
|
||||
$fachbereich_id=$_GET['fachbereich_id'];
|
||||
else
|
||||
@@ -126,7 +131,7 @@ function draw_row($mitarbeiter)
|
||||
|
||||
if($lehrveranstaltung_id==null && $filter==null && $mitarbeiter_uid==null)
|
||||
{
|
||||
$ma=$mitarbeiter->getMitarbeiter($lektor,$fixangestellt,$stg_kz);
|
||||
$ma=$mitarbeiter->getMitarbeiter($lektor,$fixangestellt,$stg_kz, $aktiv);
|
||||
|
||||
$stg_obj = new studiengang();
|
||||
$stg_obj->getAll('typ, kurzbz', false);
|
||||
|
||||
@@ -48,12 +48,14 @@ require_once('dbupdate_3.4/30181_tabelle_anrechnung_neue_attribute_fuer_begruend
|
||||
require_once('dbupdate_3.4/29529_infocenter_anpassungen.php');
|
||||
require_once('dbupdate_3.4/29835_uhstat1_erfassung_der_uhstat1_daten_ueber_das_bewerbungstool.php');
|
||||
require_once('dbupdate_3.4/33714_erhoehter_studienbeitrag_fuer_drittsaatenangehoerig.php');
|
||||
require_once('dbupdate_3.4/37107_fristenmanagement.php');
|
||||
require_once('dbupdate_3.4/33003_bis_meldung_personal.php');
|
||||
require_once('dbupdate_3.4/36275_zeitaufzeichnung_karenz.php');
|
||||
require_once('dbupdate_3.4/21620_neues_feld_zum_erfassen_des_ESI.php');
|
||||
require_once('dbupdate_3.4/36530_bis_internationsalisierung_codextabelle_neuerungen.php');
|
||||
require_once('dbupdate_3.4/34543_ux_template.php');
|
||||
require_once('dbupdate_3.4/17513_Entwicklungsteam.php');
|
||||
require_once('dbupdate_3.4/28575_softwarebereitstellung.php');
|
||||
|
||||
// *** Pruefung und hinzufuegen der neuen Attribute und Tabellen
|
||||
echo '<H2>Pruefe Tabellen und Attribute!</H2>';
|
||||
@@ -171,7 +173,8 @@ $tabellen=array(
|
||||
"hr.tbl_sachaufwandtyp" => array("sachaufwandtyp_kurzbz","bezeichnung","sort", "aktiv"),
|
||||
"hr.tbl_stundensatz" => array("stundensatz_id","uid","stundensatztyp","stundensatz","oe_kurzbz","gueltig_von","gueltig_bis","insertamum","insertvon","updateamum","updatevon"),
|
||||
"hr.tbl_stundensatztyp" => array("stundensatztyp","bezeichnung","aktiv","insertamum","insertvon","updateamum","updatevon"),
|
||||
"hr.tbl_dienstverhaeltnis" => array("dienstverhaeltnis_id","mitarbeiter_uid","vertragsart_kurzbz","oe_kurzbz","von","bis","insertamum","insertvon","updateamum","updatevon"),
|
||||
"hr.tbl_dienstverhaeltnis" => array("dienstverhaeltnis_id","mitarbeiter_uid","vertragsart_kurzbz","oe_kurzbz","von","bis","insertamum","insertvon","updateamum","updatevon","dvendegrund_kurzbz","dvendegrund_anmerkung"),
|
||||
"hr.tbl_dvendegrund" => array("dvendegrund_kurzbz", "bezeichnung", "bezeichnung_mehrsprachig", "aktiv", "sort"),
|
||||
"hr.tbl_vertragsart" => array("vertragsart_kurzbz","bezeichnung","anmerkung","dienstverhaeltnis","vertragsart_kurzbz_parent","aktiv","sort"),
|
||||
"hr.tbl_vertragsbestandteil" => array("vertragsbestandteil_id","dienstverhaeltnis_id","vertragsbestandteiltyp_kurzbz","von", "bis","insertamum", "insertvon","updateamum","updatevon"),
|
||||
"hr.tbl_vertragsbestandteiltyp" => array("vertragsbestandteiltyp_kurzbz","bezeichnung","ueberlappend"),
|
||||
@@ -188,6 +191,9 @@ $tabellen=array(
|
||||
"hr.tbl_gehaltsbestandteil" => array("gehaltsbestandteil_id","dienstverhaeltnis_id","vertragsbestandteil_id","gehaltstyp_kurzbz","von","bis","anmerkung","grundbetrag","betrag_valorisiert","valorisierungssperre","insertamum", "insertvon","updateamum","updatevon","valorisierung","auszahlungen"),
|
||||
"hr.tbl_gehaltshistorie" => array("gehaltshistorie_id", "datum","betrag","gehaltsbestandteil_id","mitarbeiter_uid"),
|
||||
"hr.tbl_gehaltstyp" => array("gehaltstyp_kurzbz","bezeichnung","valorisierung","sort","aktiv"),
|
||||
"hr.tbl_frist" => array("frist_id","mitarbeiter_uid","ereignis_kurzbz","bezeichnung","datum","status_kurzbz","parameter","insertvon","insertamum","updatevon","updateamum"),
|
||||
"hr.tbl_frist_ereignis" => array("ereignis_kurzbz","bezeichnung","manuell"),
|
||||
"hr.tbl_frist_status" => array("status_kurzbz", "bezeichnung"),
|
||||
"lehre.tbl_abschlussbeurteilung" => array("abschlussbeurteilung_kurzbz","bezeichnung","bezeichnung_english","sort"),
|
||||
"lehre.tbl_abschlusspruefung" => array("abschlusspruefung_id","student_uid","vorsitz","pruefer1","pruefer2","pruefer3","abschlussbeurteilung_kurzbz","akadgrad_id","pruefungstyp_kurzbz","datum","uhrzeit","sponsion","anmerkung","updateamum","updatevon","insertamum","insertvon","ext_id","note","protokoll","endezeit","pruefungsantritt_kurzbz","freigabedatum"),
|
||||
"lehre.tbl_abschlusspruefung_antritt" => array("pruefungsantritt_kurzbz","bezeichnung","bezeichnung_english","sort"),
|
||||
|
||||
@@ -437,7 +437,83 @@ if ($result = $db->db_query("SELECT * FROM information_schema.tables WHERE table
|
||||
if (! $db->db_query($qry))
|
||||
echo '<strong>Vertraege: ' . $db->db_last_error() . '</strong><br>';
|
||||
else
|
||||
echo 'HR Schema und Vertagstabellen wurden neu erstellt<br />';
|
||||
echo 'HR Schema und Vertagstabellen wurden neu erstellt<br>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($result = $db->db_query("SELECT * FROM information_schema.tables WHERE table_name='tbl_dvendegrund' AND table_schema='hr'"))
|
||||
{
|
||||
if ($db->db_num_rows($result) == 0)
|
||||
{
|
||||
$qry = "
|
||||
CREATE TABLE hr.tbl_dvendegrund (
|
||||
dvendegrund_kurzbz character varying(32) NOT NULL ,
|
||||
bezeichnung character varying(255) NOT NULL,
|
||||
bezeichnung_mehrsprachig character varying(255)[] NOT NULL,
|
||||
aktiv boolean DEFAULT true NOT NULL,
|
||||
sort integer DEFAULT 1 NOT NULL,
|
||||
PRIMARY KEY (dvendegrund_kurzbz),
|
||||
CONSTRAINT tbl_dvendegrund_bezeichnung_key UNIQUE (bezeichnung)
|
||||
);
|
||||
|
||||
GRANT SELECT, UPDATE, INSERT, DELETE ON hr.tbl_dvendegrund TO vilesci;
|
||||
|
||||
INSERT INTO
|
||||
hr.tbl_dvendegrund (dvendegrund_kurzbz, bezeichnung, bezeichnung_mehrsprachig)
|
||||
VALUES
|
||||
('kuendigung_arbeitnehmer', 'Kündigung durch Arbeitnehmer', ARRAY['Kündigung durch Arbeitnehmer', 'Cancellation by Employee']),
|
||||
('kuendigung_arbeitgeber', 'Kündigung durch Arbeitgeber', ARRAY['Kündigung durch Arbeitgeber', 'Cancellation by Employer']),
|
||||
('entlassung', 'Entlassung', ARRAY['Entlassung', 'Dismissal']),
|
||||
('sonstige', 'Sonstige', ARRAY['Sonstige', 'Miscellaneous']),
|
||||
('einvernehmlich', 'Einvernehmliche Auflösung', ARRAY['Einvernehmliche Auflösung', 'Rescission']),
|
||||
('ablaufzeit', 'Ablauf durch Zeit', ARRAY['Ablauf durch Zeit', 'Expired by lapse of time']);
|
||||
";
|
||||
if (! $db->db_query($qry))
|
||||
echo '<strong>Vertraege: ' . $db->db_last_error() . '</strong><br>';
|
||||
else
|
||||
echo 'Tabelle tbl_dvendegrund wurde im HR Schema neu erstellt<br>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($result = $db->db_query("SELECT * FROM information_schema.columns WHERE column_name='dvendegrund_kurzbz' AND table_name='tbl_dienstverhaeltnis' AND table_schema='hr'"))
|
||||
{
|
||||
if ($db->db_num_rows($result) == 0)
|
||||
{
|
||||
$qry = "
|
||||
ALTER TABLE
|
||||
hr.tbl_dienstverhaeltnis
|
||||
ADD COLUMN
|
||||
dvendegrund_kurzbz character varying(255)
|
||||
CONSTRAINT
|
||||
tbl_dvendegrund_fk
|
||||
REFERENCES
|
||||
hr.tbl_dvendegrund(dvendegrund_kurzbz)
|
||||
ON UPDATE
|
||||
cascade
|
||||
ON DELETE
|
||||
restrict
|
||||
";
|
||||
if (! $db->db_query($qry))
|
||||
echo '<strong>Vertraege: ' . $db->db_last_error() . '</strong><br>';
|
||||
else
|
||||
echo 'Spalte dvendegrund_kurzbz wurde in hr.tbl_dienstverhaeltnis neu erstellt<br>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($result = $db->db_query("SELECT * FROM information_schema.columns WHERE column_name='dvendegrund_anmerkung' AND table_name='tbl_dienstverhaeltnis' AND table_schema='hr'"))
|
||||
{
|
||||
if ($db->db_num_rows($result) == 0)
|
||||
{
|
||||
$qry = "
|
||||
ALTER TABLE
|
||||
hr.tbl_dienstverhaeltnis
|
||||
ADD COLUMN
|
||||
dvendegrund_anmerkung character varying(255)
|
||||
";
|
||||
if (! $db->db_query($qry))
|
||||
echo '<strong>Vertraege: ' . $db->db_last_error() . '</strong><br>';
|
||||
else
|
||||
echo 'Spalte dvendegrund_anmerkung wurde in hr.tbl_dienstverhaeltnis neu erstellt<br>';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -493,4 +569,4 @@ if ($result = $db->db_query("SELECT * FROM hr.tbl_vertragsart WHERE vertragsart_
|
||||
else
|
||||
echo 'Vertragsart "Dienstverhältnis zu einer anderen Bildungseinrichtung oder einem anderen Träger" erstellt.<br />';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
if (! defined('DB_NAME')) exit('No direct script access allowed');
|
||||
|
||||
// add app softwarebereitstellung
|
||||
if($result = $db->db_query("SELECT 1 FROM system.tbl_app WHERE app='softwarebereitstellung'"))
|
||||
{
|
||||
if($db->db_num_rows($result) === 0)
|
||||
{
|
||||
$qry = "INSERT INTO system.tbl_app (app) VALUES('softwarebereitstellung');";
|
||||
|
||||
if(!$db->db_query($qry))
|
||||
echo '<strong>System Tabelle app: '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo '<br>app softwarebereitstellung hinzugefuegt<br>';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
if (! defined('DB_NAME')) exit('No direct script access allowed');
|
||||
|
||||
if ($result = $db->db_query("SELECT * FROM information_schema.tables WHERE table_name='tbl_frist' AND table_schema='hr'"))
|
||||
{
|
||||
if ($db->db_num_rows($result) == 0)
|
||||
{
|
||||
$qry = "
|
||||
CREATE TABLE IF NOT EXISTS hr.tbl_frist (
|
||||
frist_id bigserial NOT NULL,
|
||||
mitarbeiter_uid character varying(32),
|
||||
ereignis_kurzbz character varying(32) NOT NULL,
|
||||
bezeichnung varchar(255),
|
||||
datum date,
|
||||
status_kurzbz character varying(32) NOT NULL,
|
||||
parameter jsonb NOT NULL,
|
||||
insertvon character varying(32) NOT NULL,
|
||||
insertamum timestamp without time zone DEFAULT now() NOT NULL,
|
||||
updatevon character varying(32),
|
||||
updateamum timestamp without time zone,
|
||||
CONSTRAINT tbl_frist_pkey PRIMARY KEY (frist_id)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS hr.tbl_frist_ereignis (
|
||||
ereignis_kurzbz character varying(32) NOT NULL,
|
||||
bezeichnung varchar(32) NOT NULL,
|
||||
manuell boolean DEFAULT FALSE,
|
||||
sort smallint,
|
||||
CONSTRAINT tbl_ereignis_pkey PRIMARY KEY (ereignis_kurzbz)
|
||||
);
|
||||
|
||||
COMMENT ON TABLE hr.tbl_frist_ereignis IS E'Key-Table of fristen (deadline) events';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS hr.tbl_frist_status (
|
||||
status_kurzbz character varying(32) NOT NULL,
|
||||
bezeichnung varchar(32),
|
||||
sort smallint,
|
||||
CONSTRAINT tbl_frist_status_pk PRIMARY KEY (status_kurzbz)
|
||||
);
|
||||
|
||||
COMMENT ON TABLE hr.tbl_frist_status IS E'Key-Table of fristen status (new, done)';
|
||||
|
||||
ALTER TABLE hr.tbl_frist ADD CONSTRAINT tbl_frist_mitarbeiter_uid_fk FOREIGN KEY (mitarbeiter_uid)
|
||||
REFERENCES public.tbl_mitarbeiter (mitarbeiter_uid) MATCH FULL
|
||||
ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
|
||||
ALTER TABLE hr.tbl_frist ADD CONSTRAINT tbl_frist_ereignis_kurzbz_fk FOREIGN KEY (ereignis_kurzbz)
|
||||
REFERENCES hr.tbl_frist_ereignis (ereignis_kurzbz) MATCH FULL
|
||||
ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
|
||||
ALTER TABLE hr.tbl_frist ADD CONSTRAINT tbl_frist_status_kurzbz_fk FOREIGN KEY (status_kurzbz)
|
||||
REFERENCES hr.tbl_frist_status (status_kurzbz) MATCH FULL
|
||||
ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
|
||||
GRANT SELECT, UPDATE, INSERT, DELETE ON hr.tbl_frist TO vilesci;
|
||||
GRANT SELECT, UPDATE, INSERT, DELETE ON hr.tbl_frist_status TO vilesci;
|
||||
GRANT SELECT, UPDATE, INSERT, DELETE ON hr.tbl_frist_ereignis TO vilesci;
|
||||
|
||||
GRANT USAGE ON hr.tbl_frist_frist_id_seq TO vilesci;
|
||||
|
||||
INSERT INTO hr.tbl_frist_status(status_kurzbz, bezeichnung, sort) VALUES('neu','Neu', 1);
|
||||
INSERT INTO hr.tbl_frist_status(status_kurzbz, bezeichnung, sort) VALUES('in_bearbeitung','In Bearbeitung', 2);
|
||||
INSERT INTO hr.tbl_frist_status(status_kurzbz, bezeichnung, sort) VALUES('erledigt','Erledigt', 3);
|
||||
|
||||
INSERT INTO hr.tbl_frist_ereignis(ereignis_kurzbz, bezeichnung, sort) VALUES('dv_beginn','DV Beginn', 1);
|
||||
INSERT INTO hr.tbl_frist_ereignis(ereignis_kurzbz, bezeichnung, sort) VALUES('dv_ende','DV Ende', 2);
|
||||
INSERT INTO hr.tbl_frist_ereignis(ereignis_kurzbz, bezeichnung, sort) VALUES('stunden_beginn','Stunden Beginn', 3);
|
||||
INSERT INTO hr.tbl_frist_ereignis(ereignis_kurzbz, bezeichnung, sort) VALUES('stunden_ende','Stunden Ende', 4);
|
||||
INSERT INTO hr.tbl_frist_ereignis(ereignis_kurzbz, bezeichnung, sort) VALUES('karenz_beginn','Karenz Beginn', 5);
|
||||
INSERT INTO hr.tbl_frist_ereignis(ereignis_kurzbz, bezeichnung, sort) VALUES('karenz_ende','Karenz Ende', 6);
|
||||
INSERT INTO hr.tbl_frist_ereignis(ereignis_kurzbz, bezeichnung, sort) VALUES('zeitaufzeichnung_beginn','Zeitaufzeichnung Beginn', 7);
|
||||
INSERT INTO hr.tbl_frist_ereignis(ereignis_kurzbz, bezeichnung, sort) VALUES('zeitaufzeichnung_ende','Zeitaufzeichnung Ende', 8);
|
||||
INSERT INTO hr.tbl_frist_ereignis(ereignis_kurzbz, bezeichnung, sort) VALUES('befristung_beginn','Befristung Beginn', 9);
|
||||
INSERT INTO hr.tbl_frist_ereignis(ereignis_kurzbz, bezeichnung, sort) VALUES('befristung_ende','Befristung Ende', 10);
|
||||
|
||||
";
|
||||
|
||||
if (! $db->db_query($qry))
|
||||
echo '<strong>Fristenmanagement: ' . $db->db_last_error() . '</strong><br>';
|
||||
else
|
||||
echo 'Fristenmanagementtabellen wurden neu erstellt';
|
||||
}
|
||||
}
|
||||
@@ -1280,6 +1280,79 @@ $filters = array(
|
||||
',
|
||||
'oe_kurzbz' => null,
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'dataset_name' => 'softwareManagement',
|
||||
'filter_kurzbz' => 'SoftwareManagement',
|
||||
'description' => '{Software Verwaltung}',
|
||||
'sort' => 1,
|
||||
'default_filter' => true,
|
||||
'filter' => '
|
||||
{
|
||||
"name": "SoftwareManagement",
|
||||
"columns": [
|
||||
{"name": "software_kurzbz"},
|
||||
{"name": "version"},
|
||||
{"name": "beschreibung"},
|
||||
{"name": "hersteller"},
|
||||
{"name": "os"},
|
||||
{"name": "lizenzserver_kurzbz"},
|
||||
{"name": "lizenzserver_port"},
|
||||
{"name": "softwarestatus_kurzbz"}
|
||||
],
|
||||
"filters": []
|
||||
}
|
||||
',
|
||||
'oe_kurzbz' => null,
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'dataset_name' => 'imageVerwaltung',
|
||||
'filter_kurzbz' => 'ImageVerwaltung',
|
||||
'description' => '{Image Verwaltung}',
|
||||
'sort' => 1,
|
||||
'default_filter' => true,
|
||||
'filter' => '
|
||||
{
|
||||
"name": "ImageVerwaltung",
|
||||
"columns": [
|
||||
{"name": "bezeichnung"},
|
||||
{"name": "betriebssystem"},
|
||||
{"name": "verfuegbarkeit_start"},
|
||||
{"name": "verfuegbarkeit_ende"},
|
||||
{"name": "anmerkung"},
|
||||
{"name": "ort_count"},
|
||||
{"name": "software_count"}
|
||||
],
|
||||
"filters": []
|
||||
}
|
||||
',
|
||||
'oe_kurzbz' => null,
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'dataset_name' => 'lizenzserverVerwaltung',
|
||||
'filter_kurzbz' => 'LizenzserverVerwaltung',
|
||||
'description' => '{Lizenzserver Verwaltung}',
|
||||
'sort' => 1,
|
||||
'default_filter' => true,
|
||||
'filter' => '
|
||||
{
|
||||
"name": "LizenzserverVerwaltung",
|
||||
"columns": [
|
||||
{"name": "lizenzserver_kurzbz"},
|
||||
{"name": "bezeichnung"},
|
||||
{"name": "macadresse"},
|
||||
{"name": "ipadresse"},
|
||||
{"name": "ansprechpartner"},
|
||||
{"name": "anmerkung"},
|
||||
{"name": "location"}
|
||||
],
|
||||
"filters": []
|
||||
}
|
||||
',
|
||||
'oe_kurzbz' => null,
|
||||
),
|
||||
array(
|
||||
'app' => 'fhctemplate',
|
||||
'dataset_name' => 'exampledata',
|
||||
|
||||
+1802
-1
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user