From c0e2cec5568bfa01bee49a39bbb7a610483c5869 Mon Sep 17 00:00:00 2001 From: cgfhtw Date: Wed, 14 Aug 2024 15:51:27 +0200 Subject: [PATCH 1/5] s&d --- application/libraries/AntragLib.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/application/libraries/AntragLib.php b/application/libraries/AntragLib.php index c1649587d..1a8b28ed3 100644 --- a/application/libraries/AntragLib.php +++ b/application/libraries/AntragLib.php @@ -77,7 +77,9 @@ class AntragLib 'studiensemester_kurzbz'=>$prestudentstatus->studiensemester_kurzbz, 'ausbildungssemester'=>$prestudentstatus->ausbildungssemester ], [ - 'statusgrund_id' => null + 'statusgrund_id' => null, + 'updateamum' => date('c'), + 'updatevon' => $insertvon ]); } } @@ -335,7 +337,10 @@ class AntragLib 'status_kurzbz'=>$prestudentstatus->status_kurzbz, 'studiensemester_kurzbz'=>$prestudentstatus->studiensemester_kurzbz, 'ausbildungssemester'=>$prestudentstatus->ausbildungssemester - ], []); + ], [ + 'updateamum' => $insertam, + 'updatevon' => $insertvon + ]); if (isError($result)) { $errors[] = getError($result); From fb2f8d5c530b38f63d0b16dbb6fe61272373571a Mon Sep 17 00:00:00 2001 From: Alexei Karpenko Date: Thu, 20 Mar 2025 14:41:28 +0100 Subject: [PATCH 2/5] added function for getting UHSTAT1 person data (centralizing...) --- .../models/codex/Uhstat1daten_model.php | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/application/models/codex/Uhstat1daten_model.php b/application/models/codex/Uhstat1daten_model.php index 9bca44b58..5bffb5c06 100644 --- a/application/models/codex/Uhstat1daten_model.php +++ b/application/models/codex/Uhstat1daten_model.php @@ -11,4 +11,42 @@ class Uhstat1daten_model extends DB_Model $this->dbTable = 'bis.tbl_uhstat1daten'; $this->pk = 'uhstat1daten_id'; } + + /** + * Gets person data needed for sending as UHSTAT1 data. + * @param array $person_id_arr + * @param string $studiensemester + * @param array $status_kurzbz + * @return object success with prestudents or error + */ + public function getUHSTAT1PersonData($person_id_arr) + { + $params = array($person_id_arr); + + $prstQry = "SELECT + DISTINCT ON (pers.person_id) + pers.person_id, uhstat_daten.uhstat1daten_id, pers.svnr, pers.ersatzkennzeichen, pers.geburtsnation, + uhstat_daten.mutter_geburtsstaat, uhstat_daten.mutter_bildungsstaat, uhstat_daten.mutter_geburtsjahr, + uhstat_daten.mutter_bildungmax, uhstat_daten.vater_geburtsstaat, uhstat_daten.vater_bildungsstaat, + uhstat_daten.vater_geburtsjahr, uhstat_daten.vater_bildungmax, + kzVbpkAs.inhalt AS \"vbpkAs\", kzVbpkBf.inhalt AS \"vbpkBf\" + FROM + public.tbl_person pers + JOIN public.tbl_prestudent ps USING (person_id) + JOIN public.tbl_studiengang stg USING (studiengang_kz) + JOIN bis.tbl_uhstat1daten uhstat_daten USING (person_id) + LEFT JOIN public.tbl_kennzeichen kzVbpkAs ON kzVbpkAs.kennzeichentyp_kurzbz = 'vbpkAs'AND kzVbpkAs.person_id = pers.person_id AND kzVbpkAs.aktiv + LEFT JOIN public.tbl_kennzeichen kzVbpkBf ON kzVbpkBf.kennzeichentyp_kurzbz = 'vbpkBf'AND kzVbpkBf.person_id = pers.person_id AND kzVbpkBf.aktiv + WHERE + ps.bismelden + AND stg.melderelevant + AND pers.person_id IN ? + ORDER BY + pers.person_id"; + + return $this->execReadOnlyQuery( + $prstQry, + $params + ); + } } From b4b2d8da49a4a4445634c5119cae83c89dafd723 Mon Sep 17 00:00:00 2001 From: Alexei Karpenko Date: Sun, 30 Mar 2025 23:38:35 +0200 Subject: [PATCH 3/5] added UHSTAT issue resolvers, bugfix getuhstatdata: check for empty array --- .../controllers/jobs/IssueResolver.php | 4 +- .../issues/PlausicheckResolverLib.php | 5 ++- .../issues/resolvers/CORE_PERSON_0005.php | 36 ++++++++++++++++++ .../issues/resolvers/CORE_PERSON_0006.php | 37 +++++++++++++++++++ .../models/codex/Uhstat1daten_model.php | 2 + system/fehlerupdate.php | 16 ++++++++ 6 files changed, 97 insertions(+), 3 deletions(-) create mode 100644 application/libraries/issues/resolvers/CORE_PERSON_0005.php create mode 100644 application/libraries/issues/resolvers/CORE_PERSON_0006.php diff --git a/application/controllers/jobs/IssueResolver.php b/application/controllers/jobs/IssueResolver.php index ca07439c3..fe7ee21f5 100755 --- a/application/controllers/jobs/IssueResolver.php +++ b/application/controllers/jobs/IssueResolver.php @@ -48,7 +48,9 @@ class IssueResolver extends IssueResolver_Controller 'CORE_PERSON_0001' => 'CORE_PERSON_0001', 'CORE_PERSON_0002' => 'CORE_PERSON_0002', 'CORE_PERSON_0003' => 'CORE_PERSON_0003', - 'CORE_PERSON_0004' => 'CORE_PERSON_0004' + 'CORE_PERSON_0004' => 'CORE_PERSON_0004', + 'CORE_PERSON_0005' => 'CORE_PERSON_0005', + 'CORE_PERSON_0006' => 'CORE_PERSON_0006' ); // fehler which are resolved by the job the same way as they are produced diff --git a/application/libraries/issues/PlausicheckResolverLib.php b/application/libraries/issues/PlausicheckResolverLib.php index 26da985f6..2b20a7d93 100644 --- a/application/libraries/issues/PlausicheckResolverLib.php +++ b/application/libraries/issues/PlausicheckResolverLib.php @@ -13,7 +13,7 @@ class PlausicheckResolverLib 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 + private $_codeProducerLibMappings = []; // mappings for issues which are resolved with the same check as they are produced public function __construct($params = null) { @@ -99,10 +99,11 @@ class PlausicheckResolverLib $issueResolved = getData($issueResolvedRes) === true; } } - elseif (isset($this->_codeProducerLibMappings[$issue->fehlercode])) + elseif (isset($this->_codeProducerLibMappings[$issue->fehlercode])) // check if it is an issue without explicit resolver, "self-resolving" { $libName = $this->_codeProducerLibMappings[$issue->fehlercode]; + // execute same check as used for issue production $issueResolvedRes = $this->_ci->plausicheckproducerlib->producePlausicheckIssue( $libName, $issue->fehler_kurzbz, diff --git a/application/libraries/issues/resolvers/CORE_PERSON_0005.php b/application/libraries/issues/resolvers/CORE_PERSON_0005.php new file mode 100644 index 000000000..1d768e70c --- /dev/null +++ b/application/libraries/issues/resolvers/CORE_PERSON_0005.php @@ -0,0 +1,36 @@ +_ci =& get_instance(); // get code igniter instance + + $this->_ci->load->model('person/Person_model', 'PersonModel'); + + // load geburtsnation for the given person + $this->_ci->PersonModel->addSelect('geburtsnation'); + $personRes = $this->_ci->PersonModel->load($params['issue_person_id']); + + if (isError($personRes)) return $personRes; + + if (hasData($personRes)) + { + // get person data + $personData = getData($personRes)[0]; + + // if geburtsnation present, issue is resolved + return success(!isEmptyString($personData->geburtsnation)); + } + else + return success(false); // if no person found, not resolved + } +} \ No newline at end of file diff --git a/application/libraries/issues/resolvers/CORE_PERSON_0006.php b/application/libraries/issues/resolvers/CORE_PERSON_0006.php new file mode 100644 index 000000000..8b7ff9c56 --- /dev/null +++ b/application/libraries/issues/resolvers/CORE_PERSON_0006.php @@ -0,0 +1,37 @@ +_ci =& get_instance(); // get code igniter instance + + $this->_ci->load->model('codex/Uhstat1daten_model', 'UhstatModel'); + + $personRes = $this->_ci->UhstatModel->getUHSTAT1PersonData([$params['issue_person_id']]); + + if (isError($personRes)) return $personRes; + + if (hasData($personRes)) + { + // get person data + $personData = getData($personRes)[0]; + + // if person identification data present, issue is resolved + return success( + !isEmptyString($personData->ersatzkennzeichen) + || (!isEmptyString($personData->vbpkAs) && !isEmptyString($personData->vbpkBf)) + ); + } + else + return success(false); // if no person found, not resolved + } +} \ No newline at end of file diff --git a/application/models/codex/Uhstat1daten_model.php b/application/models/codex/Uhstat1daten_model.php index 5bffb5c06..899f037ef 100644 --- a/application/models/codex/Uhstat1daten_model.php +++ b/application/models/codex/Uhstat1daten_model.php @@ -21,6 +21,8 @@ class Uhstat1daten_model extends DB_Model */ public function getUHSTAT1PersonData($person_id_arr) { + if (!isset($person_id_arr) || isEmptyArray($person_id_arr)) return success([]); + $params = array($person_id_arr); $prstQry = "SELECT diff --git a/system/fehlerupdate.php b/system/fehlerupdate.php index 89446982d..3e0cf8b8b 100644 --- a/system/fehlerupdate.php +++ b/system/fehlerupdate.php @@ -324,6 +324,22 @@ $fehlerArr = array( 'fehlertext' => 'Es sind mehrere oder keine Zustelladressen eingetragen', 'fehlertyp_kurzbz' => 'error', 'app' => 'core' + ), + array( + 'fehlercode' => 'CORE_PERSON_0005', + 'fehler_kurzbz' => 'geburtsnationFehlt', + 'fehlercode_extern' => null, + 'fehlertext' => 'Geburtsnation nicht vorhanden', + 'fehlertyp_kurzbz' => 'error', + 'app' => 'core' + ), + array( + 'fehlercode' => 'CORE_PERSON_0006', + 'fehler_kurzbz' => 'uhstatPersonkennungFehlt', + 'fehlercode_extern' => null, + 'fehlertext' => 'Personkennung fehlt (vBpk AS, vBpk BF oder Ersatzkennzeichen fehlt)', + 'fehlertyp_kurzbz' => 'error', + 'app' => 'core' ) /** Plausichecks end **/ ); From 4bceddcc82f64dc2198aa4994fc49f955ac63cf0 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Fri, 9 May 2025 13:58:14 +0200 Subject: [PATCH 4/5] add systemerror_mailto ci config, render systemerror_mailto to FHC_JS_DATA_STORAGE_OBJECT, use FHC_JS_DATA_STORAGE_OBJECT.systemerror_mailto in FhcAlert Plugins --- application/config/javascript.php | 4 +++- application/helpers/hlp_header_helper.php | 4 ++++ public/js/plugin/FhcAlert.js | 8 +++++++- public/js/plugins/FhcAlert.js | 8 +++++++- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/application/config/javascript.php b/application/config/javascript.php index 5e9aa270a..f3237fde3 100644 --- a/application/config/javascript.php +++ b/application/config/javascript.php @@ -4,4 +4,6 @@ if (! defined('BASEPATH')) exit('No direct script access allowed'); // use vuejs dev version $config['use_vuejs_dev_version'] = false; // use bundled javascript -$config['use_bundled_javascript'] = false; \ No newline at end of file +$config['use_bundled_javascript'] = false; +// systemerror_mailto use in FHC-Alert Plugin - if empty Link will not be rendered +$config['systemerror_mailto'] = ''; \ No newline at end of file diff --git a/application/helpers/hlp_header_helper.php b/application/helpers/hlp_header_helper.php index 14f7ed338..de7e866f4 100644 --- a/application/helpers/hlp_header_helper.php +++ b/application/helpers/hlp_header_helper.php @@ -95,6 +95,9 @@ function generateJSDataStorageObject($indexPage, $calledPath, $calledMethod) }, $server_language); $user_language = getUserLanguage(); + $ci->load->config('javascript'); + $systemerror_mailto = $ci->config->item('systemerror_mailto'); + $FHC_JS_DATA_STORAGE_OBJECT = array( 'app_root' => APP_ROOT, 'ci_router' => $indexPage, @@ -103,6 +106,7 @@ function generateJSDataStorageObject($indexPage, $calledPath, $calledMethod) 'server_languages' => $server_language, 'user_language' => $user_language, 'timezone' => date_default_timezone_get(), + 'systemerror_mailto' => $systemerror_mailto, ); $toPrint = "\n"; diff --git a/public/js/plugin/FhcAlert.js b/public/js/plugin/FhcAlert.js index be8d08b81..f32f18d63 100644 --- a/public/js/plugin/FhcAlert.js +++ b/public/js/plugin/FhcAlert.js @@ -117,7 +117,7 @@ const helperApp = Vue.createApp({ }, methods: { mailToUrl(slotProps) { - let mailTo = 'noreply@technikum-wien.at'; // TODO domain anpassen + let mailTo = FHC_JS_DATA_STORAGE_OBJECT.systemerror_mailto; let subject = 'Meldung%20Systemfehler'; let body = ` Danke, dass Sie uns den Fehler melden. %0D%0A %0D%0A @@ -141,6 +141,11 @@ const helperApp = Vue.createApp({ unmounted() { helperAppContainer.parentElement.removeChild(helperAppContainer); }, + computed: { + showmaillink: function() { + return FHC_JS_DATA_STORAGE_OBJECT.systemerror_mailto !== ''; + } + }, template: ` @@ -162,6 +167,7 @@ const helperApp = Vue.createApp({ Fehler anzeigen @@ -154,6 +159,7 @@ const helperApp = Vue.createApp({ Fehler anzeigen Date: Tue, 20 May 2025 11:31:28 +0200 Subject: [PATCH 5/5] Fehlerkurzbz korrigiert --- system/fehlerupdate.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/fehlerupdate.php b/system/fehlerupdate.php index 3e0cf8b8b..68ce2e2cb 100644 --- a/system/fehlerupdate.php +++ b/system/fehlerupdate.php @@ -335,7 +335,7 @@ $fehlerArr = array( ), array( 'fehlercode' => 'CORE_PERSON_0006', - 'fehler_kurzbz' => 'uhstatPersonkennungFehlt', + 'fehler_kurzbz' => 'uhstatPersonkennungFehltCore', 'fehlercode_extern' => null, 'fehlertext' => 'Personkennung fehlt (vBpk AS, vBpk BF oder Ersatzkennzeichen fehlt)', 'fehlertyp_kurzbz' => 'error',