diff --git a/application/config/anrechnung.php b/application/config/anrechnung.php new file mode 100644 index 000000000..d1f4f0958 --- /dev/null +++ b/application/config/anrechnung.php @@ -0,0 +1,22 @@ + LDAP_BASE_DN, 'username' => LDAP_BIND_USER, 'password' => LDAP_BIND_PASSWORD, - 'usf' => LDAP_USER_SEARCH_FILTER + 'usf' => LDAP_USER_SEARCH_FILTER, + 'timeout' => 1 ); } @@ -30,7 +31,8 @@ if (defined('LDAP2_SERVER')) // 2nd LDAP server 'basedn' => LDAP2_BASE_DN, 'username' => LDAP2_BIND_USER, 'password' => LDAP2_BIND_PASSWORD, - 'usf' => LDAP2_USER_SEARCH_FILTER + 'usf' => LDAP2_USER_SEARCH_FILTER, + 'timeout' => 1 ); } @@ -45,7 +47,8 @@ if (defined('LDAP_SERVER')) // 1st LDAP server 'basedn' => LDAP_BASE_DN, 'username' => LDAP_BIND_USER, 'password' => LDAP_BIND_PASSWORD, - 'usf' => LDAP_USER_SEARCH_FILTER + 'usf' => LDAP_USER_SEARCH_FILTER, + 'timeout' => 1 ); } @@ -58,6 +61,8 @@ if (defined('LDAP2_SERVER')) // 2nd LDAP server 'basedn' => LDAP2_BASE_DN, 'username' => LDAP2_BIND_USER, 'password' => LDAP2_BIND_PASSWORD, - 'usf' => LDAP2_USER_SEARCH_FILTER + 'usf' => LDAP2_USER_SEARCH_FILTER, + 'timeout' => 1 ); } + diff --git a/application/config/navigation.php b/application/config/navigation.php index c2d221a80..b788dc40c 100644 --- a/application/config/navigation.php +++ b/application/config/navigation.php @@ -23,6 +23,14 @@ $config['navigation_header'] = array( 'expand' => true, 'sort' => 10, 'requiredPermissions' => 'basis/vilesci:r' + ), + 'oehbeitragsverwaltung' => array( + 'link' => site_url('codex/Oehbeitrag'), + 'icon' => '', + 'description' => 'Öhbeitragsverwaltung', + 'expand' => true, + 'sort' => 20, + 'requiredPermissions' => 'admin:w' ) ) ), @@ -125,6 +133,13 @@ $config['navigation_header'] = array( 'expand' => true, 'sort' => 20, 'requiredPermissions' => 'system/developer:r' + ), + 'errormonitoring' => array( + 'link' => site_url('system/issues/Issues'), + 'description' => 'Fehler Monitoring', + 'expand' => true, + 'sort' => 20, + 'requiredPermissions' => 'system/issues_verwalten:r' ) ) ) diff --git a/application/config/udfmasterschema.json b/application/config/udfmasterschema.json index fa06dc80d..ab3faa8c9 100644 --- a/application/config/udfmasterschema.json +++ b/application/config/udfmasterschema.json @@ -9,6 +9,13 @@ "name": { "type": "string" }, + "type": { + "type": "string", + "enum": ["checkbox", "textfield", "textarea", "date", "dropdown", "multipledropdown"] + }, + "requiredPermissions": { + "type": "array" + }, "description": { "type": "array", }, @@ -18,10 +25,6 @@ "title": { "type": "array", }, - "type": { - "type": "string", - "enum": ["checkbox", "textfield", "textarea", "date", "dropdown", "multipledropdown"] - }, "sort": { "type": "integer" }, @@ -67,5 +70,6 @@ } } }, - "required": ["type", "name"] -} \ No newline at end of file + "required": ["type", "name", "requiredPermissions"] +} + diff --git a/application/controllers/api/v1/CheckUserAuth.php b/application/controllers/api/v1/CheckUserAuth.php index ee751e886..c82df9065 100644 --- a/application/controllers/api/v1/CheckUserAuth.php +++ b/application/controllers/api/v1/CheckUserAuth.php @@ -12,7 +12,7 @@ class CheckUserAuth extends RESTFul_Controller parent::__construct(); // Loads helper message to manage returning messages - // NOTE: loaded here because it does not extend the APIv1_Controller + // NOTE: loaded here because it does not extend the API_Controller $this->load->helper('hlp_return_object'); } diff --git a/application/controllers/api/v1/accounting/Aufteilung.php b/application/controllers/api/v1/accounting/Aufteilung.php index cc9c2826f..9cf4e3474 100644 --- a/application/controllers/api/v1/accounting/Aufteilung.php +++ b/application/controllers/api/v1/accounting/Aufteilung.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Aufteilung extends APIv1_Controller +class Aufteilung extends API_Controller { /** * Aufteilung API constructor. diff --git a/application/controllers/api/v1/accounting/Bestelldetail.php b/application/controllers/api/v1/accounting/Bestelldetail.php index 191ba95a0..f21b1bee6 100644 --- a/application/controllers/api/v1/accounting/Bestelldetail.php +++ b/application/controllers/api/v1/accounting/Bestelldetail.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Bestelldetail extends APIv1_Controller +class Bestelldetail extends API_Controller { /** * Bestelldetail API constructor. diff --git a/application/controllers/api/v1/accounting/Bestelldetailtag.php b/application/controllers/api/v1/accounting/Bestelldetailtag.php index 36229d47c..c7c534cc4 100644 --- a/application/controllers/api/v1/accounting/Bestelldetailtag.php +++ b/application/controllers/api/v1/accounting/Bestelldetailtag.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Bestelldetailtag extends APIv1_Controller +class Bestelldetailtag extends API_Controller { /** * Bestelldetailtag API constructor. diff --git a/application/controllers/api/v1/accounting/Bestellstatus.php b/application/controllers/api/v1/accounting/Bestellstatus.php index dc3695ff2..e52dedab2 100644 --- a/application/controllers/api/v1/accounting/Bestellstatus.php +++ b/application/controllers/api/v1/accounting/Bestellstatus.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Bestellstatus extends APIv1_Controller +class Bestellstatus extends API_Controller { /** * Bestellstatus API constructor. diff --git a/application/controllers/api/v1/accounting/Bestellung.php b/application/controllers/api/v1/accounting/Bestellung.php index 018b77180..96ae689e8 100644 --- a/application/controllers/api/v1/accounting/Bestellung.php +++ b/application/controllers/api/v1/accounting/Bestellung.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Bestellung extends APIv1_Controller +class Bestellung extends API_Controller { /** * Bestellung API constructor. diff --git a/application/controllers/api/v1/accounting/Bestellungtag.php b/application/controllers/api/v1/accounting/Bestellungtag.php index 7b404fa05..7609975ab 100644 --- a/application/controllers/api/v1/accounting/Bestellungtag.php +++ b/application/controllers/api/v1/accounting/Bestellungtag.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Bestellungtag extends APIv1_Controller +class Bestellungtag extends API_Controller { /** * Bestellungtag API constructor. diff --git a/application/controllers/api/v1/accounting/Buchung.php b/application/controllers/api/v1/accounting/Buchung.php index 12fa02c33..44c91f1a4 100644 --- a/application/controllers/api/v1/accounting/Buchung.php +++ b/application/controllers/api/v1/accounting/Buchung.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Buchung extends APIv1_Controller +class Buchung extends API_Controller { /** * Buchung API constructor. diff --git a/application/controllers/api/v1/accounting/Buchungstyp.php b/application/controllers/api/v1/accounting/Buchungstyp.php index 3e9718469..20b69bec9 100644 --- a/application/controllers/api/v1/accounting/Buchungstyp.php +++ b/application/controllers/api/v1/accounting/Buchungstyp.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Buchungstyp extends APIv1_Controller +class Buchungstyp extends API_Controller { /** * Buchungstyp API constructor. diff --git a/application/controllers/api/v1/accounting/Budget.php b/application/controllers/api/v1/accounting/Budget.php index 31ee3ef1c..9ffbb3656 100644 --- a/application/controllers/api/v1/accounting/Budget.php +++ b/application/controllers/api/v1/accounting/Budget.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Budget extends APIv1_Controller +class Budget extends API_Controller { /** * Budget API constructor. diff --git a/application/controllers/api/v1/accounting/Konto.php b/application/controllers/api/v1/accounting/Konto.php index 0b78ff98f..ba9b44558 100644 --- a/application/controllers/api/v1/accounting/Konto.php +++ b/application/controllers/api/v1/accounting/Konto.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Konto extends APIv1_Controller +class Konto extends API_Controller { /** * Konto API constructor. diff --git a/application/controllers/api/v1/accounting/Kostenstelle.php b/application/controllers/api/v1/accounting/Kostenstelle.php index 2ebf554c0..a90445b76 100644 --- a/application/controllers/api/v1/accounting/Kostenstelle.php +++ b/application/controllers/api/v1/accounting/Kostenstelle.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Kostenstelle extends APIv1_Controller +class Kostenstelle extends API_Controller { /** * Kostenstelle API constructor. diff --git a/application/controllers/api/v1/accounting/Rechnung.php b/application/controllers/api/v1/accounting/Rechnung.php index 5ac77b36b..18d0e36dd 100644 --- a/application/controllers/api/v1/accounting/Rechnung.php +++ b/application/controllers/api/v1/accounting/Rechnung.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Rechnung extends APIv1_Controller +class Rechnung extends API_Controller { /** * Rechnung API constructor. diff --git a/application/controllers/api/v1/accounting/Rechnungsbetrag.php b/application/controllers/api/v1/accounting/Rechnungsbetrag.php index 2f02c794d..57f2803a4 100644 --- a/application/controllers/api/v1/accounting/Rechnungsbetrag.php +++ b/application/controllers/api/v1/accounting/Rechnungsbetrag.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Rechnungsbetrag extends APIv1_Controller +class Rechnungsbetrag extends API_Controller { /** * Rechnungsbetrag API constructor. diff --git a/application/controllers/api/v1/accounting/Rechnungstyp.php b/application/controllers/api/v1/accounting/Rechnungstyp.php index f85dae43e..37efdd784 100644 --- a/application/controllers/api/v1/accounting/Rechnungstyp.php +++ b/application/controllers/api/v1/accounting/Rechnungstyp.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Rechnungstyp extends APIv1_Controller +class Rechnungstyp extends API_Controller { /** * Rechnungstyp API constructor. diff --git a/application/controllers/api/v1/accounting/Vertrag.php b/application/controllers/api/v1/accounting/Vertrag.php index 3b3d3fac2..164dd05a0 100644 --- a/application/controllers/api/v1/accounting/Vertrag.php +++ b/application/controllers/api/v1/accounting/Vertrag.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Vertrag extends APIv1_Controller +class Vertrag extends API_Controller { /** * Vertrag API constructor. diff --git a/application/controllers/api/v1/accounting/Vertragsstatus.php b/application/controllers/api/v1/accounting/Vertragsstatus.php index c6125e609..876a2912a 100644 --- a/application/controllers/api/v1/accounting/Vertragsstatus.php +++ b/application/controllers/api/v1/accounting/Vertragsstatus.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Vertragsstatus extends APIv1_Controller +class Vertragsstatus extends API_Controller { /** * Vertragsstatus API constructor. diff --git a/application/controllers/api/v1/accounting/Vertragstyp.php b/application/controllers/api/v1/accounting/Vertragstyp.php index 69b0907dd..40d826af2 100644 --- a/application/controllers/api/v1/accounting/Vertragstyp.php +++ b/application/controllers/api/v1/accounting/Vertragstyp.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Vertragstyp extends APIv1_Controller +class Vertragstyp extends API_Controller { /** * Vertragstyp API constructor. diff --git a/application/controllers/api/v1/accounting/Zahlungstyp.php b/application/controllers/api/v1/accounting/Zahlungstyp.php index e7abf74df..bef1e14e1 100644 --- a/application/controllers/api/v1/accounting/Zahlungstyp.php +++ b/application/controllers/api/v1/accounting/Zahlungstyp.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Zahlungstyp extends APIv1_Controller +class Zahlungstyp extends API_Controller { /** * Zahlungstyp API constructor. diff --git a/application/controllers/api/v1/codex/Akadgrad.php b/application/controllers/api/v1/codex/Akadgrad.php index 2aeb01e59..3d99d16be 100644 --- a/application/controllers/api/v1/codex/Akadgrad.php +++ b/application/controllers/api/v1/codex/Akadgrad.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Akadgrad extends APIv1_Controller +class Akadgrad extends API_Controller { /** * Akadgrad API constructor. diff --git a/application/controllers/api/v1/codex/Archiv.php b/application/controllers/api/v1/codex/Archiv.php index b35ec840d..38fbb1710 100644 --- a/application/controllers/api/v1/codex/Archiv.php +++ b/application/controllers/api/v1/codex/Archiv.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Archiv extends APIv1_Controller +class Archiv extends API_Controller { /** * Archiv API constructor. diff --git a/application/controllers/api/v1/codex/Aufmerksamdurch.php b/application/controllers/api/v1/codex/Aufmerksamdurch.php index dc27d4dd8..ce9cf25ba 100644 --- a/application/controllers/api/v1/codex/Aufmerksamdurch.php +++ b/application/controllers/api/v1/codex/Aufmerksamdurch.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Aufmerksamdurch extends APIv1_Controller +class Aufmerksamdurch extends API_Controller { /** * Aufmerksamdurch API constructor. diff --git a/application/controllers/api/v1/codex/Ausbildung.php b/application/controllers/api/v1/codex/Ausbildung.php index 4fea8add4..5886ed724 100644 --- a/application/controllers/api/v1/codex/Ausbildung.php +++ b/application/controllers/api/v1/codex/Ausbildung.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Ausbildung extends APIv1_Controller +class Ausbildung extends API_Controller { /** * Ausbildung API constructor. diff --git a/application/controllers/api/v1/codex/Berufstaetigkeit.php b/application/controllers/api/v1/codex/Berufstaetigkeit.php index 0941eba9e..02d62ae5d 100644 --- a/application/controllers/api/v1/codex/Berufstaetigkeit.php +++ b/application/controllers/api/v1/codex/Berufstaetigkeit.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Berufstaetigkeit extends APIv1_Controller +class Berufstaetigkeit extends API_Controller { /** * Berufstaetigkeit API constructor. diff --git a/application/controllers/api/v1/codex/Beschaeftigungsausmass.php b/application/controllers/api/v1/codex/Beschaeftigungsausmass.php index 115aa37fd..f10fe9d51 100644 --- a/application/controllers/api/v1/codex/Beschaeftigungsausmass.php +++ b/application/controllers/api/v1/codex/Beschaeftigungsausmass.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Beschaeftigungsausmass extends APIv1_Controller +class Beschaeftigungsausmass extends API_Controller { /** * Beschaeftigungsausmass API constructor. diff --git a/application/controllers/api/v1/codex/Besqual.php b/application/controllers/api/v1/codex/Besqual.php index 6bad18ff7..f4b5c8a16 100644 --- a/application/controllers/api/v1/codex/Besqual.php +++ b/application/controllers/api/v1/codex/Besqual.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Besqual extends APIv1_Controller +class Besqual extends API_Controller { /** * Besqual API constructor. diff --git a/application/controllers/api/v1/codex/Bisfunktion.php b/application/controllers/api/v1/codex/Bisfunktion.php index 85a7fca7b..c7318c51c 100644 --- a/application/controllers/api/v1/codex/Bisfunktion.php +++ b/application/controllers/api/v1/codex/Bisfunktion.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Bisfunktion extends APIv1_Controller +class Bisfunktion extends API_Controller { /** * Bisfunktion API constructor. diff --git a/application/controllers/api/v1/codex/Bisio.php b/application/controllers/api/v1/codex/Bisio.php index 1b0999bb1..3cbb0ca4f 100644 --- a/application/controllers/api/v1/codex/Bisio.php +++ b/application/controllers/api/v1/codex/Bisio.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Bisio extends APIv1_Controller +class Bisio extends API_Controller { /** * Bisio API constructor. diff --git a/application/controllers/api/v1/codex/Bisorgform.php b/application/controllers/api/v1/codex/Bisorgform.php index af72644c8..8ead76ecf 100644 --- a/application/controllers/api/v1/codex/Bisorgform.php +++ b/application/controllers/api/v1/codex/Bisorgform.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Bisorgform extends APIv1_Controller +class Bisorgform extends API_Controller { /** * Bisorgform API constructor. diff --git a/application/controllers/api/v1/codex/Bisverwendung.php b/application/controllers/api/v1/codex/Bisverwendung.php index ee2b0d5ca..8e6a1a310 100644 --- a/application/controllers/api/v1/codex/Bisverwendung.php +++ b/application/controllers/api/v1/codex/Bisverwendung.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Bisverwendung extends APIv1_Controller +class Bisverwendung extends API_Controller { /** * Bisverwendung API constructor. diff --git a/application/controllers/api/v1/codex/Bundesland.php b/application/controllers/api/v1/codex/Bundesland.php index ccff4f047..53fbda2ba 100644 --- a/application/controllers/api/v1/codex/Bundesland.php +++ b/application/controllers/api/v1/codex/Bundesland.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Bundesland extends APIv1_Controller +class Bundesland extends API_Controller { /** * Course API constructor. diff --git a/application/controllers/api/v1/codex/Entwicklungsteam.php b/application/controllers/api/v1/codex/Entwicklungsteam.php index bf376a842..5ad2fb453 100644 --- a/application/controllers/api/v1/codex/Entwicklungsteam.php +++ b/application/controllers/api/v1/codex/Entwicklungsteam.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Entwicklungsteam extends APIv1_Controller +class Entwicklungsteam extends API_Controller { /** * Entwicklungsteam API constructor. diff --git a/application/controllers/api/v1/codex/Gemeinde.php b/application/controllers/api/v1/codex/Gemeinde.php index 340d1ed9b..8f8e76854 100644 --- a/application/controllers/api/v1/codex/Gemeinde.php +++ b/application/controllers/api/v1/codex/Gemeinde.php @@ -14,7 +14,7 @@ if (!defined("BASEPATH")) exit("No direct script access allowed"); -class Gemeinde extends APIv1_Controller +class Gemeinde extends API_Controller { /** * Gemeinde API constructor. diff --git a/application/controllers/api/v1/codex/Hauptberuf.php b/application/controllers/api/v1/codex/Hauptberuf.php index 05396c473..4fdf8a687 100644 --- a/application/controllers/api/v1/codex/Hauptberuf.php +++ b/application/controllers/api/v1/codex/Hauptberuf.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Hauptberuf extends APIv1_Controller +class Hauptberuf extends API_Controller { /** * Hauptberuf API constructor. diff --git a/application/controllers/api/v1/codex/Lehrform.php b/application/controllers/api/v1/codex/Lehrform.php index e789e76ec..25b5a4253 100644 --- a/application/controllers/api/v1/codex/Lehrform.php +++ b/application/controllers/api/v1/codex/Lehrform.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Lehrform extends APIv1_Controller +class Lehrform extends API_Controller { /** * Lehrform API constructor. diff --git a/application/controllers/api/v1/codex/Lgartcode.php b/application/controllers/api/v1/codex/Lgartcode.php index 5be7cab59..2ee1bbf6f 100644 --- a/application/controllers/api/v1/codex/Lgartcode.php +++ b/application/controllers/api/v1/codex/Lgartcode.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Lgartcode extends APIv1_Controller +class Lgartcode extends API_Controller { /** * Lgartcode API constructor. diff --git a/application/controllers/api/v1/codex/Mobilitaetsprogramm.php b/application/controllers/api/v1/codex/Mobilitaetsprogramm.php index 70f0c3dc6..2215ebf92 100644 --- a/application/controllers/api/v1/codex/Mobilitaetsprogramm.php +++ b/application/controllers/api/v1/codex/Mobilitaetsprogramm.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Mobilitaetsprogramm extends APIv1_Controller +class Mobilitaetsprogramm extends API_Controller { /** * Mobilitaetsprogramm API constructor. diff --git a/application/controllers/api/v1/codex/Nation.php b/application/controllers/api/v1/codex/Nation.php index ad6c5e10e..16d9bf59a 100644 --- a/application/controllers/api/v1/codex/Nation.php +++ b/application/controllers/api/v1/codex/Nation.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Nation extends APIv1_Controller +class Nation extends API_Controller { /** * Course API constructor. diff --git a/application/controllers/api/v1/codex/Note.php b/application/controllers/api/v1/codex/Note.php index f42032fe5..d6f9c919a 100644 --- a/application/controllers/api/v1/codex/Note.php +++ b/application/controllers/api/v1/codex/Note.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Note extends APIv1_Controller +class Note extends API_Controller { /** * Note API constructor. diff --git a/application/controllers/api/v1/codex/Orgform.php b/application/controllers/api/v1/codex/Orgform.php index ad5d94185..481f01d2e 100644 --- a/application/controllers/api/v1/codex/Orgform.php +++ b/application/controllers/api/v1/codex/Orgform.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Orgform extends APIv1_Controller +class Orgform extends API_Controller { /** * Orgform API constructor. diff --git a/application/controllers/api/v1/codex/Verwendung.php b/application/controllers/api/v1/codex/Verwendung.php index 9823d3915..0eab46414 100644 --- a/application/controllers/api/v1/codex/Verwendung.php +++ b/application/controllers/api/v1/codex/Verwendung.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Verwendung extends APIv1_Controller +class Verwendung extends API_Controller { /** * Verwendung API constructor. diff --git a/application/controllers/api/v1/codex/Zgv.php b/application/controllers/api/v1/codex/Zgv.php index b1a0981dc..670ffc190 100644 --- a/application/controllers/api/v1/codex/Zgv.php +++ b/application/controllers/api/v1/codex/Zgv.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Zgv extends APIv1_Controller +class Zgv extends API_Controller { /** * Zgv API constructor. diff --git a/application/controllers/api/v1/codex/Zgvdoktor.php b/application/controllers/api/v1/codex/Zgvdoktor.php index aeaf56463..63059356e 100644 --- a/application/controllers/api/v1/codex/Zgvdoktor.php +++ b/application/controllers/api/v1/codex/Zgvdoktor.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Zgvdoktor extends APIv1_Controller +class Zgvdoktor extends API_Controller { /** * Zgvdoktor API constructor. diff --git a/application/controllers/api/v1/codex/Zgvgruppe.php b/application/controllers/api/v1/codex/Zgvgruppe.php index 38b1fe520..95ac6c6fc 100644 --- a/application/controllers/api/v1/codex/Zgvgruppe.php +++ b/application/controllers/api/v1/codex/Zgvgruppe.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Zgvgruppe extends APIv1_Controller +class Zgvgruppe extends API_Controller { /** * Zgvgruppe API constructor. diff --git a/application/controllers/api/v1/codex/Zgvmaster.php b/application/controllers/api/v1/codex/Zgvmaster.php index b8e7ee86d..ff737dd7f 100644 --- a/application/controllers/api/v1/codex/Zgvmaster.php +++ b/application/controllers/api/v1/codex/Zgvmaster.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Zgvmaster extends APIv1_Controller +class Zgvmaster extends API_Controller { /** * Zgvmaster API constructor. diff --git a/application/controllers/api/v1/codex/Zweck.php b/application/controllers/api/v1/codex/Zweck.php index c5710c7a5..75333fa6d 100644 --- a/application/controllers/api/v1/codex/Zweck.php +++ b/application/controllers/api/v1/codex/Zweck.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Zweck extends APIv1_Controller +class Zweck extends API_Controller { /** * Zweck API constructor. diff --git a/application/controllers/api/v1/content/Ampel.php b/application/controllers/api/v1/content/Ampel.php index f550eafdd..661af47cc 100644 --- a/application/controllers/api/v1/content/Ampel.php +++ b/application/controllers/api/v1/content/Ampel.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Ampel extends APIv1_Controller +class Ampel extends API_Controller { /** * Ampel API constructor. diff --git a/application/controllers/api/v1/content/Content.php b/application/controllers/api/v1/content/Content.php index 5d0854c2e..8d2474457 100644 --- a/application/controllers/api/v1/content/Content.php +++ b/application/controllers/api/v1/content/Content.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Content extends APIv1_Controller +class Content extends API_Controller { /** * Content API constructor. diff --git a/application/controllers/api/v1/content/Contentchild.php b/application/controllers/api/v1/content/Contentchild.php index 95dbc4ab0..d4647e3d3 100644 --- a/application/controllers/api/v1/content/Contentchild.php +++ b/application/controllers/api/v1/content/Contentchild.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Contentchild extends APIv1_Controller +class Contentchild extends API_Controller { /** * Contentchild API constructor. diff --git a/application/controllers/api/v1/content/Contentgruppe.php b/application/controllers/api/v1/content/Contentgruppe.php index 794400dc1..18c245288 100644 --- a/application/controllers/api/v1/content/Contentgruppe.php +++ b/application/controllers/api/v1/content/Contentgruppe.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Contentgruppe extends APIv1_Controller +class Contentgruppe extends API_Controller { /** * Contentgruppe API constructor. diff --git a/application/controllers/api/v1/content/Contentlog.php b/application/controllers/api/v1/content/Contentlog.php index ef4738828..d6e6ff940 100644 --- a/application/controllers/api/v1/content/Contentlog.php +++ b/application/controllers/api/v1/content/Contentlog.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Contentlog extends APIv1_Controller +class Contentlog extends API_Controller { /** * Contentlog API constructor. diff --git a/application/controllers/api/v1/content/Contentsprache.php b/application/controllers/api/v1/content/Contentsprache.php index f3696d2ad..15430d405 100644 --- a/application/controllers/api/v1/content/Contentsprache.php +++ b/application/controllers/api/v1/content/Contentsprache.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Contentsprache extends APIv1_Controller +class Contentsprache extends API_Controller { /** * Contentsprache API constructor. diff --git a/application/controllers/api/v1/content/Dms.php b/application/controllers/api/v1/content/Dms.php index e73254888..1109bd3ca 100644 --- a/application/controllers/api/v1/content/Dms.php +++ b/application/controllers/api/v1/content/Dms.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Dms extends APIv1_Controller +class Dms extends API_Controller { /** * diff --git a/application/controllers/api/v1/content/Infoscreen.php b/application/controllers/api/v1/content/Infoscreen.php index 3012af304..4b648c753 100644 --- a/application/controllers/api/v1/content/Infoscreen.php +++ b/application/controllers/api/v1/content/Infoscreen.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Infoscreen extends APIv1_Controller +class Infoscreen extends API_Controller { /** * Infoscreen API constructor. diff --git a/application/controllers/api/v1/content/News.php b/application/controllers/api/v1/content/News.php index b085afb7d..e7c0b3797 100644 --- a/application/controllers/api/v1/content/News.php +++ b/application/controllers/api/v1/content/News.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class News extends APIv1_Controller +class News extends API_Controller { /** * News API constructor. diff --git a/application/controllers/api/v1/content/Template.php b/application/controllers/api/v1/content/Template.php index e15156b14..bfd9fcd08 100644 --- a/application/controllers/api/v1/content/Template.php +++ b/application/controllers/api/v1/content/Template.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Template extends APIv1_Controller +class Template extends API_Controller { /** * Template API constructor. diff --git a/application/controllers/api/v1/content/Veranstaltung.php b/application/controllers/api/v1/content/Veranstaltung.php index 5f922e65a..5447e538d 100644 --- a/application/controllers/api/v1/content/Veranstaltung.php +++ b/application/controllers/api/v1/content/Veranstaltung.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Veranstaltung extends APIv1_Controller +class Veranstaltung extends API_Controller { /** * Veranstaltung API constructor. diff --git a/application/controllers/api/v1/content/Veranstaltungskategorie.php b/application/controllers/api/v1/content/Veranstaltungskategorie.php index 20af408c5..afc2c4968 100644 --- a/application/controllers/api/v1/content/Veranstaltungskategorie.php +++ b/application/controllers/api/v1/content/Veranstaltungskategorie.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Veranstaltungskategorie extends APIv1_Controller +class Veranstaltungskategorie extends API_Controller { /** * Veranstaltungskategorie API constructor. diff --git a/application/controllers/api/v1/crm/Akte.php b/application/controllers/api/v1/crm/Akte.php index e9c892da5..a24d7abcc 100644 --- a/application/controllers/api/v1/crm/Akte.php +++ b/application/controllers/api/v1/crm/Akte.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Akte extends APIv1_Controller +class Akte extends API_Controller { /** * Akte API constructor. diff --git a/application/controllers/api/v1/crm/Aufnahmeschluessel.php b/application/controllers/api/v1/crm/Aufnahmeschluessel.php index f2724481c..f055f1d20 100644 --- a/application/controllers/api/v1/crm/Aufnahmeschluessel.php +++ b/application/controllers/api/v1/crm/Aufnahmeschluessel.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Aufnahmeschluessel extends APIv1_Controller +class Aufnahmeschluessel extends API_Controller { /** * Aufnahmeschluessel API constructor. diff --git a/application/controllers/api/v1/crm/Aufnahmetermin.php b/application/controllers/api/v1/crm/Aufnahmetermin.php index e199adbf8..31b1d8ef4 100644 --- a/application/controllers/api/v1/crm/Aufnahmetermin.php +++ b/application/controllers/api/v1/crm/Aufnahmetermin.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Aufnahmetermin extends APIv1_Controller +class Aufnahmetermin extends API_Controller { /** * Aufnahmetermin API constructor. diff --git a/application/controllers/api/v1/crm/Aufnahmetermintyp.php b/application/controllers/api/v1/crm/Aufnahmetermintyp.php index 7219598bf..ccc5d5901 100644 --- a/application/controllers/api/v1/crm/Aufnahmetermintyp.php +++ b/application/controllers/api/v1/crm/Aufnahmetermintyp.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Aufnahmetermintyp extends APIv1_Controller +class Aufnahmetermintyp extends API_Controller { /** * Aufnahmetermintyp API constructor. diff --git a/application/controllers/api/v1/crm/Bewerbungstermine.php b/application/controllers/api/v1/crm/Bewerbungstermine.php index 55d49ff58..f39623b6b 100644 --- a/application/controllers/api/v1/crm/Bewerbungstermine.php +++ b/application/controllers/api/v1/crm/Bewerbungstermine.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Bewerbungstermine extends APIv1_Controller +class Bewerbungstermine extends API_Controller { /** * Bewerbungstermine API constructor. diff --git a/application/controllers/api/v1/crm/Buchungstyp.php b/application/controllers/api/v1/crm/Buchungstyp.php index 0253050f3..90129f1c3 100644 --- a/application/controllers/api/v1/crm/Buchungstyp.php +++ b/application/controllers/api/v1/crm/Buchungstyp.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Buchungstyp extends APIv1_Controller +class Buchungstyp extends API_Controller { /** * Buchungstyp API constructor. diff --git a/application/controllers/api/v1/crm/Dokument.php b/application/controllers/api/v1/crm/Dokument.php index 11a603496..c94413f55 100644 --- a/application/controllers/api/v1/crm/Dokument.php +++ b/application/controllers/api/v1/crm/Dokument.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Dokument extends APIv1_Controller +class Dokument extends API_Controller { /** * Dokument API constructor. diff --git a/application/controllers/api/v1/crm/Dokumentprestudent.php b/application/controllers/api/v1/crm/Dokumentprestudent.php index e05815d33..20ebe37bc 100644 --- a/application/controllers/api/v1/crm/Dokumentprestudent.php +++ b/application/controllers/api/v1/crm/Dokumentprestudent.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Dokumentprestudent extends APIv1_Controller +class Dokumentprestudent extends API_Controller { /** * Dokumentprestudent API constructor. diff --git a/application/controllers/api/v1/crm/Dokumentstudiengang.php b/application/controllers/api/v1/crm/Dokumentstudiengang.php index 3e908d455..81b84c888 100644 --- a/application/controllers/api/v1/crm/Dokumentstudiengang.php +++ b/application/controllers/api/v1/crm/Dokumentstudiengang.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Dokumentstudiengang extends APIv1_Controller +class Dokumentstudiengang extends API_Controller { /** * Dokumentstudiengang API constructor. diff --git a/application/controllers/api/v1/crm/Konto.php b/application/controllers/api/v1/crm/Konto.php index 5a2cdafe2..135d36ab7 100644 --- a/application/controllers/api/v1/crm/Konto.php +++ b/application/controllers/api/v1/crm/Konto.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Konto extends APIv1_Controller +class Konto extends API_Controller { /** * Konto API constructor. diff --git a/application/controllers/api/v1/crm/Preincoming.php b/application/controllers/api/v1/crm/Preincoming.php index 14da2b9c3..f319218ae 100644 --- a/application/controllers/api/v1/crm/Preincoming.php +++ b/application/controllers/api/v1/crm/Preincoming.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Preincoming extends APIv1_Controller +class Preincoming extends API_Controller { /** * Preincoming API constructor. diff --git a/application/controllers/api/v1/crm/Preinteressent.php b/application/controllers/api/v1/crm/Preinteressent.php index 62c29dfda..ab3ee68d6 100644 --- a/application/controllers/api/v1/crm/Preinteressent.php +++ b/application/controllers/api/v1/crm/Preinteressent.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Preinteressent extends APIv1_Controller +class Preinteressent extends API_Controller { /** * Person API constructor. diff --git a/application/controllers/api/v1/crm/Preinteressentstudiengang.php b/application/controllers/api/v1/crm/Preinteressentstudiengang.php index e4e834ef9..4a97077d0 100644 --- a/application/controllers/api/v1/crm/Preinteressentstudiengang.php +++ b/application/controllers/api/v1/crm/Preinteressentstudiengang.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Preinteressentstudiengang extends APIv1_Controller +class Preinteressentstudiengang extends API_Controller { /** * Preinteressentstudiengang API constructor. diff --git a/application/controllers/api/v1/crm/Preoutgoing.php b/application/controllers/api/v1/crm/Preoutgoing.php index 733bd2eb9..0f2829dfd 100644 --- a/application/controllers/api/v1/crm/Preoutgoing.php +++ b/application/controllers/api/v1/crm/Preoutgoing.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Preoutgoing extends APIv1_Controller +class Preoutgoing extends API_Controller { /** * Preoutgoing API constructor. diff --git a/application/controllers/api/v1/crm/Prestudent.php b/application/controllers/api/v1/crm/Prestudent.php index 072ba3eea..6376ef94f 100644 --- a/application/controllers/api/v1/crm/Prestudent.php +++ b/application/controllers/api/v1/crm/Prestudent.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Prestudent extends APIv1_Controller +class Prestudent extends API_Controller { /** * Prestudent API constructor. diff --git a/application/controllers/api/v1/crm/Prestudentstatus.php b/application/controllers/api/v1/crm/Prestudentstatus.php index b72ac2fe9..5c3c38e1c 100644 --- a/application/controllers/api/v1/crm/Prestudentstatus.php +++ b/application/controllers/api/v1/crm/Prestudentstatus.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Prestudentstatus extends APIv1_Controller +class Prestudentstatus extends API_Controller { /** * Prestudentstatus API constructor. diff --git a/application/controllers/api/v1/crm/Reihungstest.php b/application/controllers/api/v1/crm/Reihungstest.php index e9012d740..81dc32cec 100644 --- a/application/controllers/api/v1/crm/Reihungstest.php +++ b/application/controllers/api/v1/crm/Reihungstest.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Reihungstest extends APIv1_Controller +class Reihungstest extends API_Controller { /** * Reihungstest API constructor. diff --git a/application/controllers/api/v1/crm/RtPerson.php b/application/controllers/api/v1/crm/RtPerson.php index f9610722a..ed84de90e 100644 --- a/application/controllers/api/v1/crm/RtPerson.php +++ b/application/controllers/api/v1/crm/RtPerson.php @@ -14,7 +14,7 @@ if (!defined("BASEPATH")) exit("No direct script access allowed"); -class RtPerson extends APIv1_Controller +class RtPerson extends API_Controller { /** * Status API constructor. diff --git a/application/controllers/api/v1/crm/Status.php b/application/controllers/api/v1/crm/Status.php index 37a8fbd11..6a9a89ec3 100644 --- a/application/controllers/api/v1/crm/Status.php +++ b/application/controllers/api/v1/crm/Status.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Status extends APIv1_Controller +class Status extends API_Controller { /** * Status API constructor. diff --git a/application/controllers/api/v1/crm/Statusgrund.php b/application/controllers/api/v1/crm/Statusgrund.php index 3f19f2f82..fbf225e42 100644 --- a/application/controllers/api/v1/crm/Statusgrund.php +++ b/application/controllers/api/v1/crm/Statusgrund.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Statusgrund extends APIv1_Controller +class Statusgrund extends API_Controller { /** * Status API constructor. diff --git a/application/controllers/api/v1/crm/Student.php b/application/controllers/api/v1/crm/Student.php index 6227cb6e3..34920021c 100644 --- a/application/controllers/api/v1/crm/Student.php +++ b/application/controllers/api/v1/crm/Student.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Student extends APIv1_Controller +class Student extends API_Controller { /** * Student API constructor. diff --git a/application/controllers/api/v1/education/Abgabe.php b/application/controllers/api/v1/education/Abgabe.php index e3fd64530..676414d70 100644 --- a/application/controllers/api/v1/education/Abgabe.php +++ b/application/controllers/api/v1/education/Abgabe.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Abgabe extends APIv1_Controller +class Abgabe extends API_Controller { /** * Abgabe API constructor. diff --git a/application/controllers/api/v1/education/Abschlussbeurteilung.php b/application/controllers/api/v1/education/Abschlussbeurteilung.php index 1987e276f..1c4f3fb90 100644 --- a/application/controllers/api/v1/education/Abschlussbeurteilung.php +++ b/application/controllers/api/v1/education/Abschlussbeurteilung.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Abschlussbeurteilung extends APIv1_Controller +class Abschlussbeurteilung extends API_Controller { /** * Abschlussbeurteilung API constructor. diff --git a/application/controllers/api/v1/education/Abschlusspruefung.php b/application/controllers/api/v1/education/Abschlusspruefung.php index cadea53ca..a47adc992 100644 --- a/application/controllers/api/v1/education/Abschlusspruefung.php +++ b/application/controllers/api/v1/education/Abschlusspruefung.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Abschlusspruefung extends APIv1_Controller +class Abschlusspruefung extends API_Controller { /** * Abschlusspruefung API constructor. diff --git a/application/controllers/api/v1/education/Anrechnung.php b/application/controllers/api/v1/education/Anrechnung.php index 5a99b08ab..743ff7e5b 100644 --- a/application/controllers/api/v1/education/Anrechnung.php +++ b/application/controllers/api/v1/education/Anrechnung.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Anrechnung extends APIv1_Controller +class Anrechnung extends API_Controller { /** * Anrechnung API constructor. diff --git a/application/controllers/api/v1/education/Anwesenheit.php b/application/controllers/api/v1/education/Anwesenheit.php index 2e915f071..2403220e0 100644 --- a/application/controllers/api/v1/education/Anwesenheit.php +++ b/application/controllers/api/v1/education/Anwesenheit.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Anwesenheit extends APIv1_Controller +class Anwesenheit extends API_Controller { /** * Anwesenheit API constructor. diff --git a/application/controllers/api/v1/education/Beispiel.php b/application/controllers/api/v1/education/Beispiel.php index b2c06047b..4bcd6ac55 100644 --- a/application/controllers/api/v1/education/Beispiel.php +++ b/application/controllers/api/v1/education/Beispiel.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Beispiel extends APIv1_Controller +class Beispiel extends API_Controller { /** * Beispiel API constructor. diff --git a/application/controllers/api/v1/education/Betreuerart.php b/application/controllers/api/v1/education/Betreuerart.php index 43b4c51f6..b4cf34b7b 100644 --- a/application/controllers/api/v1/education/Betreuerart.php +++ b/application/controllers/api/v1/education/Betreuerart.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Betreuerart extends APIv1_Controller +class Betreuerart extends API_Controller { /** * Betreuerart API constructor. diff --git a/application/controllers/api/v1/education/Feedback.php b/application/controllers/api/v1/education/Feedback.php index abef22d77..8179181bc 100644 --- a/application/controllers/api/v1/education/Feedback.php +++ b/application/controllers/api/v1/education/Feedback.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Feedback extends APIv1_Controller +class Feedback extends API_Controller { /** * Feedback API constructor. diff --git a/application/controllers/api/v1/education/Legesamtnote.php b/application/controllers/api/v1/education/Legesamtnote.php index 96ff25c4f..c4f51b7ff 100644 --- a/application/controllers/api/v1/education/Legesamtnote.php +++ b/application/controllers/api/v1/education/Legesamtnote.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Legesamtnote extends APIv1_Controller +class Legesamtnote extends API_Controller { /** * Legesamtnote API constructor. diff --git a/application/controllers/api/v1/education/Lehreinheit.php b/application/controllers/api/v1/education/Lehreinheit.php index f229de846..05741b6c7 100644 --- a/application/controllers/api/v1/education/Lehreinheit.php +++ b/application/controllers/api/v1/education/Lehreinheit.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Lehreinheit extends APIv1_Controller +class Lehreinheit extends API_Controller { /** * Lehreinheit API constructor. diff --git a/application/controllers/api/v1/education/Lehreinheitgruppe.php b/application/controllers/api/v1/education/Lehreinheitgruppe.php index 6ef949d3e..a8d996c4e 100644 --- a/application/controllers/api/v1/education/Lehreinheitgruppe.php +++ b/application/controllers/api/v1/education/Lehreinheitgruppe.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Lehreinheitgruppe extends APIv1_Controller +class Lehreinheitgruppe extends API_Controller { /** * Lehreinheitgruppe API constructor. diff --git a/application/controllers/api/v1/education/Lehreinheitmitarbeiter.php b/application/controllers/api/v1/education/Lehreinheitmitarbeiter.php index 5237ca849..6861c7b77 100644 --- a/application/controllers/api/v1/education/Lehreinheitmitarbeiter.php +++ b/application/controllers/api/v1/education/Lehreinheitmitarbeiter.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Lehreinheitmitarbeiter extends APIv1_Controller +class Lehreinheitmitarbeiter extends API_Controller { /** * Lehreinheitmitarbeiter API constructor. diff --git a/application/controllers/api/v1/education/Lehrfach.php b/application/controllers/api/v1/education/Lehrfach.php index 81ce519e1..e65776e08 100644 --- a/application/controllers/api/v1/education/Lehrfach.php +++ b/application/controllers/api/v1/education/Lehrfach.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Lehrfach extends APIv1_Controller +class Lehrfach extends API_Controller { /** * Lehrfach API constructor. diff --git a/application/controllers/api/v1/education/Lehrfunktion.php b/application/controllers/api/v1/education/Lehrfunktion.php index e29f1227d..93f504fa7 100644 --- a/application/controllers/api/v1/education/Lehrfunktion.php +++ b/application/controllers/api/v1/education/Lehrfunktion.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Lehrfunktion extends APIv1_Controller +class Lehrfunktion extends API_Controller { /** * Lehrfunktion API constructor. diff --git a/application/controllers/api/v1/education/Lehrtyp.php b/application/controllers/api/v1/education/Lehrtyp.php index dfcfd3033..bd73d14c4 100644 --- a/application/controllers/api/v1/education/Lehrtyp.php +++ b/application/controllers/api/v1/education/Lehrtyp.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Lehrtyp extends APIv1_Controller +class Lehrtyp extends API_Controller { /** * Lehrtyp API constructor. diff --git a/application/controllers/api/v1/education/Lehrveranstaltung.php b/application/controllers/api/v1/education/Lehrveranstaltung.php index 2e2fffb66..676b6478d 100644 --- a/application/controllers/api/v1/education/Lehrveranstaltung.php +++ b/application/controllers/api/v1/education/Lehrveranstaltung.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Lehrveranstaltung extends APIv1_Controller +class Lehrveranstaltung extends API_Controller { /** * Lehrveranstaltung API constructor. diff --git a/application/controllers/api/v1/education/Lenotenschluessel.php b/application/controllers/api/v1/education/Lenotenschluessel.php index 9477172a3..980258859 100644 --- a/application/controllers/api/v1/education/Lenotenschluessel.php +++ b/application/controllers/api/v1/education/Lenotenschluessel.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Lenotenschluessel extends APIv1_Controller +class Lenotenschluessel extends API_Controller { /** * LeNotenschluessel API constructor. diff --git a/application/controllers/api/v1/education/Lepruefung.php b/application/controllers/api/v1/education/Lepruefung.php index 52e1d81b6..3234a30c0 100644 --- a/application/controllers/api/v1/education/Lepruefung.php +++ b/application/controllers/api/v1/education/Lepruefung.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Lepruefung extends APIv1_Controller +class Lepruefung extends API_Controller { /** * LePruefung API constructor. diff --git a/application/controllers/api/v1/education/Lvangebot.php b/application/controllers/api/v1/education/Lvangebot.php index ecd917233..1a364bea3 100644 --- a/application/controllers/api/v1/education/Lvangebot.php +++ b/application/controllers/api/v1/education/Lvangebot.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Lvangebot extends APIv1_Controller +class Lvangebot extends API_Controller { /** * Lvangebot API constructor. diff --git a/application/controllers/api/v1/education/Lvgesamtnote.php b/application/controllers/api/v1/education/Lvgesamtnote.php index 464ef99a9..10c5c8577 100644 --- a/application/controllers/api/v1/education/Lvgesamtnote.php +++ b/application/controllers/api/v1/education/Lvgesamtnote.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Lvgesamtnote extends APIv1_Controller +class Lvgesamtnote extends API_Controller { /** * Lvgesamtnote API constructor. diff --git a/application/controllers/api/v1/education/Lvinfo.php b/application/controllers/api/v1/education/Lvinfo.php index 8631583b9..d0cdb637b 100644 --- a/application/controllers/api/v1/education/Lvinfo.php +++ b/application/controllers/api/v1/education/Lvinfo.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Lvinfo extends APIv1_Controller +class Lvinfo extends API_Controller { /** * Lvinfo API constructor. diff --git a/application/controllers/api/v1/education/Lvregel.php b/application/controllers/api/v1/education/Lvregel.php index 33410cb88..0334c8ff2 100644 --- a/application/controllers/api/v1/education/Lvregel.php +++ b/application/controllers/api/v1/education/Lvregel.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Lvregel extends APIv1_Controller +class Lvregel extends API_Controller { /** * Lvregel API constructor. diff --git a/application/controllers/api/v1/education/Lvregeltyp.php b/application/controllers/api/v1/education/Lvregeltyp.php index 22fe0a9ff..9e7b90f22 100644 --- a/application/controllers/api/v1/education/Lvregeltyp.php +++ b/application/controllers/api/v1/education/Lvregeltyp.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Lvregeltyp extends APIv1_Controller +class Lvregeltyp extends API_Controller { /** * Lvregeltyp API constructor. diff --git a/application/controllers/api/v1/education/Notenschluessel.php b/application/controllers/api/v1/education/Notenschluessel.php index 91c7c513e..415a6c252 100644 --- a/application/controllers/api/v1/education/Notenschluessel.php +++ b/application/controllers/api/v1/education/Notenschluessel.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Notenschluessel extends APIv1_Controller +class Notenschluessel extends API_Controller { /** * Notenschluessel API constructor. diff --git a/application/controllers/api/v1/education/Notenschluesselaufteilung.php b/application/controllers/api/v1/education/Notenschluesselaufteilung.php index 1e4b168ef..11d325183 100644 --- a/application/controllers/api/v1/education/Notenschluesselaufteilung.php +++ b/application/controllers/api/v1/education/Notenschluesselaufteilung.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Notenschluesselaufteilung extends APIv1_Controller +class Notenschluesselaufteilung extends API_Controller { /** * Notenschluesselaufteilung API constructor. diff --git a/application/controllers/api/v1/education/Notenschluesseluebung.php b/application/controllers/api/v1/education/Notenschluesseluebung.php index bb907f4ff..c1f13633e 100644 --- a/application/controllers/api/v1/education/Notenschluesseluebung.php +++ b/application/controllers/api/v1/education/Notenschluesseluebung.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Notenschluesseluebung extends APIv1_Controller +class Notenschluesseluebung extends API_Controller { /** * Notenschluesseluebung API constructor. diff --git a/application/controllers/api/v1/education/Notenschluesselzuordnung.php b/application/controllers/api/v1/education/Notenschluesselzuordnung.php index a4e7d757a..af4295fcd 100644 --- a/application/controllers/api/v1/education/Notenschluesselzuordnung.php +++ b/application/controllers/api/v1/education/Notenschluesselzuordnung.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Notenschluesselzuordnung extends APIv1_Controller +class Notenschluesselzuordnung extends API_Controller { /** * Notenschluesselzuordnung API constructor. diff --git a/application/controllers/api/v1/education/Paabgabe.php b/application/controllers/api/v1/education/Paabgabe.php index 87e9c2ec7..716fb7574 100644 --- a/application/controllers/api/v1/education/Paabgabe.php +++ b/application/controllers/api/v1/education/Paabgabe.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Paabgabe extends APIv1_Controller +class Paabgabe extends API_Controller { /** * Paabgabe API constructor. diff --git a/application/controllers/api/v1/education/Paabgabetyp.php b/application/controllers/api/v1/education/Paabgabetyp.php index 999cbd57b..117c4ffd1 100644 --- a/application/controllers/api/v1/education/Paabgabetyp.php +++ b/application/controllers/api/v1/education/Paabgabetyp.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Paabgabetyp extends APIv1_Controller +class Paabgabetyp extends API_Controller { /** * Paabgabetyp API constructor. diff --git a/application/controllers/api/v1/education/Projektarbeit.php b/application/controllers/api/v1/education/Projektarbeit.php index 1b09fa4e7..0a77a9e64 100644 --- a/application/controllers/api/v1/education/Projektarbeit.php +++ b/application/controllers/api/v1/education/Projektarbeit.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Projektarbeit extends APIv1_Controller +class Projektarbeit extends API_Controller { /** * Projektarbeit API constructor. diff --git a/application/controllers/api/v1/education/Projektbetreuer.php b/application/controllers/api/v1/education/Projektbetreuer.php index b395b7e5f..e0a078a51 100644 --- a/application/controllers/api/v1/education/Projektbetreuer.php +++ b/application/controllers/api/v1/education/Projektbetreuer.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Projektbetreuer extends APIv1_Controller +class Projektbetreuer extends API_Controller { /** * Projektbetreuer API constructor. diff --git a/application/controllers/api/v1/education/Projekttyp.php b/application/controllers/api/v1/education/Projekttyp.php index bf4c5d73a..f75fd6477 100644 --- a/application/controllers/api/v1/education/Projekttyp.php +++ b/application/controllers/api/v1/education/Projekttyp.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Projekttyp extends APIv1_Controller +class Projekttyp extends API_Controller { /** * Projekttyp API constructor. diff --git a/application/controllers/api/v1/education/Pruefung.php b/application/controllers/api/v1/education/Pruefung.php index 23fc97c8d..8218b63b0 100644 --- a/application/controllers/api/v1/education/Pruefung.php +++ b/application/controllers/api/v1/education/Pruefung.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Pruefung extends APIv1_Controller +class Pruefung extends API_Controller { /** * Pruefung API constructor. diff --git a/application/controllers/api/v1/education/Pruefungsanmeldung.php b/application/controllers/api/v1/education/Pruefungsanmeldung.php index d65ded0b4..8ffbbc0cf 100644 --- a/application/controllers/api/v1/education/Pruefungsanmeldung.php +++ b/application/controllers/api/v1/education/Pruefungsanmeldung.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Pruefungsanmeldung extends APIv1_Controller +class Pruefungsanmeldung extends API_Controller { /** * Pruefungsanmeldung API constructor. diff --git a/application/controllers/api/v1/education/Pruefungsfenster.php b/application/controllers/api/v1/education/Pruefungsfenster.php index 50d13cff5..8e4c3af99 100644 --- a/application/controllers/api/v1/education/Pruefungsfenster.php +++ b/application/controllers/api/v1/education/Pruefungsfenster.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Pruefungsfenster extends APIv1_Controller +class Pruefungsfenster extends API_Controller { /** * Pruefungsfenster API constructor. diff --git a/application/controllers/api/v1/education/Pruefungsstatus.php b/application/controllers/api/v1/education/Pruefungsstatus.php index cbfbfb044..c2bfe6f9b 100644 --- a/application/controllers/api/v1/education/Pruefungsstatus.php +++ b/application/controllers/api/v1/education/Pruefungsstatus.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Pruefungsstatus extends APIv1_Controller +class Pruefungsstatus extends API_Controller { /** * Pruefungsstatus API constructor. diff --git a/application/controllers/api/v1/education/Pruefungstermin.php b/application/controllers/api/v1/education/Pruefungstermin.php index fd16159dc..d6b61e7f7 100644 --- a/application/controllers/api/v1/education/Pruefungstermin.php +++ b/application/controllers/api/v1/education/Pruefungstermin.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Pruefungstermin extends APIv1_Controller +class Pruefungstermin extends API_Controller { /** * Pruefungstermin API constructor. diff --git a/application/controllers/api/v1/education/Pruefungstyp.php b/application/controllers/api/v1/education/Pruefungstyp.php index 4c460d5cd..7e0707c17 100644 --- a/application/controllers/api/v1/education/Pruefungstyp.php +++ b/application/controllers/api/v1/education/Pruefungstyp.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Pruefungstyp extends APIv1_Controller +class Pruefungstyp extends API_Controller { /** * Pruefungstyp API constructor. diff --git a/application/controllers/api/v1/education/Studentbeispiel.php b/application/controllers/api/v1/education/Studentbeispiel.php index 45012231a..504614334 100644 --- a/application/controllers/api/v1/education/Studentbeispiel.php +++ b/application/controllers/api/v1/education/Studentbeispiel.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Studentbeispiel extends APIv1_Controller +class Studentbeispiel extends API_Controller { /** * Studentbeispiel API constructor. diff --git a/application/controllers/api/v1/education/Studentlehrverband.php b/application/controllers/api/v1/education/Studentlehrverband.php index 4793b0b1b..7bae1e375 100644 --- a/application/controllers/api/v1/education/Studentlehrverband.php +++ b/application/controllers/api/v1/education/Studentlehrverband.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Studentlehrverband extends APIv1_Controller +class Studentlehrverband extends API_Controller { /** * Studentlehrverband API constructor. diff --git a/application/controllers/api/v1/education/Studentuebung.php b/application/controllers/api/v1/education/Studentuebung.php index 2a086610c..e36add29e 100644 --- a/application/controllers/api/v1/education/Studentuebung.php +++ b/application/controllers/api/v1/education/Studentuebung.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Studentuebung extends APIv1_Controller +class Studentuebung extends API_Controller { /** * Studentuebung API constructor. diff --git a/application/controllers/api/v1/education/Uebung.php b/application/controllers/api/v1/education/Uebung.php index 41d8f8448..e6e27560d 100644 --- a/application/controllers/api/v1/education/Uebung.php +++ b/application/controllers/api/v1/education/Uebung.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Uebung extends APIv1_Controller +class Uebung extends API_Controller { /** * Uebung API constructor. diff --git a/application/controllers/api/v1/education/Zeugnis.php b/application/controllers/api/v1/education/Zeugnis.php index 86af07284..a58eadcce 100644 --- a/application/controllers/api/v1/education/Zeugnis.php +++ b/application/controllers/api/v1/education/Zeugnis.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Zeugnis extends APIv1_Controller +class Zeugnis extends API_Controller { /** * Zeugnis API constructor. diff --git a/application/controllers/api/v1/education/Zeugnisnote.php b/application/controllers/api/v1/education/Zeugnisnote.php index 10083865e..9a00e0c23 100644 --- a/application/controllers/api/v1/education/Zeugnisnote.php +++ b/application/controllers/api/v1/education/Zeugnisnote.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Zeugnisnote extends APIv1_Controller +class Zeugnisnote extends API_Controller { /** * Zeugnisnote API constructor. diff --git a/application/controllers/api/v1/organisation/Erhalter.php b/application/controllers/api/v1/organisation/Erhalter.php index 0098f7fcc..e4b2532de 100644 --- a/application/controllers/api/v1/organisation/Erhalter.php +++ b/application/controllers/api/v1/organisation/Erhalter.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Erhalter extends APIv1_Controller +class Erhalter extends API_Controller { /** * Erhalter API constructor. diff --git a/application/controllers/api/v1/organisation/Fachbereich2.php b/application/controllers/api/v1/organisation/Fachbereich2.php index a2d3d3838..dc6af4253 100644 --- a/application/controllers/api/v1/organisation/Fachbereich2.php +++ b/application/controllers/api/v1/organisation/Fachbereich2.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Fachbereich2 extends APIv1_Controller +class Fachbereich2 extends API_Controller { /** * Fachbereich API constructor. diff --git a/application/controllers/api/v1/organisation/Ferien.php b/application/controllers/api/v1/organisation/Ferien.php index e943a7e66..f74ab37c1 100644 --- a/application/controllers/api/v1/organisation/Ferien.php +++ b/application/controllers/api/v1/organisation/Ferien.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Ferien extends APIv1_Controller +class Ferien extends API_Controller { /** * Ferien API constructor. diff --git a/application/controllers/api/v1/organisation/Geschaeftsjahr2.php b/application/controllers/api/v1/organisation/Geschaeftsjahr2.php index 2dfa9f400..9284f7d47 100644 --- a/application/controllers/api/v1/organisation/Geschaeftsjahr2.php +++ b/application/controllers/api/v1/organisation/Geschaeftsjahr2.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Geschaeftsjahr2 extends APIv1_Controller +class Geschaeftsjahr2 extends API_Controller { /** * Geschaeftsjahr API constructor. diff --git a/application/controllers/api/v1/organisation/Gruppe.php b/application/controllers/api/v1/organisation/Gruppe.php index e3ef92fa4..41727dfcf 100644 --- a/application/controllers/api/v1/organisation/Gruppe.php +++ b/application/controllers/api/v1/organisation/Gruppe.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Gruppe extends APIv1_Controller +class Gruppe extends API_Controller { /** * Gruppe API constructor. diff --git a/application/controllers/api/v1/organisation/Lehrverband.php b/application/controllers/api/v1/organisation/Lehrverband.php index 9b12dcf90..b9981a1cd 100644 --- a/application/controllers/api/v1/organisation/Lehrverband.php +++ b/application/controllers/api/v1/organisation/Lehrverband.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Lehrverband extends APIv1_Controller +class Lehrverband extends API_Controller { /** * Lehrverband API constructor. diff --git a/application/controllers/api/v1/organisation/Organisationseinheit2.php b/application/controllers/api/v1/organisation/Organisationseinheit2.php index 3f62bbdf1..a828da0ae 100644 --- a/application/controllers/api/v1/organisation/Organisationseinheit2.php +++ b/application/controllers/api/v1/organisation/Organisationseinheit2.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Organisationseinheit2 extends APIv1_Controller +class Organisationseinheit2 extends API_Controller { /** * Organisationseinheit API constructor. diff --git a/application/controllers/api/v1/organisation/Organisationseinheittyp.php b/application/controllers/api/v1/organisation/Organisationseinheittyp.php index 62a723b1e..3f5925f63 100644 --- a/application/controllers/api/v1/organisation/Organisationseinheittyp.php +++ b/application/controllers/api/v1/organisation/Organisationseinheittyp.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Organisationseinheittyp extends APIv1_Controller +class Organisationseinheittyp extends API_Controller { /** * Organisationseinheittyp API constructor. diff --git a/application/controllers/api/v1/organisation/Semesterwochen.php b/application/controllers/api/v1/organisation/Semesterwochen.php index 2dbd26ab0..0bab990bd 100644 --- a/application/controllers/api/v1/organisation/Semesterwochen.php +++ b/application/controllers/api/v1/organisation/Semesterwochen.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Semesterwochen extends APIv1_Controller +class Semesterwochen extends API_Controller { /** * Semesterwochen API constructor. diff --git a/application/controllers/api/v1/organisation/Service.php b/application/controllers/api/v1/organisation/Service.php index 4d1988430..80c971ba4 100644 --- a/application/controllers/api/v1/organisation/Service.php +++ b/application/controllers/api/v1/organisation/Service.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Service extends APIv1_Controller +class Service extends API_Controller { /** * Service API constructor. diff --git a/application/controllers/api/v1/organisation/Standort.php b/application/controllers/api/v1/organisation/Standort.php index 16c206401..a9b7a76ec 100644 --- a/application/controllers/api/v1/organisation/Standort.php +++ b/application/controllers/api/v1/organisation/Standort.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Standort extends APIv1_Controller +class Standort extends API_Controller { /** * Standort API constructor. diff --git a/application/controllers/api/v1/organisation/Statistik.php b/application/controllers/api/v1/organisation/Statistik.php index b85c27f42..0c0cbe133 100644 --- a/application/controllers/api/v1/organisation/Statistik.php +++ b/application/controllers/api/v1/organisation/Statistik.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Statistik extends APIv1_Controller +class Statistik extends API_Controller { /** * Statistik API constructor. diff --git a/application/controllers/api/v1/organisation/Studiengang2.php b/application/controllers/api/v1/organisation/Studiengang2.php index 2e1b549ff..5e8ddfe9e 100644 --- a/application/controllers/api/v1/organisation/Studiengang2.php +++ b/application/controllers/api/v1/organisation/Studiengang2.php @@ -13,7 +13,7 @@ // ------------------------------------------------------------------------ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Studiengang2 extends APIv1_Controller +class Studiengang2 extends API_Controller { /** * diff --git a/application/controllers/api/v1/organisation/Studiengangstyp.php b/application/controllers/api/v1/organisation/Studiengangstyp.php index b10811636..e637e0c9d 100644 --- a/application/controllers/api/v1/organisation/Studiengangstyp.php +++ b/application/controllers/api/v1/organisation/Studiengangstyp.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Studiengangstyp extends APIv1_Controller +class Studiengangstyp extends API_Controller { /** * Studiengangstyp API constructor. diff --git a/application/controllers/api/v1/organisation/Studienjahr.php b/application/controllers/api/v1/organisation/Studienjahr.php index eb7c38847..b681e8864 100644 --- a/application/controllers/api/v1/organisation/Studienjahr.php +++ b/application/controllers/api/v1/organisation/Studienjahr.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Studienjahr extends APIv1_Controller +class Studienjahr extends API_Controller { /** * Studienjahr API constructor. diff --git a/application/controllers/api/v1/organisation/Studienordnung.php b/application/controllers/api/v1/organisation/Studienordnung.php index 122c8f099..541eccbf2 100644 --- a/application/controllers/api/v1/organisation/Studienordnung.php +++ b/application/controllers/api/v1/organisation/Studienordnung.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Studienordnung extends APIv1_Controller +class Studienordnung extends API_Controller { /** * Studienordnung API constructor. diff --git a/application/controllers/api/v1/organisation/Studienordnungstatus.php b/application/controllers/api/v1/organisation/Studienordnungstatus.php index 30d38c4ad..8de5cf126 100644 --- a/application/controllers/api/v1/organisation/Studienordnungstatus.php +++ b/application/controllers/api/v1/organisation/Studienordnungstatus.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Studienordnungstatus extends APIv1_Controller +class Studienordnungstatus extends API_Controller { /** * Studienordnungstatus API constructor. diff --git a/application/controllers/api/v1/organisation/Studienplan.php b/application/controllers/api/v1/organisation/Studienplan.php index 05d8d7837..f461565d3 100644 --- a/application/controllers/api/v1/organisation/Studienplan.php +++ b/application/controllers/api/v1/organisation/Studienplan.php @@ -14,7 +14,7 @@ if (!defined("BASEPATH")) exit("No direct script access allowed"); -class Studienplan extends APIv1_Controller +class Studienplan extends API_Controller { /** * Course API constructor. diff --git a/application/controllers/api/v1/organisation/Studienplatz.php b/application/controllers/api/v1/organisation/Studienplatz.php index 88ce6a12d..217fa40a7 100644 --- a/application/controllers/api/v1/organisation/Studienplatz.php +++ b/application/controllers/api/v1/organisation/Studienplatz.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Studienplatz extends APIv1_Controller +class Studienplatz extends API_Controller { /** * Studienplatz API constructor. diff --git a/application/controllers/api/v1/organisation/Studiensemester.php b/application/controllers/api/v1/organisation/Studiensemester.php index f714214d9..619bc2dba 100644 --- a/application/controllers/api/v1/organisation/Studiensemester.php +++ b/application/controllers/api/v1/organisation/Studiensemester.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Studiensemester extends APIv1_Controller +class Studiensemester extends API_Controller { /** * Studiensemester API constructor. diff --git a/application/controllers/api/v1/person/Adresse.php b/application/controllers/api/v1/person/Adresse.php index ddbbfe554..153423ac0 100644 --- a/application/controllers/api/v1/person/Adresse.php +++ b/application/controllers/api/v1/person/Adresse.php @@ -15,7 +15,7 @@ if (! defined('BASEPATH')) exit('No direct script access allowed'); -class Adresse extends APIv1_Controller +class Adresse extends API_Controller { /** * Person API constructor. diff --git a/application/controllers/api/v1/person/Bankverbindung.php b/application/controllers/api/v1/person/Bankverbindung.php index 06f6b040d..2c524e0ab 100644 --- a/application/controllers/api/v1/person/Bankverbindung.php +++ b/application/controllers/api/v1/person/Bankverbindung.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Bankverbindung extends APIv1_Controller +class Bankverbindung extends API_Controller { /** * Bankverbindung API constructor. diff --git a/application/controllers/api/v1/person/Benutzer.php b/application/controllers/api/v1/person/Benutzer.php index f1ea4f149..d983103c8 100644 --- a/application/controllers/api/v1/person/Benutzer.php +++ b/application/controllers/api/v1/person/Benutzer.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Benutzer extends APIv1_Controller +class Benutzer extends API_Controller { /** * Benutzer API constructor. diff --git a/application/controllers/api/v1/person/Benutzerfunktion.php b/application/controllers/api/v1/person/Benutzerfunktion.php index 98fd8654a..75b338df0 100644 --- a/application/controllers/api/v1/person/Benutzerfunktion.php +++ b/application/controllers/api/v1/person/Benutzerfunktion.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Benutzerfunktion extends APIv1_Controller +class Benutzerfunktion extends API_Controller { /** * Benutzerfunktion API constructor. diff --git a/application/controllers/api/v1/person/Benutzergruppe.php b/application/controllers/api/v1/person/Benutzergruppe.php index 0adc8c73a..cf14d6d5a 100644 --- a/application/controllers/api/v1/person/Benutzergruppe.php +++ b/application/controllers/api/v1/person/Benutzergruppe.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Benutzergruppe extends APIv1_Controller +class Benutzergruppe extends API_Controller { /** * Benutzergruppe API constructor. diff --git a/application/controllers/api/v1/person/Fotostatus.php b/application/controllers/api/v1/person/Fotostatus.php index acd1ef5b6..1b64f43f7 100644 --- a/application/controllers/api/v1/person/Fotostatus.php +++ b/application/controllers/api/v1/person/Fotostatus.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Fotostatus extends APIv1_Controller +class Fotostatus extends API_Controller { /** * Fotostatus API constructor. diff --git a/application/controllers/api/v1/person/Freebusy.php b/application/controllers/api/v1/person/Freebusy.php index eb1651c00..435073d2f 100644 --- a/application/controllers/api/v1/person/Freebusy.php +++ b/application/controllers/api/v1/person/Freebusy.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Freebusy extends APIv1_Controller +class Freebusy extends API_Controller { /** * Freebusy API constructor. diff --git a/application/controllers/api/v1/person/Freebusytyp.php b/application/controllers/api/v1/person/Freebusytyp.php index 0187035d1..a05c4d142 100644 --- a/application/controllers/api/v1/person/Freebusytyp.php +++ b/application/controllers/api/v1/person/Freebusytyp.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Freebusytyp extends APIv1_Controller +class Freebusytyp extends API_Controller { /** * Freebusytyp API constructor. diff --git a/application/controllers/api/v1/person/Kontakt.php b/application/controllers/api/v1/person/Kontakt.php index fceeaaeaf..0d925b7ac 100644 --- a/application/controllers/api/v1/person/Kontakt.php +++ b/application/controllers/api/v1/person/Kontakt.php @@ -15,7 +15,7 @@ if (! defined('BASEPATH')) exit('No direct script access allowed'); -class Kontakt extends APIv1_Controller +class Kontakt extends API_Controller { /** * Person API constructor. diff --git a/application/controllers/api/v1/person/Kontaktmedium.php b/application/controllers/api/v1/person/Kontaktmedium.php index b732d6eee..bfda0d7fe 100644 --- a/application/controllers/api/v1/person/Kontaktmedium.php +++ b/application/controllers/api/v1/person/Kontaktmedium.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Kontaktmedium extends APIv1_Controller +class Kontaktmedium extends API_Controller { /** * Kontaktmedium API constructor. diff --git a/application/controllers/api/v1/person/Kontakttyp.php b/application/controllers/api/v1/person/Kontakttyp.php index c3d2b6e94..f4951e09a 100644 --- a/application/controllers/api/v1/person/Kontakttyp.php +++ b/application/controllers/api/v1/person/Kontakttyp.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Kontakttyp extends APIv1_Controller +class Kontakttyp extends API_Controller { /** * Kontakttyp API constructor. diff --git a/application/controllers/api/v1/person/Notiz.php b/application/controllers/api/v1/person/Notiz.php index 29755d7d3..96a527c93 100644 --- a/application/controllers/api/v1/person/Notiz.php +++ b/application/controllers/api/v1/person/Notiz.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Notiz extends APIv1_Controller +class Notiz extends API_Controller { /** * Notiz API constructor. diff --git a/application/controllers/api/v1/person/Notizzuordnung.php b/application/controllers/api/v1/person/Notizzuordnung.php index da185e20f..39b388a3a 100644 --- a/application/controllers/api/v1/person/Notizzuordnung.php +++ b/application/controllers/api/v1/person/Notizzuordnung.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Notizzuordnung extends APIv1_Controller +class Notizzuordnung extends API_Controller { /** * Notizzuordnung API constructor. diff --git a/application/controllers/api/v1/person/Person.php b/application/controllers/api/v1/person/Person.php index ca8a66bea..a686f6060 100644 --- a/application/controllers/api/v1/person/Person.php +++ b/application/controllers/api/v1/person/Person.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Person extends APIv1_Controller +class Person extends API_Controller { /** * Person API constructor. diff --git a/application/controllers/api/v1/project/Aktivitaet.php b/application/controllers/api/v1/project/Aktivitaet.php index 7aa647058..f188448a5 100644 --- a/application/controllers/api/v1/project/Aktivitaet.php +++ b/application/controllers/api/v1/project/Aktivitaet.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Aktivitaet extends APIv1_Controller +class Aktivitaet extends API_Controller { /** * Aktivitaet API constructor. diff --git a/application/controllers/api/v1/project/Aufwandstyp.php b/application/controllers/api/v1/project/Aufwandstyp.php index 96be6ab55..ee2df5b29 100644 --- a/application/controllers/api/v1/project/Aufwandstyp.php +++ b/application/controllers/api/v1/project/Aufwandstyp.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Aufwandstyp extends APIv1_Controller +class Aufwandstyp extends API_Controller { /** * Aufwandstyp API constructor. diff --git a/application/controllers/api/v1/project/Projekt.php b/application/controllers/api/v1/project/Projekt.php index 64533f36f..370876ed3 100644 --- a/application/controllers/api/v1/project/Projekt.php +++ b/application/controllers/api/v1/project/Projekt.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Projekt extends APIv1_Controller +class Projekt extends API_Controller { /** * Projekt API constructor. diff --git a/application/controllers/api/v1/project/Projekt_ressource.php b/application/controllers/api/v1/project/Projekt_ressource.php index 2869f935a..030a7f73c 100644 --- a/application/controllers/api/v1/project/Projekt_ressource.php +++ b/application/controllers/api/v1/project/Projekt_ressource.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Projekt_ressource extends APIv1_Controller +class Projekt_ressource extends API_Controller { /** * Projekt_ressource API constructor. diff --git a/application/controllers/api/v1/project/Projektphase.php b/application/controllers/api/v1/project/Projektphase.php index c48893948..d4754fccb 100644 --- a/application/controllers/api/v1/project/Projektphase.php +++ b/application/controllers/api/v1/project/Projektphase.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Projektphase extends APIv1_Controller +class Projektphase extends API_Controller { /** * Projektphase API constructor. diff --git a/application/controllers/api/v1/project/Projekttask.php b/application/controllers/api/v1/project/Projekttask.php index 5793c85a1..048c7f9fd 100644 --- a/application/controllers/api/v1/project/Projekttask.php +++ b/application/controllers/api/v1/project/Projekttask.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Projekttask extends APIv1_Controller +class Projekttask extends API_Controller { /** * Projekttask API constructor. diff --git a/application/controllers/api/v1/project/Ressource.php b/application/controllers/api/v1/project/Ressource.php index fddf77c57..45ebe2089 100644 --- a/application/controllers/api/v1/project/Ressource.php +++ b/application/controllers/api/v1/project/Ressource.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Ressource extends APIv1_Controller +class Ressource extends API_Controller { /** * Ressource API constructor. diff --git a/application/controllers/api/v1/project/Scrumsprint.php b/application/controllers/api/v1/project/Scrumsprint.php index ff0e75b09..6be2ba152 100644 --- a/application/controllers/api/v1/project/Scrumsprint.php +++ b/application/controllers/api/v1/project/Scrumsprint.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Scrumsprint extends APIv1_Controller +class Scrumsprint extends API_Controller { /** * Scrumsprint API constructor. diff --git a/application/controllers/api/v1/ressource/Betriebsmittel.php b/application/controllers/api/v1/ressource/Betriebsmittel.php index 63e003cfd..3f7306167 100644 --- a/application/controllers/api/v1/ressource/Betriebsmittel.php +++ b/application/controllers/api/v1/ressource/Betriebsmittel.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Betriebsmittel extends APIv1_Controller +class Betriebsmittel extends API_Controller { /** * Betriebsmittel API constructor. diff --git a/application/controllers/api/v1/ressource/Betriebsmittelperson2.php b/application/controllers/api/v1/ressource/Betriebsmittelperson2.php index 71b5af77a..ba3a304c4 100644 --- a/application/controllers/api/v1/ressource/Betriebsmittelperson2.php +++ b/application/controllers/api/v1/ressource/Betriebsmittelperson2.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Betriebsmittelperson2 extends APIv1_Controller +class Betriebsmittelperson2 extends API_Controller { /** * Betriebsmittelperson API constructor. diff --git a/application/controllers/api/v1/ressource/Betriebsmittelstatus.php b/application/controllers/api/v1/ressource/Betriebsmittelstatus.php index 8dcfad8c6..11b485f97 100644 --- a/application/controllers/api/v1/ressource/Betriebsmittelstatus.php +++ b/application/controllers/api/v1/ressource/Betriebsmittelstatus.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Betriebsmittelstatus extends APIv1_Controller +class Betriebsmittelstatus extends API_Controller { /** * Betriebsmittelstatus API constructor. diff --git a/application/controllers/api/v1/ressource/Betriebsmitteltyp.php b/application/controllers/api/v1/ressource/Betriebsmitteltyp.php index 9902ec032..bc383fd9c 100644 --- a/application/controllers/api/v1/ressource/Betriebsmitteltyp.php +++ b/application/controllers/api/v1/ressource/Betriebsmitteltyp.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Betriebsmitteltyp extends APIv1_Controller +class Betriebsmitteltyp extends API_Controller { /** * Betriebsmitteltyp API constructor. diff --git a/application/controllers/api/v1/ressource/Coodle.php b/application/controllers/api/v1/ressource/Coodle.php index bd7cfcf7f..b9c92e1bb 100644 --- a/application/controllers/api/v1/ressource/Coodle.php +++ b/application/controllers/api/v1/ressource/Coodle.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Coodle extends APIv1_Controller +class Coodle extends API_Controller { /** * Coodle API constructor. diff --git a/application/controllers/api/v1/ressource/Erreichbarkeit.php b/application/controllers/api/v1/ressource/Erreichbarkeit.php index 291451faf..080ac258c 100644 --- a/application/controllers/api/v1/ressource/Erreichbarkeit.php +++ b/application/controllers/api/v1/ressource/Erreichbarkeit.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Erreichbarkeit extends APIv1_Controller +class Erreichbarkeit extends API_Controller { /** * Erreichbarkeit API constructor. diff --git a/application/controllers/api/v1/ressource/Firma.php b/application/controllers/api/v1/ressource/Firma.php index 159d63642..e18799253 100644 --- a/application/controllers/api/v1/ressource/Firma.php +++ b/application/controllers/api/v1/ressource/Firma.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Firma extends APIv1_Controller +class Firma extends API_Controller { /** * Firma API constructor. diff --git a/application/controllers/api/v1/ressource/Firmatag.php b/application/controllers/api/v1/ressource/Firmatag.php index b9df31896..e2e98d7a8 100644 --- a/application/controllers/api/v1/ressource/Firmatag.php +++ b/application/controllers/api/v1/ressource/Firmatag.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Firmatag extends APIv1_Controller +class Firmatag extends API_Controller { /** * Firmatag API constructor. diff --git a/application/controllers/api/v1/ressource/Firmentyp.php b/application/controllers/api/v1/ressource/Firmentyp.php index 2d13ae845..268428f40 100644 --- a/application/controllers/api/v1/ressource/Firmentyp.php +++ b/application/controllers/api/v1/ressource/Firmentyp.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Firmentyp extends APIv1_Controller +class Firmentyp extends API_Controller { /** * Firmentyp API constructor. diff --git a/application/controllers/api/v1/ressource/Funktion.php b/application/controllers/api/v1/ressource/Funktion.php index 0ff059d2a..0f18b7649 100644 --- a/application/controllers/api/v1/ressource/Funktion.php +++ b/application/controllers/api/v1/ressource/Funktion.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Funktion extends APIv1_Controller +class Funktion extends API_Controller { /** * Funktion API constructor. diff --git a/application/controllers/api/v1/ressource/Lehrmittel.php b/application/controllers/api/v1/ressource/Lehrmittel.php index 36d0d7a2f..6cb5ea9bb 100644 --- a/application/controllers/api/v1/ressource/Lehrmittel.php +++ b/application/controllers/api/v1/ressource/Lehrmittel.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Lehrmittel extends APIv1_Controller +class Lehrmittel extends API_Controller { /** * Lehrmittel API constructor. diff --git a/application/controllers/api/v1/ressource/Mitarbeiter.php b/application/controllers/api/v1/ressource/Mitarbeiter.php index 70f4b441c..359088074 100644 --- a/application/controllers/api/v1/ressource/Mitarbeiter.php +++ b/application/controllers/api/v1/ressource/Mitarbeiter.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Mitarbeiter extends APIv1_Controller +class Mitarbeiter extends API_Controller { /** * Mitarbeiter API constructor. diff --git a/application/controllers/api/v1/ressource/Ort.php b/application/controllers/api/v1/ressource/Ort.php index a49bbe2fb..7937c3816 100644 --- a/application/controllers/api/v1/ressource/Ort.php +++ b/application/controllers/api/v1/ressource/Ort.php @@ -14,7 +14,7 @@ if (!defined("BASEPATH")) exit("No direct script access allowed"); -class Ort extends APIv1_Controller +class Ort extends API_Controller { /** * Ort API constructor. diff --git a/application/controllers/api/v1/ressource/Ortraumtyp.php b/application/controllers/api/v1/ressource/Ortraumtyp.php index cbf9c3d9b..fe3c628b6 100644 --- a/application/controllers/api/v1/ressource/Ortraumtyp.php +++ b/application/controllers/api/v1/ressource/Ortraumtyp.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Ortraumtyp extends APIv1_Controller +class Ortraumtyp extends API_Controller { /** * Ortraumtyp API constructor. diff --git a/application/controllers/api/v1/ressource/Personfunktionstandort.php b/application/controllers/api/v1/ressource/Personfunktionstandort.php index 1c7551984..251d2c7ae 100644 --- a/application/controllers/api/v1/ressource/Personfunktionstandort.php +++ b/application/controllers/api/v1/ressource/Personfunktionstandort.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Personfunktionstandort extends APIv1_Controller +class Personfunktionstandort extends API_Controller { /** * Personfunktionstandort API constructor. diff --git a/application/controllers/api/v1/ressource/Raumtyp.php b/application/controllers/api/v1/ressource/Raumtyp.php index 71b7bf5d8..7ff7b5ccd 100644 --- a/application/controllers/api/v1/ressource/Raumtyp.php +++ b/application/controllers/api/v1/ressource/Raumtyp.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Raumtyp extends APIv1_Controller +class Raumtyp extends API_Controller { /** * Raumtyp API constructor. diff --git a/application/controllers/api/v1/ressource/Reservierung.php b/application/controllers/api/v1/ressource/Reservierung.php index 633f61036..50a0528c7 100644 --- a/application/controllers/api/v1/ressource/Reservierung.php +++ b/application/controllers/api/v1/ressource/Reservierung.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Reservierung extends APIv1_Controller +class Reservierung extends API_Controller { /** * Reservierung API constructor. diff --git a/application/controllers/api/v1/ressource/Stunde.php b/application/controllers/api/v1/ressource/Stunde.php index 5d2f37049..2844860f4 100644 --- a/application/controllers/api/v1/ressource/Stunde.php +++ b/application/controllers/api/v1/ressource/Stunde.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Stunde extends APIv1_Controller +class Stunde extends API_Controller { /** * Stunde API constructor. diff --git a/application/controllers/api/v1/ressource/Stundenplan.php b/application/controllers/api/v1/ressource/Stundenplan.php index 2d4b3c705..9a6614f21 100644 --- a/application/controllers/api/v1/ressource/Stundenplan.php +++ b/application/controllers/api/v1/ressource/Stundenplan.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Stundenplan extends APIv1_Controller +class Stundenplan extends API_Controller { /** * Stundenplan API constructor. diff --git a/application/controllers/api/v1/ressource/Stundenplandev.php b/application/controllers/api/v1/ressource/Stundenplandev.php index 385f2bf9e..fa6e788c3 100644 --- a/application/controllers/api/v1/ressource/Stundenplandev.php +++ b/application/controllers/api/v1/ressource/Stundenplandev.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Stundenplandev extends APIv1_Controller +class Stundenplandev extends API_Controller { /** * Stundenplandev API constructor. diff --git a/application/controllers/api/v1/ressource/Zeitaufzeichnung.php b/application/controllers/api/v1/ressource/Zeitaufzeichnung.php index 8c30390e6..74290898d 100644 --- a/application/controllers/api/v1/ressource/Zeitaufzeichnung.php +++ b/application/controllers/api/v1/ressource/Zeitaufzeichnung.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Zeitaufzeichnung extends APIv1_Controller +class Zeitaufzeichnung extends API_Controller { /** * Zeitaufzeichnung API constructor. diff --git a/application/controllers/api/v1/ressource/Zeitfenster.php b/application/controllers/api/v1/ressource/Zeitfenster.php index e180d0d75..d2dd864cc 100644 --- a/application/controllers/api/v1/ressource/Zeitfenster.php +++ b/application/controllers/api/v1/ressource/Zeitfenster.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Zeitfenster extends APIv1_Controller +class Zeitfenster extends API_Controller { /** * Zeitfenster API constructor. diff --git a/application/controllers/api/v1/ressource/Zeitsperre.php b/application/controllers/api/v1/ressource/Zeitsperre.php index 626a88d79..a3eafd525 100644 --- a/application/controllers/api/v1/ressource/Zeitsperre.php +++ b/application/controllers/api/v1/ressource/Zeitsperre.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Zeitsperre extends APIv1_Controller +class Zeitsperre extends API_Controller { /** * Zeitsperre API constructor. diff --git a/application/controllers/api/v1/ressource/Zeitsperretyp.php b/application/controllers/api/v1/ressource/Zeitsperretyp.php index c70a9b2f4..aaa8ad656 100644 --- a/application/controllers/api/v1/ressource/Zeitsperretyp.php +++ b/application/controllers/api/v1/ressource/Zeitsperretyp.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Zeitsperretyp extends APIv1_Controller +class Zeitsperretyp extends API_Controller { /** * Zeitsperretyp API constructor. diff --git a/application/controllers/api/v1/ressource/Zeitwunsch.php b/application/controllers/api/v1/ressource/Zeitwunsch.php index 8d9646edc..08f031eef 100644 --- a/application/controllers/api/v1/ressource/Zeitwunsch.php +++ b/application/controllers/api/v1/ressource/Zeitwunsch.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Zeitwunsch extends APIv1_Controller +class Zeitwunsch extends API_Controller { /** * Zeitwunsch API constructor. diff --git a/application/controllers/api/v1/system/Appdaten.php b/application/controllers/api/v1/system/Appdaten.php index 3395ec9b6..34b53524b 100644 --- a/application/controllers/api/v1/system/Appdaten.php +++ b/application/controllers/api/v1/system/Appdaten.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Appdaten extends APIv1_Controller +class Appdaten extends API_Controller { /** * Appdaten API constructor. diff --git a/application/controllers/api/v1/system/Benutzerrolle.php b/application/controllers/api/v1/system/Benutzerrolle.php index 99ec3d79e..4ad4d0c25 100644 --- a/application/controllers/api/v1/system/Benutzerrolle.php +++ b/application/controllers/api/v1/system/Benutzerrolle.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Benutzerrolle extends APIv1_Controller +class Benutzerrolle extends API_Controller { /** * Benutzerrolle API constructor. diff --git a/application/controllers/api/v1/system/Berechtigung.php b/application/controllers/api/v1/system/Berechtigung.php index e94bf30f3..f88c01731 100644 --- a/application/controllers/api/v1/system/Berechtigung.php +++ b/application/controllers/api/v1/system/Berechtigung.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Berechtigung extends APIv1_Controller +class Berechtigung extends API_Controller { /** * Berechtigung API constructor. diff --git a/application/controllers/api/v1/system/Cronjob.php b/application/controllers/api/v1/system/Cronjob.php index 4b3bcba82..12ebe62d7 100644 --- a/application/controllers/api/v1/system/Cronjob.php +++ b/application/controllers/api/v1/system/Cronjob.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Cronjob extends APIv1_Controller +class Cronjob extends API_Controller { /** * Cronjob API constructor. diff --git a/application/controllers/api/v1/system/Filter.php b/application/controllers/api/v1/system/Filter.php index bc217d385..eb611da64 100644 --- a/application/controllers/api/v1/system/Filter.php +++ b/application/controllers/api/v1/system/Filter.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Filter extends APIv1_Controller +class Filter extends API_Controller { /** * Filter API constructor. diff --git a/application/controllers/api/v1/system/Log.php b/application/controllers/api/v1/system/Log.php index c270922c5..7dbee8f38 100644 --- a/application/controllers/api/v1/system/Log.php +++ b/application/controllers/api/v1/system/Log.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Log extends APIv1_Controller +class Log extends API_Controller { /** * Log API constructor. diff --git a/application/controllers/api/v1/system/Message.php b/application/controllers/api/v1/system/Message.php index 1825b7db9..59d6a0b2c 100644 --- a/application/controllers/api/v1/system/Message.php +++ b/application/controllers/api/v1/system/Message.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Message extends APIv1_Controller +class Message extends API_Controller { /** * Message API constructor. diff --git a/application/controllers/api/v1/system/Phrase.php b/application/controllers/api/v1/system/Phrase.php index 1a7846cb5..ff64dbce3 100644 --- a/application/controllers/api/v1/system/Phrase.php +++ b/application/controllers/api/v1/system/Phrase.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Phrase extends APIv1_Controller +class Phrase extends API_Controller { /** * Phrase API constructor. diff --git a/application/controllers/api/v1/system/Rolle.php b/application/controllers/api/v1/system/Rolle.php index ba257145f..e5344539e 100644 --- a/application/controllers/api/v1/system/Rolle.php +++ b/application/controllers/api/v1/system/Rolle.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Rolle extends APIv1_Controller +class Rolle extends API_Controller { /** * Rolle API constructor. diff --git a/application/controllers/api/v1/system/Rolleberechtigung.php b/application/controllers/api/v1/system/Rolleberechtigung.php index 3838dc6de..9fca1509f 100644 --- a/application/controllers/api/v1/system/Rolleberechtigung.php +++ b/application/controllers/api/v1/system/Rolleberechtigung.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Rolleberechtigung extends APIv1_Controller +class Rolleberechtigung extends API_Controller { /** * Rolleberechtigung API constructor. diff --git a/application/controllers/api/v1/system/Server.php b/application/controllers/api/v1/system/Server.php index 0f3c76655..fe6a175f1 100644 --- a/application/controllers/api/v1/system/Server.php +++ b/application/controllers/api/v1/system/Server.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Server extends APIv1_Controller +class Server extends API_Controller { /** * Server API constructor. diff --git a/application/controllers/api/v1/system/Sprache2.php b/application/controllers/api/v1/system/Sprache2.php index 3a3b7e6de..f84d9070b 100644 --- a/application/controllers/api/v1/system/Sprache2.php +++ b/application/controllers/api/v1/system/Sprache2.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Sprache2 extends APIv1_Controller +class Sprache2 extends API_Controller { /** * Sprache API constructor. diff --git a/application/controllers/api/v1/system/Tag.php b/application/controllers/api/v1/system/Tag.php index 2bcb2dec2..7ce375217 100644 --- a/application/controllers/api/v1/system/Tag.php +++ b/application/controllers/api/v1/system/Tag.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Tag extends APIv1_Controller +class Tag extends API_Controller { /** * Tag API constructor. diff --git a/application/controllers/api/v1/system/UDF.php b/application/controllers/api/v1/system/UDF.php index 57d22600c..566a4c5bc 100644 --- a/application/controllers/api/v1/system/UDF.php +++ b/application/controllers/api/v1/system/UDF.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class UDF extends APIv1_Controller +class UDF extends API_Controller { /** * UDF API constructor. diff --git a/application/controllers/api/v1/system/Variable.php b/application/controllers/api/v1/system/Variable.php index 8a4e196dc..b84888b7e 100644 --- a/application/controllers/api/v1/system/Variable.php +++ b/application/controllers/api/v1/system/Variable.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Variable extends APIv1_Controller +class Variable extends API_Controller { /** * Variable API constructor. diff --git a/application/controllers/api/v1/system/Vorlage.php b/application/controllers/api/v1/system/Vorlage.php index 48a73ac4f..24db38570 100644 --- a/application/controllers/api/v1/system/Vorlage.php +++ b/application/controllers/api/v1/system/Vorlage.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Vorlage extends APIv1_Controller +class Vorlage extends API_Controller { /** * Vorlage API constructor. diff --git a/application/controllers/api/v1/system/Vorlagestudiengang.php b/application/controllers/api/v1/system/Vorlagestudiengang.php index dbbe23e1e..e28533f99 100644 --- a/application/controllers/api/v1/system/Vorlagestudiengang.php +++ b/application/controllers/api/v1/system/Vorlagestudiengang.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Vorlagestudiengang extends APIv1_Controller +class Vorlagestudiengang extends API_Controller { /** * Vorlagestudiengang API constructor. diff --git a/application/controllers/api/v1/system/Webservicelog.php b/application/controllers/api/v1/system/Webservicelog.php index ece2e2ff6..cb7882ad6 100644 --- a/application/controllers/api/v1/system/Webservicelog.php +++ b/application/controllers/api/v1/system/Webservicelog.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Webservicelog extends APIv1_Controller +class Webservicelog extends API_Controller { /** * Webservicelog API constructor. diff --git a/application/controllers/api/v1/system/Webservicerecht.php b/application/controllers/api/v1/system/Webservicerecht.php index 4f281edaa..0031675ce 100644 --- a/application/controllers/api/v1/system/Webservicerecht.php +++ b/application/controllers/api/v1/system/Webservicerecht.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Webservicerecht extends APIv1_Controller +class Webservicerecht extends API_Controller { /** * Webservicerecht API constructor. diff --git a/application/controllers/api/v1/system/Webservicetyp.php b/application/controllers/api/v1/system/Webservicetyp.php index 09303c87c..c77745319 100644 --- a/application/controllers/api/v1/system/Webservicetyp.php +++ b/application/controllers/api/v1/system/Webservicetyp.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Webservicetyp extends APIv1_Controller +class Webservicetyp extends API_Controller { /** * Webservicetyp API constructor. diff --git a/application/controllers/api/v1/testtool/Ablauf.php b/application/controllers/api/v1/testtool/Ablauf.php index f2e7d9d63..9d5ae9a8d 100644 --- a/application/controllers/api/v1/testtool/Ablauf.php +++ b/application/controllers/api/v1/testtool/Ablauf.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Ablauf extends APIv1_Controller +class Ablauf extends API_Controller { /** * Ablauf API constructor. diff --git a/application/controllers/api/v1/testtool/Antwort.php b/application/controllers/api/v1/testtool/Antwort.php index 7730dd3e9..db7d970a5 100644 --- a/application/controllers/api/v1/testtool/Antwort.php +++ b/application/controllers/api/v1/testtool/Antwort.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Antwort extends APIv1_Controller +class Antwort extends API_Controller { /** * Antwort API constructor. diff --git a/application/controllers/api/v1/testtool/Frage.php b/application/controllers/api/v1/testtool/Frage.php index 83989956a..e6f7a7ea7 100644 --- a/application/controllers/api/v1/testtool/Frage.php +++ b/application/controllers/api/v1/testtool/Frage.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Frage extends APIv1_Controller +class Frage extends API_Controller { /** * Frage API constructor. diff --git a/application/controllers/api/v1/testtool/Gebiet.php b/application/controllers/api/v1/testtool/Gebiet.php index 12cba24ab..dda2b98a1 100644 --- a/application/controllers/api/v1/testtool/Gebiet.php +++ b/application/controllers/api/v1/testtool/Gebiet.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Gebiet extends APIv1_Controller +class Gebiet extends API_Controller { /** * Gebiet API constructor. diff --git a/application/controllers/api/v1/testtool/Kategorie.php b/application/controllers/api/v1/testtool/Kategorie.php index 5058ac76d..c0e84a61b 100644 --- a/application/controllers/api/v1/testtool/Kategorie.php +++ b/application/controllers/api/v1/testtool/Kategorie.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Kategorie extends APIv1_Controller +class Kategorie extends API_Controller { /** * Kategorie API constructor. diff --git a/application/controllers/api/v1/testtool/Kriterien.php b/application/controllers/api/v1/testtool/Kriterien.php index 2420dcb62..e00932afe 100644 --- a/application/controllers/api/v1/testtool/Kriterien.php +++ b/application/controllers/api/v1/testtool/Kriterien.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Kriterien extends APIv1_Controller +class Kriterien extends API_Controller { /** * Kriterien API constructor. diff --git a/application/controllers/api/v1/testtool/Pruefling.php b/application/controllers/api/v1/testtool/Pruefling.php index 3a471035e..626bb2760 100644 --- a/application/controllers/api/v1/testtool/Pruefling.php +++ b/application/controllers/api/v1/testtool/Pruefling.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Pruefling extends APIv1_Controller +class Pruefling extends API_Controller { /** * Pruefling API constructor. diff --git a/application/controllers/api/v1/testtool/Vorschlag.php b/application/controllers/api/v1/testtool/Vorschlag.php index 0874b384a..5392c8aa2 100644 --- a/application/controllers/api/v1/testtool/Vorschlag.php +++ b/application/controllers/api/v1/testtool/Vorschlag.php @@ -14,7 +14,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); -class Vorschlag extends APIv1_Controller +class Vorschlag extends API_Controller { /** * Vorschlag API constructor. diff --git a/application/controllers/codex/Oehbeitrag.php b/application/controllers/codex/Oehbeitrag.php new file mode 100644 index 000000000..fa27d1ebb --- /dev/null +++ b/application/controllers/codex/Oehbeitrag.php @@ -0,0 +1,261 @@ + 'admin:r',// TODO which Berechtigung? + 'getOehbeitraege' => 'admin:r', + 'getValidStudiensemester' => 'admin:r', + 'addOehbeitrag' => 'admin:rw', + 'updateOehbeitrag' => 'admin:rw', + 'deleteOehbeitrag' => 'admin:rw' + ) + ); + + $this->load->model('codex/Oehbeitrag_model', 'OehbeitragModel'); + $this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel'); + + $this->load->library('WidgetLib'); + } + + public function index() + { + $oehbeitraege = array(); + + $oehbeitragRes = $this->_loadOehbeitraege(); + + if (isError($oehbeitragRes)) + show_error(getError($oehbeitragRes)); + + if (hasData($oehbeitragRes)) + $oehbeitraege = getData($oehbeitragRes); + + $this->load->view("codex/oehbeitrag.php", array('oehbeitraege' => $oehbeitraege)); + } + + /** + * Gets all valid, i.e. unassigned, Studiensemester. + */ + public function getValidStudiensemester() + { + $oehbeitrag_id = $this->input->get('oehbeitrag_id'); + $oehbeitrag_id_arr = isset($oehbeitrag_id) ? array($oehbeitrag_id) : null; + + $studiensemester = array(); + + $studiensemesterres = $this->OehbeitragModel->getUnassignedStudiensemester(self::STUDIENSEMESTER_START, $oehbeitrag_id_arr); + if (isError($studiensemesterres)) + { + $this->outputJsonError(getError($studiensemesterres)); + return; + } + + if (hasData($studiensemesterres)) + $studiensemester = getData($studiensemesterres); + + $this->outputJsonSuccess($studiensemester); + } + + /** + * Gets all Öhbeiträge. Wrapper function for output as JSON. + */ + public function getOehbeitraege() + { + $this->outputJson($this->_loadOehbeitraege()); + } + + /** + * Adds an Öhbeitrag. Checks for errors beforehand. + */ + public function addOehbeitrag() + { + $studierendenbeitrag = $this->input->post('studierendenbeitrag'); + $versicherung = $this->input->post('versicherung'); + $von_studiensemester_kurzbz = $this->input->post('von_studiensemester_kurzbz'); + $bis_studiensemester_kurzbz = $this->input->post('bis_studiensemester_kurzbz'); + if ($bis_studiensemester_kurzbz == 'null') + $bis_studiensemester_kurzbz = null; + + if (!$this->_checkAmount($studierendenbeitrag)) + $this->outputJsonError('Ungültiger Studierendenbeitrag'); + elseif (!$this->_checkAmount($versicherung)) + $this->outputJsonError('Ungültige Versicherung'); + else + { + $vonBisCheck = $this->_checkVonBisStudiensemester($von_studiensemester_kurzbz, $bis_studiensemester_kurzbz); + + if (isError($vonBisCheck)) + $this->outputJsonError(getError($vonBisCheck)); + else + { + $data = array( + 'studierendenbeitrag' => $studierendenbeitrag, + 'versicherung' => $versicherung, + 'von_studiensemester_kurzbz' => $von_studiensemester_kurzbz, + 'bis_studiensemester_kurzbz' => $bis_studiensemester_kurzbz + ); + + $this->outputJson($this->OehbeitragModel->insert($data)); + } + } + } + + /** + * Updates an Öhbeitrag. Checks for errors beforehand. + */ + public function updateOehbeitrag() + { + $oehbeitrag_id = $this->input->post("oehbeitrag_id"); + $data = $this->input->post("data"); + + if (!is_numeric($oehbeitrag_id) || isEmptyArray($data)) + { + $this->outputJsonError("Ungültige Parameter"); + return; + } + + foreach ($data as $idx => $value) + { + if ($idx == 'studierendenbeitrag' || $idx == 'versicherung') + { + if (!$this->_checkAmount($value)) + { + $this->outputJsonError("Ungültige(r) $idx"); + return; + } + } + elseif ($idx == 'von_studiensemester_kurzbz' || $idx == 'bis_studiensemester_kurzbz') + { + $this->OehbeitragModel->addSelect('von_studiensemester_kurzbz, bis_studiensemester_kurzbz'); + $vonBisStudiensemesterRes = $this->OehbeitragModel->load($oehbeitrag_id); + + if (!hasData($vonBisStudiensemesterRes)) + { + $this->outputJsonError("Fehler beim Holen des Öhbeitrags"); + return; + } + + $vonBisStudiensemester = getData($vonBisStudiensemesterRes); + + $von_studiensemester_kurzbz = isset($data['von_studiensemester_kurzbz']) + ? $data['von_studiensemester_kurzbz'] + : $vonBisStudiensemester[0]->von_studiensemester_kurzbz; + + if (isset($data['bis_studiensemester_kurzbz'])) + { + $bis_studiensemester_kurzbz = $data['bis_studiensemester_kurzbz'] = $data['bis_studiensemester_kurzbz'] == 'null' ? null : $data['bis_studiensemester_kurzbz']; + } + else + $bis_studiensemester_kurzbz = $vonBisStudiensemester[0]->bis_studiensemester_kurzbz; + + $checkStudiensemester = $this->_checkVonBisStudiensemester($von_studiensemester_kurzbz, $bis_studiensemester_kurzbz, $oehbeitrag_id); + + if (isError($checkStudiensemester)) + { + $this->outputJsonError(getError($checkStudiensemester)); + return; + } + } + } + + $this->outputJson($this->OehbeitragModel->update($oehbeitrag_id, $data)); + } + + /** + * Deletes an Öhbeitrag. + */ + public function deleteOehbeitrag() + { + $oehbeitrag_id = $this->input->post("oehbeitrag_id"); + + $this->outputJson($this->OehbeitragModel->delete($oehbeitrag_id)); + } + + /** + * Loads all Öhbeiträge sorted by date descending. + * @return object + */ + private function _loadOehbeitraege() + { + $this->OehbeitragModel->addSelect('oehbeitrag_id, von_studiensemester_kurzbz, bis_studiensemester_kurzbz, studierendenbeitrag, versicherung, sem_von.start as von_datum, sem_bis.ende as bis_datum'); + $this->OehbeitragModel->addJoin('public.tbl_studiensemester sem_von', 'tbl_oehbeitrag.von_studiensemester_kurzbz = sem_von.studiensemester_kurzbz'); + $this->OehbeitragModel->addJoin('public.tbl_studiensemester sem_bis', 'tbl_oehbeitrag.bis_studiensemester_kurzbz = sem_bis.studiensemester_kurzbz', 'LEFT'); + $this->OehbeitragModel->addOrder('sem_von.start', 'DESC'); + return $this->OehbeitragModel->load(); + } + + /** + * Checks if an amount is numeric and not too big. + * @param $amount + * @return bool true if valid amount, false otherwise + */ + private function _checkAmount($amount) + { + return is_numeric($amount) && (float) $amount <= 99999.99; + } + + /** + * Checks if a certain Von-Studiensemester is valid together with a Bis-Studiensemester. + * Checks for correct format, Von-Studiensemester cannot be after the Bis-Studiensemester, + * checks that semester are not overlapping with semester for existent Öhbeiträge. + * @param string $von_studiensemester_kurzbz + * @param string $bis_studiensemester_kurzbz + * @param int $oehbeitrag_id öhbeitrag to ignore, i.e. which is assignable (id of Öhbeitrag of the passed semesters) + * @return object array with true if assignable, with false if not + */ + private function _checkVonBisStudiensemester($von_studiensemester_kurzbz, $bis_studiensemester_kurzbz, $oehbeitrag_id = null) + { + $regex = "/^(WS|SS)\d{4}$/"; + if (!preg_match($regex, $von_studiensemester_kurzbz)) + return error("Ungültiges Von-Studiensemester"); + + if (!preg_match($regex, $bis_studiensemester_kurzbz) && $bis_studiensemester_kurzbz != null) + return error("Ungültiges Bis-Studiensemester"); + + $this->StudiensemesterModel->addSelect("start"); + $vonStudiensemesterRes = $this->StudiensemesterModel->load($von_studiensemester_kurzbz); + + if (!hasData($vonStudiensemesterRes)) + return error("Fehler beim Holen von Von-Studiensemester"); + + $this->StudiensemesterModel->addSelect("start"); + $bisStudiensemesterRes = $this->StudiensemesterModel->load($bis_studiensemester_kurzbz); + + if (!hasData($bisStudiensemesterRes)) + return error("Fehler beim Holen von Bis-Studiensemester"); + + $vonStudiensemester = getData($vonStudiensemesterRes)[0]->start; + $bisStudiensemester = getData($bisStudiensemesterRes)[0]->start; + + if ($bis_studiensemester_kurzbz != null && new DateTime($vonStudiensemester) > new DateTime($bisStudiensemester)) + return error("Von-Studiensemester größer als Bis-Studiensemester"); + + $oehbeitrag_id_arr = isset($oehbeitrag_id) ? array($oehbeitrag_id) : null; + + $assignableRes = $this->OehbeitragModel->checkIfStudiensemesterAssignable( + $von_studiensemester_kurzbz, + $bis_studiensemester_kurzbz, + $oehbeitrag_id_arr + ); + + if (isError($assignableRes)) + return $assignableRes; + + if (hasData($assignableRes)) + { + $assignable = getData($assignableRes)[0]; + + if (!$assignable) + return error("Keine Zuweisung möglich, Semesterüberschneidung"); + } + + return success("Studiensemester gültig"); + } +} diff --git a/application/controllers/crm/Statusgrund.php b/application/controllers/crm/Statusgrund.php index 344ac06dc..3c7e43736 100644 --- a/application/controllers/crm/Statusgrund.php +++ b/application/controllers/crm/Statusgrund.php @@ -129,6 +129,7 @@ class Statusgrund extends Auth_Controller $aktiv = $this->input->post("aktiv") != null && $this->input->post("aktiv") == "on" ? true : false; $bezeichnung_mehrsprachig = $this->input->post("bezeichnung_mehrsprachig"); $beschreibung = $this->input->post("beschreibung"); + $statusgrund_kurzbz = $this->input->post("statusgrund_kurzbz"); for ($i = 0; $i < count($bezeichnung_mehrsprachig); $i++) { @@ -177,7 +178,8 @@ class Statusgrund extends Auth_Controller $data = array( "aktiv" => $aktiv, "bezeichnung_mehrsprachig" => $bezeichnung_mehrsprachig, - "beschreibung" => $beschreibung + "beschreibung" => $beschreibung, + "statusgrund_kurzbz" => $statusgrund_kurzbz ); $statusgrund = $this->StatusgrundModel->update($statusgrund_id, $data); @@ -196,6 +198,7 @@ class Statusgrund extends Auth_Controller $bezeichnung_mehrsprachig = $this->input->post("bezeichnung_mehrsprachig"); $beschreibung = $this->input->post("beschreibung"); $status_kurzbz = $this->input->post("status_kurzbz"); + $statusgrund_kurzbz = $this->input->post("statusgrund_kurzbz"); for ($i = 0; $i < count($bezeichnung_mehrsprachig); $i++) { @@ -245,7 +248,8 @@ class Statusgrund extends Auth_Controller "status_kurzbz" => $status_kurzbz, "aktiv" => $aktiv, "bezeichnung_mehrsprachig" => $bezeichnung_mehrsprachig, - "beschreibung" => $beschreibung + "beschreibung" => $beschreibung, + "statusgrund_kurzbz" => $statusgrund_kurzbz ); $statusgrund = $this->StatusgrundModel->insert($data); diff --git a/application/controllers/jobs/AnrechnungJob.php b/application/controllers/jobs/AnrechnungJob.php index 2868a8052..f92410dbc 100644 --- a/application/controllers/jobs/AnrechnungJob.php +++ b/application/controllers/jobs/AnrechnungJob.php @@ -15,6 +15,11 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); class AnrechnungJob extends JOB_Controller { + const APPROVE_ANRECHNUNG_URI = '/lehre/anrechnung/ApproveAnrechnungUebersicht'; + + const ANRECHNUNGSTATUS_APPROVED = 'approved'; + const ANRECHNUNGSTATUS_REJECTED = 'rejected'; + const ANRECHNUNG_NOTIZTITEL_NOTIZ_BY_STGL = 'AnrechnungNotizSTGL'; /** * Constructor @@ -23,6 +28,11 @@ class AnrechnungJob extends JOB_Controller { parent::__construct(); $this->load->model('education/Zeugnisnote_model', 'ZeugnisnoteModel'); + $this->load->model('education/Anrechnung_model', 'AnrechnungModel'); + $this->load->model('organisation/Studiengang_model', 'StudiengangModel'); + + $this->load->helper('url'); + $this->load->helper('hlp_sancho_helper'); } /** @@ -84,4 +94,320 @@ class AnrechnungJob extends JOB_Controller } $this->logInfo('End Anrechnung Grades Job', array('Number of Grades added'=>$cnt)); } + + /** + * Deletes Zeugnisnoten 'angerechnet', when Anrechnung is rejected afterwards. + * E.g., when STGL first accepts, then withdraws and finally rejects the approvement. + */ + public function deleteAnrechnungGrades() + { + $this->logInfo('Start AnrechnungJob to delete Grades'); + + // Get all Zeungisnoten, + // WHERE note is angerechnet + // AND Anrechnung was rejected AFTER the Zeugnisnote was created + $qry = ' + SELECT DISTINCT ON (status.anrechnung_id) anrechnung_id, + status.status_kurzbz AS "last_anrechnungstatus", + status.insertamum AS "last_anrechnungstatus_insertamum", + zeugnisnote.insertamum AS "zeugnisdatum_insertamum", + student.student_uid, + zeugnisnote.lehrveranstaltung_id, + zeugnisnote.studiensemester_kurzbz, + note + FROM lehre.tbl_zeugnisnote zeugnisnote + JOIN public.tbl_student student USING (student_uid) + JOIN lehre.tbl_anrechnung anrechnung + ON (zeugnisnote.lehrveranstaltung_id = anrechnung.lehrveranstaltung_id) + AND (student.prestudent_id = anrechnung.prestudent_id) + AND (zeugnisnote.studiensemester_kurzbz = anrechnung.studiensemester_kurzbz) + JOIN lehre.tbl_anrechnung_anrechnungstatus status USING (anrechnung_id) + WHERE note = 6 + AND status.insertamum > zeugnisnote.insertamum + AND status.status_kurzbz = '. $this->db->escape(self::ANRECHNUNGSTATUS_REJECTED). ' + ORDER BY status.anrechnung_id, status.insertamum DESC + '; + + $db = new DB_Model(); + $result = $db->execReadOnlyQuery($qry); + $cnt = 0; + + if (hasData($result)) + { + $this->load->model('education/Zeugnisnote_model', 'ZeugnisnoteModel'); + + foreach (getData($result) as $row) + { + // Delete Zeugnisnote + $this->ZeugnisnoteModel->delete(array( + 'lehrveranstaltung_id' => $row->lehrveranstaltung_id, + 'student_uid' => $row->student_uid, + 'studiensemester_kurzbz' => $row->studiensemester_kurzbz + )); + + // Count up + $cnt++; + } + } + + $this->logInfo('End AnrechnungJob to delete Grades', array('Number of Grades deleted: ' => $cnt)); + } + + // Send Sancho mail to STGL with yesterdays new Anrechnungen + public function sendMailToSTGL() + { + $this->logInfo('Start AnrechnungJob to send emails to STGL about yesterdays new Anrechnungen.'); + + // Get all yesterdays Anrechnungen, that did not process further than first status + // (If Anrechnung is new, but STGL already started the process yesterday, + // he does not need to be informed about this new Anrechnung anymore) + $this->AnrechnungModel->addSelect('anrechnung_id, studiensemester_kurzbz, lv.studiengang_kz, lv.bezeichnung, vorname, nachname'); + $this->AnrechnungModel->addJoin('lehre.tbl_lehrveranstaltung lv', 'lehrveranstaltung_id'); + $this->AnrechnungModel->addJoin('public.tbl_student student', 'prestudent_id'); + $this->AnrechnungModel->addJoin('public.tbl_benutzer benutzer', 'ON (benutzer.uid = student.student_uid)'); + $this->AnrechnungModel->addJoin('public.tbl_person person', 'person_id'); + $this->AnrechnungModel->addOrder('lv.studiengang_kz, lv.bezeichnung'); + + $result = $this->AnrechnungModel->loadWhere( + '(lehre.tbl_anrechnung.insertamum)::date = (NOW() - INTERVAL \'24 HOURS\')::DATE + AND 1 = (SELECT COUNT(*) FROM lehre.tbl_anrechnung_anrechnungstatus status WHERE status.anrechnung_id = tbl_anrechnung.anrechnung_id)' + ); + + // Exit if there are no Anrechnungen + if (!$anrechnungen = getData($result)) { + $this->logInfo('ABORTED: Sending emails to STGL about yesterdays new Anrechnungen aborted - No new Anrechnungen found.'); + exit; + } + + $unique_studiengang_kz_arr = array_unique(array_column($anrechnungen, 'studiengang_kz')); + + foreach ($unique_studiengang_kz_arr as $studiengang_kz) + { + // Get STG bezeichnung + $this->StudiengangModel->addSelect('UPPER( typ || kurzbz ) AS "stg_bezeichnung"'); + $studiengang_bezeichnung = $this->StudiengangModel->load($studiengang_kz)->retval[0]->stg_bezeichnung; + + // Get STGL mail address + list ($to, $vorname) = self::_getSTGLMailAddress($studiengang_kz); + + // Get HTML table with new Anrechnungen of that STG plus amount of them + list ($anrechnungen_amount, $anrechnungen_table) = self::_getSTGLMailDataTable($studiengang_kz, $anrechnungen); + + // Link to Antrag genehmigen dashboard + $url = + CIS_ROOT. 'cis/index.php?menu='. + CIS_ROOT. 'cis/menu.php?content_id=&content='. + CIS_ROOT. index_page(). self::APPROVE_ANRECHNUNG_URI; + + // Prepare mail content + $body_fields = array( + 'vorname' => $vorname, + 'studiengang' => $studiengang_bezeichnung, + 'anzahl' => $anrechnungen_amount, + 'datentabelle' => $anrechnungen_table, + 'link' => anchor($url, 'Anrechnungsanträge Übersicht') + ); + + // Send mail + sendSanchoMail( + 'AnrechnungAntragStellen', + $body_fields, + $to, + 'Anerkennung nachgewiesener Kenntnisse: Neuer Antrag wurde gestellt' + ); + } + + $this->logInfo('SUCCEDED: Sending emails to STGL about yesterdays new Anrechnungen succeded.'); + } + + /** + * Send Sancho mail to students, whose Anrechnungen were approved 24 hours ago. + */ + public function sendMailApproved(){ + + $this->logInfo('Start AnrechnungJob to send emails to students, whose Anrechnungen were approved.'); + + // Get all yesterdays approvements + $this->AnrechnungModel->addSelect('student.student_uid, vorname, nachname, geschlecht, lv.bezeichnung'); + $this->AnrechnungModel->addJoin('lehre.tbl_anrechnung_anrechnungstatus status', 'anrechnung_id'); + $this->AnrechnungModel->addJoin('lehre.tbl_lehrveranstaltung lv', 'lehrveranstaltung_id'); + $this->AnrechnungModel->addJoin('public.tbl_student student', 'prestudent_id'); + $this->AnrechnungModel->addJoin('public.tbl_benutzer benutzer', 'ON (benutzer.uid = student.student_uid)'); + $this->AnrechnungModel->addJoin('public.tbl_person person', 'person_id'); + + $result = $this->AnrechnungModel->loadWhere( + '(status.insertamum)::date = (NOW() - INTERVAL \'24 HOURS\')::DATE AND + status.status_kurzbz = '. $this->db->escape(self::ANRECHNUNGSTATUS_APPROVED) + ); + + // Exit if there are no approved Anrechnungen + if (!hasData($result)) + { + $this->logInfo('ABORTED sending emails to students, whose Anrechnungen were approved. No new approvements found.'); + exit; + } + + // Loop through students + foreach ($result->retval as $student) + { + $to = $student->student_uid. '@'. DOMAIN; + + $anrede = $student->geschlecht == 'w' ? 'Sehr geehrte Frau ' : 'Sehr geehrter Herr '; + + $text = 'Ihrem Antrag auf Anerkennung nachgewiesener Kenntnisse der Lehrveranstaltung "'. + $student->bezeichnung. '" wurde stattgegeben.'; + + // Prepare mail content + $body_fields = array( + 'anrede_name' => $anrede. $student->vorname. ' '. $student->nachname, + 'text' => $text + ); + + // Send mail + sendSanchoMail( + 'AnrechnungGenehmigen', + $body_fields, + $to, + 'Anerkennung nachgewiesener Kenntnisse: Ihr Antrag ist abgeschlossen' + ); + } + } + + /** + * Send Sancho mail to students, whose Anrechnungen were rejected 24 hours ago. + */ + public function sendMailRejected(){ + + $this->logInfo('Start AnrechnungJob to send emails to students, whose Anrechnungen were rejected.'); + + $qry = ' + SELECT + student.student_uid, vorname, nachname, geschlecht, lv.bezeichnung, + (SELECT text FROM public.tbl_notizzuordnung JOIN public.tbl_notiz USING(notiz_id) + WHERE tbl_notizzuordnung.anrechnung_id=tbl_anrechnung.anrechnung_id + AND tbl_notiz.titel='. $this->db->escape(self::ANRECHNUNG_NOTIZTITEL_NOTIZ_BY_STGL).' + ORDER BY tbl_notiz.insertamum DESC LIMIT 1) as text + FROM lehre.tbl_anrechnung + JOIN lehre.tbl_lehrveranstaltung lv USING(lehrveranstaltung_id) + JOIN public.tbl_student student USING(prestudent_id) + JOIN public.tbl_benutzer benutzer ON (benutzer.uid = student.student_uid) + JOIN public.tbl_person person USING(person_id) + + WHERE EXISTS(SELECT 1 FROM lehre.tbl_anrechnung_anrechnungstatus status WHERE + anrechnung_id=tbl_anrechnung.anrechnung_id AND + (status.insertamum)::date = (NOW() - INTERVAL \'24 HOURS\')::DATE AND + status_kurzbz = '. $this->db->escape(self::ANRECHNUNGSTATUS_REJECTED). ') + '; + + $db = new DB_Model(); + $result = $db->execReadOnlyQuery($qry); + + // Exit if there are no rejected Anrechnungen + if (!hasData($result)) + { + $this->logInfo('ABORTED sending emails to students, whose Anrechnungen were rejected. No new rejectments found.'); + exit; + } + + // Loop through students + foreach ($result->retval as $student) + { + $to = $student->student_uid. '@'. DOMAIN; + + $anrede = $student->geschlecht == 'w' ? 'Sehr geehrte Frau ' : 'Sehr geehrter Herr '; + + $text = <<bezeichnung" leider nicht anrechnen, weil die Gleichwertigkeit nicht festgestellt werden konnte.

+ Begründung: $student->text +html; + + // Prepare mail content + $body_fields = array( + 'anrede_name' => $anrede. $student->vorname. ' '. $student->nachname, + 'text' => $text + ); + + // Send mail + sendSanchoMail( + 'AnrechnungGenehmigen', + $body_fields, + $to, + 'Anerkennung nachgewiesener Kenntnisse: Ihr Antrag ist abgeschlossen' + ); + } + + } + + // Get STGL mail address + private function _getSTGLMailAddress($studiengang_kz) + { + $result = $this->StudiengangModel->getLeitung($studiengang_kz); + + // Get STGL mail address + if (hasData($result)) + { + return array( + $result->retval[0]->uid. '@'. DOMAIN, + $result->retval[0]->vorname + ); + } + // If not available, get assistance mail address + else + { + $result = $this->StudiengangModel->load($studiengang_kz); + + if (hasData($result)) + { + return array( + $result->retval[0]->email, + '' + ); + } + } + } + + // Build HTML table with yesterdays new Anrechnungen of the given STG + private function _getSTGLMailDataTable($studiengang_kz, $anrechnungen) + { + $html = ''; + $lv_bezeichnung = ''; + + // Filter Anrechnungen of given STG + $anrechnungen = array_filter( + $anrechnungen, + function ($anrechnung) use (&$studiengang_kz) { + return $anrechnung->studiengang_kz == $studiengang_kz; + }); + + // Amount of Anrechnungen + $amount = count($anrechnungen); + + // HTML table body + $html .= ' + + + '; + + foreach ($anrechnungen as $anrechnung) + { + // Head line for each LV bezeichnung + if ($anrechnung->bezeichnung != $lv_bezeichnung) + { + $html .= ''; + } + + $lv_bezeichnung = $anrechnung->bezeichnung; + + // Row for each Anrechnung / student + $html .= ''; + } + + $html .= ' + +
' . $anrechnung->bezeichnung . '
'. $anrechnung->vorname. ' '. $anrechnung->nachname. '
+ '; + + return array($amount, $html); + } } diff --git a/application/controllers/lehre/anrechnung/ApproveAnrechnungDetail.php b/application/controllers/lehre/anrechnung/ApproveAnrechnungDetail.php index c5e4b94d8..8982b9970 100644 --- a/application/controllers/lehre/anrechnung/ApproveAnrechnungDetail.php +++ b/application/controllers/lehre/anrechnung/ApproveAnrechnungDetail.php @@ -1,6 +1,6 @@ 'lehre/anrechnung_genehmigen:rw', 'approve' => 'lehre/anrechnung_genehmigen:rw', 'reject' => 'lehre/anrechnung_genehmigen:rw', - 'requestRecommendation' => 'lehre/anrechnung_genehmigen:rw' + 'requestRecommendation' => 'lehre/anrechnung_genehmigen:rw', + 'withdraw' => 'lehre/anrechnung_genehmigen:rw', + 'withdrawRequestRecommendation' => 'lehre/anrechnung_genehmigen:rw', + 'saveEmpfehlungsNotiz' => 'lehre/anrechnung_genehmigen:rw' ) ); @@ -80,29 +84,23 @@ class approveAnrechnungDetail extends Auth_Controller self::_checkIfEntitledToReadAnrechnung($anrechnung_id); // Get Anrechung data - if (!$anrechnungData = getData($this->anrechnunglib->getAnrechnungData($anrechnung_id))) - { - show_error('Missing data for Anrechnung.'); - } + $anrechnungData = $this->anrechnunglib->getAnrechnungData($anrechnung_id); + + // Get Antrag data + $antragData = $this->anrechnunglib->getAntragData( + $anrechnungData->prestudent_id, + $anrechnungData->studiensemester_kurzbz, + $anrechnungData->lehrveranstaltung_id + ); // Get Empfehlung data - if(!$empfehlungData = getData($this->anrechnunglib->getEmpfehlungData($anrechnung_id))) - { - show_error('Missing data for recommendation'); - } + $empfehlungData = $this->anrechnunglib->getEmpfehlungData($anrechnung_id); // Get Genehmigung data - if(!$genehmigungData = getData($this->anrechnunglib->getGenehmigungData($anrechnung_id))) - { - show_error('Missing data for recommendation'); - } + $genehmigungData = $this->anrechnunglib->getGenehmigungData($anrechnung_id); $viewData = array( - 'antragData' => $this->anrechnunglib->getAntragData( - $student_uid = $this->StudentModel->getUID($anrechnungData->prestudent_id), - $anrechnungData->studiensemester_kurzbz, - $anrechnungData->lehrveranstaltung_id - ), + 'antragData' => $antragData, 'anrechnungData' => $anrechnungData, 'empfehlungData' => $empfehlungData, 'genehmigungData' => $genehmigungData @@ -118,40 +116,30 @@ class approveAnrechnungDetail extends Auth_Controller { $data = $this->input->post('data'); - if(isEmptyArray($data)) + // Validate data + if (isEmptyArray($data)) { return $this->outputJsonError('Fehler beim Übertragen der Daten.'); } - // Get statusbezeichnung for 'approved' - $this->AnrechnungstatusModel->addSelect('bezeichnung_mehrsprachig'); - $approved = getData($this->AnrechnungstatusModel->load('approved'))[0]; - $approved = getUserLanguage() == 'German' - ? $approved->bezeichnung_mehrsprachig[0] - : $approved->bezeichnung_mehrsprachig[1]; - + // Get STGLs person data if (!$person = getData($this->PersonModel->getByUID($this->_uid))[0]) { show_error('Failed retrieving person data'); } + // Approve Anrechnung foreach ($data as $item) { - // Approve Anrechnung - if(getData($this->anrechnunglib->approveAnrechnung($item['anrechnung_id']))) + if ($this->anrechnunglib->approveAnrechnung($item['anrechnung_id'])) { $json[]= array( 'anrechnung_id' => $item['anrechnung_id'], 'status_kurzbz' => self::ANRECHNUNGSTATUS_APPROVED, - 'status_bezeichnung' => $approved, - 'abgeschlossen_am' => (new DateTime())->format('d.m.Y'), - 'abgeschlossen_von' => $person->vorname. ' '. $person->nachname + 'status_bezeichnung' => $this->anrechnunglib->getStatusbezeichnung(self::ANRECHNUNGSTATUS_APPROVED), + 'abgeschlossen_am' => (new DateTime())->format('d.m.Y'), + 'abgeschlossen_von' => $person->vorname. ' '. $person->nachname ); - - if(!$this->_sendSanchoMailToStudent($item['anrechnung_id'], self::ANRECHNUNGSTATUS_APPROVED)) - { - show_error('Failed sending mail'); - } } } @@ -173,40 +161,30 @@ class approveAnrechnungDetail extends Auth_Controller { $data = $this->input->post('data'); - if(isEmptyArray($data)) + // Validate data + if (isEmptyArray($data)) { return $this->outputJsonError('Fehler beim Übertragen der Daten.'); } - // Get statusbezeichnung for 'rejected' - $this->AnrechnungstatusModel->addSelect('bezeichnung_mehrsprachig'); - $rejected = getData($this->AnrechnungstatusModel->load('rejected'))[0]; - $rejected = getUserLanguage() == 'German' - ? $rejected->bezeichnung_mehrsprachig[0] - : $rejected->bezeichnung_mehrsprachig[1]; - + // Get STGLs person data if (!$person = getData($this->PersonModel->getByUID($this->_uid))[0]) { show_error('Failed retrieving person data'); } + // Reject Anrechnung foreach ($data as $item) { - // Reject Anrechnung - if(getData($this->anrechnunglib->rejectAnrechnung($item['anrechnung_id'], $item['begruendung']))) + if ($this->anrechnunglib->rejectAnrechnung($item['anrechnung_id'], $item['begruendung'])) { $json[]= array( 'anrechnung_id' => $item['anrechnung_id'], 'status_kurzbz' => self::ANRECHNUNGSTATUS_REJECTED, - 'status_bezeichnung' => $rejected, + 'status_bezeichnung' => $this->anrechnunglib->getStatusbezeichnung(self::ANRECHNUNGSTATUS_REJECTED), 'abgeschlossen_am' => (new DateTime())->format('d.m.Y'), 'abgeschlossen_von' => $person->vorname. ' '. $person->nachname ); - - if(!$this->_sendSanchoMailToStudent($item['anrechnung_id'], self::ANRECHNUNGSTATUS_REJECTED)) - { - show_error('Failed sending mail'); - } } } @@ -217,7 +195,7 @@ class approveAnrechnungDetail extends Auth_Controller } else { - return $this->outputJsonError('Es wurden keine Anrechnungen genehmigt.'); + return $this->outputJsonError($this->p->t('ui', 'errorNichtAusgefuehrt')); } } @@ -233,47 +211,165 @@ class approveAnrechnungDetail extends Auth_Controller return $this->outputJsonError('Fehler beim Übertragen der Daten.'); } - // Get statusbezeichnung for 'inProgressLektor' - $this->AnrechnungstatusModel->addSelect('bezeichnung_mehrsprachig'); - $inProgressLektor = getData($this->AnrechnungstatusModel->load('inProgressLektor'))[0]; - $inProgressLektor = getUserLanguage() == 'German' - ? $inProgressLektor->bezeichnung_mehrsprachig[0] - : $inProgressLektor->bezeichnung_mehrsprachig[1]; + $retval = array(); + $counter = 0; foreach ($data as $item) { - // Approve Anrechnung - if(getData($this->anrechnunglib->requestRecommendation($item['anrechnung_id']))) + // Check if Anrechnungs-LV has lector + if (!$this->anrechnunglib->LVhasLector($item['anrechnung_id'])) { - $json[]= array( + // Count up LV with no lector + $counter++; + + // Break, if LV has no lector + break; + } + + // Get full name of LV Leitung. + // If LV Leitung is not present, get full name of LV lectors. + $lector_arr = $this->anrechnunglib->getLectors($item['anrechnung_id']); + $empfehlungsanfrage_an = !isEmptyArray($lector_arr) + ? implode(', ', array_column($lector_arr, 'fullname')) + : ''; + + // Request Recommendation + if($this->anrechnunglib->requestRecommendation($item['anrechnung_id'])) + { + $retval[]= array( 'anrechnung_id' => $item['anrechnung_id'], 'status_kurzbz' => self::ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR, - 'status_bezeichnung' => $inProgressLektor, + 'status_bezeichnung' => $this->anrechnunglib->getStatusbezeichnung(self::ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR), 'empfehlung_anrechnung' => null, - 'empfehlung_angefordert_am' => (new DateTime())->format('d.m.Y') + 'empfehlungsanfrageAm' => (new DateTime())->format('d.m.Y'), + 'empfehlungsanfrageAn' => $empfehlungsanfrage_an ); } } - // Output json to ajax - if (isset($json) && !isEmptyArray($json)) + /** + * Send mails to lectors + * NOTE: mails are sent at the end to ensure sending only ONE mail to each LV-Leitung or lector + * even if they are required for more recommendations + * */ + if (!isEmptyArray($retval)) { - /** - * Send mails to lectors - * NOTE: mails are sent at the end to ensure sending only ONE mail to each LV-Leitung or lector - * even if they are required for more recommendations - * */ - if (!$this->_sendSanchoMailToLectors($json)) - { - show_error('Failed sending emails'); - } + self::_sendSanchoMailToLectors($retval); - return $this->outputJsonSuccess($json); + // Output json to ajax + return $this->outputJsonSuccess($retval); } - else + + // Output json to ajax + if (isEmptyArray($retval) && $counter > 0) { - return $this->outputJsonError('Es wurden keine Empfehlungen angefordert'); + return $this->outputJsonError( + "Empfehlung wurde nicht angefordert,\nDer LV sind keine LektorInnen zugeteilt." + ); } + + return $this->outputJsonError($this->p->t('ui', 'errorNichtAusgefuehrt')); + } + + /** + * Withdraw approved / rejected Anrechnung and reset to 'inProgressDP'. + */ + public function withdraw() + { + $anrechnung_id = $this->input->post('anrechnung_id'); + + if (!is_numeric($anrechnung_id)) + { + $this->terminateWithJsonError($this->p->t('ui', 'errorFelderFehlen')); + } + + // Delete last status approved / rejected. + // If last status is 'approved', Genehmigung is resetted. + $result = $this->AnrechnungModel->withdrawApprovement($anrechnung_id); + + if (isError($result)) + { + $this->terminateWithJsonError(getError($result)); + } + + // Success output to AJAX + $this->outputJsonSuccess(array( + 'status_bezeichnung' => $this->anrechnunglib->getLastAnrechnungstatus($anrechnung_id)) + ); + } + + /** + * Withdraw request for reommendation and reset to 'inProgressDP'. + * This is only possible if the lector has not provided a recommendation yet. + */ + public function withdrawRequestRecommendation() + { + $anrechnung_id = $this->input->post('anrechnung_id'); + + if (!is_numeric($anrechnung_id)) + { + show_error('Wrong parameter.'); + } + + // Get boolean empfehlung of given Anrechnung + if (!$result = getData($this->AnrechnungModel->load($anrechnung_id))[0]) + { + show_error('Failed loading Anrechnung'); + } + + $empfehlung = $result->empfehlung_anrechnung; + + // Get last Anrechnungstatus + if (!$result = getData($this->AnrechnungModel->getLastAnrechnungstatus($anrechnung_id))[0]) + { + show_error('Failed loading last Anrechnungstatus'); + } + + $last_status = $result->status_kurzbz; + $anrechnungstatus_id = $result->anrechnungstatus_id; + + // Return if Anrechnung was not waiting for recommendation or if Anrechnung has already been recommended + if ($last_status != self::ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR || !is_null($empfehlung)) + { + return $this->outputJsonError('No recommendation to withdraw.'); + } + + // Reset status to 'inProgressDP' + $result = $this->AnrechnungModel->deleteAnrechnungstatus($anrechnungstatus_id); + + if (isError($result)) + { + return $this->outputJsonError('Could not withdraw this application.'); + } + + // Success output to AJAX + return $this->outputJsonSuccess(array( + 'status_bezeichnung' => $this->anrechnunglib->getLastAnrechnungstatus($anrechnung_id)) + ); + } + + public function saveEmpfehlungsNotiz() + { + $anrechnung_id = $this->input->post('anrechnung_id'); + $notiz_id = $this->input->post('notiz_id'); + $empfehlungstext = $this->input->post('empfehlung_text'); + + // Validate data + if (isEmptyString($anrechnung_id)) + { + $this->terminateWithJsonError($this->p->t('ui', 'systemFehler')); + } + + // Save Empfehlungstext + $result = self::_saveEmpfehlungsNotiz($anrechnung_id, $empfehlungstext, $notiz_id); + + if (isError($result)) + { + $this->terminateWithJsonError($this->p->t('ui', 'fehlerBeimSpeichern')); + } + + // Output success message + $this->outputJsonSuccess($this->p->t('ui', 'gespeichert')); } /** @@ -291,7 +387,11 @@ class approveAnrechnungDetail extends Auth_Controller // Check if user is entitled to read dms doc self::_checkIfEntitledToReadDMSDoc($dms_id); - $this->dmslib->download($dms_id); + // Set filename to be used on downlaod + $filename = $this->anrechnunglib->setFilenameOnDownload($dms_id); + + // Download file + $this->dmslib->download($dms_id, $filename); } /** @@ -376,41 +476,6 @@ class approveAnrechnungDetail extends Auth_Controller show_error('You are not entitled to read this document'); } - /** - * Send mail to student to inform if Anrechnung was approved or rejected - * @param $mail_params - */ - private function _sendSanchoMailToStudent($anrechnung_id, $status_kurzbz) - { - $result = getData($this->anrechnunglib->getStudentData($anrechnung_id))[0]; - - // Get student name and mail address - $to = $result->uid. '@'. DOMAIN; - - $anrede = $result->geschlecht == 'w' ? 'Sehr geehrte Frau ' : 'Sehr geehrter Herr '; - - $text = $status_kurzbz == self::ANRECHNUNGSTATUS_APPROVED - ? 'Ihrem Antrag auf Anerkennung nachgewiesener Kenntnisse der Lehrveranstaltung "'. - $result->lv_bezeichnung. '" wurde stattgegeben.' - : 'wir haben Ihren Antrag auf Anerkennung nachgewiesener Kenntnisse geprüft und können die Lehrveranstaltung "'. - $result->lv_bezeichnung. '" leider nicht anrechnen, weil die Gleichwertigkeit nicht festgestellt werden konnte.'; - - // Prepare mail content - $body_fields = array( - 'anrede_name' => $anrede. $result->vorname. ' '. $result->nachname, - 'text' => $text - ); - - sendSanchoMail( - 'AnrechnungGenehmigen', - $body_fields, - $to, - 'Anerkennung nachgewiesener Kenntnisse: Ihr Antrag ist abgeschlossen' - ); - - return true; - } - /** * Send mail to lectors asking for recommendation. (first to LV-Leitung, if not present to all lectors of lv) * @param $mail_params @@ -439,6 +504,8 @@ class approveAnrechnungDetail extends Auth_Controller * **/ $lector_arr = $this->_getLectors($anrechnung_arr); + + // Send mail to lectors foreach ($lector_arr as $lector) { @@ -476,8 +543,8 @@ class approveAnrechnungDetail extends Auth_Controller } /** - * Get lectors (prio for LV-Leitung, if not present to all lectors of LV. - * Anyway this function will receive a unique array to avoid sending more mails to one and the same lector. + * Get unique array of LV lectors. + * Only get LV Leitung if present, otherwise all lectors of LV. * @param $anrechnung_arr * @return array */ @@ -521,11 +588,37 @@ class approveAnrechnungDetail extends Auth_Controller unset($lector->lvleiter); } - // Now make the lector array aka mail receivers unique + // Make the lector array unique $lector_arr = array_unique($lector_arr, SORT_REGULAR); return $lector_arr; } + private function _saveEmpfehlungsNotiz($anrechnung_id, $empfehlungstext, $notiz_id) + { + $this->load->model('person/Notiz_model', 'NotizModel'); + + if (!isEmptyString($notiz_id)) + { + return $this->NotizModel->update( + $notiz_id, + array( + 'text' => $empfehlungstext, + 'updateamum' => (new DateTime())->format('Y-m-d H:i:s'), + 'updatevon' => $this->_uid + ) + ); + } + + return $this->NotizModel->addNotizForAnrechnung( + $anrechnung_id, + self::ANRECHNUNG_NOTIZTITEL_EMPFEHLUNGSNOTIZ_BY_STGL, + trim($empfehlungstext), + $this->_uid + ); + + + } + } diff --git a/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php b/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php index b2d09fbe1..d59d97514 100644 --- a/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php +++ b/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php @@ -62,27 +62,21 @@ class approveAnrechnungUebersicht extends Auth_Controller public function index() { + // Get study semester $studiensemester_kurzbz = $this->input->get('studiensemester'); - // Retrieve studiengaenge the user is entitled for + if (isEmptyString($studiensemester_kurzbz)) + { + $result = $this->StudiensemesterModel->getNearest(); + $studiensemester_kurzbz = getData($result)[0]->studiensemester_kurzbz; + } + + // Get studiengaenge the user is entitled for if (!$studiengang_kz_arr = $this->permissionlib->getSTG_isEntitledFor(self::BERECHTIGUNG_ANRECHNUNG_GENEHMIGEN)) { show_error(getError($studiengang_kz_arr)); } - if (!is_string($studiensemester_kurzbz)) - { - $studiensemester = $this->StudiensemesterModel->getNearest(); - if (hasData($studiensemester)) - { - $studiensemester_kurzbz = $studiensemester->retval[0]->studiensemester_kurzbz; - } - elseif (isError($studiensemester)) - { - show_error(getError($studiensemester)); - } - } - $viewData = array( 'studiensemester_selected' => $studiensemester_kurzbz, 'studiengaenge_entitled' => $studiengang_kz_arr @@ -98,33 +92,22 @@ class approveAnrechnungUebersicht extends Auth_Controller { $data = $this->input->post('data'); - if(isEmptyArray($data)) + // Validate data + if (isEmptyArray($data)) { return $this->outputJsonError('Fehler beim Übertragen der Daten.'); } - // Get statusbezeichnung for 'approved' - $this->AnrechnungstatusModel->addSelect('bezeichnung_mehrsprachig'); - $approved = getData($this->AnrechnungstatusModel->load('approved'))[0]; - $approved = getUserLanguage() == 'German' - ? $approved->bezeichnung_mehrsprachig[0] - : $approved->bezeichnung_mehrsprachig[1]; - + // Approve Anrechnung foreach ($data as $item) { - // Approve Anrechnung - if(getData($this->anrechnunglib->approveAnrechnung($item['anrechnung_id']))) + if ($this->anrechnunglib->approveAnrechnung($item['anrechnung_id'])) { $json[]= array( 'anrechnung_id' => $item['anrechnung_id'], 'status_kurzbz' => self::ANRECHNUNGSTATUS_APPROVED, - 'status_bezeichnung' => $approved + 'status_bezeichnung' => $this->anrechnunglib->getStatusbezeichnung(self::ANRECHNUNGSTATUS_APPROVED) ); - - if(!$this->_sendSanchoMailToStudent($item['anrechnung_id'], self::ANRECHNUNGSTATUS_APPROVED)) - { - show_error('Failed sending mail'); - } } } @@ -146,33 +129,22 @@ class approveAnrechnungUebersicht extends Auth_Controller { $data = $this->input->post('data'); - if(isEmptyArray($data)) + // Validate data + if (isEmptyArray($data)) { return $this->outputJsonError('Fehler beim Übertragen der Daten.'); } - // Get statusbezeichnung for 'rejected' - $this->AnrechnungstatusModel->addSelect('bezeichnung_mehrsprachig'); - $rejected = getData($this->AnrechnungstatusModel->load('rejected'))[0]; - $rejected = getUserLanguage() == 'German' - ? $rejected->bezeichnung_mehrsprachig[0] - : $rejected->bezeichnung_mehrsprachig[1]; - + // Reject Anrechnung foreach ($data as $item) { - // Reject Anrechnung - if(getData($this->anrechnunglib->rejectAnrechnung($item['anrechnung_id'], $item['begruendung']))) + if ($this->anrechnunglib->rejectAnrechnung($item['anrechnung_id'], $item['begruendung'])) { $json[]= array( 'anrechnung_id' => $item['anrechnung_id'], 'status_kurzbz' => self::ANRECHNUNGSTATUS_REJECTED, - 'status_bezeichnung' => $rejected + 'status_bezeichnung' => $this->anrechnunglib->getStatusbezeichnung(self::ANRECHNUNGSTATUS_REJECTED) ); - - if(!$this->_sendSanchoMailToStudent($item['anrechnung_id'], self::ANRECHNUNGSTATUS_REJECTED)) - { - show_error('Failed sending mail'); - } } } @@ -199,46 +171,59 @@ class approveAnrechnungUebersicht extends Auth_Controller return $this->outputJsonError('Fehler beim Übertragen der Daten.'); } - // Get statusbezeichnung for 'inProgressLektor' - $this->AnrechnungstatusModel->addSelect('bezeichnung_mehrsprachig'); - $inProgressLektor = getData($this->AnrechnungstatusModel->load('inProgressLektor'))[0]; - $inProgressLektor = getUserLanguage() == 'German' - ? $inProgressLektor->bezeichnung_mehrsprachig[0] - : $inProgressLektor->bezeichnung_mehrsprachig[1]; + $retval = array(); + $counter = 0; foreach ($data as $item) { - // Approve Anrechnung - if(getData($this->anrechnunglib->requestRecommendation($item['anrechnung_id']))) + // Check if Anrechnungs-LV has lector + if (!$this->anrechnunglib->LVhasLector($item['anrechnung_id'])) { - $json[]= array( + // Count up LV with no lector + $counter++; + + // Continue loop, if LV has no lector + continue; + } + + // Request Recommendation + if($this->anrechnunglib->requestRecommendation($item['anrechnung_id'])) + { + // Get full name of LV Leitung. + // If LV Leitung is not present, get full name of LV lectors. + $lector_arr = $this->anrechnunglib->getLectors($item['anrechnung_id']); + $empfehlungsanfrage_an = !isEmptyArray($lector_arr) + ? implode(', ', array_column($lector_arr, 'fullname')) + : ''; + + $retval[]= array( 'anrechnung_id' => $item['anrechnung_id'], 'status_kurzbz' => self::ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR, - 'status_bezeichnung' => $inProgressLektor, - 'empfehlung_anrechnung' => null + 'status_bezeichnung' => $this->anrechnunglib->getStatusbezeichnung(self::ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR), + 'empfehlung_anrechnung' => null, + 'empfehlungsanfrageAm' => (new DateTime())->format('Y-m-d H:i:s'), + 'empfehlungsanfrageAn' => $empfehlungsanfrage_an ); } } - // Output json to ajax - if (isset($json) && !isEmptyArray($json)) + /** + * Send mails to lectors + * NOTE: mails are sent at the end to ensure sending only ONE mail to each LV-Leitung or lector + * even if they are required for more recommendations + * */ + if (!isEmptyArray($retval)) { - /** - * Send mails to lectors - * NOTE: mails are sent at the end to ensure sending only ONE mail to each LV-Leitung or lector - * even if they are required for more recommendations - * */ - if (!$this->_sendSanchoMailToLectors($json)) - { - show_error('Failed sending emails'); - } - - return $this->outputJsonSuccess($json); + self::_sendSanchoMailToLectors($retval); } - else + + // Output json to ajax + if (isEmptyArray($retval) && $counter == 0) { return $this->outputJsonError('Es wurden keine Empfehlungen angefordert'); } + + return $this->outputJsonSuccess($retval); } /** @@ -256,7 +241,11 @@ class approveAnrechnungUebersicht extends Auth_Controller // Check if user is entitled to read dms doc self::_checkIfEntitledToReadDMSDoc($dms_id); - $this->dmslib->download($dms_id); + // Set filename to be used on downlaod + $filename = $this->anrechnunglib->setFilenameOnDownload($dms_id); + + // Download file + $this->dmslib->download($dms_id, $filename); } @@ -307,41 +296,6 @@ class approveAnrechnungUebersicht extends Auth_Controller show_error('You are not entitled to read this document'); } - /** - * Send mail to student to inform if Anrechnung was approved or rejected - * @param $mail_params - */ - private function _sendSanchoMailToStudent($anrechnung_id, $status_kurzbz) - { - $result = getData($this->anrechnunglib->getStudentData($anrechnung_id))[0]; - - // Get student name and mail address - $to = $result->uid. '@'. DOMAIN; - - $anrede = $result->geschlecht == 'w' ? 'Sehr geehrte Frau ' : 'Sehr geehrter Herr '; - - $text = $status_kurzbz == self::ANRECHNUNGSTATUS_APPROVED - ? 'Ihrem Antrag auf Anerkennung nachgewiesener Kenntnisse der Lehrveranstaltung "'. - $result->lv_bezeichnung. '" wurde stattgegeben.' - : 'wir haben Ihren Antrag auf Anerkennung nachgewiesener Kenntnisse geprüft und können die Lehrveranstaltung "'. - $result->lv_bezeichnung. '" leider nicht anrechnen, weil die Gleichwertigkeit nicht festgestellt werden konnte.'; - - // Prepare mail content - $body_fields = array( - 'anrede_name' => $anrede. $result->vorname. ' '. $result->nachname, - 'text' => $text - ); - - sendSanchoMail( - 'AnrechnungGenehmigen', - $body_fields, - $to, - 'Anerkennung nachgewiesener Kenntnisse: Ihr Antrag ist abgeschlossen' - ); - - return true; - } - /** * Send mail to lectors asking for recommendation. (first to LV-Leitung, if not present to all lectors of lv) * @param $mail_params @@ -456,6 +410,5 @@ class approveAnrechnungUebersicht extends Auth_Controller $lector_arr = array_unique($lector_arr, SORT_REGULAR); return $lector_arr; - } } \ No newline at end of file diff --git a/application/controllers/lehre/anrechnung/CreateAnrechnung.php b/application/controllers/lehre/anrechnung/CreateAnrechnung.php new file mode 100644 index 000000000..bc594371d --- /dev/null +++ b/application/controllers/lehre/anrechnung/CreateAnrechnung.php @@ -0,0 +1,271 @@ + 'lehre/anrechnung_anlegen:r', + 'getLVsByStudent' => 'lehre/anrechnung_anlegen:r', + 'create' => 'lehre/anrechnung_anlegen:rw' + ) + ); + + // Load models + $this->load->model('education/Anrechnung_model', 'AnrechnungModel'); + $this->load->model('education/Anrechnungstatus_model', 'AnrechnungstatusModel'); + $this->load->model('content/DmsVersion_model', 'DmsVersionModel'); + $this->load->model('crm/Student_model', 'StudentModel'); + $this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel'); + + // Load libraries + $this->load->library('WidgetLib'); + $this->load->library('PermissionLib'); + $this->load->library('AnrechnungLib'); + $this->load->library('DmsLib'); + + // Load helpers + $this->load->helper('form'); + $this->load->helper('url'); + + // Load language phrases + $this->loadPhrases( + array( + 'global', + 'ui', + 'anrechnung', + 'person', + 'lehre' + ) + ); + + // Load configs + $this->load->config('anrechnung'); + + $this->_setAuthUID(); + + $this->setControllerId(); + } + + public function index() + { + // Get Studiensemester + $studiensemester_kurzbz = $this->input->get('studiensemester'); + + // If no Studiensemester is given + if (isEmptyString($studiensemester_kurzbz)) + { + //...use the nearest Studiensemester + $result = $this->StudiensemesterModel->getNearest(); + $studiensemester_kurzbz = getData($result)[0]->studiensemester_kurzbz; + } + + // Get Studiengaenge the user is entitled for + if (!$studiengang_kz_arr = $this->permissionlib->getSTG_isEntitledFor(self::BERECHTIGUNG_ANRECHNUNG_ANLEGEN)) + { + show_error('Failed retrieving Studiengaenge'); + } + + // Get Anrechnungsbegruendungen + $this->load->model('education/Anrechnungbegruendung_model', 'AnrechnungbegruendungModel'); + $begruendung_arr = getData($this->AnrechnungbegruendungModel->load()); + + $viewData = array( + 'studiensemester_selected' => $studiensemester_kurzbz, + 'studiengaenge_entitled' => $studiengang_kz_arr, + 'begruendungen' => $begruendung_arr + ); + + $this->load->view('lehre/anrechnung/createAnrechnung.php', $viewData); + } + + /** + * Get Lehrveranstaltungen from Student. + */ + public function getLVsByStudent() + { + $prestudent_id = $this->input->post('prestudent_id'); + $studiensemester_kurzbz = $this->input->post('studiensemester_kurzbz'); + + // Get Student UID + $student_uid = $this->StudentModel->getUID($prestudent_id); + + // Retrieve Lehrveranstaltungen from student + $result = $this->LehrveranstaltungModel->getLvsByStudent($student_uid, $studiensemester_kurzbz); + + // Exit, if student has no Lehrveranstaltungen + if (!hasData($result)) + { + $this->terminateWithJsonError($this->p->t('ui', 'keineLVzugeteilt')); + } + + // Success response to AJAX + $this->outputJsonSuccess(getData($result)); + } + + /** + * Create Anrechnungsantrag. + * + * Saves Anrechnung and Anrechnungstatus. + * Also saves Nachweisdokument to DMS. + */ + public function create() + { + $prestudent_id = $this->input->post('prestudent_id'); + $studiensemester_kurzbz = $this->input->post('studiensemester_kurzbz'); + $lehrveranstaltung_id = $this->input->post('lehrveranstaltung_id'); + $begruendung_id = $this->input->post('begruendung_id'); + $herkunftKenntnisse = $this->input->post('herkunftKenntnisse'); + + // Validate upload file + if (empty($_FILES['uploadfile']['name'])) + { + $this->terminateWithJsonError($this->p->t('ui', 'errorUploadFehlt')); + } + + // Validate required data + if (isEmptyString($begruendung_id) || isEmptyString($lehrveranstaltung_id)) + { + $this->terminateWithJsonError($this->p->t('ui', 'errorFelderFehlen')); + } + + // Exit if application already exists + if (self::_applicationExists($lehrveranstaltung_id, $studiensemester_kurzbz, $prestudent_id)) + { + $this->terminateWithJsonError($this->p->t('global', 'antragBereitsGestellt')); + } + + // Exit if Lehrveranstaltung was already graded with application blocking grades + if (self::_LVhasBlockingGrades($studiensemester_kurzbz, $lehrveranstaltung_id, $prestudent_id)) + { + $this->terminateWithJsonError($this->p->t('anrechnung', 'antragBenotungBlockiert')); + } + + // Upload document + $result = self::_uploadFile(); + + if (isError($result)) + { + $this->terminateWithJsonError($result->retval); + } + + // Hold just inserted DMS ID + $lastInsert_dms_id = $result->retval['dms_id']; + + // Save Anrechnung and Anrechnungstatus + $result = $this->AnrechnungModel->createAnrechnungsantrag( + $prestudent_id, + $studiensemester_kurzbz, + $lehrveranstaltung_id, + $begruendung_id, + $lastInsert_dms_id, + $herkunftKenntnisse + ); + + if (isError($result)) + { + $this->terminateWithJsonError(getError($result)); + } + + $lastInsert_anrechnung_id = getData($result); + + // Success response to AJAX + $this->outputJsonSuccess(array( + 'anrechnung_id' => $lastInsert_anrechnung_id, + 'msg' => $this->p->t('global', 'antragWurdeAngelegt') + )); + } + + + /** + * Retrieve the UID of the logged user and checks if it is valid + */ + private function _setAuthUID() + { + $this->_uid = getAuthUID(); + + if (!$this->_uid) show_error('User authentification failed'); + } + + /** + * Check if application already exists. + * + * @param $lehrveranstaltung_id + * @param $studiensemester_kurzbz + * @param $prestudent_id + * @return bool + */ + private function _applicationExists($lehrveranstaltung_id, $studiensemester_kurzbz, $prestudent_id) + { + $result = $this->AnrechnungModel->loadWhere(array( + 'lehrveranstaltung_id' => $lehrveranstaltung_id, + 'studiensemester_kurzbz' => $studiensemester_kurzbz, + 'prestudent_id' => $prestudent_id + )); + + if (isError($result)) + { + show_error(getError($result)); + } + + return hasData($result); + } + + /** + * Upload file via DMS library. + * + * @return mixed + * @throws Exception + */ + private function _uploadFile() + { + $dms = array( + 'kategorie_kurzbz' => 'anrechnung', + 'version' => 0, + 'name' => $_FILES['uploadfile']['name'], + 'mimetype' => $_FILES['uploadfile']['type'], + 'insertamum' => (new DateTime())->format('Y-m-d H:i:s'), + 'insertvon' => $this->_uid + ); + + // Upload document + return $this->dmslib->upload($dms, 'uploadfile', array('pdf')); + } + + private function _LVhasBlockingGrades($studiensemester_kurzbz, $lehrveranstaltung_id, $prestudent_id) + { + // Get Student UID + $student_uid = $this->StudentModel->getUID($prestudent_id); + + // Get Note of Lehrveranstaltung + $this->load->model('education/Lvgesamtnote_model', 'LvgesamtnoteModel'); + $result = $this->LvgesamtnoteModel->load(array( + 'student_uid' => $student_uid, + 'studiensemester_kurzbz' => $studiensemester_kurzbz, + 'lehrveranstaltung_id' => $lehrveranstaltung_id + ) + ); + + // If Lehrveranstaltung has Note + if (hasData($result)) + { + $note = getData($result)[0]->note; + + // Check if Note is a blocking grade + if (in_array($note, $this->config->item('grades_blocking_application'))) + { + return true; + } + } + return false; + } + +} \ No newline at end of file diff --git a/application/controllers/lehre/anrechnung/RequestAnrechnung.php b/application/controllers/lehre/anrechnung/RequestAnrechnung.php index 4f589e5f5..45a770cf5 100644 --- a/application/controllers/lehre/anrechnung/RequestAnrechnung.php +++ b/application/controllers/lehre/anrechnung/RequestAnrechnung.php @@ -6,15 +6,13 @@ class requestAnrechnung extends Auth_Controller { const REQUEST_ANRECHNUNG_URI = '/lehre/anrechnung/RequestAnrechnung'; const APPROVE_ANRECHNUNG_URI = '/lehre/anrechnung/ApproveAnrechnungUebersicht'; - + const ANRECHNUNGSTATUS_PROGRESSED_BY_STGL = 'inProgressDP'; const ANRECHNUNGSTATUS_PROGRESSED_BY_KF = 'inProgressKF'; const ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR = 'inProgressLektor'; const ANRECHNUNGSTATUS_APPROVED = 'approved'; const ANRECHNUNGSTATUS_REJECTED = 'rejected'; - - const DEADLINE_INTERVAL_NACH_SEMESTERSTART = 'P1M'; // Deadline for application - + public function __construct() { // Set required permissions @@ -25,22 +23,25 @@ class requestAnrechnung extends Auth_Controller 'download' => 'student/anrechnung_beantragen:rw', ) ); - + // Load models $this->load->model('education/Anrechnung_model', 'AnrechnungModel'); $this->load->model('content/DmsVersion_model', 'DmsVersionModel'); - + // Load libraries $this->load->library('WidgetLib'); $this->load->library('PermissionLib'); $this->load->library('AnrechnungLib'); $this->load->library('DmsLib'); - + // Load helpers $this->load->helper('form'); $this->load->helper('url'); $this->load->helper('hlp_sancho_helper'); - + + // Load configs + $this->load->config('anrechnung'); + // Load language phrases $this->loadPhrases( array( @@ -51,63 +52,59 @@ class requestAnrechnung extends Auth_Controller 'lehre' ) ); - + $this->_setAuthUID(); - + $this->setControllerId(); } - + public function index() { $studiensemester_kurzbz = $this->input->get('studiensemester'); $lehrveranstaltung_id = $this->input->get('lv_id'); - - if (!is_numeric($lehrveranstaltung_id) || !is_string($studiensemester_kurzbz)) + + if (isEmptyString($lehrveranstaltung_id) || isEmptyString($studiensemester_kurzbz)) { show_error('Missing correct parameter'); } - + + // Exit if user is not a student + $result = $this->StudentModel->load(array('student_uid' => $this->_uid)); + + if (!hasData($result)) + { + show_error('Cant load user'); + } + + // Get Prestudent ID + $prestudent_id = getData($result)[0]->prestudent_id; + // Check if application deadline is expired - // $is_expired = $this->_checkAntragDeadline($studiensemester_kurzbz); - $is_expired = false; // Set to false until Deadline is defined - - $student = $this->StudentModel->load(array('student_uid' => $this->_uid)); - if (isSuccess($student) && hasData($student)) - { - $prestudent_id = getData($student)[0]->prestudent_id; - } - else - show_error('Cant load User'); - + $is_expired = self::_checkAntragDeadline( + $this->config->item('submit_application_start'), + $this->config->item('submit_application_end'), + $studiensemester_kurzbz + ); + + // Check if Lehrveranstaltung was already graded with application blocking grades + $is_blocked = self::_LVhasBlockingGrades($studiensemester_kurzbz, $lehrveranstaltung_id); + // Get Anrechung data - $result = $this->anrechnunglib->getAnrechnungDataByLv($lehrveranstaltung_id, $studiensemester_kurzbz, $prestudent_id); - if (!$anrechnungData = getData($result)) - { - show_error(getError($anrechnungData)); - } - - // Dont show who is progressing the application to the student - if ($anrechnungData->status_kurzbz == self::ANRECHNUNGSTATUS_PROGRESSED_BY_STGL || - $anrechnungData->status_kurzbz == self::ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR || - $anrechnungData->status_kurzbz == self::ANRECHNUNGSTATUS_PROGRESSED_BY_KF) - { - $anrechnungData->status = getUserLanguage() == 'German' ? 'in Bearbeitung' : 'in process'; - } - - $antragData = $this->anrechnunglib->getAntragData($this->_uid, $studiensemester_kurzbz, $lehrveranstaltung_id); + $anrechnungData = $this->anrechnunglib->getAnrechnungDataByLv($lehrveranstaltung_id, $studiensemester_kurzbz, $prestudent_id); + // Get Antrag data + $antragData = $this->anrechnunglib->getAntragData($prestudent_id, $studiensemester_kurzbz, $lehrveranstaltung_id); + $viewData = array( 'antragData' => $antragData, 'anrechnungData' => $anrechnungData, 'is_expired' => $is_expired, - 'disabled' => $is_expired && empty($anrechnungData->anrechnung_id) || !empty($anrechnungData->anrechnung_id) - ? 'disabled' - : '' + 'is_blocked' => $is_blocked ); - + $this->load->view('lehre/anrechnung/requestAnrechnung.php', $viewData); } - + /** * Apply Anrechnungsantrag and send to STGL */ @@ -117,104 +114,82 @@ class requestAnrechnung extends Auth_Controller $begruendung_id = $this->input->post('begruendung'); $lehrveranstaltung_id = $this->input->post('lv_id'); $studiensemester_kurzbz = $this->input->post('studiensemester'); + $bestaetigung = $this->input->post('bestaetigung'); + // Validate data if (empty($_FILES['uploadfile']['name'])) { - show_error('Missing upload file'); + return $this->outputJsonError($this->p->t('ui', 'errorUploadFehlt')); } - if (!is_numeric($begruendung_id) || !is_numeric($lehrveranstaltung_id) || !is_string($studiensemester_kurzbz)) + if (isEmptyString($begruendung_id) || + isEmptyString($anmerkung) || + isEmptyString($lehrveranstaltung_id) || + isEmptyString($studiensemester_kurzbz)) { - show_error('Missing correct parameter'); + return $this->outputJsonError($this->p->t('ui', 'errorFelderFehlen')); } - - $student = $this->StudentModel->load(array('student_uid' => $this->_uid)); - if (isSuccess($student) && hasData($student)) + + if (isEmptyString($bestaetigung)) { - $prestudent_id = getData($student)[0]->prestudent_id; + return $this->outputJsonError($this->p->t('ui', 'errorBestaetigungFehlt')); } - else - show_error('Cant load User'); - - $result = $this->_getAnrechnung($lehrveranstaltung_id, $studiensemester_kurzbz, $prestudent_id); - if (hasData($result)) + + // Exit if user is not a student + $result = $this->StudentModel->load(array('student_uid' => $this->_uid)); + + if (!hasData($result)) { - show_error('Der Antrag wurde bereits gestellt'); + return $this->outputJsonError('Cant load user'); } - - // Start DB transaction - $this->db->trans_start(false); - + + // Get Prestudent ID + $prestudent_id = getData($result)[0]->prestudent_id; + + // Exit if application already exists + if (self::_applicationExists($lehrveranstaltung_id, $studiensemester_kurzbz, $prestudent_id)) + { + return $this->outputJsonError($this->p->t('anrechnung', 'antragBereitsGestellt')); + } + + // Exit if application is not for actual studysemester + if (!self::_applicationIsForActualSS($studiensemester_kurzbz)) + { + return $this->outputJsonError($this->p->t('anrechnung', 'antragNurImAktSS')); + } + // Upload document - $dms = array( - 'kategorie_kurzbz' => 'anrechnung', - 'version' => 0, - 'name' => $_FILES['uploadfile']['name'], - 'mimetype' => $_FILES['uploadfile']['type'], - 'insertamum' => (new DateTime())->format('Y-m-d H:i:s'), - 'insertvon' => $this->_uid + $result = self::_uploadFile(); + + if (isError($result)) + { + return $this->outputJsonError($result->retval); + } + + // Hold just inserted DMS ID + $lastInsert_dms_id = $result->retval['dms_id']; + + // Save Anrechnung and Anrechnungstatus + $result = $this->AnrechnungModel->createAnrechnungsantrag( + $prestudent_id, + $studiensemester_kurzbz, + $lehrveranstaltung_id, + $begruendung_id, + $lastInsert_dms_id, + $anmerkung ); - - if(isError($uploaddata = $this->dmslib->upload($dms, array('pdf')))) + + if (isError($result)) { - show_error(getError($uploaddata)); + $this->terminateWithJsonError(getError($result)); } - - // Get PrestudentID - $result = $this->_loadPrestudent($this->_uid, $studiensemester_kurzbz); - - if (!$prestudent = getData($result)[0]) - { - show_error('Failed retrieving prestudent'); - } - - // Save Anrechnung - $result = $this->AnrechnungModel->insert(array( - 'prestudent_id' => $prestudent->prestudent_id, - 'lehrveranstaltung_id' => $lehrveranstaltung_id, - 'begruendung_id' => $begruendung_id, - 'dms_id' => $uploaddata->retval['dms_id'], - 'studiensemester_kurzbz' => $studiensemester_kurzbz, - 'anmerkung_student' => $anmerkung, - 'insertvon' => $this->_uid + + // Output to AJAX + $this->outputJsonSuccess(array( + 'antragdatum' => (new DateTime())->format('d.m.Y'), + 'dms_id' => $lastInsert_dms_id, + 'filename' => $_FILES['uploadfile']['name'] )); - - if (isError($result)) - { - show_error('Failed inserting Anrechnung'); - } - - // Save Anrechnungstatus 'inProgressSTGL' - $result = $this->AnrechnungModel->saveAnrechnungstatus($result->retval, self::ANRECHNUNGSTATUS_PROGRESSED_BY_STGL); - - if (isError($result)) - { - show_error('Failed saving Anrechnungstatus'); - } - - // Transaction complete! - $this->db->trans_complete(); - - if ($this->db->trans_status() === false || isError($result)) - { - $this->db->trans_rollback(); - show_error($result->msg, EXIT_ERROR); - } - - // Send mail to STGL - $mail_params = array( - 'studiengang_kz' => $prestudent->studiengang_kz, - 'lehrveranstaltung_id' => $lehrveranstaltung_id - ); - - if(!$this->_sendSanchoMail($mail_params)) - { - show_error('Failed sending mail'); - } - else - { - redirect(site_url(). self::REQUEST_ANRECHNUNG_URI. '?studiensemester='. $studiensemester_kurzbz. '&lv_id='. $lehrveranstaltung_id); - } } /** @@ -241,53 +216,50 @@ class requestAnrechnung extends Auth_Controller private function _setAuthUID() { $this->_uid = getAuthUID(); - + if (!$this->_uid) show_error('User authentification failed'); } - - /** - * Load Prestudent by uid and Studiensemester. - * @param $uid - * @param $studiensemester_kurzbz - * @return mixed - */ - private function _loadPrestudent($uid, $studiensemester_kurzbz) - { - $this->load->model('crm/Prestudentstatus_model', 'PrestudentstatusModel'); - $this->load->model('crm/Student_model', 'StudentModel'); - - $this->PrestudentstatusModel->addJoin('public.tbl_student', 'prestudent_id'); - return $this->PrestudentstatusModel->loadWhere(array( - 'student_uid' => $uid, - 'studiensemester_kurzbz' => $studiensemester_kurzbz - ) - ); - } - + /** * Check if application deadline is expired. + * + * @param $start Start date for application submission. + * @param $ende End date for application submission. * @param $studiensemester_kurzbz - * @return bool True if semester start is more then 1 week ago + * @return bool True if today is not during the start- and ending deadlines (= if is expired) * @throws Exception */ - private function _checkAntragDeadline($studiensemester_kurzbz) + private function _checkAntragDeadline($start, $ende, $studiensemester_kurzbz) { $this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel'); - $this->StudiensemesterModel->addSelect('start'); - if (!$start = getData($this->StudiensemesterModel->load($studiensemester_kurzbz))) + + // If start is not given, set to Semesterstart. + if (!isset($start) || isEmptyString($start)) { - show_error(getError($start)); + $this->StudiensemesterModel->addSelect('start'); + $result = $this->StudiensemesterModel->load($studiensemester_kurzbz); + $start = getData($result)[0]->start; } - - $start = new DateTime($start[0]->start); + + // If ende is not given, set to Semesterende. + if (!isset($ende) || isEmptyString($ende)) + { + $this->StudiensemesterModel->addSelect('ende'); + $result = $this->StudiensemesterModel->load($studiensemester_kurzbz); + $ende = getData($result)[0]->ende; + } + $today = new DateTime('today midnight'); - - // True if today > application deadline - return ($today > $start->add((new DateInterval(self::DEADLINE_INTERVAL_NACH_SEMESTERSTART)))); + $start = new DateTime($start); + $ende = new DateTime($ende); + + // True if today is not during the start- and ending deadlines (= if is expired) + return ($today <= $start || $today >= $ende); } - + /** - * Check if user is entitled to read dms doc + * Check if user is entitled to read dms doc. + * * @param $dms_id */ private function _checkIfEntitledToReadDMSDoc($dms_id) @@ -298,7 +270,7 @@ class requestAnrechnung extends Auth_Controller } $result = $this->AnrechnungModel->loadWhere(array('dms_id' => $dms_id)); - + if($result = getData($result)[0]) { if ($result->prestudent_id == $student->prestudent_id) @@ -306,104 +278,92 @@ class requestAnrechnung extends Auth_Controller return; } } - + show_error('You are not entitled to read this document'); } - + /** - * Get Anrechnung by Lehrveranstaltung + * Check if application already exists. + * * @param $lehrveranstaltung_id - * @return mixed + * @param $studiensemester_kurzbz + * @param $prestudent_id + * @return bool */ - private function _getAnrechnung($lehrveranstaltung_id, $studiensemester_kurzbz, $prestudent_id) + private function _applicationExists($lehrveranstaltung_id, $studiensemester_kurzbz, $prestudent_id) { $result = $this->AnrechnungModel->loadWhere(array( 'lehrveranstaltung_id' => $lehrveranstaltung_id, 'studiensemester_kurzbz' => $studiensemester_kurzbz, 'prestudent_id' => $prestudent_id )); - + if (isError($result)) { show_error(getError($result)); } - - return $result; + + return hasData($result); } - + /** - * Send mail to STGL (if not available, send to STGL assistance) - * @param $mail_params + * Check if applications' study semester is actual study semester. + * + * @param $studiensemester_kurzbz + * @return bool */ - private function _sendSanchoMail($mail_params) + private function _applicationIsForActualSS($studiensemester_kurzbz) { - // Get STGL mail address, if available, otherwise get assistance mail address - list ($to, $vorname) = $this->_getSTGLMailAddress($mail_params['studiengang_kz']); - - // Get full name of student - $this->load->model('person/Person_model', 'PersonModel'); - if (!$student_name = getData($this->PersonModel->getFullName($this->_uid))) - { - show_error ('Failed retrieving person'); - } - - // Get lehrveranstaltung bezeichnung - $this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel'); - if (!$lehrveranstaltung = getData($this->LehrveranstaltungModel->load($mail_params['lehrveranstaltung_id']))[0]) - { - show_error ('Failed retrieving person'); - } - - // Link to Antrag genehmigen - $url = - CIS_ROOT. 'cis/index.php?menu='. - CIS_ROOT. 'cis/menu.php?content_id=&content='. - CIS_ROOT. index_page(). self::APPROVE_ANRECHNUNG_URI; - - // Prepare mail content - $body_fields = array( - 'vorname' => $vorname, - 'student_name' => $student_name, - 'lehrveranstaltung_bezeichnung' => $lehrveranstaltung->bezeichnung, - 'link' => anchor($url, 'Anrechnungsanträge Übersicht') - ); - - sendSanchoMail( - 'AnrechnungAntragStellen', - $body_fields, - $to, - 'Anerkennung nachgewiesener Kenntnisse: Neuer Antrag wurde gestellt' - ); - - return true; + $this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel'); + $result = $this->StudiensemesterModel->getNearest(); + $actual_ss = getData($result)[0]->studiensemester_kurzbz; + + return $studiensemester_kurzbz == $actual_ss; } - - // Get STGL mail address, if available, otherwise get assistance mail address - private function _getSTGLMailAddress($stg_kz) + + private function _LVhasBlockingGrades($studiensemester_kurzbz, $lehrveranstaltung_id) { - $this->load->model('organisation/Studiengang_model', 'StudiengangModel'); - $result = $this->StudiengangModel->getLeitung($stg_kz); - - // Get STGL mail address, if available + // Get Note of Lehrveranstaltung + $this->load->model('education/Lvgesamtnote_model', 'LvgesamtnoteModel'); + $result = $this->LvgesamtnoteModel->load(array( + 'student_uid' => $this->_uid, + 'studiensemester_kurzbz' => $studiensemester_kurzbz, + 'lehrveranstaltung_id' => $lehrveranstaltung_id + ) + ); + + // If Lehrveranstaltung has Note if (hasData($result)) { - return array( - $result->retval[0]->uid. '@'. DOMAIN, - $result->retval[0]->vorname - ); - } - // ...otherwise get assistance mail address - else - { - $result = $this->StudiengangModel->load($stg_kz); - - if (hasData($result)) + $note = getData($result)[0]->note; + + // Check if Note is a blocking grade + if (in_array($note, $this->config->item('grades_blocking_application'))) { - return array( - $result->retval[0]->email, - '' - ); + return true; } } + return false; } -} + + /** + * Upload file via DMS library. + * + * @return mixed + * @throws Exception + */ + private function _uploadFile() + { + $dms = array( + 'kategorie_kurzbz' => 'anrechnung', + 'version' => 0, + 'name' => $_FILES['uploadfile']['name'], + 'mimetype' => $_FILES['uploadfile']['type'], + 'insertamum' => (new DateTime())->format('Y-m-d H:i:s'), + 'insertvon' => $this->_uid + ); + + // Upload document + return $this->dmslib->upload($dms, 'uploadfile', array('pdf')); + } +} \ No newline at end of file diff --git a/application/controllers/lehre/anrechnung/ReviewAnrechnungDetail.php b/application/controllers/lehre/anrechnung/ReviewAnrechnungDetail.php index b9c723eee..78175f4e6 100644 --- a/application/controllers/lehre/anrechnung/ReviewAnrechnungDetail.php +++ b/application/controllers/lehre/anrechnung/ReviewAnrechnungDetail.php @@ -1,6 +1,6 @@ anrechnunglib->getAnrechnungData($anrechnung_id))) - { - show_error('Missing data for Anrechnung.'); - } + $anrechnungData = $this->anrechnunglib->getAnrechnungData($anrechnung_id); + + // Get Antrag data + $antragData = $this->anrechnunglib->getAntragData( + $anrechnungData->prestudent_id, + $anrechnungData->studiensemester_kurzbz, + $anrechnungData->lehrveranstaltung_id + ); // Get Empfehlung data - if(!$empfehlungData = getData($this->anrechnunglib->getEmpfehlungData($anrechnung_id))) - { - show_error('Missing data for recommendation'); - } + $empfehlungData = $this->anrechnunglib->getEmpfehlungData($anrechnung_id); $viewData = array( - 'antragData' => $this->anrechnunglib->getAntragData( - $student_uid = $this->StudentModel->getUID($anrechnungData->prestudent_id), - $anrechnungData->studiensemester_kurzbz, - $anrechnungData->lehrveranstaltung_id - ), + 'antragData' => $antragData, 'anrechnungData' => $anrechnungData, 'empfehlungData' => $empfehlungData ); @@ -113,29 +110,23 @@ class reviewAnrechnungDetail extends Auth_Controller { return $this->outputJsonError('Fehler beim Übertragen der Daten.'); } - - // Get statusbezeichnung for 'inProgressDP' - $this->AnrechnungstatusModel->addSelect('bezeichnung_mehrsprachig'); - $inProgressDP = getData($this->AnrechnungstatusModel->load('inProgressDP'))[0]; - $inProgressDP = getUserLanguage() == 'German' - ? $inProgressDP->bezeichnung_mehrsprachig[0] - : $inProgressDP->bezeichnung_mehrsprachig[1]; - + + // Get lectors person data if (!$person = getData($this->PersonModel->getByUID($this->_uid))[0]) { - show_error('Failed retrieving person data'); + return $this->outputJsonError('Failed retrieving person data'); } foreach ($data as $item) { // Approve Anrechnung - if(getData($this->anrechnunglib->recommendAnrechnung($item['anrechnung_id']))) + if($this->anrechnunglib->recommendAnrechnung($item['anrechnung_id'])) { $json[]= array( 'anrechnung_id' => $item['anrechnung_id'], 'empfehlung_anrechnung' => 'true', 'status_kurzbz' => self::ANRECHNUNGSTATUS_PROGRESSED_BY_STGL, - 'status_bezeichnung' => $inProgressDP, + 'status_bezeichnung' => $this->anrechnunglib->getStatusbezeichnung(self::ANRECHNUNGSTATUS_PROGRESSED_BY_STGL), 'empfehlung_am' => (new DateTime())->format('d.m.Y'), 'empfehlung_von' => $person->vorname. ' '. $person->nachname ); @@ -151,14 +142,14 @@ class reviewAnrechnungDetail extends Auth_Controller * */ if (!$this->_sendSanchoMails($json, true)) { - show_error('Failed sending emails'); + return $this->outputJsonError('Failed sending emails'); } return $this->outputJsonSuccess($json); } else { - return $this->outputJsonError('Empfehlungen wurden nicht durchgeführt'); + return $this->outputJsonError($this->p->t('ui', 'errorNichtAusgefuehrt')); } } @@ -174,29 +165,23 @@ class reviewAnrechnungDetail extends Auth_Controller return $this->outputJsonError('Fehler beim Übertragen der Daten.'); } - // Get statusbezeichnung for 'inProgressDP' - $this->AnrechnungstatusModel->addSelect('bezeichnung_mehrsprachig'); - $inProgressDP = getData($this->AnrechnungstatusModel->load('inProgressDP'))[0]; - $inProgressDP = getUserLanguage() == 'German' - ? $inProgressDP->bezeichnung_mehrsprachig[0] - : $inProgressDP->bezeichnung_mehrsprachig[1]; - + // Get lectors person data if (!$person = getData($this->PersonModel->getByUID($this->_uid))[0]) { - show_error('Failed retrieving person data'); + return $this->outputJsonError('Failed retrieving person data'); } foreach ($data as $item) { // Approve Anrechnung - if(getData($this->anrechnunglib->dontRecommendAnrechnung($item['anrechnung_id'], $item['begruendung']))) + if($this->anrechnunglib->dontRecommendAnrechnung($item['anrechnung_id'], $item['begruendung'])) { $json[]= array( 'anrechnung_id' => $item['anrechnung_id'], 'empfehlung_anrechnung' => 'false', 'status_kurzbz' => self::ANRECHNUNGSTATUS_PROGRESSED_BY_STGL, - 'status_bezeichnung' => $inProgressDP, - 'empfehlumg_am' => (new DateTime())->format('d.m.Y'), + 'status_bezeichnung' => $this->anrechnunglib->getStatusbezeichnung(self::ANRECHNUNGSTATUS_PROGRESSED_BY_STGL), + 'empfehlung_am' => (new DateTime())->format('d.m.Y'), 'empfehlung_von' => $person->vorname. ' '. $person->nachname ); } @@ -208,14 +193,14 @@ class reviewAnrechnungDetail extends Auth_Controller // Send mails to STGL (if not present STGL, send to STGL assistance) if (!$this->_sendSanchoMails($json, false)) { - show_error('Failed sending emails'); + return $this->outputJsonError('Failed sending emails'); } return $this->outputJsonSuccess($json); } else { - return $this->outputJsonError('Empfehlungen wurden nicht durchgeführt'); + return $this->outputJsonError($this->p->t('ui', 'errorNichtAusgefuehrt')); } } @@ -233,8 +218,12 @@ class reviewAnrechnungDetail extends Auth_Controller // Check if user is entitled to read dms doc self::_checkIfEntitledToReadDMSDoc($dms_id); - - $this->dmslib->download($dms_id); + + // Set filename to be used on downlaod + $filename = $this->anrechnunglib->setFilenameOnDownload($dms_id); + + // Download file + $this->dmslib->download($dms_id, $filename); } diff --git a/application/controllers/lehre/anrechnung/ReviewAnrechnungUebersicht.php b/application/controllers/lehre/anrechnung/ReviewAnrechnungUebersicht.php index 005cde97a..cd0b7afaf 100644 --- a/application/controllers/lehre/anrechnung/ReviewAnrechnungUebersicht.php +++ b/application/controllers/lehre/anrechnung/ReviewAnrechnungUebersicht.php @@ -62,19 +62,13 @@ class reviewAnrechnungUebersicht extends Auth_Controller public function index() { + // Get study semester $studiensemester_kurzbz = $this->input->get('studiensemester'); - if (!is_string($studiensemester_kurzbz)) + if (isEmptyString($studiensemester_kurzbz)) { - $studiensemester = $this->StudiensemesterModel->getNearest(); - if (hasData($studiensemester)) - { - $studiensemester_kurzbz = $studiensemester->retval[0]->studiensemester_kurzbz; - } - elseif (isError($studiensemester)) - { - show_error(getError($studiensemester)); - } + $result = $this->StudiensemesterModel->getNearest(); + $studiensemester_kurzbz = getData($result)[0]->studiensemester_kurzbz; } $viewData = array( @@ -95,24 +89,17 @@ class reviewAnrechnungUebersicht extends Auth_Controller { return $this->outputJsonError('Fehler beim Übertragen der Daten.'); } - - // Get statusbezeichnung for 'inProgressDP' - $this->AnrechnungstatusModel->addSelect('bezeichnung_mehrsprachig'); - $inProgressDP = getData($this->AnrechnungstatusModel->load('inProgressDP'))[0]; - $inProgressDP = getUserLanguage() == 'German' - ? $inProgressDP->bezeichnung_mehrsprachig[0] - : $inProgressDP->bezeichnung_mehrsprachig[1]; foreach ($data as $item) { // Approve Anrechnung - if(getData($this->anrechnunglib->recommendAnrechnung($item['anrechnung_id']))) + if($this->anrechnunglib->recommendAnrechnung($item['anrechnung_id'])) { $json[]= array( 'anrechnung_id' => $item['anrechnung_id'], 'empfehlung_anrechnung' => 'true', 'status_kurzbz' => self::ANRECHNUNGSTATUS_PROGRESSED_BY_STGL, - 'status_bezeichnung' => $inProgressDP + 'status_bezeichnung' => $this->anrechnunglib->getStatusbezeichnung(self::ANRECHNUNGSTATUS_PROGRESSED_BY_STGL) ); } } @@ -133,7 +120,7 @@ class reviewAnrechnungUebersicht extends Auth_Controller } else { - return $this->outputJsonError('Empfehlungen wurden nicht durchgeführt'); + return $this->outputJsonError($this->p->t('ui', 'errorNichtAusgefuehrt')); } } @@ -149,24 +136,16 @@ class reviewAnrechnungUebersicht extends Auth_Controller return $this->outputJsonError('Fehler beim Übertragen der Daten.'); } - // Get statusbezeichnung for 'inProgressDP' - $this->AnrechnungstatusModel->addSelect('bezeichnung_mehrsprachig'); - $inProgressDP = getData($this->AnrechnungstatusModel->load('inProgressDP'))[0]; - $inProgressDP = getUserLanguage() == 'German' - ? $inProgressDP->bezeichnung_mehrsprachig[0] - : $inProgressDP->bezeichnung_mehrsprachig[1]; - foreach ($data as $item) { // Approve Anrechnung - if(getData($this->anrechnunglib - ->dontRecommendAnrechnung($item['anrechnung_id'], $item['begruendung']))) + if($this->anrechnunglib->dontRecommendAnrechnung($item['anrechnung_id'], $item['begruendung'])) { $json[]= array( 'anrechnung_id' => $item['anrechnung_id'], 'empfehlung_anrechnung' => 'false', 'status_kurzbz' => self::ANRECHNUNGSTATUS_PROGRESSED_BY_STGL, - 'status_bezeichnung' => $inProgressDP + 'status_bezeichnung' => $this->anrechnunglib->getStatusbezeichnung(self::ANRECHNUNGSTATUS_PROGRESSED_BY_STGL) ); } } @@ -184,7 +163,7 @@ class reviewAnrechnungUebersicht extends Auth_Controller } else { - return $this->outputJsonError('Empfehlungen wurden nicht durchgeführt'); + return $this->outputJsonError($this->p->t('ui', 'errorNichtAusgefuehrt')); } } @@ -203,7 +182,11 @@ class reviewAnrechnungUebersicht extends Auth_Controller // Check if user is entitled to read dms doc self::_checkIfEntitledToReadDMSDoc($dms_id); - $this->dmslib->download($dms_id); + // Set filename to be used on downlaod + $filename = $this->anrechnunglib->setFilenameOnDownload($dms_id); + + // Download file + $this->dmslib->download($dms_id, $filename); } diff --git a/application/controllers/system/FAS_UDF.php b/application/controllers/system/FAS_UDF.php index febe266c7..ecaa44393 100644 --- a/application/controllers/system/FAS_UDF.php +++ b/application/controllers/system/FAS_UDF.php @@ -31,7 +31,7 @@ class FAS_UDF extends Auth_Controller if (isset($person_id) && is_numeric($person_id)) { - if ($this->PersonModel->hasUDF()) + if ($this->PersonModel->udfsExistAndDefined()) { $personUdfs = $this->PersonModel->getUDFs($person_id); $data['person_id'] = $person_id; @@ -41,7 +41,7 @@ class FAS_UDF extends Auth_Controller if (isset($prestudent_id) && is_numeric($prestudent_id)) { - if ($this->PrestudentModel->hasUDF()) + if ($this->PrestudentModel->udfsExistAndDefined()) { $prestudentUdfs = $this->PrestudentModel->getUDFs($prestudent_id); $data['prestudent_id'] = $prestudent_id; diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 44a1cf327..9e68c5cb8 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -124,20 +124,20 @@ class InfoCenter extends Auth_Controller 'saveAbsage' => 'infocenter:rw', 'saveFreigabe' => 'infocenter:rw', 'getNotiz' => 'infocenter:r', - 'saveNotiz' => 'infocenter:rw', + 'saveNotiz' => array('infocenter:rw', 'lehre/zgvpruefung:rw'), 'updateNotiz' => 'infocenter:rw', 'reloadZgvPruefungen' => 'infocenter:r', 'reloadMessages' => 'infocenter:r', 'reloadDoks' => 'infocenter:r', - 'reloadNotizen' => 'infocenter:r', + 'reloadNotizen' => array('infocenter:r', 'lehre/zgvpruefung:r'), 'reloadLogs' => 'infocenter:r', - 'outputAkteContent' => 'infocenter:r', - 'getPostponeDate' => 'infocenter:r', + 'outputAkteContent' => array('infocenter:r', 'lehre/zgvpruefung:r'), + 'getPostponeDate' => array('infocenter:r', 'lehre/zgvpruefung:r'), 'park' => 'infocenter:rw', 'unpark' => 'infocenter:rw', 'setOnHold' => 'infocenter:rw', - 'removeOnHold' => 'infocenter:rw', - 'getStudienjahrEnd' => 'infocenter:r', + 'removeOnHold' => array('infocenter:rw', 'lehre/zgvpruefung:rw'), + 'getStudienjahrEnd' => array('infocenter:r', 'lehre/zgvpruefung:r'), 'setNavigationMenuArrayJson' => 'infocenter:r', 'getAbsageData' => 'infocenter:r', 'saveAbsageForAll' => 'infocenter:rw' @@ -297,6 +297,13 @@ class InfoCenter extends Auth_Controller } $persondata = $this->_loadPersonData($person_id); + + $checkPerson = $this->PersonModel->checkDuplicate($person_id); + + if (isError($checkPerson)) show_error(getError($checkPerson)); + + $duplicate = array('duplicated' => getData($checkPerson)); + $prestudentdata = $this->_loadPrestudentData($person_id); $this->DokumentModel->addOrder('bezeichnung'); @@ -305,7 +312,8 @@ class InfoCenter extends Auth_Controller $data = array_merge( $persondata, $prestudentdata, - $dokumentdata + $dokumentdata, + $duplicate ); $data[self::FHC_CONTROLLER_ID] = $this->getControllerId(); @@ -734,7 +742,7 @@ class InfoCenter extends Auth_Controller if (hasData($lastStatus) && hasData($statusgrresult)) { - //check if still Interessent + //check if still Interessent, Bewerber or Wartender if ($lastStatus->retval[0]->status_kurzbz === self::INTERESSENTSTATUS || $lastStatus->retval[0]->status_kurzbz === self::BEWERBERSTATUS || $lastStatus->retval[0]->status_kurzbz === self::WARTENDER) @@ -2134,17 +2142,18 @@ class InfoCenter extends Auth_Controller { $statusgrund = $this->input->post('statusgrund'); $studiengang = $this->input->post('studiengang'); + $abgeschickt = $this->input->post('abgeschickt'); $personen = $this->input->post('personen'); $studienSemester = $this->variablelib->getVar('infocenter_studiensemester'); - if ($statusgrund === 'null' || $studiengang === 'null' || empty($personen)) - $this->terminateWithJsonError("Bitte Statusgrund, Studiengang und Personen auswählen."); + if ($statusgrund === 'null' || $studiengang === 'null' || $abgeschickt === 'null' || empty($personen)) + $this->terminateWithJsonError("Bitte füllen Sie alle Felder aus"); foreach($personen as $person) { - $prestudent = $this->PrestudentModel->getPrestudentByStudiengangAndPerson($studiengang, $person, $studienSemester); + $prestudent = $this->PrestudentModel->getPrestudentByStudiengangAndPerson($studiengang, $person, $studienSemester, $abgeschickt); - if(!hasData($prestudent)) + if (!hasData($prestudent)) continue; $prestudentData = getData($prestudent); diff --git a/application/controllers/system/issues/Issues.php b/application/controllers/system/issues/Issues.php new file mode 100644 index 000000000..f942b50d9 --- /dev/null +++ b/application/controllers/system/issues/Issues.php @@ -0,0 +1,142 @@ + array(self::BERECHTIGUNG_KURZBZ.':r'), + 'changeIssueStatus' => array(self::BERECHTIGUNG_KURZBZ.':rw') + ) + ); + + // Load libraries + $this->load->library('IssuesLib'); + $this->load->library('PermissionLib'); + $this->load->library('WidgetLib'); + + $this->loadPhrases( + array( + 'global', + 'ui', + 'filter' + ) + ); + + // Load models + $this->load->model('person/Benutzerfunktion_model', 'BenutzerfunktionModel'); + $this->load->model('organisation/Organisationseinheit_model', 'OrganisationseinheitModel'); + + $this->_setAuthUID(); // sets property uid + } + + public function index() + { + $oes_for_issues = $this->_getOesForIssues(); + + $this->load->view( + 'system/issues/issues', + $oes_for_issues + ); + } + + /** + * Initializes issues status change + */ + public function changeIssueStatus() + { + $issue_ids = $this->input->post('issue_ids'); + $status_kurzbz = $this->input->post('status_kurzbz'); + $verarbeitetvon = $this->_uid; + + $errors = array(); + foreach ($issue_ids as $issue_id) + { + $issueRes = $this->issueslib->changeIssueStatus($issue_id, $status_kurzbz, $verarbeitetvon); + + if (isError($issueRes)) + $errors[] = getError($issueRes); + } + + if (!isEmptyArray($errors)) + $this->outputJsonError(implode(", ", $errors)); + else + $this->outputJsonSuccess("Status erfolgreich aktualisiert"); + } + + /** + * Retrieve the UID of the logged user and checks if it is valid + */ + private function _setAuthUID() + { + $this->_uid = getAuthUID(); + + if (!$this->_uid) show_error('User authentification failed'); + } + + /** + * Gets oes of logged in user, which are needed to display issues of the user. + * This includes oes assigned by a funktio and as the issue permission. + * @return array + */ + private function _getOesForIssues() + { + // get oes of uid for which there is a current funktion + $all_funktionen_oe_kurzbz = array(); + $oe_kurzbz_for_funktion = array(); + $benutzerfunktionRes = $this->BenutzerfunktionModel->getBenutzerFunktionByUid($this->_uid, null, date('Y-m-d'), date('Y-m-d')); + + if (isError($benutzerfunktionRes)) + show_error(getError($benutzerfunktionRes)); + + if (hasData($benutzerfunktionRes)) + { + foreach (getData($benutzerfunktionRes) as $benutzerfunktion) + { + $all_funktionen_oe_kurzbz[$benutzerfunktion->oe_kurzbz][] = $benutzerfunktion->funktion_kurzbz; + + // separate oes for the funktion needed for displaying issues + if ($benutzerfunktion->funktion_kurzbz == self::FUNKTION_KURZBZ) + { + $oe_kurzbz_for_funktion[] = $benutzerfunktion->oe_kurzbz; + + // permission also for all oes under the oe for which funktion is assigend + $childOesFunktionRes = $this->OrganisationseinheitModel->getChilds($benutzerfunktion->oe_kurzbz); + + if (isError($childOesFunktionRes)) + show_error(getError($childOesFunktionRes)); + + if (hasData($childOesFunktionRes)) + { + $childOesFunktion = getData($childOesFunktionRes); + + foreach ($childOesFunktion as $childOeFunktion) + { + if (!in_array($childOeFunktion->oe_kurzbz, $oe_kurzbz_for_funktion)) + $oe_kurzbz_for_funktion[] = $childOeFunktion->oe_kurzbz; + } + } + } + } + } + + // add oes for which there is the "manage issues" Berechtigung + if (!$oe_kurzbz_berechtigt = $this->permissionlib->getOE_isEntitledFor(self::BERECHTIGUNG_KURZBZ)) + show_error('Keine Berechtigung oder Fehler bei Berechtigungsprüfung'); + + $all_oe_kurzbz_berechtigt = array_unique(array_merge($oe_kurzbz_for_funktion, $oe_kurzbz_berechtigt)); + + return array( + 'all_funktionen_oe_kurzbz' => $all_funktionen_oe_kurzbz, + 'all_oe_kurzbz_berechtigt' => $all_oe_kurzbz_berechtigt + ); + } +} diff --git a/application/controllers/widgets/Filters.php b/application/controllers/widgets/Filters.php index 748272f09..e87b2d331 100644 --- a/application/controllers/widgets/Filters.php +++ b/application/controllers/widgets/Filters.php @@ -211,7 +211,7 @@ class Filters extends FHC_Controller public function setNavigationMenu() { // Generates the filters structure array - $filterMenu = $this->filterwidgetlib->generateFilterMenu($this->input->get(FilterWidgetLib::NAVIGATION_PAGE)); + $this->filterwidgetlib->generateFilterMenu($this->input->get(FilterWidgetLib::NAVIGATION_PAGE)); $this->outputJsonSuccess('Success'); } @@ -271,3 +271,4 @@ class Filters extends FHC_Controller } } } + diff --git a/application/controllers/widgets/UDF.php b/application/controllers/widgets/UDF.php index 5b4c45776..26c30293c 100644 --- a/application/controllers/widgets/UDF.php +++ b/application/controllers/widgets/UDF.php @@ -26,9 +26,6 @@ class UDF extends FHC_Controller // Loads the UDFLib with HTTP GET/POST parameters $this->_loadUDFLib(); - - // Checks if the caller is allow to use this UDF widget - $this->_isAllowed(); } //------------------------------------------------------------------------------------------------------------------ @@ -39,7 +36,6 @@ class UDF extends FHC_Controller */ public function saveUDFs() { - $udfUniqueId = $this->input->post(self::UDF_UNIQUE_ID); $udfs = $this->input->post(UDFLib::UDFS_ARG_NAME); if (!isEmptyString($udfs)) @@ -47,7 +43,7 @@ class UDF extends FHC_Controller $jsonDecodedUDF = json_decode($udfs); if ($jsonDecodedUDF != null) { - $this->outputJson($this->udflib->saveUDFs($udfUniqueId, $jsonDecodedUDF)); + $this->outputJson($this->udflib->saveUDFs($jsonDecodedUDF)); } else { @@ -63,17 +59,6 @@ class UDF extends FHC_Controller //------------------------------------------------------------------------------------------------------------------ // Private methods - /** - * Checks if the user is allowed to use this UDFWidget - */ - private function _isAllowed() - { - if (!$this->udflib->isAllowed()) - { - $this->terminateWithJsonError('You are not allowed to access to this content'); - } - } - /** * Loads the UDFLib with the UDF_UNIQUE_ID parameter * If the parameter UDF_UNIQUE_ID is not given then the execution of the controller is terminated and @@ -105,3 +90,4 @@ class UDF extends FHC_Controller } } } + diff --git a/application/core/API_Controller.php b/application/core/API_Controller.php new file mode 100644 index 000000000..db78ac6ad --- /dev/null +++ b/application/core/API_Controller.php @@ -0,0 +1,124 @@ +_requiredPermissions = $requiredPermissions; + + // Loads LogLib with different debug trace levels to get data of the job that extends this class + // It also specify parameters to set database fields + $this->load->library('LogLib', array( + 'classIndex' => 5, + 'functionIndex' => 5, + 'lineIndex' => 4, + 'dbLogType' => 'API', // required + 'dbExecuteUser' => 'RESTful API' + )); + } + + /** + * This method is automatically called by CodeIgniter after the execution of the constructor is completed + * - Cheks if the Authlib was loaded, if not it means that the authentication failed + * - Loads the permsission lib and calls permissionlib->isEntitled + * - Checks if the caller is allowed to access to this content with the given permissions + * if it is not allowed will set the HTTP header with code 401 + * - Calls the parent (REST_Controller) _remap method to performs other checks + * NOTE: this methods override the parent method!!! + */ + public function _remap($object_called, $arguments = []) + { + if (isset($this->authlib)) // if set then the authentication is ok + { + // Loads permission lib + $this->load->library('PermissionLib'); + + // Cheks if the user has the permission to call a method + if (!$this->permissionlib->isEntitled($this->_requiredPermissions, $this->router->method)) + { + // If not... + $this->response(error('You are not allowed to access to this content'), REST_Controller::HTTP_UNAUTHORIZED); + } + } + + // Finally calls the parent _remap to perform other checks + parent::_remap($object_called, $arguments); + } + + //------------------------------------------------------------------------------------------------------------------ + // Protected methods + + /** + * Writes a REST call info log + */ + protected function logInfo($response, $parameters = null) + { + $this->_log(LogLib::INFO, 'RESTful API info', $response, $parameters); + } + + /** + * Writes a REST call debug log + */ + protected function logDebug($response, $parameters = null) + { + $this->_log(LogLib::DEBUG, 'RESTful API debug', $response, $parameters); + } + + /** + * Writes a REST call warning log + */ + protected function logWarning($response, $parameters = null) + { + $this->_log(LogLib::WARNING, 'RESTful API warning', $response, $parameters); + } + + /** + * Writes a REST call error log + */ + protected function logError($response, $parameters = null) + { + $this->_log(LogLib::ERROR, 'RESTful API error', $response, $parameters); + } + + //------------------------------------------------------------------------------------------------------------------ + // Private methods + + /** + * Writes a log to database + */ + private function _log($level, $requestId, $response, $parameters) + { + $data = new stdClass(); + + $data->response = $response; + if ($parameters != null) $data->parameters = $parameters; + + switch($level) + { + case LogLib::INFO: + $this->loglib->logInfoDB($requestId, json_encode(success($data, LogLib::INFO))); + break; + case LogLib::DEBUG: + $this->loglib->logDebugDB($requestId, json_encode(success($data, LogLib::DEBUG))); + break; + case LogLib::WARNING: + $this->loglib->logWarningDB($requestId, json_encode(error($data, LogLib::WARNING))); + break; + case LogLib::ERROR: + $this->loglib->logErrorDB($requestId, json_encode(error($data, LogLib::ERROR))); + break; + } + } +} diff --git a/application/core/APIv1_Controller.php b/application/core/APIv1_Controller.php deleted file mode 100644 index 14b4b626d..000000000 --- a/application/core/APIv1_Controller.php +++ /dev/null @@ -1,51 +0,0 @@ -_requiredPermissions = $requiredPermissions; - - log_message('debug', 'Called API: '.$_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING']); - } - - /** - * This method is automatically called by CodeIgniter after the execution of the constructor is completed - * - Cheks if the Authlib was loaded, if not it means that the authentication failed - * - Loads the permsission lib and calls permissionlib->isEntitled - * - Checks if the caller is allowed to access to this content with the given permissions - * if it is not allowed will set the HTTP header with code 401 - * - Calls the parent (REST_Controller) _remap method to performs other checks - * NOTE: this methods override the parent method!!! - */ - public function _remap($object_called, $arguments = []) - { - if (isset($this->authlib)) // if set then the authentication is ok - { - // Loads permission lib - $this->load->library('PermissionLib'); - - // Cheks if the user has the permission to call a method - if (!$this->permissionlib->isEntitled($this->_requiredPermissions, $this->router->method)) - { - // If not... - $this->response(error('You are not allowed to access to this content'), REST_Controller::HTTP_UNAUTHORIZED); - } - } - - // Finally calls the parent _remap to perform other checks - parent::_remap($object_called, $arguments); - } -} diff --git a/application/core/DB_Model.php b/application/core/DB_Model.php index 4b89ae5bf..4e555be6c 100644 --- a/application/core/DB_Model.php +++ b/application/core/DB_Model.php @@ -86,7 +86,7 @@ class DB_Model extends CI_Model if (is_null($this->dbTable)) return error('The given database table name is not valid', EXIT_MODEL); // If this table has UDF and the validation of them is ok - if (isError($validate = $this->_manageUDFs($data, $this->dbTable))) return $validate; + if (isError($validate = $this->_prepareUDFsWrite($data, $this->dbTable))) return $validate; // DB-INSERT $insert = $this->db->insert($this->dbTable, $data); @@ -137,7 +137,7 @@ class DB_Model extends CI_Model if (is_null($this->dbTable)) return error('The given database table name is not valid', EXIT_MODEL); // If this table has UDF and the validation of them is ok - if (isError($validate = $this->_manageUDFs($data, $this->dbTable, $id))) return $validate; + if (isError($validate = $this->_prepareUDFsWrite($data, $this->dbTable, $id))) return $validate; $tmpId = $id; @@ -670,6 +670,7 @@ class DB_Model extends CI_Model /** * Returns all the UDF contained in this table ($dbTable) * If no UDF are present, an empty array will be returned + * NOTE: only the UDFs that the logged user is allowed to read are loaded by this method */ public function getUDFs($id, $udfName = null) { @@ -700,9 +701,9 @@ class DB_Model extends CI_Model } /** - * Checks if this table has the field udf_values + * Checks if this table has the field udf_values and if there is a UDF definition for this table */ - public function hasUDF() + public function udfsExistAndDefined() { if ($this->fieldExists(UDFLib::COLUMN_NAME)) { @@ -844,25 +845,25 @@ class DB_Model extends CI_Model } /** - * Wrapper method for UDFLib->manageUDFs + * Wrapper method for UDFLib->prepareUDFsWrite */ - private function _manageUDFs(&$data, $schemaAndTable, $id = null) + private function _prepareUDFsWrite(&$data, $schemaAndTable, $id = null) { - $manageUDFs = success(); + $prepareUDFsWrite = success(); - if ($this->hasUDF()) + if ($this->udfsExistAndDefined()) { if ($id != null) { - $manageUDFs = $this->udflib->manageUDFs($data, $this->dbTable, $this->getUDFs($id)); + $prepareUDFsWrite = $this->udflib->prepareUDFsWrite($data, $this->dbTable, $this->_getUDFsNoPerms($id)); } else { - $manageUDFs = $this->udflib->manageUDFs($data, $this->dbTable); + $prepareUDFsWrite = $this->udflib->prepareUDFsWrite($data, $this->dbTable); } } - return $manageUDFs; + return $prepareUDFsWrite; } /** @@ -874,9 +875,10 @@ class DB_Model extends CI_Model */ private function _toPhp($result) { + $udfs = false; // if UDFs are inside the given result set $toPhp = $result; // if there is nothing to convert then return the result from DB - // If it's an object its fields will be parsed to find booleans and arrays types + // If it's an object its fields will be parsed to find booleans, arrays and UDFs types if (is_object($result)) { $toBeConverterdArray = array(); // Fields to be converted @@ -884,40 +886,48 @@ class DB_Model extends CI_Model $this->executedQueryMetaData = $result->field_data(); // Fields information $this->executedQueryListFields = $result->list_fields(); // List of the retrieved fields - for ($i = 0; $i < count($this->executedQueryMetaData); $i++) // Looking for booleans and arrays + // Looking for booleans, arrays and UDFs + foreach ($this->executedQueryMetaData as $eqmd) { // If array type, boolean type OR a UDF - if (strpos($this->executedQueryMetaData[$i]->type, DB_Model::PGSQL_ARRAY_TYPE) !== false - || $this->executedQueryMetaData[$i]->type == DB_Model::PGSQL_BOOLEAN_TYPE - || $this->udflib->isUDFColumn($this->executedQueryMetaData[$i]->name, $this->executedQueryMetaData[$i]->type)) + if (strpos($eqmd->type, DB_Model::PGSQL_ARRAY_TYPE) !== false + || $eqmd->type == DB_Model::PGSQL_BOOLEAN_TYPE + || $this->udflib->isUDFColumn($eqmd->name, $eqmd->type)) { - // Name and type of the field to be converted - $toBeConverted = new stdClass(); - // Set the type of the field to be converted - $toBeConverted->type = $this->executedQueryMetaData[$i]->type; - // Set the name of the field to be converted - $toBeConverted->name = $this->executedQueryMetaData[$i]->name; - // Add the field to be converted to $toBeConverterdArray - array_push($toBeConverterdArray, $toBeConverted); + // If UDFs are inside this result set + if ($this->udflib->isUDFColumn($eqmd->name, $eqmd->type)) + { + $udfs = true; + } + else // all the other cases + { + // Name and type of the field to be converted + $toBeConverted = new stdClass(); + // Set the type of the field to be converted + $toBeConverted->type = $eqmd->type; + // Set the name of the field to be converted + $toBeConverted->name = $eqmd->name; + // Add the field to be converted to $toBeConverterdArray + array_push($toBeConverterdArray, $toBeConverted); + } } } - // If there is something to convert, otherwhise don't lose time - if (count($toBeConverterdArray) > 0) - { - // Returns the array of objects, each of them represents a DB record - $resultsArray = $result->result(); - // Looping on results - for ($i = 0; $i < count($resultsArray); $i++) - { - // Single element - $resultElement = $resultsArray[$i]; - // Looping on fields to be converted - for ($j = 0; $j < count($toBeConverterdArray); $j++) - { - // Single element - $toBeConverted = $toBeConverterdArray[$j]; + // Returns the array of objects, each of them represents a DB record + $resultsArray = $result->result(); + // If in this result set there are UDFs then prepare them + if ($udfs) $this->udflib->prepareUDFsRead($resultsArray, $this->dbTable); + + // If there is something to convert, otherwhise don't waste time + if (!isEmptyArray($toBeConverterdArray)) + { + // Looping on results + foreach ($resultsArray as $resultElement) + { + // Looping on fields to be converted + foreach ($toBeConverterdArray as $toBeConverted) + { // Array type if (strpos($toBeConverted->type, DB_Model::PGSQL_ARRAY_TYPE) !== false) { @@ -931,30 +941,12 @@ class DB_Model extends CI_Model { $resultElement->{$toBeConverted->name} = $this->pgBoolPhp($resultElement->{$toBeConverted->name}); } - // UDF - elseif ($this->udflib->isUDFColumn($toBeConverted->name, $toBeConverted->type)) - { - $jsonValues = json_decode($resultElement->{$toBeConverted->name}); // decode UDFs values - if ($jsonValues != null) // if decode is ok - { - // For every UDF - foreach ($jsonValues as $key => $value) - { - $resultElement->{$key} = $value; // create a new element called like the UDF - } - } - unset($resultElement->{UDFLib::COLUMN_NAME}); // remove udf_values from the response - } } } - // Returns DB data as an array - $toPhp = $resultsArray; - } - // And returns DB data as an array - else - { - $toPhp = $result->result(); } + + // Returns DB data as an array + $toPhp = $resultsArray; } return $toPhp; @@ -998,4 +990,48 @@ class DB_Model extends CI_Model { if ($this->debugMode) $this->loglib->logDebug($this->db->last_query()); } + + /** + * Returns all the UDF contained in this table ($dbTable) + * If no UDF are present, an empty array will be returned + * NOTE: it returns all the UDFs, does _not_ check the permissions + */ + private function _getUDFsNoPerms($id) + { + $udfs = array(); + + $this->db->select(UDFLib::COLUMN_NAME, true); // get only the UDF column + + // Primary key management + $tmpId = $id; + + // Check for composite Primary Key + if (is_array($id)) + { + if (isset($id[0])) + { + $tmpId = $this->_arrayCombine($this->pk, $id); + } + } + elseif ($id != null) + { + $tmpId = array($this->pk => $id); + } + + // Read the record from the table + $result = $this->db->get_where($this->dbTable, $tmpId); + + // If was a success and there are data + if ($result && count($result->result()) == 1) + { + // Get the UDF column and decode it from JSON + $jsonValues = json_decode($result->result()[0]->{UDFLib::COLUMN_NAME}); + + // If the JSON convertion was fine convert the object to an array + if ($jsonValues != null) $udfs = get_object_vars($jsonValues); + } + + return $udfs; + } } + diff --git a/application/core/FHC_Controller.php b/application/core/FHC_Controller.php index 93c324b21..ce8748c5a 100644 --- a/application/core/FHC_Controller.php +++ b/application/core/FHC_Controller.php @@ -132,6 +132,32 @@ abstract class FHC_Controller extends CI_Controller { $this->output->set_content_type('application/json')->set_output(json_encode($mixed)); } + + protected function outputFile($fileObj) + { + if (file_exists($fileObj->file)) + { + $finfo = new finfo(FILEINFO_MIME); + + header('Content-Description: File Transfer'); + header('Content-Type: '. $finfo->file($fileObj->file)); + header('Expires: 0'); + header('Cache-Control: must-revalidate'); + header('Pragma: public'); + header('Content-Length: ' . filesize($fileObj->file)); + + if (isset($fileObj->disposition) && ($fileObj->disposition == 'inline' || $fileObj->disposition == 'attachment')) + { + header('Content-Disposition: '. $fileObj->disposition. '; filename="'. $fileObj->name. '"'); + } + + readfile($fileObj->file); + + exit; + } + + return false; + } //------------------------------------------------------------------------------------------------------------------ // Private methods diff --git a/application/core/JQW_Controller.php b/application/core/JQW_Controller.php index 1b78a2a70..1bc4cd346 100644 --- a/application/core/JQW_Controller.php +++ b/application/core/JQW_Controller.php @@ -49,10 +49,20 @@ abstract class JQW_Controller extends JOB_Controller /** * To get the oldest added job using the given job type + * NOTE: just a wrapper */ protected function getOldestJob($type) { - $jobs = $this->jobsqueuelib->getOldestJob($type); + return $this->getOldestJobs($type, 1); + } + + /** + * To get the oldest added jobs using the given job type + * It is eventually specify the maximum amount of jobs to be retrieved + */ + protected function getOldestJobs($type, $maxAmount) + { + $jobs = $this->jobsqueuelib->getOldestJobs($type, $maxAmount); // If an error occurred then log it in database if (isError($jobs)) $this->logError(getError($jobs), $type); @@ -60,6 +70,19 @@ abstract class JQW_Controller extends JOB_Controller return $jobs; } + /** + * To get all the jobs specified by the given parameters + */ + protected function getJobsByTypeStatus($type, $status) + { + $jobs = $this->jobsqueuelib->getJobsByTypeStatus($type, $status); + + // If an error occurred then log it in database + if (isError($jobs)) $this->logError(getError($jobs), array($type, $status)); + + return $jobs; + } + /** * To get all the jobs specified by the given parameters */ @@ -131,12 +154,7 @@ abstract class JQW_Controller extends JOB_Controller */ protected function generateJobs($status, $input) { - $job = new stdClass(); - - $job->{JobsQueueLib::PROPERTY_STATUS} = $status; - $job->{JobsQueueLib::PROPERTY_INPUT} = $input; - - return array($job); + return JobsQueueLib::generateJobs($status, $input); } } diff --git a/application/libraries/AnrechnungLib.php b/application/libraries/AnrechnungLib.php index c32b8a91c..3bec62dce 100644 --- a/application/libraries/AnrechnungLib.php +++ b/application/libraries/AnrechnungLib.php @@ -12,6 +12,7 @@ class AnrechnungLib const ANRECHNUNG_NOTIZTITEL_NOTIZ_BY_LEKTOR = 'AnrechnungNotizLektor'; const ANRECHNUNG_NOTIZTITEL_NOTIZ_BY_STGL = 'AnrechnungNotizSTGL'; + const ANRECHNUNG_NOTIZTITEL_EMPFEHLUNGSNOTIZ_BY_STGL = 'AnrechnungEmpfehlungsnotizSTGL'; public function __construct() { @@ -23,6 +24,10 @@ class AnrechnungLib $this->ci->load->model('organisation/Studiengang_model', 'StudiengangModel'); $this->ci->load->model('crm/Student_model', 'StudentModel'); $this->ci->load->model('content/DmsVersion_model', 'DmsVersionModel'); + $this->ci->load->model('crm/Prestudent_model', 'PrestudentModel'); + $this->ci->load->model('person/Notiz_model', 'NotizModel'); + + $this->ci->load->library('DmsLib'); } /** @@ -32,16 +37,19 @@ class AnrechnungLib * @param $lv_id * @return StdClass */ - public function getAntragData($uid, $studiensemester_kurzbz, $lv_id) + public function getAntragData($prestudent_id, $studiensemester_kurzbz, $lv_id) { $antrag_data = new StdClass(); - + + // Get students UID. + $uid = $this->ci->StudentModel->getUID($prestudent_id); + // Get lehrveranstaltung data. Break, if course is not assigned to student. if(!$lv = getData($this->ci->LehrveranstaltungModel->getLvByStudent($uid, $studiensemester_kurzbz, $lv_id))[0]) { show_error('You are not assigned to this course yet.'); } - + // Get the students personal data if (!$person = getData($this->ci->PersonModel->getByUid($uid))[0]) { @@ -61,12 +69,18 @@ class AnrechnungLib } // Get lectors of lehrveranstaltung - $antrag_data->lektoren = array(); - if (!$lv_lektoren = getData($this->ci->LehrveranstaltungModel->getLecturersByLv($studiensemester_kurzbz, $lv_id))) + $result = $this->ci->LehrveranstaltungModel->getLecturersByLv($studiensemester_kurzbz, $lv_id); + if (isError($result)) { show_error('Failed loading course lectors.'); } - + + $lv_lektoren_arr = hasData($result) ? getData($result) : array(); + + // Get latest ZGV + $result = $this->ci->PrestudentModel->getLatestZGVBezeichnung($prestudent_id); + $latest_zgv_bezeichnung = hasData($result) ? getData($result)[0]->bezeichnung : ''; + // Set the given studiensemester $antrag_data->lv_id = $lv_id; $antrag_data->lv_bezeichnung = $lv->bezeichnung; @@ -76,7 +90,8 @@ class AnrechnungLib $antrag_data->nachname = $person->nachname; $antrag_data->matrikelnr = $student->matrikelnr; $antrag_data->stg_bezeichnung = $studiengang->bezeichnung; - $antrag_data->lektoren = $lv_lektoren; + $antrag_data->lektoren = $lv_lektoren_arr; + $antrag_data->zgv = $latest_zgv_bezeichnung; return $antrag_data; } @@ -107,8 +122,12 @@ class AnrechnungLib { $anrechnung_data = $this->_setAnrechnungDataObject($anrechnung); } + else + { + show_error('No Anrechnung with this anrechnung_id.'); + } - return success($anrechnung_data); + return $anrechnung_data; } @@ -153,7 +172,7 @@ class AnrechnungLib $anrechnung_data = $this->_setAnrechnungDataObject($anrechnung); } - return success($anrechnung_data); + return $anrechnung_data; } /** @@ -171,8 +190,8 @@ class AnrechnungLib $this->ci->AnrechnungModel->addSelect('tbl_benutzer.uid, tbl_prestudent.prestudent_id, tbl_person.person_id, tbl_anrechnung.studiensemester_kurzbz, vorname, nachname, geschlecht, tbl_lehrveranstaltung.bezeichnung AS "lv_bezeichnung"'); $this->ci->AnrechnungModel->addJoin('public.tbl_prestudent', 'prestudent_id'); $this->ci->AnrechnungModel->addJoin('public.tbl_student', 'prestudent_id'); - $this->ci->AnrechnungModel->addJoin('public.tbl_benutzer', 'uid=student_uid'); - $this->ci->AnrechnungModel->addJoin('public.tbl_person', 'tbl_benutzer.person_id=tbl_person.person_id'); + $this->ci->AnrechnungModel->addJoin('public.tbl_benutzer', 'uid = student_uid'); + $this->ci->AnrechnungModel->addJoin('public.tbl_person', 'tbl_benutzer.person_id = tbl_person.person_id'); $this->ci->AnrechnungModel->addJoin('lehre.tbl_lehrveranstaltung', 'lehrveranstaltung_id'); $result = $this->ci->AnrechnungModel->load($anrechnung_id); @@ -207,28 +226,53 @@ class AnrechnungLib $empfehlung_data->empfehlung = null; $empfehlung_data->empfehlung_von = '-'; $empfehlung_data->empfehlung_am = '-'; - $empfehlung_data->empfehlung_angefordert_am = '-'; - $empfehlung_data->notiz = ''; // Begruendung, if not recommended - + $empfehlung_data->empfehlungsanfrageAm = '-'; + $empfehlung_data->empfehlungsanfrageAn = '-'; + $empfehlung_data->begruendung = '-'; // Begruendung, if not recommended + $empfehlung_data->notiz_id = ''; // Empfehlungsnotiz from STGL + $empfehlung_data->notiz = ''; // Empfehlungsnotiz from STGL + if(!$anrechnung = getData($this->ci->AnrechnungModel->load($anrechnung_id))[0]) { show_error('Failed loading Anrechnung'); } + + // Get Empfehlungsnotiz + $result = $this->ci->NotizModel->getNotizByAnrechnung( + $anrechnung_id, + self::ANRECHNUNG_NOTIZTITEL_EMPFEHLUNGSNOTIZ_BY_STGL + ); + + if ($notiz = getData($result)[0]) + { + $empfehlung_data->notiz_id = $notiz->notiz_id; + $empfehlung_data->notiz = $notiz->text; + } // Get date, where recommendation was last requested $result = $this->ci->AnrechnungModel->getLastAnrechnungstatus( $anrechnung_id, self::ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR // when STLG asks for recommendation, status is set to in progress lektor ); - if ($result = getData($result)[0]) + + // If request for recommendation exists + if (hasData($result)) { - $empfehlung_data->empfehlung_angefordert_am = (new DateTime($result->insertamum))->format('d.m.Y'); + $empfehlung_data->empfehlungsanfrageAm = (new DateTime($result->retval[0]->insertamum))->format('d.m.Y'); + + // Get lectors who received request for recommendation + $lector_arr = self::getLectors($anrechnung_id); + + if (!isEmptyArray($lector_arr)) + { + $empfehlung_data->empfehlungsanfrageAn = implode(', ', array_column($lector_arr, 'fullname')); + } } if (is_null($anrechnung->empfehlung_anrechnung)) { - return success($empfehlung_data); + return $empfehlung_data; } // If Empfehlung is true or false @@ -260,15 +304,14 @@ class AnrechnungLib if (!$anrechnung->empfehlung_anrechnung) { // Get Ablehnungsbegruendung (only set, if Anrechnung was not recommended yet) - $this->ci->load->model('person/Notiz_model', 'NotizModel'); $result = $this->ci->NotizModel->getNotizByAnrechnung($anrechnung_id, self::ANRECHNUNG_NOTIZTITEL_NOTIZ_BY_LEKTOR); if ($notiz = getData($result)[0]) { - $empfehlung_data->notiz = $notiz->text; + $empfehlung_data->begruendung = $notiz->text; } } - return success($empfehlung_data); + return $empfehlung_data; } @@ -300,9 +343,10 @@ class AnrechnungLib // Get date of approvement or rejection $result = $this->ci->AnrechnungModel->getApprovedOrRejected($anrechnung_id); + // If no approved or rejected Anrechnung exist, return basic genehmigung data object if (!$result = getData($result)[0]) { - return success($genehmigung_data); + return $genehmigung_data; } @@ -331,9 +375,30 @@ class AnrechnungLib } } - return success($genehmigung_data); + return $genehmigung_data; } + + /** + * Get Anrechnungstatusbezeichnung of given status_kurzbz in users language. + * + * @param $status_kurzbz + * @return mixed + */ + public function getStatusbezeichnung ($status_kurzbz) + { + $this->ci->AnrechnungstatusModel->addSelect('bezeichnung_mehrsprachig'); + $result = $this->ci->AnrechnungstatusModel->load($status_kurzbz); + + if (!hasData($result)) + { + show_error('Failed retrieving Anrechnungstatusbezeichung'); + } + + return getUserLanguage() == 'German' + ? $result->retval[0]->bezeichnung_mehrsprachig[0] + : $result->retval[0]->bezeichnung_mehrsprachig[1]; + } /** * Get last Anrechnungstatusbezeichnung in users language. @@ -370,7 +435,7 @@ class AnrechnungLib // Exit if already approved or rejected if ($status_kurzbz == self::ANRECHNUNGSTATUS_APPROVED || $status_kurzbz == self::ANRECHNUNGSTATUS_REJECTED) { - return success(false); // dont approve + return false; // dont approve } // Start DB transaction @@ -395,10 +460,10 @@ class AnrechnungLib if ($this->ci->db->trans_status() === false) { $this->ci->db->trans_rollback(); - return error($result->msg, EXIT_ERROR); + return false; } - return success(true); // approved + return true; // approved } /** @@ -419,16 +484,14 @@ class AnrechnungLib // Exit if already approved or rejected if ($status_kurzbz == self::ANRECHNUNGSTATUS_APPROVED || $status_kurzbz == self::ANRECHNUNGSTATUS_REJECTED) { - return success(false); // dont reject + return false; // dont reject } + + // Start DB transaction + $this->ci->db->trans_start(false); // Insert new status rejected - $result = $this->ci->AnrechnungModel->saveAnrechnungstatus($anrechnung_id, self::ANRECHNUNGSTATUS_REJECTED); - - if (isError($result)) - { - show_error(getError($result)); - } + $this->ci->AnrechnungModel->saveAnrechnungstatus($anrechnung_id, self::ANRECHNUNGSTATUS_REJECTED); // Add begruendung as notiz $this->ci->load->model('person/Notiz_model', 'NotizModel'); @@ -438,8 +501,17 @@ class AnrechnungLib $begruendung, getAuthUID() ); + + // Transaction complete + $this->ci->db->trans_complete(); + + if ($this->ci->db->trans_status() === false) + { + $this->ci->db->trans_rollback(); + return false; + } - return success(true); // rejected + return true; // rejected } /** @@ -462,7 +534,7 @@ class AnrechnungLib || $status_kurzbz == self::ANRECHNUNGSTATUS_REJECTED || $status_kurzbz == self::ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR) { - return success(false); // dont ask for recommendation + return false; // dont ask for recommendation } // Start DB transaction @@ -492,7 +564,7 @@ class AnrechnungLib return error($result->msg, EXIT_ERROR); } - return success(true); // recommended + return true; // recommended } /** @@ -537,10 +609,10 @@ class AnrechnungLib if ($this->ci->db->trans_status() === false) { $this->ci->db->trans_rollback(); - return error($result->msg, EXIT_ERROR); + return false; } - return success(true); // recommended + return true; // recommended } /** @@ -562,7 +634,7 @@ class AnrechnungLib // Exit if already approved or rejected if ($status_kurzbz == self::ANRECHNUNGSTATUS_APPROVED || $status_kurzbz == self::ANRECHNUNGSTATUS_REJECTED) { - return success(false); // dont approve + return false; // dont approve } // Start DB transaction @@ -596,10 +668,125 @@ class AnrechnungLib if ($this->ci->db->trans_status() === false) { $this->ci->db->trans_rollback(); - return error($result->msg, EXIT_ERROR); + return false; } - return success(true); // recommended + return true; // recommended + } + + /** + * Set Filename that should be used on download + * @param $dms_id + * @return string|null + */ + public function setFilenameOnDownload($dms_id) + { + // Load Anrechnung + $result = $this->ci->AnrechnungModel->loadWhere(array('dms_id' => $dms_id)); + + // Return null if no data found + if (!hasData($result)) + { + return null; + } + + $prestudent_id = $result->retval[0]->prestudent_id; + $lehrveranstaltung_id = $result->retval[0]->lehrveranstaltung_id; + + // Get LV OrgForm + $this->ci->LehrveranstaltungModel->addSelect('stg.orgform_kurzbz'); + $this->ci->LehrveranstaltungModel->addJoin('public.tbl_studiengang AS stg', 'studiengang_kz'); + $result = $this->ci->LehrveranstaltungModel->load($lehrveranstaltung_id); + $orgform_kurzbz = hasData($result) ? '_'. $result->retval[0]->orgform_kurzbz : ''; + + // Get full name of student + $this->ci->load->model('crm/Prestudent_model', 'PrestudentModel'); + $this->ci->PrestudentModel->addSelect('vorname, nachname'); + $this->ci->PrestudentModel->addJoin('public.tbl_person', 'person_id'); + $result = $this->ci->PrestudentModel->load($prestudent_id); + $fullname = hasData($result) ? $result->retval[0]->vorname. $result->retval[0]->nachname : ''; + + // Return filename + return 'Anrechnungsantrag'. $orgform_kurzbz .'_LV-'. $lehrveranstaltung_id. '_'. $fullname; + } + + public function LVhasLector($anrechnung_id) + { + $result = $this->ci->AnrechnungModel->load($anrechnung_id); + if (!hasData($result)) + { + showError('Anrechnung existiert nicht'); + } + + // Get lectors of lehrveranstaltung + $result = $this->ci->LehrveranstaltungModel->getLecturersByLv( + $result->retval[0]->studiensemester_kurzbz, + $result->retval[0]->lehrveranstaltung_id + ); + + // Continue, if LV has no lector (there is no one to ask for recommendation) + return hasData($result) ? true : false; + } + + /** + * Get LV Leitung. If not present, get all LV lectors. + * + * @param $anrechnung_id + * @return array|bool + */ + public function getLectors($anrechnung_id) + { + $this->ci->AnrechnungModel->addSelect('lehrveranstaltung_id, studiensemester_kurzbz'); + $result = $this->ci->AnrechnungModel->load($anrechnung_id); + + if (!hasData($result)) + { + return false; + } + + $lehrveranstaltung_id = getData($result)[0]->lehrveranstaltung_id; + $studiensemester_kurzbz = getData($result)[0]->studiensemester_kurzbz; + + // Get lectors + $lector_arr = array(); + + $this->ci->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel'); + $result = $this->ci->LehrveranstaltungModel->getLecturersByLv($studiensemester_kurzbz, $lehrveranstaltung_id); + + if (!$result = getData($result)) + { + return false; + } + + // Check if lv has LV-Leitung + $key = array_search(true, array_column($result, 'lvleiter')); + + // If lv has LV-Leitung, keep only the one + if ($key !== false) + { + $lector_arr[]= $result[$key]; + } + // ...otherwise keep all lectors + else + { + $lector_arr = array_merge($lector_arr, $result); + } + + /** + * NOTE: This step is only done to make the array unique by uid, vorname and nachname in the following step + * (e.g. if same lector is ones LV-Leitung and another time not, then array_unique would leave both. + * But we wish to send only one email by to that one person) + * **/ + foreach ($lector_arr as $lector) + { + unset($lector->lvleiter); + $lector->fullname = $lector->vorname. ' '. $lector->nachname; + } + + // Now make the lector array aka mail receivers unique + $lector_arr = array_unique($lector_arr, SORT_REGULAR); + + return $lector_arr; } // Return an object with Anrechnungdata @@ -631,12 +818,7 @@ class AnrechnungLib $this->ci->DmsVersionModel->addSelect('name'); $result = $this->ci->DmsVersionModel->loadWhere(array('dms_id' => $anrechnung->dms_id)); - if (isError($result)) - { - show_error(getError($result)); - } - - $anrechnung_data->dokumentname = $result->retval[0]->name; + $anrechnung_data->dokumentname = hasData($result) ? getData($result)[0]->name : ''; return $anrechnung_data; } diff --git a/application/libraries/AuthLDAPLib.php b/application/libraries/AuthLDAPLib.php new file mode 100644 index 000000000..711b7f5b9 --- /dev/null +++ b/application/libraries/AuthLDAPLib.php @@ -0,0 +1,309 @@ +_ci =& get_instance(); + + // Loads the LogLib + $this->_ci->load->library('LogLib'); + } + + //------------------------------------------------------------------------------------------------------------------ + // Public methods + + /** + * Checks if the given credentials are valid on one of the configured LDAP servers + */ + public function checkUsernamePassword($username, $password) + { + $authenticated = false; + + if (isEmptyString($username) || isEmptyString($password)) return error('Wrong username and password'); + + $ldapConfigArrays = $this->_loadConfig(); // NOTE: always the last to be called! + + // For each configured LDAP server + foreach ($ldapConfigArrays as $ldapConfigs) + { + // Check if the LDAP server is up and running + if (!$this->_servicePing($ldapConfigs)) + { + // If not available log debug and skip to the next configured server + $this->_ci->loglib->logError('This LDAP server is not available: '.$ldapConfigs[self::SERVER]); + continue; + } + + // Connection without username and passoword _or_ with the configured username and password + $noCredentialsConnectResult = $this->_connect($ldapConfigs); + if (isError($noCredentialsConnectResult)) // If an error occurred + { + // If the error is due to invalid credentials or + // the LDAP server does not support anonymous authentication + if (getCode($noCredentialsConnectResult) == AUTH_INVALID_CREDENTIALS) + { + $this->_ci->loglib->logDebug(getError($noCredentialsConnectResult).' on server '.$ldapConfigs[self::SERVER]); + } + else // otherwise if it was due to a fatal error + { + $this->_ci->loglib->logError(getError($noCredentialsConnectResult).' on server '.$ldapConfigs[self::SERVER]); + } + + continue; // anyway skip to the next configured server + } + + // If it is a success + $noCredentialsConnection = getData($noCredentialsConnectResult); + + // Check if the user exists on this LDAP server + $userDNResult = $this->_getUserDN( + $noCredentialsConnection, + $ldapConfigs[self::BASEDN], + $ldapConfigs[self::USF], + $username + ); + // If an error occurred or the user was not found or many users were found + if (isError($userDNResult)) + { + // Log debug and skip to the next configured server + // If the error is due to invalid credentials or + // the LDAP server does not support anonymous authentication + if (getCode($userDNResult) == self::LDAP_NO_USER_DN) + { + $this->_ci->loglib->logDebug(getError($userDNResult).' on server '.$ldapConfigs[self::SERVER]); + } + elseif (getCode($userDNResult) == self::LDAP_TOO_MANY_USER_DN) + { + $this->_ci->loglib->logDebug(getError($userDNResult).' on server '.$ldapConfigs[self::SERVER]); + } + else // otherwise if it was due to a fatal error + { + $this->_ci->loglib->logError(getError($userDNResult).' on server '.$ldapConfigs[self::SERVER]); + } + + $this->_close($noCredentialsConnection); // Close the current LDAP connection + continue; // anyway skip to the next configured server + } + + $this->_close($noCredentialsConnection); // Close the current LDAP connection + + // Connect to LDAP with the userDN and password + $credentialsConnectResult = $this->_connect($ldapConfigs, getData($userDNResult), $password); + if (isError($credentialsConnectResult)) // If an error occurred + { + // Log debug and skip to the next configured server + $this->_ci->loglib->logError(getError($credentialsConnectResult).' on server '.$ldapConfigs[self::SERVER]); + continue; + } + else // otherwise the user is authenticated + { + $this->_close(getData($credentialsConnectResult)); + $authenticated = true; + break; + } + } + + return $authenticated; + } + + //------------------------------------------------------------------------------------------------------------------ + // Private methods + + /** + * Loads the LDAP configuration file and returns the LDAP configuration array + */ + private function _loadConfig() + { + // Tries to require the LDAP configuration file... + // ...first in the ENVIRONMENT subdirectory... + if (file_exists(APPPATH.'config/'.ENVIRONMENT.'/'.self::LDAP_CONF_FILE.'.php')) + { + require_once(APPPATH.'config/'.ENVIRONMENT.'/'.self::LDAP_CONF_FILE.'.php'); + } + else // ...then in the default config directory + { + require_once(APPPATH.'config/'.self::LDAP_CONF_FILE.'.php'); + } + + return $ldap[$ldap_active_group]; + } + + /** + * Establish a connection to LDAP with the given LDAP configuration array and eventually with + * with a given username and password + */ + private function _connect($ldapConfigs, $username = null, $password = null) + { + // Checks if the LDAP configuraion is empty + if (isEmptyArray($ldapConfigs)) return error('Wrong parameters given'); + + // LDAP connection + $ldapConnection = @ldap_connect($ldapConfigs[self::SERVER].':'.$ldapConfigs[self::PORT]); + if ($ldapConnection) // if success + { + // Sets the LDAP protocol version + if (!@ldap_set_option($ldapConnection, LDAP_OPT_PROTOCOL_VERSION, self::LDAP_PROTOCOL_VERSION)) + { + return error('Was not possible to set the protocol version using LDAP sever '.$ldapConfigs[self::SERVER]); + } + + // Enable/disable the LDAP referrals + if (!@ldap_set_option($ldapConnection, LDAP_OPT_REFERRALS, self::LDAP_REFERRALS)) + { + return error('Was not possible to enable referrals using LDAP sever '.$ldapConfigs[self::SERVER]); + } + + // Starts TLS if required + if ($ldapConfigs[self::STARTTLS] === true && !@ldap_start_tls($ldapConnection)) + { + return error('Was not possible to enable TLS using LDAP sever '.$ldapConfigs[self::SERVER]); + } + + // If username or password are not provided... + if (isEmptyString($username) || isEmptyString($password)) + { + // ...use those provided by the configuration + $username = $ldapConfigs[self::USERNAME]; + $password = $ldapConfigs[self::PASSWORD]; + } + + // Binds to LDAP directory + if (!@ldap_bind($ldapConnection, $username, $password)) + { + // Wrong username and/or password + if (ldap_errno($ldapConnection) == self::LDAP_INVALID_CREDENTIALS) + { + return error('Invalid credentials', AUTH_INVALID_CREDENTIALS); + } + else // Error + { + return error('Was not possible to bind to the LDAP sever '.$ldapConfigs[self::SERVER]); + } + } + + return success($ldapConnection); // connected!!! + } + else // Connection error + { + return error('An error occurred while connecting to the LDAP server '.$ldapConfigs[self::SERVER]); + } + } + + /** + * Check if the network service is up and running + */ + private function _servicePing($ldapConfigs) + { + // Set the default timeout + $timeout = self::LDAP_DEFAULT_TIMEOUT; + + // If a timeout was configured for this server then use it + if (isset($ldapConfigs[self::TIMEOUT])) $timeout = $ldapConfigs[self::TIMEOUT]; + + // The LDAP server name or URL + $host = $ldapConfigs[self::SERVER]; + + // If it is a URL + if (strpos($ldapConfigs[self::SERVER], 'ldap://') !== false + || strpos($ldapConfigs[self::SERVER], 'ldaps://') !== false) + { + // Get the host from the URL + $host = parse_url($ldapConfigs[self::SERVER], PHP_URL_HOST); + } + + // Check if the given host answers on the given port using the given timeout + if ($op = @fsockopen($host, $ldapConfigs[self::PORT], $errno, $errstr, $timeout)) + { + // If it works then close the socket connection + fclose($op); + return true; + } + + return false; // otherwise this server is not up or LDAP service is not running on the given port + } + + /** + * Close the current connection to LDAP if present + */ + private function _close($connection) + { + @ldap_unbind($connection); + } + + /** + * Get the user DN from LDAP using the given username + */ + private function _getUserDN($connection, $baseDN, $usf, $username) + { + $userDN = error('AuthLDAPLib->_getUserDN() failed'); + + // Tries to search for a user DN using the given username + $searchResultIdentifier = @ldap_search( + $connection, + $baseDN, + $usf.'='.$username + ); + if (!$searchResultIdentifier) // Error + { + $userDN = error(ldap_error($connection)); + } + + // Counts the number of found entries + $countEntries = @ldap_count_entries($connection, $searchResultIdentifier); + if ($countEntries === false) // Error + { + $userDN = error(ldap_error($connection)); + } + elseif ($countEntries == 0) + { + $userDN = error('No user DN were found with username: '.$username, self::LDAP_NO_USER_DN); + } + elseif ($countEntries > 1) + { + $userDN = error('Too many users DN were found with username: '.$username, self::LDAP_TOO_MANY_USER_DN); + } + else // One entry was found + { + $entries = @ldap_get_entries($connection, $searchResultIdentifier); + if (!$entries) // Error + { + $userDN = error(ldap_error($connection)); + } + else + { + $userDN = success($entries[0][self::DN]); + } + } + + return $userDN; + } +} + diff --git a/application/libraries/AuthLib.php b/application/libraries/AuthLib.php index 67a527655..ae30d41fa 100644 --- a/application/libraries/AuthLib.php +++ b/application/libraries/AuthLib.php @@ -385,7 +385,7 @@ class AuthLib // Invalid credentials // NOTE: this is a corner case because of the HTTP basic authentication if (getCode($hta) == AUTH_NOT_AUTHENTICATED || getCode($hta) == AUTH_INVALID_CREDENTIALS - || getCode($hta) == LDAP_NO_USER_DN || getCode($hta) == LDAP_TOO_MANY_USER_DN) + || getCode($hta) == AuthLDAPLib::LDAP_NO_USER_DN || getCode($hta) == AuthLDAPLib::LDAP_TOO_MANY_USER_DN) { $this->_showInvalidAuthentication(); // this also stop the execution } @@ -404,37 +404,12 @@ class AuthLib { $ldap = error('Not authenticated', AUTH_NOT_AUTHENTICATED); // by default is NOT authenticated - $this->_ci->load->library('LDAPLib'); // Loads the LDAP library + $this->_ci->load->library('AuthLDAPLib'); // Loads the LDAP library - $ldapConnection = $this->_ci->ldaplib->anonymousConnect(); // connect anonymously! - if (isSuccess($ldapConnection)) // connected!! + // If it is possible to authenticate on LDAP with the given username and password + if ($this->_ci->authldaplib->checkUsernamePassword($username, $password) === true) { - // Get the user DN from LDAP - $userDN = $this->_ci->ldaplib->getUserDN($username); - if (isSuccess($userDN)) // got it! - { - $this->_ci->ldaplib->close(); // close the previous LDAP anonymous connection - - // Connects to LDAP using the last working configuration + the retrieved user DN + the provided password - $ldapConnection = $this->_ci->ldaplib->connectUsernamePassword(getData($userDN), $password); - if (isSuccess($ldapConnection)) // connected! - { - $this->_ci->ldaplib->close(); // close the previous connection - $ldap = success('Authenticated', AUTH_SUCCESS); // authenticated! - } - else // blocking error - { - $ldap = $ldapConnection; - } - } - else // blocking error - { - $ldap = $userDN; - } - } - else // blocking error - { - $ldap = $ldapConnection; + $ldap = success('Authenticated', AUTH_SUCCESS); // authenticated! } return $ldap; diff --git a/application/libraries/DmsLib.php b/application/libraries/DmsLib.php index da0dd84b6..eae1a9ac4 100644 --- a/application/libraries/DmsLib.php +++ b/application/libraries/DmsLib.php @@ -2,11 +2,10 @@ if (! defined('BASEPATH')) exit('No direct script access allowed'); -class DmsLib +class DmsLib extends FHC_Controller { const FILE_CONTENT_PROPERTY = 'file_content'; - - const FILE_INPUT_NAME = 'uploadfile'; // name of the HTML input tag containing the uploaded file + private $UPLOAD_PATH = DMS_PATH; // temporary directory to store the upload file /** @@ -21,6 +20,34 @@ class DmsLib $this->ci->load->model('content/DmsVersion_model', 'DmsVersionModel'); $this->ci->load->model('content/DmsFS_model', 'DmsFSModel'); } + + /** + * Load a DMS Document. + * If no version is particularly given, the latest version is loaded. + * + * @param $dms_id + * @param integer $version + * @return array + */ + public function load($dms_id, $version = null) + { + if (is_numeric($dms_id)) + { + $this->ci->DmsModel->addJoin('campus.tbl_dms_version', 'dms_id'); + $this->ci->DmsModel->addOrder('version', 'DESC'); + $this->ci->DmsModel->addLimit(1); + + if (!is_numeric($version)) + { + return $this->ci->DmsModel->load($dms_id); + } + else + { + return $this->ci->DmsModel->loadWhere(array('dms_id' => $dms_id, 'version' => $version)); + } + } + return error('The parameter DMS ID must be a number'); + } /** * Read a DMS Document from the Filesystem @@ -95,19 +122,20 @@ class DmsLib return $result; } - + /** * Uploads a document and saves it to DMS * @param $dms DMS assoc array - * @param array $allowed_types Default: all. Param example: array(jpg, pdf) + * @param $field_name Name of the HTML uploadfile input name attribute + * @param array $allowed_types Default: all. Param example: array(jpg, pdf) * @return array */ - public function upload($dms, $allowed_types = array('*')) + public function upload($dms, $field_name, $allowed_types = array('*')) { // Init upload configs $this->_loadUploadLibrary($allowed_types); - if (!$this->ci->upload->do_upload(DmsLib::FILE_INPUT_NAME)) + if (!$this->ci->upload->do_upload($field_name)) { return error($this->ci->upload->display_errors()); } @@ -132,46 +160,80 @@ class DmsLib // return result of uploaded data return success($upload_data); // data about the uploaded file } - + /** - * Download a document + * Download a document. + * * @param $dms_id + * @param string $filename $filename If String is given, it will be used as filename on download + * @param string $disposition [inline | attachment] + * Inline opens doc in new tab. Attachment displays download dialog box. */ - public function download($dms_id) + public function download($dms_id, $filename = null, $disposition = 'inline') { - if (!is_numeric($dms_id)) - { - show_error('Wrong parameter'); - } - - $this->ci->DmsVersionModel->addSelect('filename'); - $result = $this->ci->DmsVersionModel->loadWhere(array('dms_id' => $dms_id)); - + $result = $this->getFileInfo($dms_id); + if (isError($result)) { - show_error(getError($result)); + return error(getError($result)); } - $filename = $result->retval[0]->filename; - $file = DMS_PATH. $filename; - - if (file_exists($file)) + $fileObj = getData($result); + + // Change filename, if filename is provided + if (is_string($filename)) { - $finfo = new finfo(FILEINFO_MIME); - - header('Content-Description: File Transfer'); - header('Content-Type: '.$finfo->file($file)); - header('Expires: 0'); - header('Cache-Control: must-revalidate'); - header('Pragma: public'); - header('Content-Length: ' . filesize($file)); - readfile($file); - exit; + $fileObj->name = $filename; + } + + // Add file disposition + if ($disposition == 'attachment') + { + $fileObj->disposition = 'attachment'; } else { - show_error('File does not exist'); + $fileObj->disposition = 'inline'; } + + // Output file + if(!$this->outputFile($fileObj)) + { + return error('Error on file output'); + } + } + + /** + * Get file information. + * + * @param $dms_id + * @param integer $version + * @return array with File Object. + */ + public function getFileInfo($dms_id, $version = null) + { + if (!is_numeric($dms_id)) + { + return error('Wrong parameter'); + } + + // Load file + $result = $this->load($dms_id, $version); + + if (isError($result)) + { + return error(getError($result)); + } + + // Store file information in fileObj + $fileObj = new StdClass(); + $fileObj->filename = getData($result)[0]->filename; + $fileObj->file = DMS_PATH. getData($result)[0]->filename; + $fileObj->name = DMS_PATH. getData($result)[0]->name; // original users filename + $fileObj->mimetype = DMS_PATH. getData($result)[0]->mimetype; + + return success($fileObj); + } /** diff --git a/application/libraries/FilterWidgetLib.php b/application/libraries/FilterWidgetLib.php index 0a4526680..cdf0cac3c 100644 --- a/application/libraries/FilterWidgetLib.php +++ b/application/libraries/FilterWidgetLib.php @@ -266,6 +266,7 @@ class FilterWidgetLib $whereParameters = array( 'app' => $app, 'dataset_name' => $datasetName, + 'person_id' => null, 'default_filter' => true ); @@ -738,8 +739,10 @@ class FilterWidgetLib $this->_ci->load->model('system/Filters_model', 'FiltersModel'); // Loads all the filters related to this page (same dataset_name and same app name) - $filters = $this->_ci->FiltersModel->getFiltersByAppDatasetName( - $session[self::APP], $session[self::DATASET_NAME] + $filters = $this->_ci->FiltersModel->getFiltersByAppDatasetNamePersonId( + $session[self::APP], + $session[self::DATASET_NAME], + getAuthPersonId() ); // If filters were loaded @@ -813,9 +816,6 @@ class FilterWidgetLib } } - //------------------------------------------------------------------------------------------------------------------ - // Private methods - /** * Return an unique string that identify this filter widget * NOTE: The default value is the URI where the FilterWidget is called @@ -857,6 +857,9 @@ class FilterWidgetLib $this->_filterUniqueId = $filterUniqueId; } + //------------------------------------------------------------------------------------------------------------------ + // Private methods + /** * Generates a condition for a SQL where clause using the given applied filter definition. * By default an empty string is returned. @@ -972,3 +975,4 @@ class FilterWidgetLib return $pos; } } + diff --git a/application/libraries/IssuesLib.php b/application/libraries/IssuesLib.php new file mode 100644 index 000000000..1b06db333 --- /dev/null +++ b/application/libraries/IssuesLib.php @@ -0,0 +1,244 @@ +_ci =& get_instance(); + + // Properties default values + $this->_app = 'core'; + $this->_insertvon = 'system'; + $this->_fallbackFehlercode = 'UNKNOWN_ERROR'; + + // If parameters are given then overwrite the default values + if (!isEmptyArray($params)) $this->setConfigs($params); + + // load models + $this->_ci->load->model('system/Issue_model', 'IssueModel'); + $this->_ci->load->model('system/Fehler_model', 'FehlerModel'); + } + + // -------------------------------------------------------------------------------------------------------------- + // Public methods + + /** + * Store configuration parameters for this lib + */ + public function setConfigs($params) + { + // If parameters are given then overwrite the default values + if (!isEmptyArray($params)) + { + if (isset($params[self::APP_INDEX])) $this->_app = $params[self::APP_INDEX]; + if (isset($params[self::INSERTVON_INDEX])) $this->_insertvon = $params[self::INSERTVON_INDEX]; + if (isset($params[self::FALLBACK_FEHLERCODE_INDEX])) $this->_fallbackFehlercode = $params[self::FALLBACK_FEHLERCODE_INDEX]; + } + } + + /** + * Adds an Fhc issue, i.e. an internal, self-defined issue. + * @param string $fehler_kurzbz short unique text name of the issue + * @param int $person_id + * @param string $oe_kurzbz + * @param array $fehlertext_params params for sprint replace of error text in system.tbl_fehler + * @return object success or error + */ + public function addFhcIssue($fehler_kurzbz, $person_id = null, $oe_kurzbz = null, $fehlertext_params = null) + { + $fehlerRes = $this->_ci->FehlerModel->loadWhere(array('fehler_kurzbz' => $fehler_kurzbz)); + + if (hasData($fehlerRes)) + { + $fehlercode = getData($fehlerRes)[0]->fehlercode; + return $this->_addIssue($fehlercode, $person_id, $oe_kurzbz, $fehlertext_params); + } + else + return error("Fehler $fehler_kurzbz nicht gefunden"); + } + + /** + * Adds an external issue, already defined externally by another system. + * @param string $fehlercode_extern the error code in the external system + * @param string $inhalt_extern error text in external system + * @param int $person_id + * @param int $oe_kurzbz + * @param array $fehlertext_params params for replacement of parts of error text + * @param bool $force_predefined if true, only predefined external issues are added + * @return object success or error + */ + public function addExternalIssue($fehlercode_extern, $inhalt_extern, $person_id = null, $oe_kurzbz = null, $fehlertext_params = null, $force_predefined = false) + { + if (isEmptyString($fehlercode_extern)) + return error("fehlercode_extern fehlt"); + + // get external fehlercode (unique for each app) + $this->_ci->FehlerModel->addSelect('fehlercode'); + $fehlerRes = $this->_ci->FehlerModel->loadWhere( + array( + 'fehlercode_extern' => $fehlercode_extern, + 'app' => $this->_app + ) + ); + + if (isError($fehlerRes)) + return $fehlerRes; + + $fehlerData = getData($fehlerRes)[0]; + + // check if there is a predefined custom error for the external issue + if (hasData($fehlerRes)) + { + // if found, use the code + $fehlercode = $fehlerData->fehlercode; + } + elseif ($force_predefined === true) + { + // only added if predefined + return success("No definition found - not added"); + } + else + { + // if predefined error is not found, insert with fallback code + $fehlercode = $this->_fallbackFehlercode; + } + + // add external issue + return $this->_addIssue($fehlercode, $person_id, $oe_kurzbz, $fehlertext_params, $fehlercode_extern, $inhalt_extern); + } + + /** + * Changes status of an issue. + * @param int $issue_id + * @param string $status_kurzbz the new status + * @param string $verarbeitetvon uid of person changing the status (needed for in Bearbeitung and behoben) + * @return success or error + */ + public function changeIssueStatus($issue_id, $status_kurzbz, $verarbeitetvon = null) + { + if (!isset($issue_id) || !is_numeric($issue_id)) + return error("Issue Id muss korrekt gesetzt sein."); + + // check if given status is same as existing + $this->_ci->IssueModel->addSelect('status_kurzbz'); + $currStatus = $this->_ci->IssueModel->load($issue_id); + + if (hasData($currStatus)) + { + if (getData($currStatus)[0]->status_kurzbz == $status_kurzbz) + return success("Gleicher Status bereits gesetzt"); + } + else + return error("Fehler beim Holen des Status"); + + $data = array( + 'status_kurzbz' => $status_kurzbz, + 'updatevon' => $verarbeitetvon, + 'updateamum' => date('Y-m-d H:i:s') + ); + + if ($status_kurzbz == self::STATUS_NEU) + { + + $data['verarbeitetvon'] = null; + } + + if ($status_kurzbz == self::STATUS_NEU || $status_kurzbz == self::STATUS_IN_BEARBEITUNG) + { + $data['verarbeitetamum'] = null; + } + + if ($status_kurzbz == self::STATUS_IN_BEARBEITUNG || $status_kurzbz == self::STATUS_BEHOBEN) + { + if (isset($verarbeitetvon)) + $data['verarbeitetvon'] = $verarbeitetvon; + else + return error("Verarbeitetvon nicht gesetzt"); + } + + if ($status_kurzbz == self::STATUS_BEHOBEN) + $data['verarbeitetamum'] = date('Y-m-d H:i:s'); + + return $this->_ci->IssueModel->update( + array( + 'issue_id' => $issue_id + ), + $data + ); + } + + /** + * Adds an issue. + * @param $fehlercode + * @param int $person_id + * @param string $oe_kurzbz + * @param array $fehlertext_params + * @param string $fehlercode_extern + * @param string $inhalt_extern + * @return object success or error + */ + private function _addIssue($fehlercode, $person_id = null, $oe_kurzbz = null, $fehlertext_params = null, $fehlercode_extern = null, $inhalt_extern = null) + { + if (isEmptyString($person_id) && isEmptyString($oe_kurzbz)) + return error("Person_id oder oe_kurzbz muss gesetzt sein."); + + // get fehlertextVorlage and replace it with params + $fehlerRes = $this->_ci->FehlerModel->load($fehlercode); + + if (hasData($fehlerRes)) + { + $fehlertextVorlage = getData($fehlerRes)[0]->fehlertext; + $fehlertext = isEmptyArray($fehlertext_params) ? $fehlertextVorlage : vsprintf($fehlertextVorlage, $fehlertext_params); + + $openIssuesCountRes = $this->_ci->IssueModel->getOpenIssueCount($fehlercode, $person_id, $oe_kurzbz, $fehlercode_extern); + + if (hasData($openIssuesCountRes)) + { + // don't insert if issue is already open + // already open - status new with same fehlercode or same fehlercode-extern (if set) + $openIssueCount = getData($openIssuesCountRes)[0]->anzahl_open_issues; + + if ($openIssueCount == 0) + { + return $this->_ci->IssueModel->insert( + array( + 'fehlercode' => $fehlercode, + 'fehlercode_extern' => $fehlercode_extern, + 'inhalt' => $fehlertext, + 'inhalt_extern' => $inhalt_extern, + 'person_id' => $person_id, + 'oe_kurzbz' => $oe_kurzbz, + 'datum' => date('Y-m-d H:i:s'), + 'status_kurzbz' => self::STATUS_NEU, + 'insertvon' => $this->_insertvon + ) + ); + } + else + return success($openIssueCount); + } + else + return error("Anzahl offener Issues konnte nicht ermittelt werden."); + } + else + return error("Fehler $fehlercode nicht gefunden"); + } +} diff --git a/application/libraries/JobsQueueLib.php b/application/libraries/JobsQueueLib.php index a65bb0d29..5871a3767 100644 --- a/application/libraries/JobsQueueLib.php +++ b/application/libraries/JobsQueueLib.php @@ -58,17 +58,32 @@ class JobsQueueLib /** * To get the oldest added jobs using the given job type + * It is eventually specify the maximum amount of jobs to be retrieved */ - public function getOldestJob($type) + public function getOldestJobs($type, $maxAmount = null) { $this->_ci->JobsQueueModel->resetQuery(); $this->_ci->JobsQueueModel->addOrder('creationtime', 'ASC'); - $this->_ci->JobsQueueModel->addLimit('1'); + + // If the maximum amount of jobs to retrieve have been specified + if (is_numeric($maxAmount)) $this->_ci->JobsQueueModel->addLimit($maxAmount); return $this->_ci->JobsQueueModel->loadWhere(array('status' => self::STATUS_NEW, 'type' => $type)); } + /** + * To get all the jobs specified by the given parameters + */ + public function getJobsByTypeStatus($type, $status) + { + $this->_ci->JobsQueueModel->resetQuery(); + + $this->_ci->JobsQueueModel->addOrder('creationtime', 'DESC'); + + return $this->_ci->JobsQueueModel->loadWhere(array('status' => $status, 'type' => $type)); + } + /** * To get all the jobs specified by the given parameters */ @@ -221,6 +236,23 @@ class JobsQueueLib return success($results); // otherwise return results in a success object } + //------------------------------------------------------------------------------------------------------------------ + // Public static methods + + /** + * Utility method to generate a job with the given parameters and return it inside an array + * ready to be used by addNewJobsToQueue and updateJobsQueue + */ + public static function generateJobs($status, $input) + { + $job = new stdClass(); + + $job->{self::PROPERTY_STATUS} = $status; + $job->{self::PROPERTY_INPUT} = $input; + + return array($job); + } + //------------------------------------------------------------------------------------------------------------------ // Private methods diff --git a/application/libraries/LDAPLib.php b/application/libraries/LDAPLib.php deleted file mode 100644 index 195dddc88..000000000 --- a/application/libraries/LDAPLib.php +++ /dev/null @@ -1,228 +0,0 @@ -_connection = null; - $this->_workingConfigArray = null; - $this->_ldapConfigArray = null; - - $this->_loadConfig(); // NOTE: always the last to be called! - } - - //------------------------------------------------------------------------------------------------------------------ - // Public methods - - /** - * Tries to connect to LDAP using configurations in property _ldapConfigArray - * The first that works is used and stored in property _workingConfigArray - * The LDAP connection link is stored in _connection - */ - public function anonymousConnect() - { - $connect = error('Did not found a working LDAP configuration'); - - // Loops through LDAP configurations - foreach ($this->_ldapConfigArray as $ldapConfigs) - { - // Tries to establish a connection - $connect = $this->_connect($ldapConfigs); - if (isSuccess($connect)) - { - break; // found a working LDAP configuration and successfully connected! - } - else - { - $this->close(); // close the eventually established connection - } - } - - return $connect; - } - - /** - * Tries to connect using the given username and password and the last working configuration with anonymous connection - */ - public function connectUsernamePassword($username, $password) - { - if (isEmptyString($username) || isEmptyString($password)) return error('Wrong username and password'); - - return $this->_connect($this->_workingConfigArray, $username, $password); - } - - /** - * Close the current connection to LDAP if present - */ - public function close() - { - if ($this->_connection != null) @ldap_unbind($this->_connection); - } - - /** - * Get the user DN from LDAP using the given username - */ - public function getUserDN($username) - { - $userDN = error('No user DN were found', LDAP_NO_USER_DN); - - // Tries to search for a user DN using the given username - $searchResultIdentifier = @ldap_search( - $this->_connection, - $this->_workingConfigArray[self::BASEDN], - $this->_workingConfigArray[self::USF].'='.$username - ); - if (!$searchResultIdentifier) // Error - { - $userDN = error(ldap_error($this->_connection)); - } - - // Counts the number of found entries - $countEntries = @ldap_count_entries($this->_connection, $searchResultIdentifier); - if ($countEntries === false) // Error - { - $userDN = error(ldap_error($this->_connection)); - } - elseif ($countEntries == 0) - { - $userDN = error('No user DN were found', LDAP_NO_USER_DN); - } - elseif ($countEntries > 1) - { - $userDN = error('Too many users DN were found', LDAP_TOO_MANY_USER_DN); - } - else // One entry was found - { - $entries = @ldap_get_entries($this->_connection, $searchResultIdentifier); - if (!$entries) // Error - { - $userDN = error(ldap_error($this->_connection)); - } - else - { - $userDN = success($entries[0][self::DN]); - } - } - - return $userDN; - } - - //------------------------------------------------------------------------------------------------------------------ - // Private methods - - /** - * Loads the LDAP configuration file and store the LDAP configuration array into _ldapConfigArray property - */ - private function _loadConfig() - { - // Tries to require the LDAP configuration file... - // ...first in the ENVIRONMENT subdirectory... - if (file_exists(APPPATH.'config/'.ENVIRONMENT.'/'.self::LDAP_CONF_FILE.'.php')) - { - require_once(APPPATH.'config/'.ENVIRONMENT.'/'.self::LDAP_CONF_FILE.'.php'); - } - else // ...then in the default config directory - { - require_once(APPPATH.'config/'.self::LDAP_CONF_FILE.'.php'); - } - - $this->_ldapConfigArray = $ldap[$ldap_active_group]; // store the active LDAP configuration array - } - - /** - * Establish a connection to LDAP with the given LDAP configuration array and eventually with - * with a given username and password - */ - private function _connect($ldapConfigs, $username = null, $password = null) - { - // Checks if the LDAP configuraion is empty - if (isEmptyArray($ldapConfigs)) - { - return error('Wrong parameters given'); - } - - // LDAP connection - $ldapConnection = @ldap_connect($ldapConfigs[self::SERVER].':'.$ldapConfigs[self::PORT]); - if ($ldapConnection) // if success - { - // Sets the LDAP protocol version - if (!@ldap_set_option($ldapConnection, LDAP_OPT_PROTOCOL_VERSION, self::LDAP_PROTOCOL_VERSION)) - { - return error(ldap_error($ldapConnection)); - } - - // Enable/disable the LDAP referrals - if (!@ldap_set_option($ldapConnection, LDAP_OPT_REFERRALS, self::LDAP_REFERRALS)) - { - return error(ldap_error($ldapConnection)); - } - - // Starts TLS if required - if ($ldapConfigs[self::STARTTLS] === true) - { - if (!@ldap_start_tls($ldapConnection)) - { - return error(ldap_error($ldapConnection)); - } - } - - // If username and password are not provided... - if ($username == null || $password == null) - { - // ...uses those provided by the configuration - $username = $ldapConfigs[self::USERNAME]; - $password = $ldapConfigs[self::PASSWORD]; - } - - // Binds to LDAP directory - if (!@ldap_bind($ldapConnection, $username, $password)) - { - // Wrong username and/or password - if (ldap_errno($ldapConnection) == self::LDAP_INVALID_CREDENTIALS) - { - return error('Invalid credentials', AUTH_INVALID_CREDENTIALS); - } - else // Error - { - return error(ldap_error($ldapConnection)); - } - } - - $this->_connection = $ldapConnection; // save the connection into _connection property - $this->_workingConfigArray = $ldapConfigs; // save the working LDAP configuration into _workingConfigArray property - - return success('Connected'); // connected!!! - } - else // Connection error - { - return error( - 'An error occurred while connecting to the LDAP server: '.$ldapConfigs[self::SERVER].':'.$ldapConfigs[self::PORT] - ); - } - } -} diff --git a/application/libraries/UDFLib.php b/application/libraries/UDFLib.php index f9ad7d20d..c5f0d3e98 100644 --- a/application/libraries/UDFLib.php +++ b/application/libraries/UDFLib.php @@ -30,13 +30,14 @@ class UDFLib // ...to specify permissions that are needed to use this TableWidget const REQUIRED_PERMISSIONS_PARAMETER = 'requiredPermissions'; + const PERMISSION_TABLE_METHOD = 'UDFWidget'; // Name for fake method to be checked by the PermissionLib + const PERMISSION_TYPE_READ = 'r'; + const PERMISSION_TYPE_WRITE = 'w'; + // ...to specify the primary key name and value const PRIMARY_KEY_NAME = 'primaryKeyName'; const PRIMARY_KEY_VALUE = 'primaryKeyValue'; - const PERMISSION_TABLE_METHOD = 'UDFWidget'; // Name for fake method to be checked by the PermissionLib - const PERMISSION_TYPE = 'rw'; - // HTML components const LABEL = 'title'; const TITLE = 'description'; @@ -76,10 +77,10 @@ class UDFLib // Public methods /** - * UDFWidget - */ - public function UDFWidget($args, $htmlArgs = array()) - { + * UDFWidget + */ + public function UDFWidget($args, $htmlArgs = array()) + { if ((isset($args[self::SCHEMA_ARG_NAME]) && !isEmptyString($args[self::SCHEMA_ARG_NAME])) && (isset($args[self::TABLE_ARG_NAME]) && !isEmptyString($args[self::TABLE_ARG_NAME]))) { @@ -112,16 +113,17 @@ class UDFLib show_error(self::TABLE_ARG_NAME.' parameter is missing!'); } } - } + } - /** + /** * It renders the HTML of the UDF * * NOTE: When this method is called $widgetData contains different data from * parameter $args in the constructor */ - public function displayUDFWidget(&$widgetData) + public function displayUDFWidget(&$widgetData) { + $field = null; $schema = $widgetData[self::SCHEMA_ARG_NAME]; // schema attribute $table = $widgetData[self::TABLE_ARG_NAME]; // table attribute @@ -133,7 +135,7 @@ class UDFLib $udfResults = $this->_loadUDF($schema, $table); // loads UDF definition if (hasData($udfResults)) { - $udf = $udfResults->retval[0]; // only one record is loaded + $udf = getData($udfResults)[0]; // only one record is loaded if (isset($udf->jsons)) { $jsonSchemas = json_decode($udf->jsons); // decode the json schema @@ -155,7 +157,7 @@ class UDFLib $found = false; // used to check if the field is found or not in the json schema $this->_sortJsonSchemas($jsonSchemasArray); // Sort the list of UDF by sort property - + // Loops through json schemas foreach ($jsonSchemasArray as $jsonSchema) { @@ -169,21 +171,37 @@ class UDFLib { show_error(sprintf('%s.%s: Attribute "name" not present in the json schema', $schema, $table)); } + // If the requiredPermissions property is not present then show an error + if (!isset($jsonSchema->{self::REQUIRED_PERMISSIONS_PARAMETER})) + { + show_error(sprintf('%s.%s: Attribute "requiredPermissions" not present in the json schema', $schema, $table)); + } + + // Set the required permissions for this UDF + $this->_setRequiredPermissions($jsonSchema->{self::NAME}, $jsonSchema->{self::REQUIRED_PERMISSIONS_PARAMETER}); // If a UDF is specified and is present in the json schemas list or no UDF is specified if ((isset($field) && $field == $jsonSchema->{self::NAME}) || !isset($field)) { - // Set attributes using phrases - $this->_setAttributesWithPhrases($jsonSchema, $widgetData[HTMLWidget::HTML_ARG_NAME]); + // If the user has the permissions to read this field + if ($this->_readAllowed($jsonSchema->{self::REQUIRED_PERMISSIONS_PARAMETER})) + { + // Set attributes using phrases + $this->_setAttributesWithPhrases($jsonSchema, $widgetData[HTMLWidget::HTML_ARG_NAME]); - // Set validation attributes - $this->_setValidationAttributes($jsonSchema, $widgetData[HTMLWidget::HTML_ARG_NAME]); + // Set validation attributes + $this->_setValidationAttributes($jsonSchema, $widgetData[HTMLWidget::HTML_ARG_NAME]); - // Set name and id attributes - $this->_setNameAndId($jsonSchema, $widgetData[HTMLWidget::HTML_ARG_NAME]); + // Set name and id attributes + $this->_setNameAndId($jsonSchema, $widgetData[HTMLWidget::HTML_ARG_NAME]); - // Render the HTML for this UDF - $this->_render($jsonSchema, $widgetData); + // Set if the field is in read only mode + $this->_setReadOnly($jsonSchema, $widgetData[HTMLWidget::HTML_ARG_NAME]); + + // Render the HTML for this UDF + $this->_render($jsonSchema, $widgetData); + } + // otherwise the UDF is not displayed // If a UDf is specified and it was found then stop looking through this list if (isset($field) && $field == $jsonSchema->{self::NAME}) @@ -213,12 +231,97 @@ class UDFLib show_error(sprintf('%s.%s: Does not contain "jsons" field', $schema, $table)); } } - } + } /** - * Manage UDFs + * UDFs permissions check and convertion to read them from database */ - public function manageUDFs(&$data, $schemaAndTable, $udfValues = null) + public function prepareUDFsRead(&$data, $schemaAndTable, $udfValues = null) + { + $this->_ci->load->model('system/UDF_model', 'UDFModel'); + + // Retrieves UDFs definitions for this table + $resultUDFsDefinitions = $this->_ci->UDFModel->getUDFsDefinitions($schemaAndTable); + + // If an error occurred while reading from database + if (isError($resultUDFsDefinitions)) + { + $data = array(); // then set data as an empty array + return; // and exit from this method + } + + // If there are no UDFs defined for this table the return + if (!hasData($resultUDFsDefinitions)) return; + + // If not an error and has data, decodes json that define the UDFs for this table + $decodedUDFDefinitions = json_decode( + getData($resultUDFsDefinitions)[0]->{self::COLUMN_JSON_DESCRIPTION} + ); + + // Looping on results, resultElement is an object that represent a database record + foreach ($data as $resultElement) + { + // Decode the JSON column udf_values + $udfColumn = json_decode($resultElement->{self::COLUMN_NAME}); + + // If this is not a valid JSON then skip to the next database record + if ($udfColumn == null) continue; + + // For each UDF column of this database record + foreach (get_object_vars($udfColumn) as $columnName => $columnValue) + { + $udfColumnToBeRemoved = $columnName; // let's try to remove it + + // Loops through the UDFs definitions + foreach ($decodedUDFDefinitions as $decodedUDFDefinition) + { + // If the column exists in the UDF definition + if ($columnName == $decodedUDFDefinition->{self::NAME}) + { + $udfColumnToBeRemoved = null; // then keep it + } + } + + // If in this record have been found a _not_ defined UDF then remove it + if (!isEmptyString($udfColumnToBeRemoved)) unset($udfColumn->{$udfColumnToBeRemoved}); + } + + // Loops through the UDFs definitions + foreach ($decodedUDFDefinitions as $decodedUDFDefinition) + { + // Checks if the requiredPermissions is available and it is a valid array or a valid string + if (isset($decodedUDFDefinition->{self::REQUIRED_PERMISSIONS_PARAMETER}) + && (!isEmptyArray($decodedUDFDefinition->{self::REQUIRED_PERMISSIONS_PARAMETER}) + || !isEmptyString($decodedUDFDefinition->{self::REQUIRED_PERMISSIONS_PARAMETER}))) + { + // Then check if the user has the permissions to read such UDF + if (!$this->_readAllowed($decodedUDFDefinition->{self::REQUIRED_PERMISSIONS_PARAMETER})) + { + // If not then remove the UDF from the result set + unset($udfColumn->{$decodedUDFDefinition->{self::NAME}}); + } + } + else // If not then remove the UDF from the result set + { + unset($udfColumn->{$decodedUDFDefinition->{self::NAME}}); + } + } + + // Add the defined and permitted UDF columns to the record set + foreach (get_object_vars($udfColumn) as $columnName => $columnValue) + { + $resultElement->{$columnName} = $columnValue; + } + + // And finally remove the UDFs column + unset($resultElement->{self::COLUMN_NAME}); + } + } + + /** + * UDFs validation and permissions check to write them into database + */ + public function prepareUDFsWrite(&$data, $schemaAndTable, $udfValues = null) { $validate = success(true); // returned value // Contains a list of validation errors for the UDFs that have not passed the validation @@ -241,18 +344,34 @@ class UDFLib // Decodes json that define the UDFs for this table $decodedUDFDefinitions = json_decode( - $resultUDFsDefinitions->retval[0]->{self::COLUMN_JSON_DESCRIPTION} + getData($resultUDFsDefinitions)[0]->{self::COLUMN_JSON_DESCRIPTION} ); // Loops through the UDFs definitions - for ($i = 0; $i < count($decodedUDFDefinitions); $i++) + foreach ($decodedUDFDefinitions as $decodedUDFDefinition) { - $decodedUDFDefinition = $decodedUDFDefinitions[$i]; // Definition of a single UDF + // Checks if the requiredPermissions is available and it is a valid array or a valid string + if (isset($decodedUDFDefinition->{self::REQUIRED_PERMISSIONS_PARAMETER}) + && (!isEmptyArray($decodedUDFDefinition->{self::REQUIRED_PERMISSIONS_PARAMETER}) + || !isEmptyString($decodedUDFDefinition->{self::REQUIRED_PERMISSIONS_PARAMETER}))) + { + // Then check if the user has the permissions to write such UDF + if (!$this->_writeAllowed($decodedUDFDefinition->{self::REQUIRED_PERMISSIONS_PARAMETER})) + { + // If the logged user has no permissions then remove the UDF + unset($udfsParameters[$decodedUDFDefinition->{self::NAME}]); + } + } + else + { + // If no permissions have been defined for this UDF then remove it + unset($udfsParameters[$decodedUDFDefinition->{self::NAME}]); + } // Loops through the UDFs values that should be stored foreach ($udfsParameters as $key => $val) { - $tmpValidate = success(true); // temporary variable used to store the returned value from _validateUDFs + $tmpValidateArray = array(); // temporary variable used to store the returned value from _validateUDFs // If this is the definition of this UDF if ($decodedUDFDefinition->{self::NAME} == $key) @@ -314,7 +433,7 @@ class UDFLib if ($toBeValidated === true) // Checks if validation should be performed { - $tmpValidate = $this->_validateUDFs( + $tmpValidateArray = $this->_validateUDFs( $decodedUDFDefinition->{self::VALIDATION}, $decodedUDFDefinition->{self::NAME}, $val @@ -324,13 +443,13 @@ class UDFLib } // If validation is ok copy the value that is to be stored into $toBeStoredUDFsArray - if (isSuccess($tmpValidate)) + if (isEmptyArray($tmpValidateArray)) { $toBeStoredUDFsArray[$key] = $val; } - else // otherwise store the validation error in $notValidUDFsArray + else // otherwise store the validation errors in $notValidUDFsArray { - $notValidUDFsArray[] = $tmpValidate; + $notValidUDFsArray = array_merge($notValidUDFsArray, $tmpValidateArray); } } } @@ -344,11 +463,11 @@ class UDFLib } // If the validation of all the supplied UDFs is ok - if (count($notValidUDFsArray) == 0) + if (isEmptyArray($notValidUDFsArray)) { // An update is performed, then in this case it preserves the values // of the UDF that are not updated - if (is_array($udfValues) && count($udfValues) > 0) + if (!isEmptyArray($udfValues)) { foreach ($udfValues as $fieldName => $fieldValue) { @@ -379,7 +498,7 @@ class UDFLib /** * isUDFColumn */ - public function isUDFColumn($columnName, $columnType) + public function isUDFColumn($columnName, $columnType = self::COLUMN_TYPE) { $isUDFColumn = false; @@ -466,7 +585,7 @@ class UDFLib /** * Save UDFs */ - public function saveUDFs($udfUniqueId, $udfs) + public function saveUDFs($udfs) { // Read the all session for this udf widget $session = $this->getSession(); @@ -490,30 +609,80 @@ class UDFLib // Returns the result of the database update operation to save UDFs return $dbModel->update( array($session[self::PRIMARY_KEY_NAME] => $session[self::PRIMARY_KEY_VALUE]), - (array)$udfs + get_object_vars($udfs) ); } - /** - * Checks if at least one of the permissions given as parameter (requiredPermissions) belongs - * to the authenticated user, if confirmed then is allowed to use this UDFWidget. - * If the parameter requiredPermissions is NOT given or is not present in the session, - * then NO one is allow to use this UDFWidget - * Wrapper method to permissionlib->hasAtLeastOne - */ - public function isAllowed($requiredPermissions = null) - { - $this->_ci->load->library('PermissionLib'); // Load permission library - - // Gets the required permissions from the session if they are not provided as parameter - $rq = $requiredPermissions; - if ($rq == null) $rq = $this->getSessionElement(self::REQUIRED_PERMISSIONS_PARAMETER); - - return $this->_ci->permissionlib->hasAtLeastOne($rq, self::PERMISSION_TABLE_METHOD, self::PERMISSION_TYPE); - } - // ------------------------------------------------------------------------------------------------- // Private methods + // + + /** + * Checks if at least one of the permissions given as parameter belongs to the authenticated user in read mode + * Wrapper method to permissionlib->hasAtLeastOne + */ + private function _readAllowed($requiredPermissions) + { + $readAllowed = false; + + // If the user is logged then it is possible to check the permissions + if (isLogged()) + { + $this->_ci->load->library('PermissionLib'); // Load permission library + + $readAllowed = $this->_ci->permissionlib->hasAtLeastOne( + $requiredPermissions, + self::PERMISSION_TABLE_METHOD, + self::PERMISSION_TYPE_READ + ); + } // otherwise it is not possible to check the permissions + + return $readAllowed; + } + + /** + * Checks if at least one of the permissions given as parameter belongs to the authenticated user in write mode + * Wrapper method to permissionlib->hasAtLeastOne + */ + private function _writeAllowed($requiredPermissions) + { + $writeAllowed = false; + + // If the user is logged then it is possible to check the permissions + if (isLogged()) + { + $this->_ci->load->library('PermissionLib'); // Load permission library + + $writeAllowed = $this->_ci->permissionlib->hasAtLeastOne( + $requiredPermissions, + self::PERMISSION_TABLE_METHOD, + self::PERMISSION_TYPE_WRITE + ); + } // otherwise it is not possible to check the permissions + + return $writeAllowed; + } + + /** + * Set an array of required permissions for a UDF into the session + */ + private function _setRequiredPermissions($udfName, $permissions) + { + // Get the session for this UDFWidget + $session = $this->getSession(); + + // If does _not_ exist yet in the session + if (!isset($session[self::REQUIRED_PERMISSIONS_PARAMETER])) + { + $session[self::REQUIRED_PERMISSIONS_PARAMETER] = array(); + } + + // Set the required permission in the session for this UDFWidget + $session[self::REQUIRED_PERMISSIONS_PARAMETER][$udfName] = $permissions; + + // Write into the session + $this->setSession($session); + } /** * Print the block for UDFs @@ -544,12 +713,12 @@ class UDFLib { $udfsParameters = array(); - foreach ($data as $key => $val) + foreach ($data as $columnName => $columnValue) { - if (substr($key, 0, 4) == self::COLUMN_PREFIX) + if ($this->isUDFColumn($columnName)) { - $udfsParameters[$key] = $val; // stores UDF value into property UDFs - unset($data[$key]); // remove from data + $udfsParameters[$columnName] = $columnValue; // stores UDF value into property UDFs + unset($data[$columnName]); // remove from data } } @@ -645,29 +814,39 @@ class UDFLib } } - // If no UDF validation errors were raised, it's a success!! - if (count($returnArrayValidation) == 0) - { - $returnArrayValidation = success(true); - } - return $returnArrayValidation; } - /** - * Set the name and id attribute of the HTML element - */ - private function _setNameAndId($jsonSchema, &$htmlParameters) - { + /** + * Disable the HTML element if in read only mode + */ + private function _setReadOnly($jsonSchema, &$htmlParameters) + { + // If write permissions _not_ exist then set the field as disabled + if (!$this->_writeAllowed($jsonSchema->{self::REQUIRED_PERMISSIONS_PARAMETER})) + { + $htmlParameters[HTMLWidget::DISABLED] = HTMLWidget::DISABLED; // any values is fine + } + else // otherwise restore to default + { + if (isset($htmlParameters[HTMLWidget::DISABLED])) unset($htmlParameters[HTMLWidget::DISABLED]); + } + } + + /** + * Set the name and id attribute of the HTML element + */ + private function _setNameAndId($jsonSchema, &$htmlParameters) + { $htmlParameters[HTMLWidget::HTML_ID] = $jsonSchema->{self::NAME}; $htmlParameters[HTMLWidget::HTML_NAME] = $jsonSchema->{self::NAME}; - } - - /** - * Sort the list of UDF by sort property - */ - private function _sortJsonSchemas(&$jsonSchemasArray) - { + } + + /** + * Sort the list of UDF by sort property + */ + private function _sortJsonSchemas(&$jsonSchemasArray) + { usort($jsonSchemasArray, function ($a, $b) { if (!isset($a->{self::SORT})) { @@ -684,13 +863,13 @@ class UDFLib return ($a->{self::SORT} < $b->{self::SORT}) ? -1 : 1; }); - } - - /** - * Loads the UDF description by the given schema and table - */ - private function _loadUDF($schema, $table) - { + } + + /** + * Loads the UDF description by the given schema and table + */ + private function _loadUDF($schema, $table) + { // Loads UDF model $this->_ci->load->model('system/UDF_model', 'UDFModel'); @@ -703,18 +882,7 @@ class UDFLib if (isError($udfResults)) { - if (is_object($udfResults) && isset($udfResults->retval)) - { - show_error(getError($udfResults)); - } - elseif (is_string($udfResults)) - { - show_error($udfResults); - } - else - { - show_error('UDFWidget: generic error occurred'); - } + show_error(getError($udfResults)); } elseif (!hasData($udfResults)) { @@ -722,13 +890,13 @@ class UDFLib } return $udfResults; - } + } - /** - * Render the HTML for the UDF - */ - private function _render($jsonSchema, &$widgetData) - { + /** + * Render the HTML for the UDF + */ + private function _render($jsonSchema, &$widgetData) + { // Checkbox if ($jsonSchema->{self::TYPE} == 'checkbox') { @@ -759,11 +927,11 @@ class UDFLib { $this->_renderDropdown($jsonSchema, $widgetData, true); } - } + } - /** - * Renders a dropdown element - */ + /** + * Renders a dropdown element + */ private function _renderDropdown($jsonSchema, &$widgetData, $multiple = false) { // Selected element/s @@ -792,7 +960,7 @@ class UDFLib $queryResult = $this->_ci->UDFModel->execReadOnlyQuery($jsonSchema->{self::LIST_VALUES}->sql); if (hasData($queryResult)) { - $parameters = $queryResult->retval; + $parameters = getData($queryResult); } } @@ -805,8 +973,8 @@ class UDFLib } /** - * Renders a textarea element - */ + * Renders a textarea element + */ private function _renderTextarea($jsonSchema, &$widgetData) { $text = null; // text value @@ -823,8 +991,8 @@ class UDFLib } /** - * Renders an input text element - */ + * Renders an input text element + */ private function _renderTextfield($jsonSchema, &$widgetData) { $text = null; // text value @@ -841,8 +1009,8 @@ class UDFLib } /** - * Renders a checkbox element - */ + * Renders a checkbox element + */ private function _renderCheckbox($jsonSchema, &$widgetData) { // Set checkbox value if present in the DB @@ -861,11 +1029,11 @@ class UDFLib $checkboxWidgetUDF->render(); } - /** - * Sets the attributes of the HTML element using the phrases system - */ - private function _setAttributesWithPhrases($jsonSchema, &$htmlParameters) - { + /** + * Sets the attributes of the HTML element using the phrases system + */ + private function _setAttributesWithPhrases($jsonSchema, &$htmlParameters) + { // By default set to null all the attributes $htmlParameters[HTMLWidget::LABEL] = null; $htmlParameters[HTMLWidget::TITLE] = null; @@ -893,7 +1061,7 @@ class UDFLib ); if (hasData($tmpResult)) { - $htmlParameters[HTMLWidget::LABEL] = $tmpResult->retval[0]->text; + $htmlParameters[HTMLWidget::LABEL] = getData($tmpResult)[0]->text; } } @@ -911,7 +1079,7 @@ class UDFLib ); if (hasData($tmpResult)) { - $htmlParameters[HTMLWidget::TITLE] = $tmpResult->retval[0]->text; + $htmlParameters[HTMLWidget::TITLE] = getData($tmpResult)[0]->text; } } @@ -929,17 +1097,17 @@ class UDFLib ); if (hasData($tmpResult)) { - $htmlParameters[HTMLWidget::PLACEHOLDER] = $tmpResult->retval[0]->text; + $htmlParameters[HTMLWidget::PLACEHOLDER] = getData($tmpResult)[0]->text; } } } - } + } - /** - * Sets the validation attributes of the HTML element using the configuration inside the json schema - */ - private function _setValidationAttributes($jsonSchema, &$htmlParameters) - { + /** + * Sets the validation attributes of the HTML element using the configuration inside the json schema + */ + private function _setValidationAttributes($jsonSchema, &$htmlParameters) + { // Validation attributes set by default to null $htmlParameters[HTMLWidget::REGEX] = null; $htmlParameters[HTMLWidget::REQUIRED] = null; @@ -998,3 +1166,4 @@ class UDFLib } } } + diff --git a/application/models/codex/Aufenthaltfoerderung_model.php b/application/models/codex/Aufenthaltfoerderung_model.php new file mode 100644 index 000000000..b650b3a05 --- /dev/null +++ b/application/models/codex/Aufenthaltfoerderung_model.php @@ -0,0 +1,14 @@ +dbTable = 'bis.tbl_aufenthaltfoerderung'; + $this->pk = 'aufenthaltfoerderung_code'; + } +} diff --git a/application/models/codex/Oehbeitrag_model.php b/application/models/codex/Oehbeitrag_model.php new file mode 100644 index 000000000..0df016ba8 --- /dev/null +++ b/application/models/codex/Oehbeitrag_model.php @@ -0,0 +1,107 @@ +dbTable = 'bis.tbl_oehbeitrag'; + $this->pk = 'oehbeitrag_id'; + } + + /** + * Gets oehbeitrag data valid for a certain Studiensemester. + * @param string $studiensemester_kurzbz + * @return object + */ + public function getByStudiensemester($studiensemester_kurzbz) + { + $qry = "WITH semstart AS ( + SELECT start FROM public.tbl_studiensemester + WHERE studiensemester_kurzbz = ? + ) + SELECT * FROM bis.tbl_oehbeitrag oehb + JOIN public.tbl_studiensemester semvon ON oehb.von_studiensemester_kurzbz = semvon.studiensemester_kurzbz + LEFT JOIN public.tbl_studiensemester sembis ON oehb.bis_studiensemester_kurzbz = sembis.studiensemester_kurzbz + JOIN semstart ON semstart.start::date >= semvon.start::date AND (sembis.studiensemester_kurzbz IS NULL OR semstart.start::date <= sembis.start::date) + ORDER BY semvon.start + LIMIT 1"; + + return $this->execQuery($qry, array($studiensemester_kurzbz)); + } + + /** + * Gets all Studiensemester for which no Oehbeitrag value assignment exists. + * @param string $start_studiensemester_kurzbz semester before the given semester are ignored + * @param array $excluded_oehbeitrag_id oehbeitraege to be ignored, i.e. which are assigned + * @return object + */ + public function getUnassignedStudiensemester($start_studiensemester_kurzbz, $excluded_oehbeitrag_id = array()) + { + $params = array($start_studiensemester_kurzbz); + + $qry = "SELECT * FROM public.tbl_studiensemester sem + WHERE sem.start >= (SELECT start FROM public.tbl_studiensemester WHERE studiensemester_kurzbz = ?) + AND NOT EXISTS (SELECT 1 FROM bis.tbl_oehbeitrag oeh + JOIN public.tbl_studiensemester oeh_von ON oeh.von_studiensemester_kurzbz = oeh_von.studiensemester_kurzbz + LEFT JOIN public.tbl_studiensemester oeh_bis ON oeh.bis_studiensemester_kurzbz = oeh_bis.studiensemester_kurzbz + WHERE sem.start::date >= oeh_von.start::date AND (sem.start::date <= oeh_bis.start::date OR oeh_bis.studiensemester_kurzbz IS NULL)"; + + if (!isEmptyArray($excluded_oehbeitrag_id)) + { + $qry .= " AND oehbeitrag_id NOT IN ?"; + $params[] = $excluded_oehbeitrag_id; + } + + $qry .= ") ORDER BY sem.start"; + + return $this->execQuery($qry, $params); + } + + /** + * Checks if a Öhbeitrag can be assigned for a Studiensemester range. + * @param string $von_studiensemester_kurzbz + * @param string $bis_studiensemester_kurzbz + * @param array $excluded_oehbeitrag_id oehbeitraege to ignore, i.e. which are assignable + * @return object array with true if assignable, with false if not + */ + public function checkIfStudiensemesterAssignable($von_studiensemester_kurzbz, $bis_studiensemester_kurzbz = null, $excluded_oehbeitrag_id = array()) + { + $params = array($von_studiensemester_kurzbz); + + $allStdSemSpanQry = "SELECT count(studiensemester_kurzbz) as number_assigned FROM public.tbl_studiensemester sem + WHERE start >= (SELECT start FROM public.tbl_studiensemester WHERE studiensemester_kurzbz = ?)"; + + if ($bis_studiensemester_kurzbz != null) + { + $allStdSemSpanQry .= " AND (start <= (SELECT start FROM public.tbl_studiensemester WHERE studiensemester_kurzbz = ?))"; + $params[] = $bis_studiensemester_kurzbz; + } + + $allStdSemSpanQry .= " AND EXISTS (SELECT 1 FROM bis.tbl_oehbeitrag + JOIN public.tbl_studiensemester sem_von ON tbl_oehbeitrag.von_studiensemester_kurzbz = sem_von.studiensemester_kurzbz + LEFT JOIN public.tbl_studiensemester sem_bis ON tbl_oehbeitrag.bis_studiensemester_kurzbz = sem_bis.studiensemester_kurzbz + WHERE sem.start >= sem_von.start AND (sem.start <= sem_bis.start OR sem_bis.studiensemester_kurzbz IS NULL)"; + + if (!isEmptyArray($excluded_oehbeitrag_id)) + { + $allStdSemSpanQry .= " AND oehbeitrag_id NOT IN ?"; + $params[] = $excluded_oehbeitrag_id; + } + + $allStdSemSpanQry .= ")"; + + $nrAssigned = $this->execQuery($allStdSemSpanQry, $params); + + if (isError($nrAssigned)) + return $nrAssigned; + + if (!hasData($nrAssigned)) + return error("Fehler bei Überprüfung der Möglichkeit der Semesterzuweisung"); + + return success(array(getData($nrAssigned)[0]->number_assigned == 0)); + } +} diff --git a/application/models/crm/Prestudent_model.php b/application/models/crm/Prestudent_model.php index 52ba4d9f3..2d8ac4a7e 100644 --- a/application/models/crm/Prestudent_model.php +++ b/application/models/crm/Prestudent_model.php @@ -291,7 +291,7 @@ class Prestudent_model extends DB_Model $prestudentdata->prestudentstatus = $lastStatusData; - if ($this->hasUDF()) + if ($this->udfsExistAndDefined()) { $prestudentdata->prestudentUdfs = $this->getUDFs($prestudent_id); } @@ -581,8 +581,37 @@ class Prestudent_model extends DB_Model return $this->execQuery($query, array($person_id)); } + + /** + * Get latest ZGV Bezeichnung of Prestudent. + * + * @param $prestudent_id + */ + public function getLatestZGVBezeichnung($prestudent_id) + { + if (!is_numeric($prestudent_id)) + { + show_error('Prestudent_id is not numeric.'); + } + + $language_index = getUserLanguage() == 'German' ? 0 : 1; + + $this->addSelect(' + COALESCE( + array_to_json(zgvmaster.bezeichnung::varchar[])->>' . $language_index . ', + array_to_json(zgv.bezeichnung::varchar[])->>' . $language_index . ' + ) AS bezeichnung' + ); + + $this->addJoin('bis.tbl_zgv zgv', 'zgv_code', 'LEFT'); + $this->addJoin('bis.tbl_zgvmaster zgvmaster', 'zgvmas_code', 'LEFT'); + + return $this->loadWhere(array( + 'prestudent_id' => $prestudent_id + )); + } - public function getPrestudentByStudiengangAndPerson($studiengang, $person, $studienSemester) + public function getPrestudentByStudiengangAndPerson($studiengang, $person, $studienSemester, $abgeschickt) { $query = "SELECT ps.prestudent_id FROM public.tbl_prestudentstatus pss @@ -592,8 +621,48 @@ class Prestudent_model extends DB_Model WHERE ps.person_id = ? AND UPPER((sg.typ || sg.kurzbz) || ':' || sp.orgform_kurzbz) = ? AND pss.studiensemester_kurzbz = ? - "; + AND"; + + if ($abgeschickt === 'true') + $query .= " EXISTS"; + else + $query .= " NOT EXISTS"; + + $query .= " (SELECT 1 FROM public.tbl_prestudentstatus spss + JOIN public.tbl_prestudent sps USING(prestudent_id) + WHERE sps.prestudent_id = ps.prestudent_id + AND spss.bewerbung_abgeschicktamum IS NOT NULL)"; return $this->execQuery($query, array($person, $studiengang, $studienSemester)); } + + /** + * Gets förderrelevant flag for a prestudent, from prestudent, or, if not set on prestudent level, from studiengang + * @param int $prestudent_id + * @return object + */ + public function getFoerderrelevant($prestudent_id) + { + $query = 'SELECT COALESCE (ps.foerderrelevant, stg.foerderrelevant) AS foerderrelevant + FROM public.tbl_prestudent ps + LEFT JOIN public.tbl_studiengang stg USING (studiengang_kz) + WHERE prestudent_id = ?'; + + return $this->execQuery($query, array($prestudent_id)); + } + + /** + * Gets bis standort_code for a prestudent, from prestudent, or, if not set on prestudent level, from studiengang + * @param int $prestudent_id + * @return object + */ + public function getStandortCode($prestudent_id) + { + $query = 'SELECT COALESCE (ps.standort_code, stg.standort_code) AS standort_code + FROM public.tbl_prestudent ps + LEFT JOIN public.tbl_studiengang stg USING (studiengang_kz) + WHERE prestudent_id = ?'; + + return $this->execQuery($query, array($prestudent_id)); + } } diff --git a/application/models/crm/Statusgrund_model.php b/application/models/crm/Statusgrund_model.php index 7ab17a45b..d488e12d1 100644 --- a/application/models/crm/Statusgrund_model.php +++ b/application/models/crm/Statusgrund_model.php @@ -12,7 +12,7 @@ class Statusgrund_model extends DB_Model $this->pk = "statusgrund_id"; } - public function getStatus($status_kurzbz = null, $aktiv = null) + public function getStatus($status_kurzbz = null, $aktiv = null, $statusgrund_kurzbz = null) { $this->addOrder('bezeichnung_mehrsprachig'); $where = array(); @@ -20,6 +20,8 @@ class Statusgrund_model extends DB_Model $where['status_kurzbz'] = $status_kurzbz; if (!is_null($aktiv)) $where['aktiv'] = $aktiv; + if (!is_null($statusgrund_kurzbz)) + $where['statusgrund_kurzbz'] = $statusgrund_kurzbz; $status = $this->loadWhere($where); diff --git a/application/models/education/Anrechnung_model.php b/application/models/education/Anrechnung_model.php index b4c7de835..ebecf4118 100644 --- a/application/models/education/Anrechnung_model.php +++ b/application/models/education/Anrechnung_model.php @@ -1,7 +1,11 @@ pk = 'anrechnung_id'; } + /** + * Creates new Anrechnungsantrag. + * Saves new Anrechnung and sets Anrechnungstatus for the new Anrechnung. + * + * @param $prestudent_id + * @param $studiensemester_kurzbz + * @param $lehrveranstaltung_id + * @param $begruendung_id + * @param $dms_id DMS ID of uploaded Nachweisdokument + * @param null $anmerkung_student = Herkunft der Kenntnisse + * @return array + */ + public function createAnrechnungsantrag( + $prestudent_id, $studiensemester_kurzbz, $lehrveranstaltung_id, + $begruendung_id, $dms_id, $anmerkung_student = null + ) + { + // Start DB transaction + $this->db->trans_start(false); + + // Save Anrechnung + $result = $this->AnrechnungModel->insert(array( + 'prestudent_id' => $prestudent_id, + 'lehrveranstaltung_id' => $lehrveranstaltung_id, + 'begruendung_id' => $begruendung_id, + 'dms_id' => $dms_id, + 'studiensemester_kurzbz' => $studiensemester_kurzbz, + 'anmerkung_student' => $anmerkung_student, + 'insertvon' => $this->_uid + )); + + // Store just inserted Anrechnung ID + $lastInsert_anrechnung_id = $result->retval; + + // Save Anrechnungstatus + $this->AnrechnungModel->saveAnrechnungstatus($lastInsert_anrechnung_id, self::ANRECHNUNGSTATUS_PROGRESSED_BY_STGL); + + // Transaction complete + $this->db->trans_complete(); + + if ($this->db->trans_status() === false) + { + $this->db->trans_rollback(); + return error('Failed inserting Anrechnung', EXIT_ERROR); + } + + return success($lastInsert_anrechnung_id); + } + /** * Save Anrechnungstatus. * @param $anrechnung_id @@ -83,4 +136,68 @@ class Anrechnung_model extends DB_Model return $this->execQuery($qry, array($anrechnung_id)); } + + /** + * Delete Anrechnungstatus. + * + * @param $anrechnungstatus_id + */ + public function deleteAnrechnungstatus($anrechnungstatus_id){ + + $qry = ' + DELETE FROM lehre.tbl_anrechnung_anrechnungstatus + WHERE anrechnungstatus_id = ? + '; + + return $this->execQuery($qry, array($anrechnungstatus_id)); + } + + /** + * Delete last status approved / rejected. + * If last status is 'approved', Genehmigung is resetted. + * + * @param $anrechnung_id + * @return array + */ + public function withdrawApprovement($anrechnung_id) + { + // Get last Anrechnungstatus + if (!$result = getData($this->AnrechnungModel->getLastAnrechnungstatus($anrechnung_id))[0]) + { + return error('Failed loading Anrechnung'); + } + + $last_status = $result->status_kurzbz; + $anrechnungstatus_id = $result->anrechnungstatus_id; + + // Exit, if last status is not approved / rejected + if ($last_status != self::ANRECHNUNGSTATUS_APPROVED && $last_status != self::ANRECHNUNGSTATUS_REJECTED) + { + return error('Nothing to withdraw. Application is still in progress'); + } + + // Start DB transaction + $this->db->trans_start(false); + + // If Anrechnung was approved + if ($last_status == self::ANRECHNUNGSTATUS_APPROVED) + { + // Reset Genehmigung + $this->AnrechnungModel->update($anrechnung_id, array('genehmigt_von' => NULL)); + } + + // Delete last status approved / rejected + $this->AnrechnungModel->deleteAnrechnungstatus($anrechnungstatus_id); + + // Transaction complete + $this->db->trans_complete(); + + if ($this->db->trans_status() === false) + { + $this->db->trans_rollback(); + return error('Failed withdrawing Genehmigung', EXIT_ERROR); + } + return success(); + + } } diff --git a/application/models/education/Anrechnungbegruendung_model.php b/application/models/education/Anrechnungbegruendung_model.php new file mode 100644 index 000000000..81f1ef614 --- /dev/null +++ b/application/models/education/Anrechnungbegruendung_model.php @@ -0,0 +1,15 @@ +dbTable = 'lehre.tbl_anrechnung_begruendung'; + $this->pk = 'begruendung_id'; + } +} diff --git a/application/models/education/Lehrveranstaltung_model.php b/application/models/education/Lehrveranstaltung_model.php index ef5373f5f..8517d7f9d 100644 --- a/application/models/education/Lehrveranstaltung_model.php +++ b/application/models/education/Lehrveranstaltung_model.php @@ -169,18 +169,34 @@ class Lehrveranstaltung_model extends DB_Model */ public function getLecturersByLv($studiensemester_kurzbz, $lehrveranstaltung_id) { - $query = "SELECT * FROM (SELECT distinct on(uid) vorname, nachname, tbl_benutzer.uid as uid, - CASE WHEN lehrfunktion_kurzbz='LV-Leitung' THEN true ELSE false END as lvleiter - FROM lehre.tbl_lehreinheit, lehre.tbl_lehreinheitmitarbeiter, public.tbl_benutzer, public.tbl_person - WHERE - tbl_lehreinheit.lehreinheit_id=tbl_lehreinheitmitarbeiter.lehreinheit_id AND - tbl_lehreinheitmitarbeiter.mitarbeiter_uid=tbl_benutzer.uid AND - tbl_person.person_id=tbl_benutzer.person_id AND - lehrveranstaltung_id=? AND - tbl_lehreinheitmitarbeiter.mitarbeiter_uid NOT like '_Dummy%' AND - tbl_benutzer.aktiv=true AND tbl_person.aktiv=true AND - studiensemester_kurzbz=?) AS a - ORDER BY lvleiter DESC, nachname, vorname"; + $query = "SELECT + * + FROM + (SELECT distinct on(uid) vorname, nachname, tbl_benutzer.uid as uid, + CASE WHEN + EXISTS( + SELECT + 1 + FROM + lehre.tbl_lehreinheitmitarbeiter lvllem + JOIN lehre.tbl_lehreinheit lvlle USING(lehreinheit_id) + WHERE + lehrfunktion_kurzbz='LV-Leitung' + AND lehrveranstaltung_id=tbl_lehreinheit.lehrveranstaltung_id + AND studiensemester_kurzbz=tbl_lehreinheit.studiensemester_kurzbz + AND mitarbeiter_uid=tbl_benutzer.uid + ) THEN true ELSE false END as lvleiter + FROM lehre.tbl_lehreinheit, lehre.tbl_lehreinheitmitarbeiter, public.tbl_benutzer, public.tbl_person + WHERE + tbl_lehreinheit.lehreinheit_id=tbl_lehreinheitmitarbeiter.lehreinheit_id AND + tbl_lehreinheitmitarbeiter.mitarbeiter_uid=tbl_benutzer.uid AND + tbl_person.person_id=tbl_benutzer.person_id AND + lehrveranstaltung_id=? AND + tbl_lehreinheitmitarbeiter.mitarbeiter_uid NOT like '_Dummy%' AND + tbl_benutzer.aktiv=true AND tbl_person.aktiv=true AND + studiensemester_kurzbz=? + ) AS a + ORDER BY lvleiter DESC, nachname, vorname"; return $this->execQuery($query, array($lehrveranstaltung_id, $studiensemester_kurzbz)); } @@ -273,7 +289,7 @@ class Lehrveranstaltung_model extends DB_Model return $this->execQuery($query, $parametersarray); } - + /** * Gets Lehrveranstaltung and its Lehreinheiten (multiple rows possible). * Returns empty array if student has no Lehrveranstaltung. @@ -290,7 +306,7 @@ class Lehrveranstaltung_model extends DB_Model AND studiensemester_kurzbz = ? AND lehrveranstaltung_id = ?; '; - + return $this->execQuery($query, array($uid, $studiensemester_kurzbz, $lehrveranstaltung_id)); } } diff --git a/application/models/education/Pruefung_model.php b/application/models/education/Pruefung_model.php index d10364979..e3776c4ad 100644 --- a/application/models/education/Pruefung_model.php +++ b/application/models/education/Pruefung_model.php @@ -11,4 +11,29 @@ class Pruefung_model extends DB_Model $this->dbTable = 'campus.tbl_pruefung'; $this->pk = 'pruefung_id'; } + + /** + * Gets Pruefungen of a person for a Studiensemester. + * @param int $person_id + * @param string $studiensemester_kurzbz + * @return object + */ + public function getByPerson($person_id, $studiensemester_kurzbz) + { + $qry = ' + SELECT prfg.*, pers.matr_nr, lv.ects, stg.studiengang_kz, prst.prestudent_id, + UPPER(stg.typ||stg.kurzbz) AS studiengang, stg.bezeichnung AS studiengang_bezeichnung + FROM public.tbl_person pers + JOIN public.tbl_prestudent prst USING (person_id) + JOIN public.tbl_student USING (prestudent_id) + JOIN lehre.tbl_pruefung prfg USING (student_uid) + JOIN lehre.tbl_lehreinheit le USING (lehreinheit_id) + JOIN lehre.tbl_lehrveranstaltung lv USING (lehrveranstaltung_id) + JOIN public.tbl_studiengang stg ON prst.studiengang_kz = stg.studiengang_kz + WHERE pers.person_id = ? + AND le.studiensemester_kurzbz = ? + ORDER BY prfg.datum, pruefung_id'; + + return $this->execQuery($qry, array($person_id, $studiensemester_kurzbz)); + } } diff --git a/application/models/education/Zeugnisnote_model.php b/application/models/education/Zeugnisnote_model.php index 7ed0e6456..65607e252 100644 --- a/application/models/education/Zeugnisnote_model.php +++ b/application/models/education/Zeugnisnote_model.php @@ -12,4 +12,125 @@ class Zeugnisnote_model extends DB_Model $this->pk = array('studiensemester_kurzbz', 'student_uid', 'lehrveranstaltung_id'); $this->hasSequence = false; } + + /** + * Gets ECTS sums of completed courses (Zeugnisnoten) of a person for a Studiensemester. + * If no valid Noten for the course were entered, 0 ects is returned. + * @param int $person_id + * @param string $studiensemester_kurzbz + * @param bool $aktiv + * @param bool $lehre + * @param bool $offiziell + * @param bool $positiv + * @return object + */ + public function getEctsSumsByPerson($person_id, $studiensemester_kurzbz, $aktiv = true, $lehre = null, $offiziell = null, $positiv = null) + { + $params = array(); + + $qry = "SELECT DISTINCT ON (prst.prestudent_id) pers.matr_nr, stg.studiengang_kz, prst.prestudent_id, stg.erhalter_kz, + UPPER(stg.typ||stg.kurzbz) AS studiengang, stg.bezeichnung AS studiengang_bezeichnung, COALESCE(summen.summe_ects, 0) AS summe_ects + FROM public.tbl_person pers + JOIN public.tbl_prestudent prst USING (person_id) + JOIN public.tbl_prestudentstatus prstst USING (prestudent_id) + JOIN public.tbl_studiengang stg ON prst.studiengang_kz = stg.studiengang_kz + LEFT JOIN ( + SELECT zgnisnote.student_uid, prestudent_id, zgnisnote.studiensemester_kurzbz, sum(ects) AS summe_ects + FROM public.tbl_student + LEFT JOIN lehre.tbl_zeugnisnote zgnisnote USING(student_uid) + LEFT JOIN lehre.tbl_note note ON zgnisnote.note = note.note + LEFT JOIN lehre.tbl_lehrveranstaltung lv USING (lehrveranstaltung_id) + WHERE TRUE"; + + if (isset($aktiv)) + { + $qry .= ' AND (note.aktiv = ?)'; + $params[] = $aktiv; + } + + if (isset($lehre)) + { + $qry .= ' AND (note.lehre = ?)'; + $params[] = $lehre; + } + + if (isset($offiziell)) + { + $qry .= ' AND (note.offiziell = ?)'; + $params[] = $offiziell; + } + + if (isset($positiv)) + { + $qry .= ' AND (note.positiv = ?)'; + $params[] = $positiv; + } + + $qry .= " GROUP BY zgnisnote.studiensemester_kurzbz, zgnisnote.student_uid, prestudent_id + ) summen ON prst.prestudent_id = summen.prestudent_id AND prstst.studiensemester_kurzbz = summen.studiensemester_kurzbz + WHERE pers.person_id = ? + AND prstst.studiensemester_kurzbz = ? + ORDER BY prst.prestudent_id"; + + $params[] = $person_id; + $params[] = $studiensemester_kurzbz; + + return $this->execQuery($qry, $params); + } + + /** + * Gets courses (Zeugnisnoten) of a person for a Studiensemester. + * @param int $person_id + * @param string $studiensemester_kurzbz + * @param bool $aktiv + * @param bool $lehre + * @param bool $offiziell + * @param bool $positiv + * @return object + */ + public function getByPerson($person_id, $studiensemester_kurzbz, $aktiv = true, $lehre = null, $offiziell = null, $positiv = null) + { + $params = array($person_id, $studiensemester_kurzbz); + + $qry = "SELECT zgnisnote.*, pers.matr_nr, lv.ects, stg.studiengang_kz, prst.prestudent_id, stg.erhalter_kz, + UPPER(stg.typ||stg.kurzbz) AS studiengang, stg.bezeichnung AS studiengang_bezeichnung, note.note, + note.bezeichnung AS note_bezeichnung + FROM public.tbl_person pers + JOIN public.tbl_prestudent prst USING (person_id) + JOIN public.tbl_student USING (prestudent_id) + JOIN lehre.tbl_zeugnisnote zgnisnote USING (student_uid) + JOIN lehre.tbl_note note ON zgnisnote.note = note.note + JOIN lehre.tbl_lehrveranstaltung lv USING (lehrveranstaltung_id) + JOIN public.tbl_studiengang stg ON prst.studiengang_kz = stg.studiengang_kz + WHERE pers.person_id = ? + AND zgnisnote.studiensemester_kurzbz = ?"; + + if (isset($aktiv)) + { + $qry .= ' AND note.aktiv = ?'; + $params[] = $aktiv; + } + + if (isset($lehre)) + { + $qry .= ' AND note.lehre = ?'; + $params[] = $lehre; + } + + if (isset($offiziell)) + { + $qry .= ' AND note.offiziell = ?'; + $params[] = $offiziell; + } + + if (isset($positiv)) + { + $qry .= ' AND note.positiv = ?'; + $params[] = $positiv; + } + + $qry .= ' ORDER BY zgnisnote.benotungsdatum'; + + return $this->execQuery($qry, $params); + } } diff --git a/application/models/organisation/Geschaeftsjahr_model.php b/application/models/organisation/Geschaeftsjahr_model.php index 9c856f40e..4f0d03b73 100644 --- a/application/models/organisation/Geschaeftsjahr_model.php +++ b/application/models/organisation/Geschaeftsjahr_model.php @@ -20,8 +20,8 @@ class Geschaeftsjahr_model extends DB_Model { $query = 'SELECT * FROM public.tbl_geschaeftsjahr - WHERE start <= now() - AND ende >= now() + WHERE start <= CURRENT_DATE + AND ende >= CURRENT_DATE ORDER BY start DESC LIMIT 1'; diff --git a/application/models/organisation/Studiengang_model.php b/application/models/organisation/Studiengang_model.php index 41bdabd11..6358ca81e 100644 --- a/application/models/organisation/Studiengang_model.php +++ b/application/models/organisation/Studiengang_model.php @@ -475,7 +475,7 @@ class Studiengang_model extends DB_Model funktion_kurzbz = \'Leitung\' AND ( datum_von <= NOW() OR datum_von IS NULL ) AND ( datum_bis >= NOW() OR datum_bis IS NULL ) - AND studiengang_kz = ' . $this->db->escape($studiengang_kz, FHC_INTEGER) + AND studiengang_kz = ' . $this->db->escape($studiengang_kz) ; } diff --git a/application/models/person/Notiz_model.php b/application/models/person/Notiz_model.php index fd08cc384..bfd8aa258 100644 --- a/application/models/person/Notiz_model.php +++ b/application/models/person/Notiz_model.php @@ -152,6 +152,7 @@ class Notiz_model extends DB_Model */ public function getNotizByTitel($person_id, $titel) { + $this->addSelect('public.tbl_notiz.insertamum as insertnotiz, *'); // Join with the table public.tbl_notizzuordnung using notiz_id $this->addJoin('public.tbl_notizzuordnung', 'notiz_id'); $this->addJoin('public.tbl_prestudent', 'prestudent_id', 'LEFT'); diff --git a/application/models/person/Person_model.php b/application/models/person/Person_model.php index e005e243c..ec5522674 100644 --- a/application/models/person/Person_model.php +++ b/application/models/person/Person_model.php @@ -152,34 +152,36 @@ class Person_model extends DB_Model */ public function getPersonStammdaten($person_id, $zustellung_only = false) { - $this->addSelect('public.tbl_person.*, s.kurztext as staatsbuergerschaft, g.kurztext as geburtsnation'); + $this->addSelect('public.tbl_person.*, tbl_person.staatsbuergerschaft AS staatsbuergerschaft_code, tbl_person.geburtsnation AS geburtsnation_code, + s.kurztext as staatsbuergerschaft, g.kurztext as geburtsnation'); $this->addJoin('bis.tbl_nation s', 'public.tbl_person.staatsbuergerschaft = s.nation_code', 'LEFT'); $this->addJoin('bis.tbl_nation g', 'public.tbl_person.geburtsnation = g.nation_code', 'LEFT'); $person = $this->load($person_id); - if($person->error) return $person; + if (isError($person)) return $person; //return null if not found - if(count($person->retval) < 1) + if (!hasData($person)) return success(null); - $this->KontaktModel->addDistinct(); $this->KontaktModel->addSelect('kontakttyp, anmerkung, kontakt, zustellung'); $this->KontaktModel->addOrder('kontakttyp'); + $this->KontaktModel->addOrder('insertamum', 'DESC'); $where = $zustellung_only === true ? array('person_id' => $person_id, 'zustellung' => true) : array('person_id' => $person_id); $kontakte = $this->KontaktModel->loadWhere($where); - if($kontakte->error) return $kontakte; + if (isError($kontakte)) return $kontakte; $where = $zustellung_only === true ? array('person_id' => $person_id, 'zustelladresse' => true) : array('person_id' => $person_id); $this->AdresseModel->addSelect('public.tbl_adresse.*, bis.tbl_nation.kurztext AS nationkurztext'); $this->AdresseModel->addJoin('bis.tbl_nation', 'tbl_adresse.nation = tbl_nation.nation_code', 'LEFT'); + $this->AdresseModel->addOrder('insertamum', 'DESC'); $adressen = $this->AdresseModel->loadWhere($where); - if($adressen->error) return $adressen; + if (isError($adressen)) return $adressen; - $stammdaten = $person->retval[0]; - $stammdaten->kontakte = $kontakte->retval; - $stammdaten->adressen = $adressen->retval; + $stammdaten = getData($person)[0]; + $stammdaten->kontakte = hasData($kontakte) ? getData($kontakte) : array(); + $stammdaten->adressen = hasData($adressen) ? getData($adressen) : array(); return success($stammdaten); } @@ -263,4 +265,19 @@ class Person_model extends DB_Model return success($result->vorname. ' '. $result->nachname); } + + public function checkDuplicate($person_id) + { + $qry = "SELECT sp.person_id + FROM public.tbl_person p + LEFT JOIN public.tbl_person sp ON p.vorname = sp.vorname + AND p.nachname = sp.nachname + AND p.gebdatum = sp.gebdatum + JOIN public.tbl_prestudent ps ON sp.person_id = ps.person_id + JOIN public.tbl_prestudentstatus pss ON ps.prestudent_id = pss.prestudent_id + WHERE p.person_id = ? AND sp.person_id != ? AND pss.status_kurzbz = ?"; + + + return $this->execQuery($qry, array($person_id, $person_id, 'Abbrecher')); + } } diff --git a/application/models/ressource/Betriebsmittelperson_model.php b/application/models/ressource/Betriebsmittelperson_model.php index 87915cfa8..1a97d9e38 100644 --- a/application/models/ressource/Betriebsmittelperson_model.php +++ b/application/models/ressource/Betriebsmittelperson_model.php @@ -18,7 +18,7 @@ class Betriebsmittelperson_model extends DB_Model * @param bool $isRetourniert False to retrieve only active Betriebsmittel. * @return array|bool */ - public function getBetriebsmittel($person_id, $betriebsmitteltyp = null, $isRetourniert = null) + public function getBetriebsmittel($person_id, $betriebsmitteltyp = null, $isRetourniert = null, $onlyAktiveBenutzer=false) { if (!is_numeric($person_id)) { @@ -28,8 +28,12 @@ class Betriebsmittelperson_model extends DB_Model $this->addJoin('wawi.tbl_betriebsmittel', 'betriebsmittel_id'); + if( $onlyAktiveBenutzer ) { + $this->addJoin('public.tbl_benutzer b', 'b.uid = wawi.tbl_betriebsmittelperson.uid AND b.aktiv = \'t\''); + } + $condition = ' - person_id = '. $this->escape($person_id). ' + wawi.tbl_betriebsmittelperson.person_id = '. $this->escape($person_id). ' '; if (is_string($betriebsmitteltyp)) { diff --git a/application/models/system/Fehler_model.php b/application/models/system/Fehler_model.php new file mode 100644 index 000000000..28618f6d9 --- /dev/null +++ b/application/models/system/Fehler_model.php @@ -0,0 +1,14 @@ +dbTable = 'system.tbl_fehler'; + $this->pk = 'fehlercode'; + } +} diff --git a/application/models/system/Filters_model.php b/application/models/system/Filters_model.php index 20394b36d..581be65e1 100644 --- a/application/models/system/Filters_model.php +++ b/application/models/system/Filters_model.php @@ -57,19 +57,34 @@ class Filters_model extends DB_Model /** * Loads all filters by their app and dataset_name */ - public function getFiltersByAppDatasetName($app, $dataset_name) + public function getFiltersByAppDatasetNamePersonId($app, $dataset_name, $person_id) { - $this->resetQuery(); // reset any previous built query + $query = ' + ( + -- Global filters + SELECT gs.filter_id, + gs.person_id, + gs.description + FROM system.tbl_filters gs + WHERE gs.app = ? + AND gs.dataset_name = ? + AND gs.person_id IS NULL + ORDER BY gs.person_id DESC, gs.sort ASC + ) + UNION ALL + ( + -- Personal filters + SELECT ps.filter_id, + ps.person_id, + ps.description + FROM system.tbl_filters ps + WHERE ps.app = ? + AND ps.dataset_name = ? + AND ps.person_id = ? + ORDER BY ps.person_id DESC, ps.sort ASC + )'; - $this->addSelect('filter_id, person_id, description'); - $this->addOrder('person_id', 'DESC'); // sort descending on column person_id - $this->addOrder('sort', 'ASC'); // sort on column sort - - $filterParametersArray = array( - 'app' => $app, - 'dataset_name' => $dataset_name - ); - - return $this->loadWhere($filterParametersArray); + return $this->execQuery($query, array($app, $dataset_name, $app, $dataset_name, $person_id)); } } + diff --git a/application/models/system/Issue_model.php b/application/models/system/Issue_model.php new file mode 100644 index 000000000..5dac85066 --- /dev/null +++ b/application/models/system/Issue_model.php @@ -0,0 +1,51 @@ +dbTable = 'system.tbl_issue'; + $this->pk = 'issue_id'; + } + + /** + * Gets number of open (non-resolved) issues. + * @param string $fehlercode unique error code + * @param int $person_id if provided, only issues with this person_id are counted. + * @param string $oe_kurzbz if provided, only issues with this oe_kurzbz are counted. + * @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) + { + $params = array($fehlercode); + // issue exists for a fehlercode (or fehlercode_extern), person_id, oe_kurzbz, if not verarbeitet yet + $qry = 'SELECT count(*) as anzahl_open_issues FROM system.tbl_issue + WHERE fehlercode = ? + AND verarbeitetamum IS NULL'; + + if (!isEmptyString($fehlercode_extern)) + { + $qry .= ' AND fehlercode_extern = ?'; + $params[] = $fehlercode_extern; + } + + if (isset($person_id)) + { + $qry .= ' AND person_id = ?'; + $params[] = $person_id; + } + + if (isset($oe_kurzbz)) + { + $qry .= ' AND oe_kurzbz = ?'; + $params[] = $oe_kurzbz; + } + + return $this->execQuery($qry, $params); + } +} diff --git a/application/views/codex/oehbeitrag.php b/application/views/codex/oehbeitrag.php new file mode 100644 index 000000000..7cfb18fe8 --- /dev/null +++ b/application/views/codex/oehbeitrag.php @@ -0,0 +1,60 @@ +load->view( + 'templates/FHC-Header', + array( + 'title' => 'ÖH-Beitragsverwaltung', + 'jquery' => true, + 'jqueryui' => true, + 'bootstrap' => true, + 'fontawesome' => true, + 'sbadmintemplate' => true, + 'tablesorter' => true, + 'dialoglib' => true, + 'ajaxlib' => true, + 'navigationwidget' => true, + 'customCSSs' => array('public/css/sbadmin2/tablesort_bootstrap.css', 'public/css/codex/oehbeitrag.css'), + 'customJSs' => array('public/js/tablesort/tablesort.js', 'public/js/codex/oehbeitrag.js') + ) +); +?> + + +
+ + widgetlib->widget('NavigationWidget'); ?> + +
+
+
+
+ +
+
+
+
+ +
+
+ + + + + + + + + + + + +
Gültig vonGültig bisStudierendenbetragVersicherungsbetragAktion
+
+
+
+
+
+ + +load->view('templates/FHC-Footer'); ?> diff --git a/application/views/crm/statusGrundList.php b/application/views/crm/statusGrundList.php index e128856d3..ab8f096bb 100644 --- a/application/views/crm/statusGrundList.php +++ b/application/views/crm/statusGrundList.php @@ -15,6 +15,7 @@ Aktiv Bezeichnung mehrsprachig Beschreibung + Statusgrund @@ -25,6 +26,7 @@ aktiv); ?> bezeichnung_mehrsprachig); ?> beschreibung); ?> + statusgrund_kurzbz); ?> Edit @@ -33,4 +35,4 @@ - \ No newline at end of file + diff --git a/application/views/crm/statusgrundEdit.php b/application/views/crm/statusgrundEdit.php index 9fa91b6d5..fc001d92a 100644 --- a/application/views/crm/statusgrundEdit.php +++ b/application/views/crm/statusgrundEdit.php @@ -81,6 +81,21 @@   + + + StatusGrund: + + + + +
+ + + + +   + + diff --git a/application/views/crm/statusgrundNew.php b/application/views/crm/statusgrundNew.php index ffcd18429..1c3a5f9e0 100644 --- a/application/views/crm/statusgrundNew.php +++ b/application/views/crm/statusgrundNew.php @@ -51,6 +51,16 @@   + + + StatusGrund: + + + + +
+ + diff --git a/application/views/lehre/anrechnung/approveAnrechnungDetail.php b/application/views/lehre/anrechnung/approveAnrechnungDetail.php index 75059ec69..4603708f4 100644 --- a/application/views/lehre/anrechnung/approveAnrechnungDetail.php +++ b/application/views/lehre/anrechnung/approveAnrechnungDetail.php @@ -12,7 +12,8 @@ $this->load->view( 'phrases' => array( 'global' => array( 'anerkennungNachgewiesenerKenntnisse', - 'antragStellen' + 'antragStellen', + 'begruendung' ), 'ui' => array( 'hilfeZuDieserSeite', @@ -36,7 +37,14 @@ $this->load->view( 'lehrveranstaltung', 'ects', 'lektor', - ) + ), + 'anrechnung' => array( + 'genehmigungAblehnungWirklichZuruecknehmen', + 'empfehlungsanforderungWirklichZuruecknehmen', + 'erfolgreichZurueckgenommen', + 'empfehlungPositivConfirmed', + 'empfehlungNegativConfirmed' + ) ), 'customCSSs' => array( 'public/css/Tabulator.css' @@ -53,7 +61,7 @@ $this->load->view(
- +
- + +
-
-
- - -
-
-
-
- p->t('anrechnung', 'antrag'); ?>  - - - - p->t('anrechnung', 'antragdatum'); ?>: anrechnung_id) ? $anrechnungData->insertamum : '-' ?> -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
p->t('person', 'student')); ?>vorname . ' ' . $antragData->nachname; ?>
p->t('person', 'personenkennzeichen'); ?>matrikelnr ?>
p->t('lehre', 'studiensemester')); ?>studiensemester_kurzbz ?>
p->t('lehre', 'studiengang')); ?>stg_bezeichnung ?>
p->t('lehre', 'lehrveranstaltung'); ?>lv_bezeichnung ?>
p->t('lehre', 'ects'); ?>ects ?>
p->t('lehre', 'lektorInnen'); ?> - lektoren) - 1 ?> - lektoren as $key => $lektor): ?> - vorname . ' ' . $lektor->nachname; - echo $key === $len ? '' : ', ' ?> - -
p->t('anrechnung', 'herkunftDerKenntnisse'); ?>anmerkung ?>
p->t('anrechnung', 'nachweisdokumente'); ?> - dokumentname) ?> -
-
-
-
- -
-
-
- -
- -
- p->t('anrechnung', 'empfehlung'); ?>  - - -p->t('anrechnung', 'empfehlungInfoTooltipText'); ?> - - -
- p->t('anrechnung', 'empfehlungVon'); ?>: - empfehlung_von ?> -  |  - p->t('anrechnung', 'empfehlungdatum'); ?>: - empfehlung_am ?> -
-
- -
- -
- p->t('anrechnung', 'keineEmpfehlungAngefordert'); ?> -
- -
- p->t('anrechnung', 'empfehlungAngefordertNochKeineEmpfehlung'); ?> - - empfehlung_angefordert_am ?> - . -
- -
- p->t('anrechnung', 'empfehlungPositivConfirmed'); ?> -
- -
-
- p->t('anrechnung', 'empfehlungNegativConfirmed'); ?> -
-
p->t('global', 'begruendung'); ?> - : - notiz) ?> -
-
-
-
-
-
- -
-
-
-

- -
-
- -
- -
- p->t('anrechnung', 'genehmigung'); ?>  - - -p->t('anrechnung', 'genehmigungInfoTooltipText'); ?> - - -
- p->t('anrechnung', 'abgeschlossenVon'); ?>: - abgeschlossen_von ?> -  |  - p->t('anrechnung', 'abschlussdatum'); ?>: - abgeschlossen_am ?> - -
-
- -
- -
- p->t('anrechnung', 'nochKeineGenehmigung'); ?> -
- -
- p->t('anrechnung', 'genehmigungPositiv'); ?> -
- -
-
- p->t('anrechnung', 'genehmigungNegativ'); ?> -
-
p->t('global', 'begruendung'); ?> - : - notiz) ?> -
-
-
-
-
- - - -
-
-
- -
-
- -
-
- -
- - -
- + +
+
+
+
+ p->t('anrechnung', 'antrag'); ?>  + + + + p->t('anrechnung', 'antragdatum'); ?>: anrechnung_id) ? $anrechnungData->insertamum : '-' ?> +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
p->t('person', 'studentIn')); ?>vorname . ' ' . $antragData->nachname; ?>
p->t('person', 'personenkennzeichen'); ?>matrikelnr ?>
p->t('lehre', 'studiensemester')); ?>studiensemester_kurzbz ?>
p->t('lehre', 'studiengang')); ?>stg_bezeichnung ?>
p->t('lehre', 'lehrveranstaltung'); ?>lv_bezeichnung ?>
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
p->t('lehre', 'ects'); ?>ects ?>
p->t('lehre', 'lektorInnen'); ?> + lektoren) - 1 ?> + lektoren as $key => $lektor): ?> + vorname . ' ' . $lektor->nachname; + echo $key === $len ? '' : ', ' ?> + +
p->t('global', 'zgv')); ?>zgv ?>
p->t('anrechnung', 'herkunftDerKenntnisse'); ?>anmerkung ?>
p->t('anrechnung', 'nachweisdokumente'); ?> + dokumentname) ?> +
+
+
+
+
+
+
+ +
+
+
+
+ p->t('anrechnung', 'empfehlung'); ?>  +
+ p->t('anrechnung', 'empfehlungVon'); ?>: + empfehlung_von ?> +  |  + p->t('anrechnung', 'empfehlungdatum'); ?>: + empfehlung_am ?> +
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
p->t('anrechnung', 'empfehlungsanfrageAm')); ?> + empfehlungsanfrageAm; ?> +
p->t('anrechnung', 'empfehlungsanfrageAn'); ?> + empfehlungsanfrageAn; ?> +
p->t('anrechnung', 'empfehlungAm')); ?>empfehlung_am ?>
p->t('anrechnung', 'empfehlungVon')); ?>empfehlung_von ?>
p->t('anrechnung', 'empfehlung'); ?>
p->t('global', 'begruendung'); ?> + begruendung) ?> +
+
+
+
+
+ + +
+ + +
+ +
+
+
+
+
+ +
+ + +
+
+
+

+ +
+
+
+
+ p->t('anrechnung', 'genehmigung'); ?>  +
+ p->t('anrechnung', 'abgeschlossenVon'); ?>: + abgeschlossen_von ?> +  |  + p->t('anrechnung', 'abschlussdatum'); ?>: + abgeschlossen_am ?> +
+
+
+ +
+ p->t('anrechnung', 'nochKeineGenehmigung'); ?> +
+ +
+ p->t('anrechnung', 'genehmigungPositiv'); ?> +
+ +
+
+ p->t('anrechnung', 'genehmigungNegativ'); ?> +
+
p->t('global', 'begruendung'); ?> + : + notiz) ?> +
+
+ +
+ + + + + +
+
+
+ +
+ + + +
+
+
+



+
- Status: - status; ?>

+ load->view('lehre/anrechnung/reviewAnrechnungInfo'); ?>
-
-
+ + load->view('templates/FHC-Footer'); ?> diff --git a/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php b/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php index 91d821fde..850affeea 100644 --- a/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php +++ b/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php @@ -13,11 +13,14 @@ $this->load->view( 'tablewidget' => true, 'phrases' => array( 'global' => array( - 'begruendung' + 'begruendung', + 'zgv' ), 'anrechnung' => array( 'nachweisdokumente', 'empfehlung', + 'empfehlungsanfrageAn', + 'empfehlungsanfrageAm', 'confirmTextAntragHatBereitsEmpfehlung', 'herkunft' ), @@ -43,6 +46,7 @@ $this->load->view( 'bitteMindEinenAntragWaehlen', 'bitteBegruendungAngeben', 'empfehlungWurdeAngefordert', + 'empfehlungWurdeAngefordertAusnahmeWoKeineLektoren', 'anrechnungenWurdenGenehmigt', 'anrechnungenWurdenAbgelehnt' ), @@ -155,11 +159,12 @@ $this->load->view(
-
@@ -173,11 +178,12 @@ $this->load->view(
-
@@ -186,7 +192,7 @@ $this->load->view(
-
+
+ ' target='_blank'> + p->t('global', 'antragAnlegen'); ?> + +
-
+
+ class="btn btn-default btn-w200 btn-mr50" type="button"> + p->t('anrechnung', 'empfehlungAnfordern')); ?> + class="btn btn-danger btn-w200" type="button"> + p->t('global', 'ablehnen')); ?> + class="btn btn-primary btn-w200" type="button"> + p->t('global', 'genehmigen')); ?>
diff --git a/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php b/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php index 0ee3fdc57..31e848481 100644 --- a/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php +++ b/application/views/lehre/anrechnung/approveAnrechnungUebersichtData.php @@ -1,4 +1,7 @@ >' . $LANGUAGE_INDEX . ', + array_to_json(zgv.bezeichnung::varchar[])->>' . $LANGUAGE_INDEX . ' + ) AS zgv + FROM public.tbl_prestudent + LEFT JOIN bis.tbl_zgv zgv USING (zgv_code) + LEFT JOIN bis.tbl_zgvmaster zgvmaster USING (zgvmas_code) + WHERE prestudent_id = anrechnung.prestudent_id + ) AS zgv, + anrechnung.insertamum::date AS "antragsdatum", empfehlung_anrechnung, (SELECT status_kurzbz FROM lehre.tbl_anrechnungstatus @@ -33,13 +52,47 @@ $query = ' JOIN public.tbl_person AS person USING (person_id) JOIN public.tbl_studiengang AS stg USING (studiengang_kz) JOIN lehre.tbl_lehrveranstaltung AS lv USING (lehrveranstaltung_id) - JOIN campus.tbl_dms_version AS dmsversion USING (dms_id) + LEFT JOIN campus.tbl_dms_version AS dmsversion USING (dms_id) JOIN lehre.tbl_anrechnung_anrechnungstatus USING (anrechnung_id) JOIN lehre.tbl_anrechnung_begruendung AS begruendung USING (begruendung_id) ) SELECT anrechnungen.*, - array_to_json(anrechnungstatus.bezeichnung_mehrsprachig::varchar[])->>' . $LANGUAGE_INDEX . ' AS "status_bezeichnung" + array_to_json(anrechnungstatus.bezeichnung_mehrsprachig::varchar[])->>' . $LANGUAGE_INDEX . ' AS "status_bezeichnung", + CASE + WHEN (anrechnungen.empfehlung_anrechnung IS NULL AND anrechnungen.status_kurzbz = \'' . ANRECHNUNGSTATUS_PROGRESSED_BY_STGL . '\') THEN NULL + ELSE + (SELECT insertamum::date + FROM lehre.tbl_anrechnungstatus + JOIN lehre.tbl_anrechnung_anrechnungstatus USING (status_kurzbz) + WHERE anrechnung_id = anrechnungen.anrechnung_id + AND status_kurzbz = \'' . ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR . '\' + ORDER BY insertamum DESC + LIMIT 1) + END "empfehlungsanfrageAm", + CASE + WHEN (anrechnungen.empfehlung_anrechnung IS NULL AND anrechnungen.status_kurzbz = \'' . ANRECHNUNGSTATUS_PROGRESSED_BY_STGL . '\') THEN NULL + ELSE + (SELECT COALESCE( + STRING_AGG(CONCAT_WS(\' \', vorname, nachname), \', \') FILTER (WHERE lvleiter = TRUE), + STRING_AGG(CONCAT_WS(\' \', vorname, nachname), \', \') FILTER (WHERE lvleiter = FALSE) + ) empfehlungsanfrageAn + FROM ( + SELECT DISTINCT ON (benutzer.uid) uid, vorname, nachname, + CASE WHEN lehrfunktion_kurzbz = \'LV-Leitung\' THEN TRUE ELSE FALSE END AS lvleiter + FROM lehre.tbl_lehreinheit + JOIN lehre.tbl_lehreinheitmitarbeiter lema USING (lehreinheit_id) + JOIN public.tbl_benutzer benutzer ON lema.mitarbeiter_uid = benutzer.uid + JOIN public.tbl_person USING (person_id) + WHERE studiensemester_kurzbz = \'' . $STUDIENSEMESTER . '\' + AND lehrveranstaltung_id = anrechnungen.lehrveranstaltung_id + AND lema.mitarbeiter_uid NOT like \'_Dummy%\' + AND benutzer.aktiv = TRUE + AND tbl_person.aktiv = TRUE + ORDER BY benutzer.uid, lvleiter DESC, nachname, vorname + ) as tmp_lvlektoren + ) + END "empfehlungsanfrageAn" FROM anrechnungen JOIN lehre.tbl_anrechnungstatus as anrechnungstatus ON (anrechnungstatus.status_kurzbz = anrechnungen.status_kurzbz) WHERE studiensemester_kurzbz = \'' . $STUDIENSEMESTER . '\' @@ -59,21 +112,28 @@ $filterWidgetArray = array( 'studiensemester_kurzbz', 'studiengang_kz', ucfirst($this->p->t('lehre', 'studiengang')), + ucfirst($this->p->t('lehre', 'organisationsform')), + 'Semester', ucfirst($this->p->t('lehre', 'lehrveranstaltung')), 'ECTS', ucfirst($this->p->t('person', 'studentIn')), ucfirst($this->p->t('global', 'begruendung')), ucfirst($this->p->t('anrechnung', 'nachweisdokumente')), ucfirst($this->p->t('anrechnung', 'herkunft')), + ucfirst($this->p->t('global', 'zgv')), + ucfirst($this->p->t('anrechnung', 'antragdatum')), ucfirst($this->p->t('anrechnung', 'empfehlung')), 'status_kurzbz', - 'Status' + 'Status', + ucfirst($this->p->t('anrechnung', 'empfehlungsanfrageAm')), + ucfirst($this->p->t('anrechnung', 'empfehlungsanfrageAn')) ), 'datasetRepOptions' => '{ height: func_height(this), layout: "fitColumns", // fit columns to width of table persistentLayout:true, persistentSort:true, + persistentFilter:true, autoResize: false, // prevent auto resizing of table (false to allow adapting table size when cols are (de-)activated headerFilterPlaceholder: " ", index: "anrechnung_id", // assign specific column as unique id (important for row indexing) @@ -100,26 +160,32 @@ $filterWidgetArray = array( } }', // tabulator properties 'datasetRepFieldsDefs' => '{ - anrechnung_id: {visible: false}, - lehrveranstaltung_id: {visible: false}, - begruendung_id: {visible: false}, - dms_id: {visible: false}, - studiensemester_kurzbz: {visible: false}, - studiengang_kz: {visible: false}, + anrechnung_id: {visible: false, headerFilter:"input"}, + lehrveranstaltung_id: {visible: false, headerFilter:"input"}, + begruendung_id: {visible: false, headerFilter:"input"}, + dms_id: {visible: false, headerFilter:"input"}, + studiensemester_kurzbz: {visible: false, headerFilter:"input"}, + studiengang_kz: {visible: false, headerFilter:"input"}, stg_bezeichnung: {headerFilter:"input"}, + orgform_kurzbz: {headerFilter:"input"}, + ausbildungssemester: {headerFilter:"input"}, lv_bezeichnung: {headerFilter:"input"}, ects: {headerFilter:"input", align:"center"}, student: {headerFilter:"input"}, begruendung: {headerFilter:"input"}, + zgv: {visible: false, headerFilter:"input"}, dokument_bezeichnung: {headerFilter:"input", formatter:"link", formatterParams:{ labelField:"dokument_bezeichnung", url:function(cell){return "'. current_url() .'/download?dms_id=" + cell.getData().dms_id}, target:"_blank" }}, anmerkung_student: {headerFilter:"input"}, + antragsdatum: {align:"center", headerFilter:"input", mutator: mut_formatStringDate}, empfehlung_anrechnung: {headerFilter:"input", align:"center", formatter: format_empfehlung_anrechnung, headerFilterFunc: hf_filterTrueFalse}, - status_kurzbz: {visible: false}, - status_bezeichnung: {headerFilter:"input"} + status_kurzbz: {visible: false, headerFilter:"input"}, + status_bezeichnung: {headerFilter:"input"}, + empfehlungsanfrageAm: {visible: false, align:"center", headerFilter:"input", mutator: mut_formatStringDate}, + empfehlungsanfrageAn: {visible: false, headerFilter:"input"} }', // col properties ); diff --git a/application/views/lehre/anrechnung/createAnrechnung.php b/application/views/lehre/anrechnung/createAnrechnung.php new file mode 100644 index 000000000..58b0757b9 --- /dev/null +++ b/application/views/lehre/anrechnung/createAnrechnung.php @@ -0,0 +1,173 @@ +load->view( + 'templates/FHC-Header', + array( + 'title' => $this->p->t('anrechnung', 'neueAnrechnung'), + 'jquery' => true, + 'jqueryui' => true, + 'bootstrap' => true, + 'fontawesome' => true, + 'ajaxlib' => true, + 'dialoglib' => true, + 'tabulator' => true, + 'tablewidget' => true, + 'phrases' => array( + 'global' => array( + 'anerkennungNachgewiesenerKenntnisse', + 'antragWurdeGestellt', + 'antragBereitsGestellt', + 'antragBearbeiten' + ), + 'ui' => array( + 'hochladen' + ), + 'lehre' => array( + 'studiensemester', + 'studiengang', + 'lehrveranstaltung' + ) + ), + 'customJSs' => array( + 'public/js/bootstrapper.js', + 'public/js/lehre/anrechnung/createAnrechnung.js' + ), + 'customCSSs' => array( + 'public/css/lehre/anrechnung.css' + ) + ) +); +?> + + +
+
+ + +
+ +
+ + +
+
+
+
+ widgetlib->widget( + 'Studiensemester_widget', + array( + DropdownWidget::SELECTED_ELEMENT => $studiensemester_selected + ), + array( + 'name' => 'studiensemester', + 'id' => 'studiensemester' + ) + ); + ?> +
+ +
+
+
+ + +
+
+ load->view('lehre/anrechnung/createAnrechnungData.php'); ?> +
+
+

+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
p->t('lehre', 'lehrveranstaltung'); ?> * + +
p->t('global', 'begruendung'); ?> * + +
p->t('anrechnung', 'herkunftDerKenntnisse'); ?> + 'herkunftKenntnisse', + 'rows' => 1 + )); ?> +
p->t('anrechnung', 'nachweisdokumente'); ?> * +
'uploadfile', + 'accept' => '.pdf', + 'size' => '50', + 'required' => 'required', + 'enctype' => "multipart/form-data" + )); ?> +
+ +
+
+
+ +
+
+ + + + +
+
+ +
+ + +
+
+ diff --git a/application/views/lehre/anrechnung/createAnrechnungData.php b/application/views/lehre/anrechnung/createAnrechnungData.php new file mode 100644 index 000000000..643c64626 --- /dev/null +++ b/application/views/lehre/anrechnung/createAnrechnungData.php @@ -0,0 +1,84 @@ +>' . $LANGUAGE_INDEX . ', + array_to_json(zgv.bezeichnung::varchar[])->>' . $LANGUAGE_INDEX . ' + ) AS zgv + FROM public.tbl_prestudent + LEFT JOIN bis.tbl_zgv zgv USING (zgv_code) + LEFT JOIN bis.tbl_zgvmaster zgvmaster USING (zgvmas_code) + WHERE prestudent_id = pst.prestudent_id + ) AS zgv + FROM public.tbl_prestudent pst + JOIN public.tbl_prestudentstatus pststatus USING (prestudent_id) + JOIN public.tbl_person person USING (person_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 stg.studiengang_kz = pst.studiengang_kz + WHERE pststatus.studiensemester_kurzbz = \'' . $STUDIENSEMESTER . '\' + AND pst.studiengang_kz IN (' . $STUDIENGAENGE_ENTITLED . ') + AND benutzer.aktiv = true + AND pststatus.status_kurzbz = \'Student\' + ORDER BY "stg_bezeichnung", ausbildungssemester, nachname +'; + +$filterWidgetArray = array( + 'query' => $query, + 'tableUniqueId' => 'createAnrechnung', + 'requiredPermissions' => 'lehre/anrechnung_anlegen', + 'datasetRepresentation' => 'tabulator', + 'columnsAliases' => array( + 'prestudent_id', + 'person_id', + 'studienplan_id', + 'studiengang_kz', + ucfirst($this->p->t('lehre', 'studiengang')), + 'Semester', + ucfirst($this->p->t('person', 'nachname')), + ucfirst($this->p->t('person', 'vorname')), + ucfirst($this->p->t('global', 'zgv')) + ), + 'datasetRepOptions' => '{ + height: 300, + layout: "fitColumns", // fit columns to width of table + persistentLayout:true, + autoResize: false, // prevent auto resizing of table (false to allow adapting table size when cols are (de-)activated + headerFilterPlaceholder: " ", + index: "prestudent_id", // assign specific column as unique id (important for row indexing) + selectable: 1, // allow row selection + selectablePersistence:false, // deselect previously selected rows when table is filtered, sorted or paginated + rowSelected: function(row) { + func_rowSelected(row); + }, + rowSelectionChanged:function(data, rows){ + func_rowSelectionChanged(data, rows); + }, + tableWidgetHeader: false + }', + 'datasetRepFieldsDefs' => '{ + prestudent_id: {visible: false, headerFilter:"input"}, + person_id: {visible: false, headerFilter:"input"}, + studienplan_id: {visible: false, headerFilter:"input"}, + studiengang_kz: {visible: false, headerFilter:"input"}, + stg_bezeichnung: {headerFilter:"input"}, + ausbildungssemester: {headerFilter:"input"}, + nachname: {headerFilter:"input"}, + vorname: {headerFilter:"input"}, + zgv: {headerFilter:"input"} + }' +); + +echo $this->widgetlib->widget('TableWidget', $filterWidgetArray); \ No newline at end of file diff --git a/application/views/lehre/anrechnung/requestAnrechnung.php b/application/views/lehre/anrechnung/requestAnrechnung.php index 5d6fa9a16..e507d3846 100644 --- a/application/views/lehre/anrechnung/requestAnrechnung.php +++ b/application/views/lehre/anrechnung/requestAnrechnung.php @@ -1,9 +1,12 @@ load->view( 'templates/FHC-Header', array( 'title' => $this->p->t('anrechnung', 'antragStellen'), 'jquery' => true, + 'jqueryui' => true, 'bootstrap' => true, 'fontawesome' => true, 'ajaxlib' => true, @@ -11,11 +14,23 @@ $this->load->view( 'phrases' => array( 'global' => array( 'anerkennungNachgewiesenerKenntnisse', - 'antragStellen' + 'antragStellen', + 'antragWurdeGestellt', + 'antragBereitsGestellt', + 'bearbeitungGesperrt' ), 'ui' => array( 'hilfeZuDieserSeite', - 'hochladen' + 'hochladen', + 'inBearbeitung', + 'neu', + 'maxZeichen', + 'errorBestaetigungFehlt', + 'systemfehler' + ), + 'anrechnung' => array( + 'deadlineUeberschritten', + 'benotungDerLV' ), 'person' => array( 'student', @@ -47,7 +62,7 @@ $this->load->view(
- +
- - 'requestAnrechnung-form'], - ['lv_id' => $antragData->lv_id, 'studiensemester' => $antragData->studiensemester_kurzbz] - ); ?> + +
-
-
- -
-
- -
-
-
-
- p->t('anrechnung', 'antrag'); ?>  - - - - p->t('anrechnung', 'antragdatum'); ?>: anrechnung_id) ? $anrechnungData->insertamum : '-' ?> -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
p->t('person', 'student')); ?>vorname . ' ' . $antragData->nachname; ?>
p->t('person', 'personenkennzeichen'); ?>matrikelnr ?>
p->t('lehre', 'studiensemester')); ?>studiensemester_kurzbz ?>
p->t('lehre', 'studiengang')); ?>stg_bezeichnung ?>
p->t('lehre', 'lehrveranstaltung'); ?>lv_bezeichnung ?>
p->t('lehre', 'ects'); ?>ects ?>
p->t('lehre', 'lektor')); ?> - lektoren) - 1 ?> - lektoren as $key => $lektor): ?> - vorname . ' ' . $lektor->nachname; - echo $key === $len ? '' : ', ' ?> - -
-
-
-
- -
-
-
- p->t('anrechnung', 'antragStellenText'); ?>  -
- -
-
- -
-
-
-
- -
-
-
-
- p->t('anrechnung', 'nachweisdokumente'); ?>  - - - -
-
-
- > -
- - - - dms_id)): ?> - dokumentname) ?> - -
-
-
-
- -
-
-
-
-
-
- p->t('anrechnung', 'herkunftDerKenntnisse'); ?>  - - - -
-
- -
-
-
-
-
-
- -
- > -
-
-
-
-
+ +
+
+
+ + + +
+
+
+
+ p->t('anrechnung', 'antrag'); ?>  + + + + p->t('anrechnung', 'antragdatum'); ?>: anrechnung_id) ? $anrechnungData->insertamum : '-' ?> +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
p->t('person', 'studentIn')); ?>vorname . ' ' . $antragData->nachname; ?>
p->t('person', 'personenkennzeichen'); ?>matrikelnr ?>
p->t('lehre', 'studiensemester')); ?>studiensemester_kurzbz ?>
p->t('lehre', 'studiengang')); ?>stg_bezeichnung ?>
p->t('lehre', 'lehrveranstaltung'); ?>lv_bezeichnung ?>
p->t('lehre', 'ects'); ?>ects ?>
p->t('lehre', 'lektorInnen')); ?> + lektoren) - 1 ?> + lektoren as $key => $lektor): ?> + vorname . ' ' . $lektor->nachname; + echo $key === $len ? '' : ', ' ?> + +
+
+
+
+ +
+
+
+ p->t('anrechnung', 'antragStellenText'); ?>  +
+ +
+
+ +
+
+
+
+ +
+
+
+
+ p->t('anrechnung', 'nachweisdokumente'); ?>  + + + +
+
+
+ +
+ + + + dokumentname) ?> + +
+
+
+
+ +
+
+
+
+
+
+ p->t('anrechnung', 'herkunftDerKenntnisse'); ?>  + + + +
+
+ + p->t('ui', 'maxZeichen'); ?> : +
+
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+ +
+
+
+
+



-
- Status: - +
Status: status; ?> -
- -
- p->t('global', 'bearbeitungGesperrt'); ?> - anrechnung_id) ? ': ' . $this->p->t('anrechnung', 'deadlineUeberschritten') : ''; ?> -
- +
+ +
load->view('lehre/anrechnung/requestAnrechnungImportant'); ?>
-
diff --git a/application/views/lehre/anrechnung/reviewAnrechnungDetail.php b/application/views/lehre/anrechnung/reviewAnrechnungDetail.php index 455c31e65..18c70e5af 100644 --- a/application/views/lehre/anrechnung/reviewAnrechnungDetail.php +++ b/application/views/lehre/anrechnung/reviewAnrechnungDetail.php @@ -34,7 +34,11 @@ $this->load->view( 'lehrveranstaltung', 'ects', 'lektor', - ) + ), + 'anrechnung' => array( + 'empfehlungPositivConfirmed', + 'empfehlungNegativConfirmed' + ) ), 'customCSSs' => array( 'public/css/Tabulator.css' @@ -63,199 +67,240 @@ $this->load->view(
-
-
+ +
+
+
+
+ p->t('anrechnung', 'antrag'); ?> +   + + + + p->t('anrechnung', 'antragdatum'); ?>: anrechnung_id) ? $anrechnungData->insertamum : '-' ?> +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
p->t('person', 'studentIn')); ?>vorname . ' ' . $antragData->nachname; ?>
p->t('person', 'personenkennzeichen'); ?>matrikelnr ?>
p->t('lehre', 'studiensemester')); ?>studiensemester_kurzbz ?>
p->t('lehre', 'studiengang')); ?>stg_bezeichnung ?>
p->t('lehre', 'lehrveranstaltung'); ?>lv_bezeichnung ?>
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
p->t('lehre', 'ects'); ?>ects ?>
p->t('lehre', 'lektorInnen'); ?> + lektoren) - 1 ?> + lektoren as $key => $lektor): ?> + vorname . ' ' . $lektor->nachname; + echo $key === $len ? '' : ', ' ?> + +
p->t('global', 'zgv')); ?>zgv ?>
p->t('anrechnung', 'herkunftDerKenntnisse'); ?>anmerkung ?>
p->t('anrechnung', 'nachweisdokumente'); ?> + dokumentname) ?> +
- -
-
-
-
- p->t('anrechnung', 'antrag'); ?> -   - - - - p->t('anrechnung', 'antragdatum'); ?>: anrechnung_id) ? $anrechnungData->insertamum : '-' ?> -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
p->t('person', 'student')); ?>vorname . ' ' . $antragData->nachname; ?>
p->t('person', 'personenkennzeichen'); ?>matrikelnr ?>
p->t('lehre', 'studiensemester')); ?>studiensemester_kurzbz ?>
p->t('lehre', 'studiengang')); ?>stg_bezeichnung ?>
p->t('lehre', 'lehrveranstaltung'); ?>lv_bezeichnung ?>
p->t('lehre', 'ects'); ?>ects ?>
p->t('lehre', 'lektorInnen'); ?> - lektoren) - 1 ?> - lektoren as $key => $lektor): ?> - vorname . ' ' . $lektor->nachname; - echo $key === $len ? '' : ', ' ?> - -
p->t('anrechnung', 'herkunftDerKenntnisse'); ?>anmerkung ?>
p->t('anrechnung', 'nachweisdokumente'); ?> - dokumentname) ?> -
-
-
-
- -
-
-
-
- p->t('anrechnung', 'empfehlung'); ?> -
- p->t('anrechnung', 'empfehlungVon'); ?>: - empfehlung_von ?> -  |  - p->t('anrechnung', 'empfehlungdatum'); ?>: - empfehlung_am ?> +
+
+
+
+
+
+ +
+
+
+
+ p->t('anrechnung', 'empfehlung'); ?> +
+ p->t('anrechnung', 'empfehlungVon'); ?>: + empfehlung_von ?> +  |  + p->t('anrechnung', 'empfehlungdatum'); ?>: + empfehlung_am ?> -
-
-
- -
- p->t('anrechnung', 'nochKeineEmpfehlung'); ?> -
- -
- p->t('anrechnung', 'empfehlungPositivConfirmed'); ?> -
- -
-
- p->t('anrechnung', 'empfehlungNegativConfirmed'); ?> -
-
p->t('global', 'begruendung'); ?> - : - notiz) ?> -
-
-
-
-
- - - -
-
-
-
-
-
-
- -
- - -
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
p->t('anrechnung', 'empfehlungsanfrageAm')); ?> + empfehlungsanfrageAm; ?> +
p->t('anrechnung', 'empfehlungsanfrageAn'); ?> + empfehlungsanfrageAn; ?> +
p->t('anrechnung', 'empfehlungAm')); ?> + empfehlung_am ?> +
p->t('anrechnung', 'empfehlungVon')); ?> + empfehlung_von ?> +
p->t('anrechnung', 'empfehlung'); ?>
p->t('global', 'begruendung'); ?> + begruendung) ?> +
+
+
+
+ + +
+
+
+
+
+ + + + + +
+
+ +
+ + +
+
+
diff --git a/application/views/lehre/anrechnung/reviewAnrechnungInfo.php b/application/views/lehre/anrechnung/reviewAnrechnungInfo.php index a89c9c987..4b899d4dc 100644 --- a/application/views/lehre/anrechnung/reviewAnrechnungInfo.php +++ b/application/views/lehre/anrechnung/reviewAnrechnungInfo.php @@ -25,7 +25,7 @@
-
+
p->t('anrechnung', 'reviewAnrechnungInfoAntragVoraussetungenBody'); ?>
diff --git a/application/views/lehre/anrechnung/reviewAnrechnungUebersicht.php b/application/views/lehre/anrechnung/reviewAnrechnungUebersicht.php index 55c82b4e3..54d0b49d1 100644 --- a/application/views/lehre/anrechnung/reviewAnrechnungUebersicht.php +++ b/application/views/lehre/anrechnung/reviewAnrechnungUebersicht.php @@ -13,7 +13,8 @@ $this->load->view( 'tablewidget' => true, 'phrases' => array( 'global' => array( - 'begruendung' + 'begruendung', + 'zgv' ), 'anrechnung' => array( 'nachweisdokumente', @@ -154,11 +155,12 @@ $this->load->view(
-
@@ -172,11 +174,12 @@ $this->load->view(
-
@@ -222,9 +225,11 @@ $this->load->view(
+ class="btn btn-danger btn-w200" type="button"> + p->t('anrechnung', 'nichtEmpfehlen')); ?> + class="btn btn-primary btn-w200" type="button"> + p->t('anrechnung', 'empfehlen')); ?>
diff --git a/application/views/lehre/anrechnung/reviewAnrechnungUebersichtData.php b/application/views/lehre/anrechnung/reviewAnrechnungUebersichtData.php index 7382df85b..89b3ba70f 100644 --- a/application/views/lehre/anrechnung/reviewAnrechnungUebersichtData.php +++ b/application/views/lehre/anrechnung/reviewAnrechnungUebersichtData.php @@ -20,6 +20,16 @@ $query = ' begruendung.bezeichnung AS "begruendung", dmsversion.name AS "dokument_bezeichnung", anrechnung.anmerkung_student, + (SELECT COALESCE( + array_to_json(zgvmaster.bezeichnung::varchar[])->>' . $LANGUAGE_INDEX . ', + array_to_json(zgv.bezeichnung::varchar[])->>' . $LANGUAGE_INDEX . ' + ) AS zgv + FROM public.tbl_prestudent + LEFT JOIN bis.tbl_zgv zgv USING (zgv_code) + LEFT JOIN bis.tbl_zgvmaster zgvmaster USING (zgvmas_code) + WHERE prestudent_id = anrechnung.prestudent_id + ) AS zgv, + anrechnung.insertamum::date AS "antragsdatum", empfehlung_anrechnung, (SELECT status_kurzbz FROM lehre.tbl_anrechnungstatus @@ -33,7 +43,7 @@ $query = ' JOIN public.tbl_person AS person USING (person_id) JOIN public.tbl_studiengang AS stg USING (studiengang_kz) JOIN lehre.tbl_lehrveranstaltung AS lv USING (lehrveranstaltung_id) - JOIN campus.tbl_dms_version AS dmsversion USING (dms_id) + LEFT JOIN campus.tbl_dms_version AS dmsversion USING (dms_id) JOIN lehre.tbl_anrechnung_anrechnungstatus USING (anrechnung_id) JOIN lehre.tbl_anrechnung_begruendung AS begruendung USING (begruendung_id) ) @@ -75,6 +85,8 @@ $filterWidgetArray = array( ucfirst($this->p->t('global', 'begruendung')), ucfirst($this->p->t('anrechnung', 'nachweisdokumente')), ucfirst($this->p->t('anrechnung', 'herkunft')), + ucfirst($this->p->t('global', 'zgv')), + ucfirst($this->p->t('anrechnung', 'antragdatum')), ucfirst($this->p->t('anrechnung', 'empfehlung')), 'status_kurzbz', 'Status' @@ -110,25 +122,27 @@ $filterWidgetArray = array( } }', // tabulator properties 'datasetRepFieldsDefs' => '{ - anrechnung_id: {visible: false}, - lehrveranstaltung_id: {visible: false}, - begruendung_id: {visible: false}, - dms_id: {visible: false}, - studiensemester_kurzbz: {visible: false}, - studiengang_kz: {visible: false}, + anrechnung_id: {visible: false, headerFilter:"input"}, + lehrveranstaltung_id: {visible: false, headerFilter:"input"}, + begruendung_id: {visible: false, headerFilter:"input"}, + dms_id: {visible: false, headerFilter:"input"}, + studiensemester_kurzbz: {visible: false, headerFilter:"input"}, + studiengang_kz: {visible: false, headerFilter:"input"}, stg_bezeichnung: {headerFilter:"input"}, lv_bezeichnung: {headerFilter:"input"}, ects: {headerFilter:"input", align:"center"}, student: {headerFilter:"input"}, begruendung: {headerFilter:"input"}, + zgv: {visible: false, headerFilter:"input"}, dokument_bezeichnung: {headerFilter:"input", formatter:"link", formatterParams:{ labelField:"dokument_bezeichnung", url:function(cell){return "'. current_url() .'/download?dms_id=" + cell.getData().dms_id}, target:"_blank" }}, anmerkung_student: {headerFilter:"input"}, + antragsdatum: {align:"center", headerFilter:"input", mutator: mut_formatStringDate}, empfehlung_anrechnung: {headerFilter:"input", align:"center", formatter: format_empfehlung_anrechnung, headerFilterFunc: hf_filterTrueFalse}, - status_kurzbz: {visible: false}, + status_kurzbz: {visible: false, headerFilter:"input"}, status_bezeichnung: {headerFilter:"input"} }', // col properties ); diff --git a/application/views/lehre/lehrauftrag/approveLehrauftragData.php b/application/views/lehre/lehrauftrag/approveLehrauftragData.php index 7c9669ae3..4d8dc36d0 100644 --- a/application/views/lehre/lehrauftrag/approveLehrauftragData.php +++ b/application/views/lehre/lehrauftrag/approveLehrauftragData.php @@ -2,7 +2,7 @@ $STUDIENSEMESTER = $studiensemester_selected; $ORGANISATIONSEINHEIT = (isset($organisationseinheit_selected) && !is_null($organisationseinheit_selected)) ? array($organisationseinheit_selected) : $organisationseinheit; -$AUSBILDUNGSSEMESTER = (isset($ausbildungssemester_selected) && !is_null($ausbildungssemester_selected)) ? $ausbildungssemester_selected : '1,2,3,4,5,6,7,8'; +$AUSBILDUNGSSEMESTER = (isset($ausbildungssemester_selected) && !is_null($ausbildungssemester_selected)) ? $ausbildungssemester_selected : '1,2,3,4,5,6,7,8,9,10'; $query = ' SELECT diff --git a/application/views/lehre/lehrauftrag/orderLehrauftrag.php b/application/views/lehre/lehrauftrag/orderLehrauftrag.php index 4498dacb4..023df1ac7 100644 --- a/application/views/lehre/lehrauftrag/orderLehrauftrag.php +++ b/application/views/lehre/lehrauftrag/orderLehrauftrag.php @@ -160,7 +160,7 @@ $this->load->view( 'Ausbildungssemester_widget', array( DropdownWidget::SELECTED_ELEMENT => $ausbildungssemester_selected, - 'number_semester' => 6 + 'number_semester' => 10 ), array( 'name' => 'ausbildungssemester', diff --git a/application/views/lehre/lehrauftrag/orderLehrauftragData.php b/application/views/lehre/lehrauftrag/orderLehrauftragData.php index 1ccfc55a4..c272c392c 100644 --- a/application/views/lehre/lehrauftrag/orderLehrauftragData.php +++ b/application/views/lehre/lehrauftrag/orderLehrauftragData.php @@ -2,7 +2,7 @@ $STUDIENSEMESTER = $studiensemester_selected; $STUDIENGANG = (isset($studiengang_selected) && !is_null($studiengang_selected)) ? array($studiengang_selected) : $studiengang; -$AUSBILDUNGSSEMESTER = (isset($ausbildungssemester_selected) && !is_null($ausbildungssemester_selected)) ? $ausbildungssemester_selected : '1,2,3,4,5,6,7,8'; +$AUSBILDUNGSSEMESTER = (isset($ausbildungssemester_selected) && !is_null($ausbildungssemester_selected)) ? $ausbildungssemester_selected : '1,2,3,4,5,6,7,8,9,10'; $query = ' SELECT diff --git a/application/views/organisation/reihungstest/ReihungstestUebersichtData.php b/application/views/organisation/reihungstest/ReihungstestUebersichtData.php index 931a09d80..be41e06c7 100644 --- a/application/views/organisation/reihungstest/ReihungstestUebersichtData.php +++ b/application/views/organisation/reihungstest/ReihungstestUebersichtData.php @@ -106,7 +106,7 @@ public.tbl_reihungstest LEFT JOIN public.tbl_studiengang using(studiengang_kz) WHERE - datum>now()-'5 months'::interval + datum>now()-'12 months'::interval ORDER BY datum desc ) data ", diff --git a/application/views/system/fas_udf.php b/application/views/system/fas_udf.php index 8a1200b6a..e6fa396cf 100644 --- a/application/views/system/fas_udf.php +++ b/application/views/system/fas_udf.php @@ -45,7 +45,6 @@ echo $this->udflib->UDFWidget( array( UDFLib::UDF_UNIQUE_ID => 'fasPersonUDFs', - UDFLib::REQUIRED_PERMISSIONS_PARAMETER => 'basis/person', UDFLib::SCHEMA_ARG_NAME => 'public', UDFLib::TABLE_ARG_NAME => 'tbl_person', UDFLib::PRIMARY_KEY_NAME => 'person_id', @@ -70,7 +69,6 @@ echo $this->udflib->UDFWidget( array( UDFLib::UDF_UNIQUE_ID => 'fasPrestudentUDFs', - UDFLib::REQUIRED_PERMISSIONS_PARAMETER => 'basis/person', UDFLib::SCHEMA_ARG_NAME => 'public', UDFLib::TABLE_ARG_NAME => 'tbl_prestudent', UDFLib::PRIMARY_KEY_NAME => 'prestudent_id', @@ -109,3 +107,4 @@ load->view("templates/footer"); ?> + diff --git a/application/views/system/infocenter/anmerkungenZurBewerbung.php b/application/views/system/infocenter/anmerkungenZurBewerbung.php index 508f041de..ca012ff3e 100644 --- a/application/views/system/infocenter/anmerkungenZurBewerbung.php +++ b/application/views/system/infocenter/anmerkungenZurBewerbung.php @@ -12,7 +12,7 @@ - insertamum), 'd.m.Y H:i:s') ?> + insertnotiz), 'd.m.Y H:i:s') ?> kurzbzlang)) ?: print_r('(' . nl2br($notiz->kurzbzlang) . ') - ') ?> diff --git a/application/views/system/infocenter/infocenterData.php b/application/views/system/infocenter/infocenterData.php index 4dd897f7f..c49a1c6cc 100644 --- a/application/views/system/infocenter/infocenterData.php +++ b/application/views/system/infocenter/infocenterData.php @@ -6,7 +6,7 @@ $INTERESSENT_STATUS = '\'Interessent\''; $STUDIENGANG_TYP = '\''.$this->variablelib->getVar('infocenter_studiensgangtyp').'\''; $TAETIGKEIT_KURZBZ = '\'bewerbung\', \'kommunikation\''; - $LOGDATA_NAME = '\'Login with code\', \'Login with user\', \'New application\', \'Interessent rejected\''; + $LOGDATA_NAME = '\'Login with code\', \'Login with user\', \'Interessent rejected\''; $LOGDATA_NAME_PARKED = '\'Parked\''; $LOGDATA_NAME_ONHOLD = '\'Onhold\''; $LOGTYPE_KURZBZ = '\'Processstate\''; @@ -14,6 +14,7 @@ $ADDITIONAL_STG = $this->config->item('infocenter_studiengang_kz'); $AKTE_TYP = '\'identity\', \'zgv_bakk\''; $STUDIENSEMESTER = '\''.$this->variablelib->getVar('infocenter_studiensemester').'\''; + $ORG_NAME = '\'InfoCenter\''; $query = ' SELECT @@ -33,7 +34,7 @@ WHERE l.taetigkeit_kurzbz IN ('.$TAETIGKEIT_KURZBZ.') AND l.logdata->>\'name\' NOT IN ('.$LOGDATA_NAME.') AND l.person_id = p.person_id - ORDER BY l.zeitpunkt DESC + ORDER BY l.log_id DESC LIMIT 1 ) AS "LastAction", ( @@ -42,7 +43,7 @@ WHERE l.taetigkeit_kurzbz IN('.$TAETIGKEIT_KURZBZ.') AND l.logdata->>\'name\' NOT IN ('.$LOGDATA_NAME.') AND l.person_id = p.person_id - ORDER BY l.zeitpunkt DESC + ORDER BY l.log_id DESC LIMIT 1 ) AS "LastActionType", ( @@ -59,7 +60,7 @@ WHERE l.taetigkeit_kurzbz IN ('.$TAETIGKEIT_KURZBZ.') AND l.logdata->>\'name\' NOT IN ('.$LOGDATA_NAME.') AND l.person_id = p.person_id - ORDER BY l.zeitpunkt DESC + ORDER BY l.log_id DESC LIMIT 1 ) AS "User/Operator", ( @@ -184,6 +185,32 @@ ) LIMIT 1 ) AS "StgNichtAbgeschickt", + ( + SELECT COUNT(*) + FROM public.tbl_prestudentstatus pss + JOIN public.tbl_prestudent ps USING(prestudent_id) + JOIN public.tbl_studiengang sg USING(studiengang_kz) + JOIN lehre.tbl_studienplan sp USING(studienplan_id) + WHERE pss.status_kurzbz = '.$INTERESSENT_STATUS.' + AND pss.bewerbung_abgeschicktamum IS NULL + AND pss.bestaetigtam IS NULL + AND ps.person_id = p.person_id + AND (sg.typ IN ('.$STUDIENGANG_TYP.') + OR + sg.studiengang_kz in('.$ADDITIONAL_STG.') + ) + AND pss.studiensemester_kurzbz = '.$STUDIENSEMESTER.' + + AND NOT EXISTS ( + SELECT 1 + FROM tbl_prestudentstatus spss + WHERE spss.prestudent_id = pss.prestudent_id + AND spss.status_kurzbz = '.$REJECTED_STATUS.' + AND spss.studiensemester_kurzbz IN (SELECT ss.studiensemester_kurzbz FROM public.tbl_studiensemester ss WHERE ss.ende > + (SELECT start FROM public.tbl_studiensemester sss WHERE studiensemester_kurzbz = '.$STUDIENSEMESTER.')) + ) + LIMIT 1 + ) AS "AnzahlStgNichtAbgeschickt", ( SELECT ARRAY_TO_STRING(ARRAY_AGG(DISTINCT UPPER(sg.typ || sg.kurzbz) || \':\' || sp.orgform_kurzbz), \', \') FROM public.tbl_prestudentstatus pss @@ -228,13 +255,14 @@ JOIN public.tbl_organisationseinheit USING(oe_kurzbz) WHERE (tbl_benutzerfunktion.datum_von IS NULL OR tbl_benutzerfunktion.datum_von <= now()) AND (tbl_benutzerfunktion.datum_bis IS NULL OR tbl_benutzerfunktion.datum_bis >= now()) + AND tbl_organisationseinheit.bezeichnung = '.$ORG_NAME.' AND tbl_benutzerfunktion.uid = ( SELECT l.insertvon FROM system.tbl_log l WHERE l.taetigkeit_kurzbz IN ('.$TAETIGKEIT_KURZBZ.') AND l.logdata->>\'name\' NOT IN ('.$LOGDATA_NAME.') AND l.person_id = p.person_id - ORDER BY l.zeitpunkt DESC + ORDER BY l.log_id DESC LIMIT 1 ) LIMIT 1 @@ -322,6 +350,7 @@ ucfirst($this->p->t('global', 'abgeschickt')).' ('.$this->p->t('global', 'anzahl').')', ucfirst($this->p->t('lehre', 'studiengang')).' ('.$this->p->t('global', 'gesendet').')', ucfirst($this->p->t('lehre', 'studiengang')).' ('.$this->p->t('global', 'nichtGesendet').')', + ucfirst($this->p->t('lehre', 'studiengang')).' ('.$this->p->t('global', 'anzahlNichtGesendet').')', ucfirst($this->p->t('lehre', 'studiengang')).' ('.$this->p->t('global', 'aktiv').')', 'ZGV Nation BA', 'ZGV Nation MA', @@ -412,13 +441,13 @@ $datasetRaw->{'ZGVMNation'} = '-'; } - if ($datasetRaw->{'InfoCenterMitarbeiter'} === 'InfoCenter') + if ($datasetRaw->{'InfoCenterMitarbeiter'} === null) { - $datasetRaw->{'InfoCenterMitarbeiter'} = 'Ja'; + $datasetRaw->{'InfoCenterMitarbeiter'} = 'Nein'; } else { - $datasetRaw->{'InfoCenterMitarbeiter'} = 'Nein'; + $datasetRaw->{'InfoCenterMitarbeiter'} = 'Ja'; } return $datasetRaw; diff --git a/application/views/system/infocenter/infocenterDetails.php b/application/views/system/infocenter/infocenterDetails.php index 30acb8617..76a371c11 100644 --- a/application/views/system/infocenter/infocenterDetails.php +++ b/application/views/system/infocenter/infocenterDetails.php @@ -101,6 +101,22 @@
+ +
+

+ p->t('global', 'bewerberVorhanden') . ':'; ?> +

+
+ person_id . '
'; + } + ?> +
+ +
+
diff --git a/application/views/system/infocenter/infocenterFreigegebenData.php b/application/views/system/infocenter/infocenterFreigegebenData.php index 26c30d718..9078c13db 100644 --- a/application/views/system/infocenter/infocenterFreigegebenData.php +++ b/application/views/system/infocenter/infocenterFreigegebenData.php @@ -5,13 +5,14 @@ $INTERESSENT_STATUS = '\'Interessent\''; $STUDIENGANG_TYP = '\''.$this->variablelib->getVar('infocenter_studiensgangtyp').'\''; $TAETIGKEIT_KURZBZ = '\'bewerbung\', \'kommunikation\''; - $LOGDATA_NAME = '\'Login with code\', \'Login with user\', \'New application\''; + $LOGDATA_NAME = '\'Login with code\', \'Login with user\''; $REJECTED_STATUS = '\'Abgewiesener\''; $ADDITIONAL_STG = $this->config->item('infocenter_studiengang_kz'); $STATUS_KURZBZ = '\'Wartender\', \'Bewerber\', \'Aufgenommener\', \'Student\''; $STUDIENSEMESTER = '\''.$this->variablelib->getVar('infocenter_studiensemester').'\''; + $ORG_NAME = '\'InfoCenter\''; - $query = ' +$query = ' SELECT p.person_id AS "PersonId", p.vorname AS "Vorname", @@ -27,7 +28,7 @@ WHERE l.taetigkeit_kurzbz IN('.$TAETIGKEIT_KURZBZ.') AND l.logdata->>\'name\' NOT IN ('.$LOGDATA_NAME.') AND l.person_id = p.person_id - ORDER BY l.zeitpunkt DESC + ORDER BY l.log_id DESC LIMIT 1 ) AS "LastAction", ( @@ -36,7 +37,7 @@ WHERE l.taetigkeit_kurzbz IN('.$TAETIGKEIT_KURZBZ.') AND l.logdata->>\'name\' NOT IN ('.$LOGDATA_NAME.') AND l.person_id = p.person_id - ORDER BY l.zeitpunkt DESC + ORDER BY l.log_id DESC LIMIT 1 ) AS "LastActionType", ( @@ -45,7 +46,7 @@ WHERE l.taetigkeit_kurzbz IN('.$TAETIGKEIT_KURZBZ.') AND l.logdata->>\'name\' NOT IN ('.$LOGDATA_NAME.') AND l.person_id = p.person_id - ORDER BY l.zeitpunkt DESC + ORDER BY l.log_id DESC LIMIT 1 ) AS "User/Operator", ( @@ -231,13 +232,14 @@ JOIN public.tbl_organisationseinheit USING(oe_kurzbz) WHERE (tbl_benutzerfunktion.datum_von IS NULL OR tbl_benutzerfunktion.datum_von <= now()) AND (tbl_benutzerfunktion.datum_bis IS NULL OR tbl_benutzerfunktion.datum_bis >= now()) + AND tbl_organisationseinheit.bezeichnung = '.$ORG_NAME.' AND tbl_benutzerfunktion.uid = ( SELECT l.insertvon FROM system.tbl_log l WHERE l.taetigkeit_kurzbz IN ('.$TAETIGKEIT_KURZBZ.') AND l.logdata->>\'name\' NOT IN ('.$LOGDATA_NAME.') AND l.person_id = p.person_id - ORDER BY l.zeitpunkt DESC + ORDER BY l.log_id DESC LIMIT 1 ) LIMIT 1 @@ -410,13 +412,13 @@ $datasetRaw->{'ZGVMNation'} = '-'; } - if ($datasetRaw->{'InfoCenterMitarbeiter'} === 'InfoCenter') + if ($datasetRaw->{'InfoCenterMitarbeiter'} === null) { - $datasetRaw->{'InfoCenterMitarbeiter'} = 'Ja'; + $datasetRaw->{'InfoCenterMitarbeiter'} = 'Nein'; } else { - $datasetRaw->{'InfoCenterMitarbeiter'} = 'Nein'; + $datasetRaw->{'InfoCenterMitarbeiter'} = 'Ja'; } return $datasetRaw; diff --git a/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php b/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php index 81ddd2594..5aa664a97 100644 --- a/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php +++ b/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php @@ -5,11 +5,12 @@ $INTERESSENT_STATUS = '\'Interessent\''; $STUDIENGANG_TYP = '\''.$this->variablelib->getVar('infocenter_studiensgangtyp').'\''; $TAETIGKEIT_KURZBZ = '\'bewerbung\', \'kommunikation\''; - $LOGDATA_NAME = '\'Login with code\', \'Login with user\', \'New application\''; + $LOGDATA_NAME = '\'Login with code\', \'Login with user\''; $ADDITIONAL_STG = $this->config->item('infocenter_studiengang_kz'); $STUDIENSEMESTER = '\''.$this->variablelib->getVar('infocenter_studiensemester').'\''; + $ORG_NAME = '\'InfoCenter\''; - $query = ' +$query = ' SELECT p.person_id AS "PersonId", p.vorname AS "Vorname", @@ -25,7 +26,7 @@ WHERE l.taetigkeit_kurzbz IN('.$TAETIGKEIT_KURZBZ.') AND l.logdata->>\'name\' NOT IN ('.$LOGDATA_NAME.') AND l.person_id = p.person_id - ORDER BY l.zeitpunkt DESC + ORDER BY l.log_id DESC LIMIT 1 ) AS "LastAction", ( @@ -34,7 +35,7 @@ WHERE l.taetigkeit_kurzbz IN('.$TAETIGKEIT_KURZBZ.') AND l.logdata->>\'name\' NOT IN ('.$LOGDATA_NAME.') AND l.person_id = p.person_id - ORDER BY l.zeitpunkt DESC + ORDER BY l.log_id DESC LIMIT 1 ) AS "User/Operator", ( @@ -182,13 +183,14 @@ JOIN public.tbl_organisationseinheit USING(oe_kurzbz) WHERE (tbl_benutzerfunktion.datum_von IS NULL OR tbl_benutzerfunktion.datum_von <= now()) AND (tbl_benutzerfunktion.datum_bis IS NULL OR tbl_benutzerfunktion.datum_bis >= now()) + AND tbl_organisationseinheit.bezeichnung = '.$ORG_NAME.' AND tbl_benutzerfunktion.uid = ( SELECT l.insertvon FROM system.tbl_log l WHERE l.taetigkeit_kurzbz IN ('.$TAETIGKEIT_KURZBZ.') AND l.logdata->>\'name\' NOT IN ('.$LOGDATA_NAME.') AND l.person_id = p.person_id - ORDER BY l.zeitpunkt DESC + ORDER BY l.log_id DESC LIMIT 1 ) LIMIT 1 @@ -347,13 +349,13 @@ $datasetRaw->{'ZGVMNation'} = '-'; } - if ($datasetRaw->{'InfoCenterMitarbeiter'} === 'InfoCenter') + if ($datasetRaw->{'InfoCenterMitarbeiter'} === null) { - $datasetRaw->{'InfoCenterMitarbeiter'} = 'Ja'; + $datasetRaw->{'InfoCenterMitarbeiter'} = 'Nein'; } else { - $datasetRaw->{'InfoCenterMitarbeiter'} = 'Nein'; + $datasetRaw->{'InfoCenterMitarbeiter'} = 'Ja'; } return $datasetRaw; diff --git a/application/views/system/infocenter/zgvpruefungen.php b/application/views/system/infocenter/zgvpruefungen.php index 05c94c384..253145557 100644 --- a/application/views/system/infocenter/zgvpruefungen.php +++ b/application/views/system/infocenter/zgvpruefungen.php @@ -341,7 +341,6 @@ echo $this->udflib->UDFWidget( array( UDFLib::UDF_UNIQUE_ID => 'infocenterPrestudentUDFs_'.$zgvpruefung->prestudent_id, - UDFLib::REQUIRED_PERMISSIONS_PARAMETER => 'infocenter', UDFLib::SCHEMA_ARG_NAME => 'public', UDFLib::TABLE_ARG_NAME => 'tbl_prestudent', UDFLib::PRIMARY_KEY_NAME => 'prestudent_id', @@ -414,7 +413,7 @@ selected="selected">p->t('ui', 'freigabeart')) . '...' ?> - + @@ -553,3 +552,4 @@ endforeach; // end foreach zgvpruefungen ?>
+ diff --git a/application/views/system/issues/issues.php b/application/views/system/issues/issues.php new file mode 100644 index 000000000..ebe92012d --- /dev/null +++ b/application/views/system/issues/issues.php @@ -0,0 +1,48 @@ +load->view( + 'templates/FHC-Header', + array( + 'title' => 'Fehler Monitoring', + 'jquery' => true, + 'jqueryui' => true, + 'jquerycheckboxes' => true, + 'bootstrap' => true, + 'fontawesome' => true, + 'sbadmintemplate' => true, + 'tablesorter' => true, + 'ajaxlib' => true, + 'filterwidget' => true, + 'navigationwidget' => true, + 'dialoglib' => true, + 'phrases' => array( + 'ui' => array('bitteEintragWaehlen') + ), + 'customCSSs' => array('public/css/issues/issuesDataset.css', 'public/css/sbadmin2/tablesort_bootstrap.css'), + 'customJSs' => array('public/js/issues/issuesDataset.js', 'public/js/bootstrapper.js') + ) +); +?> + + +
+ + widgetlib->widget('NavigationWidget'); ?> + +
+
+
+
+ +
+
+
+ load->view('system/issues/issuesData.php'); ?> +
+
+
+
+ + +load->view('templates/FHC-Footer'); ?> diff --git a/application/views/system/issues/issuesData.php b/application/views/system/issues/issuesData.php new file mode 100644 index 000000000..1f0bf12b0 --- /dev/null +++ b/application/views/system/issues/issuesData.php @@ -0,0 +1,173 @@ + $funktionen_kurzbz) + { + foreach ($funktionen_kurzbz as $funktion_kurzbz) + { + $query .= " OR (zst.oe_kurzbz = '$oe_kurzbz' AND zst.funktion_kurzbz = '$funktion_kurzbz')"; + } + } +} + +$query .= "))"; // close AND of exists, and exists + +// show issue if it is assigend to oe of logged in user or to student of oe of logged in user +if (!isEmptyArray($all_oe_kurzbz_berechtigt)) +{ + $query .= " OR iss.oe_kurzbz IN $ALL_OE_KURZBZ_BERECHTIGT /* if issue is for oe */"; + + $query .= " OR (iss.oe_kurzbz IS NULL AND EXISTS ( /* if person_id of issue is a student of studiengang oe */ + SELECT 1 FROM public.tbl_prestudent ps + JOIN public.tbl_prestudentstatus pss USING (prestudent_id) + JOIN public.tbl_studiengang stg USING (studiengang_kz) + WHERE person_id = iss.person_id + AND stg.oe_kurzbz IN $ALL_OE_KURZBZ_BERECHTIGT + AND pss.status_kurzbz IN $RELEVANT_PRESTUDENT_STATUS + AND NOT EXISTS (SELECT 1 /* irrelevant if already finished studies and studied a while ago */ + FROM public.tbl_prestudentstatus ps_finished + JOIN public.tbl_studiensemester sem_finished USING (studiensemester_kurzbz) + WHERE prestudent_id = ps.prestudent_id + AND status_kurzbz IN ('Absolvent','Abbrecher','Abgewiesener') + AND datum::date + interval '2 months' < NOW() + AND EXISTS (SELECT 1 FROM public.tbl_prestudent /* if more recent prestudent exists, still display the issue */ + JOIN public.tbl_prestudentstatus USING (prestudent_id) + JOIN public.tbl_studiensemester USING (studiensemester_kurzbz) + WHERE tbl_prestudentstatus.status_kurzbz IN $RELEVANT_PRESTUDENT_STATUS + AND person_id = ps.person_id + AND prestudent_id <> ps_finished.prestudent_id + AND tbl_studiensemester.start::date > sem_finished.start::date) + ) + ) + )"; +} + +$query .= " ORDER BY CASE + WHEN iss.status_kurzbz = '".IssuesLib::STATUS_NEU."' THEN 0 + WHEN iss.status_kurzbz = '".IssuesLib::STATUS_IN_BEARBEITUNG."' THEN 1 + ELSE 2 + END, + CASE + WHEN fehlertyp_kurzbz = '".IssuesLib::ERRORTYPE_CODE."' THEN 0 + WHEN fehlertyp_kurzbz = '".IssuesLib::WARNINGTYPE_CODE."' THEN 1 + ELSE 2 + END, + datum DESC, fehlercode, issue_id DESC"; + +$filterWidgetArray = array( + 'query' => $query, + 'app' => 'core', + 'datasetName' => 'issues', + 'filter_id' => $this->input->get('filter_id'), + 'tableUniqueId' => 'issues', + 'requiredPermissions' => 'admin', + 'datasetRepresentation' => 'tablesorter', + 'checkboxes' => 'issue_id', + 'columnsAliases' => array( + 'ID', + 'Fehlercode', + 'Fehlercode extern', + 'Datum', + 'Inhalt', + 'Inhalt extern', + 'PersonId', + 'OE', + 'Fehlertyp', + 'Fehlerstatus', + 'Verarbeitet von', + 'Verarbeitet am', + 'Applikation', + 'Fehlertypcode', + 'Statuscode', + 'Vorname', + 'Nachname' + ), + 'formatRow' => function($datasetRaw) { + + if ($datasetRaw->{'Fehlercode extern'} == null) + { + $datasetRaw->{'Fehlercode extern'} = '-'; + } + + if ($datasetRaw->{'Inhalt'} == null) + { + $datasetRaw->{'Inhalt'} = '-'; + } + + if ($datasetRaw->{'Inhalt extern'} == null) + { + $datasetRaw->{'Inhalt extern'} = '-'; + } + + if ($datasetRaw->{'PersonId'} == null) + { + $datasetRaw->{'PersonId'} = '-'; + } + + if ($datasetRaw->{'OE'} == null) + { + $datasetRaw->{'OE'} = '-'; + } + + if ($datasetRaw->{'Verarbeitet am'} == null) + { + $datasetRaw->{'Verarbeitet am'} = '-'; + } + + if ($datasetRaw->{'Verarbeitet von'} == null) + { + $datasetRaw->{'Verarbeitet von'} = '-'; + } + + return $datasetRaw; + }, + 'markRow' => function($datasetRaw) { + + $mark = ''; + + if ($datasetRaw->Statuscode == IssuesLib::STATUS_BEHOBEN) + $mark = "text-success"; + elseif ($datasetRaw->Statuscode == IssuesLib::STATUS_NEU || $datasetRaw->Statuscode == IssuesLib::STATUS_IN_BEARBEITUNG) + { + if ($datasetRaw->Fehlertypcode == IssuesLib::ERRORTYPE_CODE) + { + $mark = "text-danger"; + } + elseif ($datasetRaw->Fehlertypcode == IssuesLib::WARNINGTYPE_CODE) + { + $mark = "text-warning"; + } + } + + return $mark; + } +); + +echo $this->widgetlib->widget('FilterWidget', $filterWidgetArray); diff --git a/application/views/templates/FHC-Header.php b/application/views/templates/FHC-Header.php index 6a0969cd4..f4ba1bb4b 100644 --- a/application/views/templates/FHC-Header.php +++ b/application/views/templates/FHC-Header.php @@ -44,6 +44,8 @@ <?php printPageTitle($title); ?> + + + - \ No newline at end of file + + diff --git a/application/views/widgets/dropdown.php b/application/views/widgets/dropdown.php index d9faf1978..51db6d536 100644 --- a/application/views/widgets/dropdown.php +++ b/application/views/widgets/dropdown.php @@ -33,6 +33,7 @@ + > + diff --git a/application/views/widgets/textarea.php b/application/views/widgets/textarea.php index c72b52658..5346fefa8 100644 --- a/application/views/widgets/textarea.php +++ b/application/views/widgets/textarea.php @@ -29,9 +29,11 @@ + > - \ No newline at end of file + + diff --git a/application/views/widgets/textfield.php b/application/views/widgets/textfield.php index 73b1daa1b..c5ba81710 100644 --- a/application/views/widgets/textfield.php +++ b/application/views/widgets/textfield.php @@ -31,10 +31,12 @@ + value="" > - \ No newline at end of file + + diff --git a/application/widgets/html/HTMLWidget.php b/application/widgets/html/HTMLWidget.php index 9639890ea..0034edfd9 100644 --- a/application/widgets/html/HTMLWidget.php +++ b/application/widgets/html/HTMLWidget.php @@ -6,18 +6,18 @@ class HTMLWidget extends Widget { // The name of the array present in the data array given to the view that will render this widget - const HTML_ARG_NAME = 'HTML'; + const HTML_ARG_NAME = 'HTML'; const HTML_DEFAULT_VALUE = ''; // Default value of the html element - const HTML_NAME = 'name'; // HTML name attribute - const HTML_ID = 'id'; // HTML id attribute - - // External block definition - const EXTERNAL_BLOCK = 'externalBlock'; // External block name - const EXTERNAL_START_BLOCK_HTML_TAG = '
'; // External block start tag - const EXTERNAL_END_BLOCK_HTML_TAG = '
'; // External block end tag - - // HTML attributes - const LABEL = 'title'; + const HTML_NAME = 'name'; // HTML name attribute + const HTML_ID = 'id'; // HTML id attribute + + // External block definition + const EXTERNAL_BLOCK = 'externalBlock'; // External block name + const EXTERNAL_START_BLOCK_HTML_TAG = '
'; // External block start tag + const EXTERNAL_END_BLOCK_HTML_TAG = '
'; // External block end tag + + // HTML attributes + const LABEL = 'title'; const REGEX = 'regex'; const TITLE = 'description'; const REQUIRED = 'required-field'; @@ -26,11 +26,12 @@ class HTMLWidget extends Widget const MAX_LENGTH = 'max-length'; const MIN_LENGTH = 'min-length'; const PLACEHOLDER = 'placeholder'; + const DISABLED = 'disabled'; - /** - * It gets also the htmlArgs array as parameter, it will be used to set the HTML properties - */ - public function __construct($name, $args = array(), $htmlArgs = array()) + /** + * It gets also the htmlArgs array as parameter, it will be used to set the HTML properties + */ + public function __construct($name, $args = array(), $htmlArgs = array()) { parent::__construct($name, $args); @@ -38,11 +39,11 @@ class HTMLWidget extends Widget $this->_setHtmlProperties($htmlArgs); } - /** - * Initialising html properties, such as the id and name attributes of the HTML element - */ - private function _setHtmlProperties($htmlArgs) - { + /** + * Initialising html properties, such as the id and name attributes of the HTML element + */ + private function _setHtmlProperties($htmlArgs) + { // If $htmlArgs wasn't already stored in $this->_args if (!isset($this->_args[HTMLWidget::HTML_ARG_NAME])) { @@ -58,9 +59,9 @@ class HTMLWidget extends Widget $this->_args[HTMLWidget::HTML_ARG_NAME][$argName] = $argValue; } } - } + } - /** + /** * Prints an attribute name and eventually also the value extracted from $htmlArgs * Set $isValuePresent to false the value should not be displayed */ @@ -113,3 +114,4 @@ class HTMLWidget extends Widget } } } + diff --git a/application/widgets/udf/UDFWidget.php b/application/widgets/udf/UDFWidget.php index 7af3dd926..abbbab022 100644 --- a/application/widgets/udf/UDFWidget.php +++ b/application/widgets/udf/UDFWidget.php @@ -6,8 +6,6 @@ */ class UDFWidget extends HTMLWidget { - private $_requiredPermissions; // The required permissions to use this UDF widget - private $_schema; // Schema name private $_table; // Table name private $_primaryKeyName; // Primary key name @@ -26,26 +24,16 @@ class UDFWidget extends HTMLWidget $this->_initUDFWidget($args); // checks parameters and initialize properties - // Let's start if it's allowed - // NOTE: If it is NOT allowed then no data are loaded - if ($this->udflib->isAllowed($this->_requiredPermissions)) - { - $this->_startUDFWidget($args[UDFLib::UDF_UNIQUE_ID]); - } + $this->_startUDFWidget($args[UDFLib::UDF_UNIQUE_ID]); } /** * Called by the WidgetLib, it renders the HTML of the UDF */ - public function display($widgetData) + public function display($widgetData) { - // Let's start if it's allowed - // NOTE: If it is NOT allowed then no data are loaded - if ($this->_ci->udflib->isAllowed($this->_requiredPermissions)) - { - $this->_ci->udflib->displayUDFWidget($widgetData); - } - } + $this->_ci->udflib->displayUDFWidget($widgetData); + } //------------------------------------------------------------------------------------------------------------------ // Private methods @@ -60,18 +48,11 @@ class UDFWidget extends HTMLWidget // If here then everything is ok // Initialize class properties - $this->_requiredPermissions = null; $this->_schema = null; $this->_table = null; $this->_primaryKeyName = null; $this->_primaryKeyValue = null; - // Retrieved the required permissions parameter if present - if (isset($args[UDFLib::REQUIRED_PERMISSIONS_PARAMETER])) - { - $this->_requiredPermissions = $args[UDFLib::REQUIRED_PERMISSIONS_PARAMETER]; - } - // Retrieved the if (isset($args[UDFLib::SCHEMA_ARG_NAME])) { @@ -113,11 +94,6 @@ class UDFWidget extends HTMLWidget show_error('The parameter "'.UDFLib::UDF_UNIQUE_ID.'" must be specified'); } - if (!isset($args[UDFLib::REQUIRED_PERMISSIONS_PARAMETER])) - { - show_error('The parameter "'.UDFLib::REQUIRED_PERMISSIONS_PARAMETER.'" must be specified'); - } - if (!isset($args[UDFLib::SCHEMA_ARG_NAME])) { show_error('The parameter "'.UDFLib::SCHEMA_ARG_NAME.'" must be specified'); @@ -149,7 +125,6 @@ class UDFWidget extends HTMLWidget $this->udflib->setSession( array( UDFLib::UDF_UNIQUE_ID => $udfUniqueId, // table unique id - UDFLib::REQUIRED_PERMISSIONS_PARAMETER => $this->_requiredPermissions, // UDFLib::SCHEMA_ARG_NAME => $this->_schema, // UDFLib::TABLE_ARG_NAME => $this->_table, // UDFLib::PRIMARY_KEY_NAME => $this->_primaryKeyName, // @@ -158,3 +133,4 @@ class UDFWidget extends HTMLWidget ); } } + diff --git a/cis/private/lehre/abgabe_student.php b/cis/private/lehre/abgabe_student.php index bec071fa8..2a328dd35 100644 --- a/cis/private/lehre/abgabe_student.php +++ b/cis/private/lehre/abgabe_student.php @@ -1,248 +1,248 @@ - - * Andreas Oesterreicher < andreas.oesterreicher@technikum-wien.at > - * Rudolf Hangl < rudolf.hangl@technikum-wien.at > - * Gerald Simane-Sequens < gerald.simane-sequens@technikum-wien.at > - */ - -require_once('../../../config/cis.config.inc.php'); -require_once('../../../include/functions.inc.php'); -require_once('../../../include/datum.class.php'); -require_once('../../../include/person.class.php'); -require_once('../../../include/benutzer.class.php'); -require_once('../../../include/student.class.php'); -require_once('../../../include/studiengang.class.php'); -require_once('../../../include/benutzerberechtigung.class.php'); -require_once('../../../include/phrasen.class.php'); - -$sprache = getSprache(); -$p = new phrasen($sprache); - -if (!$db = new basis_db()) - die($p->t('global/fehlerBeimOeffnenDerDatenbankverbindung')); - -$getuid=get_uid(); -$uid=$getuid; - -if(isset($_GET['uid'])) -{ - //Studentenansicht - $uid = $_GET['uid']; - //Rechte Pruefen - $allowed=false; - - $student = new student(); - if(!$student->load($uid)) - die($p->t('global/fehlerBeimErmittelnDerUID')); - - $stg_obj = new studiengang(); - if(!$stg_obj->load($student->studiengang_kz)) - die($p->t('global/fehlerBeimLesenAusDatenbank')); - - //Berechtigung ueber das Berechtigungssystem - $rechte = new benutzerberechtigung(); - $rechte->getBerechtigungen($getuid); - if($rechte->isBerechtigt('lehre/abgabetool',$stg_obj->oe_kurzbz,'s')) - $allowed=true; - - //oder Lektor mit Betreuung dieses Studenten - $qry = "SELECT 1 - FROM - lehre.tbl_projektarbeit - JOIN lehre.tbl_projektbetreuer USING(projektarbeit_id) - JOIN campus.vw_benutzer on(vw_benutzer.person_id=tbl_projektbetreuer.person_id) - WHERE - tbl_projektarbeit.student_uid=".$db->db_add_param($uid)." AND - vw_benutzer.uid=".$db->db_add_param($getuid).";"; - - if($result = $db->db_query($qry)) - { - if($db->db_num_rows($result)>0) - { - $allowed=true; - } - } - - if(!$allowed) - { - die($p->t('abgabetool/keineBerechtigungStudentenansicht')); - } -} -$htmlstr = ''; -$htmlstr1 = ''; -$vorname=''; -$nachname=''; -$zweitbetreuer = ''; - -$sql_query = "SELECT (SELECT nachname FROM public.tbl_person WHERE person_id=tbl_projektbetreuer.person_id) AS bnachname, - (SELECT vorname FROM public.tbl_person WHERE person_id=tbl_projektbetreuer.person_id) AS bvorname, - (SELECT titelpre FROM public.tbl_person WHERE person_id=tbl_projektbetreuer.person_id) AS btitelpre, - (SELECT titelpost FROM public.tbl_person WHERE person_id=tbl_projektbetreuer.person_id) AS btitelpost, - (SELECT person_id FROM lehre.tbl_projektbetreuer WHERE projektarbeit_id=tbl_projektarbeit.projektarbeit_id - AND betreuerart_kurzbz IN ('Zweitbetreuer', 'Zweitbegutachter') LIMIT 1) AS zweitbetreuer_person_id, - (SELECT betreuerart_kurzbz FROM lehre.tbl_projektbetreuer WHERE projektarbeit_id=tbl_projektarbeit.projektarbeit_id - AND betreuerart_kurzbz IN ('Zweitbetreuer', 'Zweitbegutachter') LIMIT 1) AS zweitbetreuer_betreuerart_kurzbz, - tbl_projektbetreuer.person_id AS betreuer_person_id, - tbl_projekttyp.bezeichnung AS prjbez, *, - lehre.tbl_projektbetreuer.note as note, - public.tbl_benutzer.aktiv as aktiv, - (SELECT abgeschicktvon FROM extension.tbl_projektarbeitsbeurteilung WHERE projektarbeit_id = tbl_projektarbeit.projektarbeit_id AND betreuer_person_id = tbl_projektbetreuer.person_id) AS babgeschickt, - (SELECT abgeschicktvon FROM extension.tbl_projektarbeitsbeurteilung WHERE projektarbeit_id = tbl_projektarbeit.projektarbeit_id AND betreuerart_kurzbz IN ('Zweitbetreuer', 'Zweitbegutachter') LIMIT 1) AS zweitbetreuer_abgeschickt - FROM lehre.tbl_projektarbeit - LEFT JOIN lehre.tbl_projektbetreuer USING(projektarbeit_id) - LEFT JOIN public.tbl_benutzer ON(uid=student_uid) - LEFT JOIN public.tbl_person ON(tbl_benutzer.person_id=tbl_person.person_id) - LEFT JOIN lehre.tbl_lehreinheit USING(lehreinheit_id) - LEFT JOIN lehre.tbl_lehrveranstaltung USING(lehrveranstaltung_id) - LEFT JOIN public.tbl_studiengang USING(studiengang_kz) - LEFT JOIN lehre.tbl_projekttyp USING (projekttyp_kurzbz) - WHERE (projekttyp_kurzbz='Bachelor' OR projekttyp_kurzbz='Diplom') - AND (tbl_projektbetreuer.betreuerart_kurzbz='Betreuer' - OR tbl_projektbetreuer.betreuerart_kurzbz='Begutachter' - OR tbl_projektbetreuer.betreuerart_kurzbz='Erstbetreuer' - OR tbl_projektbetreuer.betreuerart_kurzbz='Erstbegutachter') - AND tbl_projektarbeit.student_uid=".$db->db_add_param($uid)." - ORDER BY studiensemester_kurzbz desc, tbl_lehrveranstaltung.kurzbz"; - -//AND tbl_projektarbeit.student_uid='$getuid' 'ie07m102'; -if(!$erg=$db->db_query($sql_query)) -{ - $errormsg=$p->t('global/fehlerBeimLesenAusDatenbank'); -} -else -{ - $htmlstr .= "
\n"; - $htmlstr .= "\n"; - $htmlstr .= " - - - - - - - - "; - $htmlstr .= "\n"; - $i = 0; - while($row=$db->db_fetch_object($erg)) - { - $htmlstr1 = ''; - $zweitbetreuer_obj = new person(); - if ($zweitbetreuer_obj->load($row->zweitbetreuer_person_id)) - { - $zweitbetreuer = ', '.$db->convert_html_chars($row->zweitbetreuer_betreuerart_kurzbz).': '.$zweitbetreuer_obj->titelpre.' '.$zweitbetreuer_obj->vorname.' '.$zweitbetreuer_obj->nachname.' '.$zweitbetreuer_obj->titelpost; - } - $htmlstr1 = ''.$db->convert_html_chars($row->betreuerart_kurzbz).': '; - $vorname=$row->vorname; - $nachname=$row->nachname; - $uid=$row->uid; - ($row->btitelpre!=''?$htmlstr1 .= $row->btitelpre.' ':$htmlstr1 .= ''); - $htmlstr1 .= $row->bvorname.' '.$row->bnachname; - ($row->btitelpost!=''?$htmlstr1 .= ' '.$row->btitelpost:$htmlstr1 .= ''); - $htmlstr1 .= $zweitbetreuer; - $htmlstr .= " \n"; //class='liste".($i%2)."' - - if (is_null($row->note) && $row->aktiv === 't') - $htmlstr .= " \n"; - elseif (!is_null($row->babgeschickt) || !is_null($row->zweitbetreuer_abgeschickt)) - { - $htmlstr .= ""; - } else - { - $htmlstr .= ""; - } - - - $htmlstr .= " \n"; - $htmlstr .= " \n"; - $htmlstr .= " "; - $htmlstr .= " \n"; - $htmlstr .= " \n"; - $htmlstr .= " \n"; -// $htmlstr .= " \n"; - $htmlstr .= " \n"; - $i++; - } - $htmlstr .= "
".$p->t('abgabetool/details')."".$p->t('lvplan/sem')."".$p->t('lvplan/stg')."".$p->t('global/mail')."".$p->t('abgabetool/betreuer')."".$p->t('abgabetool/typ')."".$p->t('abgabetool/titel')."
".$p->t('abgabetool/upload').""; - - if (!is_null($row->babgeschickt)) - $htmlstr .= "".$p->t('abgabetool/projektbeurteilungErstDownload').""; - - if (!is_null($row->babgeschickt) && !is_null($row->zweitbetreuer_abgeschickt)) - $htmlstr .= "/"; - - if (!is_null($row->zweitbetreuer_abgeschickt)) - $htmlstr .= "".$p->t('abgabetool/projektbeurteilungZweitDownload').""; - - $htmlstr .= "".$row->studiensemester_kurzbz."".strtoupper($row->typ.$row->kurzbz).""; - - $qry_betr="SELECT mitarbeiter_uid FROM public.tbl_person - JOIN public.tbl_benutzer USING(person_id) - JOIN public.tbl_mitarbeiter ON(uid=mitarbeiter_uid) - WHERE person_id=".$db->db_add_param($row->betreuer_person_id, FHC_INTEGER).";"; - if($result_betr=$db->db_query($qry_betr)) - { - if($row_betr=$db->db_fetch_object($result_betr)) - { - $htmlstr.="email"; - } - else - { - $htmlstr.="UID unknown!"; - } - } - $htmlstr .= " ".$htmlstr1." ".$db->convert_html_chars($row->prjbez)."".$db->convert_html_chars($row->titel)."".$db->convert_html_chars($row->betreuerart_kurzbz)."
\n"; -} -echo ' - - - - Abgabesystem_Studentensicht - - - - - - - - - - - - -'; - - echo '

'.$p->t('abgabetool/ueberschrift'); - if(trim($uid)!='') - echo " ($uid $vorname $nachname)
Anleitung ".$p->t('global/handbuch')."
"; - echo '

'; - echo $htmlstr; - echo ' -'; -?> + + * Andreas Oesterreicher < andreas.oesterreicher@technikum-wien.at > + * Rudolf Hangl < rudolf.hangl@technikum-wien.at > + * Gerald Simane-Sequens < gerald.simane-sequens@technikum-wien.at > + */ + +require_once('../../../config/cis.config.inc.php'); +require_once('../../../include/functions.inc.php'); +require_once('../../../include/datum.class.php'); +require_once('../../../include/person.class.php'); +require_once('../../../include/benutzer.class.php'); +require_once('../../../include/student.class.php'); +require_once('../../../include/studiengang.class.php'); +require_once('../../../include/benutzerberechtigung.class.php'); +require_once('../../../include/phrasen.class.php'); + +$sprache = getSprache(); +$p = new phrasen($sprache); + +if (!$db = new basis_db()) + die($p->t('global/fehlerBeimOeffnenDerDatenbankverbindung')); + +$getuid=get_uid(); +$uid=$getuid; + +if(isset($_GET['uid'])) +{ + //Studentenansicht + $uid = $_GET['uid']; + //Rechte Pruefen + $allowed=false; + + $student = new student(); + if(!$student->load($uid)) + die($p->t('global/fehlerBeimErmittelnDerUID')); + + $stg_obj = new studiengang(); + if(!$stg_obj->load($student->studiengang_kz)) + die($p->t('global/fehlerBeimLesenAusDatenbank')); + + //Berechtigung ueber das Berechtigungssystem + $rechte = new benutzerberechtigung(); + $rechte->getBerechtigungen($getuid); + if($rechte->isBerechtigt('lehre/abgabetool',$stg_obj->oe_kurzbz,'s')) + $allowed=true; + + //oder Lektor mit Betreuung dieses Studenten + $qry = "SELECT 1 + FROM + lehre.tbl_projektarbeit + JOIN lehre.tbl_projektbetreuer USING(projektarbeit_id) + JOIN campus.vw_benutzer on(vw_benutzer.person_id=tbl_projektbetreuer.person_id) + WHERE + tbl_projektarbeit.student_uid=".$db->db_add_param($uid)." AND + vw_benutzer.uid=".$db->db_add_param($getuid).";"; + + if($result = $db->db_query($qry)) + { + if($db->db_num_rows($result)>0) + { + $allowed=true; + } + } + + if(!$allowed) + { + die($p->t('abgabetool/keineBerechtigungStudentenansicht')); + } +} +$htmlstr = ''; +$htmlstr1 = ''; +$vorname=''; +$nachname=''; +$zweitbetreuer = ''; + +$sql_query = "SELECT (SELECT nachname FROM public.tbl_person WHERE person_id=tbl_projektbetreuer.person_id) AS bnachname, + (SELECT vorname FROM public.tbl_person WHERE person_id=tbl_projektbetreuer.person_id) AS bvorname, + (SELECT titelpre FROM public.tbl_person WHERE person_id=tbl_projektbetreuer.person_id) AS btitelpre, + (SELECT titelpost FROM public.tbl_person WHERE person_id=tbl_projektbetreuer.person_id) AS btitelpost, + (SELECT person_id FROM lehre.tbl_projektbetreuer WHERE projektarbeit_id=tbl_projektarbeit.projektarbeit_id + AND betreuerart_kurzbz IN ('Zweitbetreuer', 'Zweitbegutachter') LIMIT 1) AS zweitbetreuer_person_id, + (SELECT betreuerart_kurzbz FROM lehre.tbl_projektbetreuer WHERE projektarbeit_id=tbl_projektarbeit.projektarbeit_id + AND betreuerart_kurzbz IN ('Zweitbetreuer', 'Zweitbegutachter') LIMIT 1) AS zweitbetreuer_betreuerart_kurzbz, + tbl_projektbetreuer.person_id AS betreuer_person_id, + tbl_projekttyp.bezeichnung AS prjbez, *, + lehre.tbl_projektbetreuer.note as note, + public.tbl_benutzer.aktiv as aktiv, + (SELECT abgeschicktvon FROM extension.tbl_projektarbeitsbeurteilung WHERE projektarbeit_id = tbl_projektarbeit.projektarbeit_id AND betreuer_person_id = tbl_projektbetreuer.person_id) AS babgeschickt, + (SELECT abgeschicktvon FROM extension.tbl_projektarbeitsbeurteilung WHERE projektarbeit_id = tbl_projektarbeit.projektarbeit_id AND betreuerart_kurzbz IN ('Zweitbetreuer', 'Zweitbegutachter') LIMIT 1) AS zweitbetreuer_abgeschickt + FROM lehre.tbl_projektarbeit + LEFT JOIN lehre.tbl_projektbetreuer USING(projektarbeit_id) + LEFT JOIN public.tbl_benutzer ON(uid=student_uid) + LEFT JOIN public.tbl_person ON(tbl_benutzer.person_id=tbl_person.person_id) + LEFT JOIN lehre.tbl_lehreinheit USING(lehreinheit_id) + LEFT JOIN lehre.tbl_lehrveranstaltung USING(lehrveranstaltung_id) + LEFT JOIN public.tbl_studiengang USING(studiengang_kz) + LEFT JOIN lehre.tbl_projekttyp USING (projekttyp_kurzbz) + WHERE (projekttyp_kurzbz='Bachelor' OR projekttyp_kurzbz='Diplom') + AND (tbl_projektbetreuer.betreuerart_kurzbz='Betreuer' + OR tbl_projektbetreuer.betreuerart_kurzbz='Begutachter' + OR tbl_projektbetreuer.betreuerart_kurzbz='Erstbetreuer' + OR tbl_projektbetreuer.betreuerart_kurzbz='Erstbegutachter') + AND tbl_projektarbeit.student_uid=".$db->db_add_param($uid)." + ORDER BY studiensemester_kurzbz desc, tbl_lehrveranstaltung.kurzbz"; + +//AND tbl_projektarbeit.student_uid='$getuid' 'ie07m102'; +if(!$erg=$db->db_query($sql_query)) +{ + $errormsg=$p->t('global/fehlerBeimLesenAusDatenbank'); +} +else +{ + $htmlstr .= "
\n"; + $htmlstr .= "\n"; + $htmlstr .= " + + + + + + + + "; + $htmlstr .= "\n"; + $i = 0; + while($row=$db->db_fetch_object($erg)) + { + $htmlstr1 = ''; + $zweitbetreuer_obj = new person(); + if ($zweitbetreuer_obj->load($row->zweitbetreuer_person_id)) + { + $zweitbetreuer = ', '.$db->convert_html_chars($row->zweitbetreuer_betreuerart_kurzbz).': '.$zweitbetreuer_obj->titelpre.' '.$zweitbetreuer_obj->vorname.' '.$zweitbetreuer_obj->nachname.' '.$zweitbetreuer_obj->titelpost; + } + $htmlstr1 = ''.$db->convert_html_chars($row->betreuerart_kurzbz).': '; + $vorname=$row->vorname; + $nachname=$row->nachname; + $uid=$row->uid; + ($row->btitelpre!=''?$htmlstr1 .= $row->btitelpre.' ':$htmlstr1 .= ''); + $htmlstr1 .= $row->bvorname.' '.$row->bnachname; + ($row->btitelpost!=''?$htmlstr1 .= ' '.$row->btitelpost:$htmlstr1 .= ''); + $htmlstr1 .= $zweitbetreuer; + $htmlstr .= " \n"; //class='liste".($i%2)."' + + if (is_null($row->note) && $row->aktiv === 't') + $htmlstr .= " \n"; + elseif (!is_null($row->babgeschickt) || !is_null($row->zweitbetreuer_abgeschickt)) + { + $htmlstr .= ""; + } else + { + $htmlstr .= ""; + } + + + $htmlstr .= " \n"; + $htmlstr .= " \n"; + $htmlstr .= " "; + $htmlstr .= " \n"; + $htmlstr .= " \n"; + $htmlstr .= " \n"; +// $htmlstr .= " \n"; + $htmlstr .= " \n"; + $i++; + } + $htmlstr .= "
".$p->t('abgabetool/details')."".$p->t('lvplan/sem')."".$p->t('lvplan/stg')."".$p->t('global/mail')."".$p->t('abgabetool/betreuer')."".$p->t('abgabetool/typ')."".$p->t('abgabetool/titel')."
".$p->t('abgabetool/upload').""; + + if (!is_null($row->babgeschickt)) + $htmlstr .= "".$p->t('abgabetool/projektbeurteilungErstDownload').""; + + if (!is_null($row->babgeschickt) && !is_null($row->zweitbetreuer_abgeschickt)) + $htmlstr .= "/"; + + if (!is_null($row->zweitbetreuer_abgeschickt)) + $htmlstr .= "".$p->t('abgabetool/projektbeurteilungZweitDownload').""; + + $htmlstr .= "".$row->studiensemester_kurzbz."".strtoupper($row->typ.$row->kurzbz).""; + + $qry_betr="SELECT mitarbeiter_uid FROM public.tbl_person + JOIN public.tbl_benutzer USING(person_id) + JOIN public.tbl_mitarbeiter ON(uid=mitarbeiter_uid) + WHERE person_id=".$db->db_add_param($row->betreuer_person_id, FHC_INTEGER).";"; + if($result_betr=$db->db_query($qry_betr)) + { + if($row_betr=$db->db_fetch_object($result_betr)) + { + $htmlstr.="email"; + } + else + { + $htmlstr.="UID unknown!"; + } + } + $htmlstr .= " ".$htmlstr1." ".$db->convert_html_chars($row->prjbez)."".$db->convert_html_chars($row->titel)."".$db->convert_html_chars($row->betreuerart_kurzbz)."
\n"; +} +echo ' + + + + Abgabesystem_Studentensicht + + + + + + + + + + + + +'; + + echo '

'.$p->t('abgabetool/ueberschrift'); + if(trim($uid)!='') + echo " ($uid $vorname $nachname)
Anleitung ".$p->t('global/handbuch')."
"; + echo '

'; + echo $htmlstr; + echo ' +'; +?> diff --git a/cis/private/lehre/anwesenheitsliste.pdf.php b/cis/private/lehre/anwesenheitsliste.pdf.php index eef40ff3f..01ec1c93f 100644 --- a/cis/private/lehre/anwesenheitsliste.pdf.php +++ b/cis/private/lehre/anwesenheitsliste.pdf.php @@ -166,13 +166,14 @@ $qry = 'SELECT tbl_studentlehrverband.semester, tbl_studentlehrverband.verband, tbl_studentlehrverband.gruppe, (SELECT status_kurzbz FROM public.tbl_prestudentstatus WHERE prestudent_id=tbl_student.prestudent_id ORDER BY datum DESC, insertamum DESC, ext_id DESC LIMIT 1) as status, tbl_bisio.bisio_id, tbl_bisio.von, tbl_bisio.bis, tbl_student.studiengang_kz AS stg_kz_student, - tbl_zeugnisnote.note, tbl_mitarbeiter.mitarbeiter_uid, tbl_person.matr_nr, tbl_studiengang.kurzbzlang + tbl_note.lkt_ueberschreibbar, tbl_note.anmerkung, tbl_mitarbeiter.mitarbeiter_uid, tbl_person.matr_nr, tbl_studiengang.kurzbzlang FROM campus.vw_student_lehrveranstaltung JOIN public.tbl_benutzer USING(uid) JOIN public.tbl_person USING(person_id) LEFT JOIN public.tbl_student ON(uid=student_uid) LEFT JOIN public.tbl_mitarbeiter ON(uid=mitarbeiter_uid) LEFT JOIN public.tbl_studentlehrverband USING(student_uid,studiensemester_kurzbz) LEFT JOIN lehre.tbl_zeugnisnote on(vw_student_lehrveranstaltung.lehrveranstaltung_id=tbl_zeugnisnote.lehrveranstaltung_id AND tbl_zeugnisnote.student_uid=tbl_student.student_uid AND tbl_zeugnisnote.studiensemester_kurzbz=tbl_studentlehrverband.studiensemester_kurzbz) + LEFT JOIN lehre.tbl_note USING (note) LEFT JOIN bis.tbl_bisio ON(uid=tbl_bisio.student_uid) LEFT JOIN public.tbl_studiengang ON(tbl_student.studiengang_kz=tbl_studiengang.studiengang_kz) WHERE @@ -213,8 +214,8 @@ if($result = $db->db_query($qry)) if($row->bisio_id!='' && $row->status!='Incoming' && ($row->bis > $stsemdatumvon || $row->bis=='') && $row->von < $stsemdatumbis) //Outgoing $zusatz.='(o)(ab '.$datum->formatDatum($row->von,'d.m.Y').')'; - if($row->note==6) //angerechnet - $zusatz.='(ar)'; + if($row->lkt_ueberschreibbar == 'f') // angerechnet / intern angerechnet / nicht zugelassen + $zusatz.= '('. $row->anmerkung. ')'; if($row->mitarbeiter_uid!='') //mitarbeiter $zusatz.='(ma)'; diff --git a/cis/private/tools/zeitaufzeichnung.php b/cis/private/tools/zeitaufzeichnung.php index 2a7939e17..5bdc40925 100644 --- a/cis/private/tools/zeitaufzeichnung.php +++ b/cis/private/tools/zeitaufzeichnung.php @@ -22,6 +22,7 @@ * Manfred Kindl * Gerald Raab * Alexei Karpenko + * Manuela Thamer */ require_once('../../../config/cis.config.inc.php'); require_once('../../../include/functions.inc.php'); @@ -44,6 +45,7 @@ require_once('../../../include/bisverwendung.class.php'); require_once('../../../include/studiensemester.class.php'); require_once('../../../include/benutzerberechtigung.class.php'); + $sprache = getSprache(); $p=new phrasen($sprache); $sprache_obj = new sprache(); @@ -88,7 +90,7 @@ $fieldheadings = array( 'oe1' => $p->t("zeitaufzeichnung/oe"), 'oe2' => $p->t("zeitaufzeichnung/oe").'2', 'aktivitaet' => $p->t("zeitaufzeichnung/aktivitaet"), 'service' => $p->t("zeitaufzeichnung/service"), 'start' => $p->t("zeitaufzeichnung/start"), 'ende' => $p->t("zeitaufzeichnung/ende"), 'dauer' => $p->t("zeitaufzeichnung/dauer"), 'kunde' => $p->t("zeitaufzeichnung/kunde"), 'beschreibung' => $p->t("global/beschreibung"), 'aktion' => $p->t("global/aktion"), - 'datum' => $p->t("global/datum") + 'datum' => $p->t("global/datum"),'homeoffice' => $p->t("zeitaufzeichnung/homeoffice") ); if ($rechte->isBerechtigt('basis/servicezeitaufzeichnung')) @@ -131,10 +133,13 @@ $bis_datum = (isset($_REQUEST['bis_datum'])?$_REQUEST['bis_datum']:date('d.m.Y') $bis_uhrzeit = (isset($_POST['bis_uhrzeit'])?$_POST['bis_uhrzeit']:date('H:i',mktime(date('H'), date('i')+10))); $bis = $bis_datum.' '.$bis_uhrzeit; +$homeoffice = (isset($_POST['homeoffice'])?true:false); $pause_von = (isset($_POST['pause_von'])?$_POST['pause_von']:date('H:i')); $pause_bis = (isset($_POST['pause_bis'])?$_POST['pause_bis']:date('H:i')); $von_pause = $von_datum.' '.$pause_von; $bis_pause = $bis_datum.' '.$pause_bis; +$homeofficeChecked = ''; +//$reload = false; $beschreibung = (isset($_POST['beschreibung'])?$_POST['beschreibung']:''); $service_id = (isset($_POST['service_id'])?$_POST['service_id']:''); @@ -221,7 +226,7 @@ echo ' @@ -806,6 +927,39 @@ if(isset($_POST['save']) || isset($_POST['edit']) || isset($_POST['import'])) $zeit->projektphase_id = $data[7]; if (isset($data[8])) $zeit->service_id = $data[8]; + if (isset($data[9])) + { + if (strtolower($data[9] == 'true')) + { + // check, ob homeoffice gemäß Bisverwendung + $verwendung = new bisverwendung(); + $verwendung->getVerwendungDatum($data[0],$vonCSV); + + foreach ($verwendung->result as $v) + // echo "homeoffice für Tag " . $vonCSV . " ". $v->homeoffice . " " . $v->bisverwendung_id . "
"; + + if ($v->homeoffice) + { + + // echo "homeoffice erlaubt
"; + $zeit->homeoffice = true; + } + else + { + echo ''.$p->t("zeitaufzeichnung/homeofficeNichtErlaubt", ($vonCSV)) .'
'; + + $zeit->homeoffice = false; + } + } + else + { + $zeit->homeoffice = false; + } + } + else + { + $zeit->homeoffice = false; + } $tag = $datum->formatDatum($data[2], $format='Y-m-d'); if(!in_array($tag, $importtage_array)) @@ -829,6 +983,7 @@ if(isset($_POST['save']) || isset($_POST['edit']) || isset($_POST['import'])) $pause->start = $ende_vorher; $pause->ende = $zeit->start; $pause->beschreibung = ''; + $pause->homeoffice = $homeoffice; if(!$pause->save()) { echo ''.$p->t("global/fehlerBeimSpeichernDerDaten").': '.$pause->errormsg.'
'; @@ -908,6 +1063,7 @@ if(isset($_POST['save']) || isset($_POST['edit']) || isset($_POST['import'])) $zeit->updatevon = $user; $zeit->projekt_kurzbz = $projekt_kurzbz; $zeit->projektphase_id = $projektphase_id; + $zeit->homeoffice = $homeoffice; $zeit->service_id = $service_id; $zeit->kunde_uid = $kunde_uid; $saveerror = 0; @@ -924,8 +1080,10 @@ if(isset($_POST['save']) || isset($_POST['edit']) || isset($_POST['import'])) } elseif (!$projectphase->checkProjectphaseInCorrectTime($projektphase_id, $datum->formatDatum($von, $format='Y-m-d'), $datum->formatDatum($bis, $format='Y-m-d'))) { - echo ''.$p->t("global/fehlerBeimSpeichernDerDaten").': Eingabe nicht möglich, da angegebenes Anfangs und Enddatum nicht in den Projektphasenzeitrahmen fällt.
'; + echo '

'.$p->t("global/fehlerBeimSpeichernDerDaten").': + Eingabe nicht möglich, da angegebenes Anfangs und Enddatum nicht in den Projektphasenzeitrahmen fällt.


'; $saveerror = 1; + } elseif (abs($von-$bis)>0 && $aktivitaet_kurzbz!="DienstreiseMT") { @@ -968,6 +1126,7 @@ if(isset($_POST['save']) || isset($_POST['edit']) || isset($_POST['import'])) $pause->insertvon = $user; $pause->uid = $user; $pause->aktivitaet_kurzbz = 'Pause'; + $pause->homeoffice = $homeoffice; $pause->start = $datum->formatDatum($von_pause, $format='Y-m-d H:i:s'); $pause->ende = $datum->formatDatum($bis_pause, $format='Y-m-d H:i:s'); $pause->beschreibung = ''; @@ -1055,13 +1214,12 @@ else echo ' '; //Laden der Daten zum aendern -if(isset($_GET['type']) && $_GET['type']=='edit') +if (isset($_GET['type']) && $_GET['type'] == 'edit') { $zeit = new zeitaufzeichnung(); - - if($zeit->load($zeitaufzeichnung_id)) + if ($zeit->load($zeitaufzeichnung_id)) { - if($zeit->uid==$user) + if ($zeit->uid == $user) { $uid = $zeit->uid; $aktivitaet_kurzbz = $zeit->aktivitaet_kurzbz; @@ -1072,13 +1230,15 @@ if(isset($_GET['type']) && $_GET['type']=='edit') $oe_kurzbz_2 = $zeit->oe_kurzbz_2; $projekt_kurzbz = $zeit->projekt_kurzbz; $projektphase_id = $zeit->projektphase_id; + $homeoffice = $zeit->homeoffice; + $homeoffice[0] == 't' ? $homeofficeChecked = 'checked' : $homeofficeChecked = ''; $service_id = $zeit->service_id; $kunde_uid = $zeit->kunde_uid; $projektphase = new projektphase(); - $projektphasen = array(); - if($projektphase->getProjektphasen($projekt_kurzbz)) + + if ($projektphase->getProjectphaseForMitarbeiterByKurzBz($uid, $projekt_kurzbz)) { foreach ($projektphase->result as $row) { @@ -1089,15 +1249,16 @@ if(isset($_GET['type']) && $_GET['type']=='edit') else { echo "".$p->t("global/keineBerechtigungZumAendernDesDatensatzes").""; - $zeitaufzeichnung_id=''; + $zeitaufzeichnung_id = ''; } } } + //Projekte holen zu denen der Benutzer zugeteilt ist $projekt = new projekt(); -if($projekt->getProjekteMitarbeiter($user, true)) +if ($projekt->getProjekteMitarbeiter($user, true)) { //if(count($projekt->result)>0) //{ @@ -1324,36 +1485,48 @@ if($projekt->getProjekteMitarbeiter($user, true)) $selected = ''; echo ''; - } - echo ''; - - //Projektphase - $showprojphases = isset($projektphasen) && is_array($projektphasen) && count($projektphasen) > 0 && $projektfound; - $hiddentext = $showprojphases ? "" : " style='display:none'"; - - echo - '    '. - $p->t("zeitaufzeichnung/projektphase").' - '; - } - echo ''; } + echo ''; - if ($za_simple == 0) + //Projektphase + $showprojphases = isset($projektphasen) && is_array($projektphasen) && count($projektphasen) > 0 && $projektfound; + $hiddentext = $showprojphases ? "" : " style='display:none'"; + + echo + '    '. + $p->t("zeitaufzeichnung/projektphase").' + '; + } + echo ''; + } + + echo ""; + + if ($za_simple == 0) { // Service echo ' @@ -1402,6 +1575,7 @@ if($projekt->getProjekteMitarbeiter($user, true)) $von_ts = $datum->mktime_fromtimestamp($datum->formatDatum($von, $format='Y-m-d H:i:s')); $bis_ts = $datum->mktime_fromtimestamp($datum->formatDatum($bis, $format='Y-m-d H:i:s')); $diff = $bis_ts - $von_ts; + echo ' '.$p->t("global/von").' - '.$p->t("global/bis").' @@ -1444,6 +1618,20 @@ if($projekt->getProjekteMitarbeiter($user, true)) '; + + //Homeoffice Checkbox + echo ' + +   + + + Homeoffice + + + + + '; + //Beschreibung echo ''.$p->t("global/beschreibung").''; echo ''; @@ -1505,7 +1693,7 @@ if($projekt->getProjekteMitarbeiter($user, true)) echo ''; else echo ''; - //echo ''; + //echo ''; $za = new zeitaufzeichnung(); if(isset($_GET['filter'])) @@ -1621,6 +1809,7 @@ if($projekt->getProjekteMitarbeiter($user, true)) elseif ($tagessaldo > 18000 && $tagessaldo < 19800 && $pausesumme < $tagessaldo - 18000) $pausefehlt_str = '-- Pause fehlt oder zu kurz --'; + $tagessaldo = date('H:i', ($tagessaldo)); $colspan = ($za_simple)?6:8; echo ''; @@ -1770,6 +1959,11 @@ if($projekt->getProjekteMitarbeiter($user, true)) $style = 'style="border-top: 3px solid #8DBDD8; border-bottom: 3px solid #8DBDD8"'; if ($row->aktivitaet_kurzbz=='Pause' || $row->aktivitaet_kurzbz=='LehreExtern'|| $row->aktivitaet_kurzbz=='Ersatzruhe') $style .= ' style="color: grey;"'; + if($db->convert_html_chars($row->homeoffice)=='t') + { + $homeoffice = " - Homeoffice"; + }else + $homeoffice=""; $summe = $row->summe; $service = new service(); $service->load($row->service_id); @@ -1785,7 +1979,7 @@ if($projekt->getProjekteMitarbeiter($user, true)) { echo ' '.$db->convert_html_chars($row->oe_kurzbz_2).''; } - echo ''.$db->convert_html_chars($row->aktivitaet_kurzbz).''; + echo ''.$db->convert_html_chars($row->aktivitaet_kurzbz).($homeoffice).''; if(!$za_simple) { echo ' '.StringCut($db->convert_html_chars($service->bezeichnung),20,null,'...').' '; @@ -1919,8 +2113,8 @@ function getDataForCSV($rawdata, $fieldheadings, $za_simple = false) $datum = new datum(); $csvData = array(); //headers schreiben - $csvData[] = ($za_simple) ? array($fieldheadings['user'], $fieldheadings['datum'], $fieldheadings['start'], $fieldheadings['ende'], $fieldheadings['projekt'], $fieldheadings['ap'], $fieldheadings['oe1'], $fieldheadings['aktivitaet'], $fieldheadings['beschreibung']) - : array($fieldheadings['user'], $fieldheadings['datum'], $fieldheadings['start'], $fieldheadings['ende'], $fieldheadings['projekt'], $fieldheadings['ap'], $fieldheadings['oe1'], $fieldheadings['oe2'], $fieldheadings['aktivitaet'], $fieldheadings['service'], $fieldheadings['kunde'], $fieldheadings['beschreibung']); + $csvData[] = ($za_simple) ? array($fieldheadings['user'], $fieldheadings['datum'], $fieldheadings['start'], $fieldheadings['ende'], $fieldheadings['projekt'], $fieldheadings['ap'], $fieldheadings['oe1'], $fieldheadings['aktivitaet'], $fieldheadings['beschreibung'], $fieldheadings['homeoffice']) + : array($fieldheadings['user'], $fieldheadings['datum'], $fieldheadings['start'], $fieldheadings['ende'], $fieldheadings['projekt'], $fieldheadings['ap'], $fieldheadings['oe1'], $fieldheadings['oe2'], $fieldheadings['aktivitaet'], $fieldheadings['service'], $fieldheadings['kunde'], $fieldheadings['beschreibung'], $fieldheadings['homeoffice']); foreach ($rawdata as $zeitauf) { //Newline characters bei Beschreibung ersetzen @@ -1933,13 +2127,13 @@ function getDataForCSV($rawdata, $fieldheadings, $za_simple = false) if($za_simple) { $csvData[] = array($zeitauf->uid, $hauptdatum, $datum->formatDatum($zeitauf->start, 'H:i'), - $bisdatum, $zeitauf->projekt_kurzbz, $zeitauf->projektphase_id, $zeitauf->oe_kurzbz_1, $zeitauf->aktivitaet_kurzbz, $beschreibung); + $bisdatum, $zeitauf->projekt_kurzbz, $zeitauf->projektphase_id, $zeitauf->oe_kurzbz_1, $zeitauf->aktivitaet_kurzbz, $beschreibung, $zeitauf->homeoffice); } else { $servicebez = ($service->load($zeitauf->service_id))?$service->bezeichnung:""; $csvData[] = array($zeitauf->uid, $hauptdatum, $datum->formatDatum($zeitauf->start, 'H:i'), $bisdatum, - $zeitauf->projekt_kurzbz, $zeitauf->projektphase_id, $zeitauf->oe_kurzbz_1, $zeitauf->oe_kurzbz_2, $zeitauf->aktivitaet_kurzbz, $servicebez, $zeitauf->kunde_uid, $beschreibung); + $zeitauf->projekt_kurzbz, $zeitauf->projektphase_id, $zeitauf->oe_kurzbz_1, $zeitauf->oe_kurzbz_2, $zeitauf->aktivitaet_kurzbz, $servicebez, $zeitauf->kunde_uid, $beschreibung, $zeitauf->homeoffice); } } return $csvData; @@ -1987,6 +2181,7 @@ function exportProjectOverviewAsCSV($user, $delimiter = ',') function getDataForProjectOverviewCSV($user) { + $db = new basis_db(); $projects_of_user = new projekt(); $projects = $projects_of_user->getProjekteListForMitarbeiter($user); @@ -1994,10 +2189,12 @@ function getDataForProjectOverviewCSV($user) if($projektphase->getProjectphaseForMitarbeiter($user)) $projektphasen = $projektphase->result; else - $projetkphasen = array(); + $projektphasen = array(); $csvData = array(); + $exists = @$db->db_query('SELECT 1 FROM sync.tbl_projects_timesheets_project LIMIT 1;'); + foreach ($projects as $project) { $titel = $project->titel; @@ -2007,27 +2204,47 @@ function getDataForProjectOverviewCSV($user) $beginn = $project->beginn; $ende = $project->ende; - $csvData[] = array($titel, $projekt_kurzbz, $projekt_phase, $projekt_phase_id, $beginn, $ende); + $inhalt = array($titel, $projekt_kurzbz, $projekt_phase, $projekt_phase_id, $beginn, $ende); + + if ($exists) + { + $sap_projekt_id = $project->sap_project_id; + $inhalt[] = $sap_projekt_id; + } + + $csvData[] = $inhalt; } foreach ($projektphasen as $prjp) { if (true) { - $titel = $prjp->projekt_kurzbz; + $titel = $prjp->projekttitel; $projekt_kurzbz = $prjp->projekt_kurzbz; $projekt_phase = $prjp->bezeichnung; $projekt_phase_id = $prjp->projektphase_id; $beginn = $prjp->start; $ende = $prjp->ende; + $inhalt = array($titel, $projekt_kurzbz, $projekt_phase, $projekt_phase_id, $beginn, $ende); - array_push($csvData, array($titel, $projekt_kurzbz, $projekt_phase, $projekt_phase_id, $beginn, $ende) ); + if ($exists) + { + $project_task_id = $prjp->project_task_id; + $inhalt[] = $project_task_id; + } + + array_push($csvData, $inhalt); } } sort($csvData); //headers schreiben - array_unshift($csvData, array('PROJEKT', 'PROJEKT KURZBEZEICHNUNG', 'PROJEKTPHASE', 'PROJEKTPHASEN ID', 'START', 'PROJEKT ENDE')); + $header = array('PROJEKT', 'PROJEKT KURZBEZEICHNUNG', 'PROJEKTPHASE', 'PROJEKTPHASEN ID', 'START', 'PROJEKT ENDE'); + + if ($exists) + $header[] = 'SAP PROJEKTNUMMER'; + + array_unshift($csvData, $header); return $csvData; } ?> diff --git a/cis/private/tools/zeitaufzeichnung_bisverwendung.php b/cis/private/tools/zeitaufzeichnung_bisverwendung.php new file mode 100644 index 000000000..2f430ecda --- /dev/null +++ b/cis/private/tools/zeitaufzeichnung_bisverwendung.php @@ -0,0 +1,75 @@ + + */ +/** + * Checks, if there is the possibility for homeoffice for the given bisverwendung of + * a certain date. + */ +require_once('../../../config/cis.config.inc.php'); +require_once('../../../include/globals.inc.php'); +require_once('../../../include/phrasen.class.php'); +require_once('../../../include/datum.class.php'); +require_once('../../../include/Excel/excel.php'); +require_once('../../../include/benutzer.class.php'); +require_once('../../../include/benutzerberechtigung.class.php'); +require_once('../../../include/mitarbeiter.class.php'); +require_once('../../../include/zeitaufzeichnung.class.php'); +require_once('../../../include/projekt.class.php'); +require_once('../../../include/bisverwendung.class.php'); + +if ((isset($_GET['uid'])) && (isset($_GET['day']))) +{ + $uid = get_uid(); + + //Wenn User Administrator ist und UID uebergeben wurde, dann die Zeitaufzeichnung + //des uebergebenen Users anzeigen + if (isset($_GET['uid']) && $_GET['uid'] != $uid) + { + $p = new phrasen(); + $rechte = new benutzerberechtigung(); + $rechte->getBerechtigungen($uid); + + if ($rechte->isBerechtigt('admin')) + { + $uid = $_GET['uid']; + } + else + { + die($p->t('global/FuerDieseAktionBenoetigenSieAdministrationsrechte')); + } + } + + $day = $_GET['day']; + + $verwendung = new bisverwendung(); + + $verwendung->getVerwendungDatum($uid, $day); + $homeoffice = false; + + foreach ($verwendung->result as $v) + { + if ($v->homeoffice) + { + $homeoffice = true; + } + } + + echo json_encode($homeoffice); + +} diff --git a/cis/private/tools/zeitaufzeichnung_projektliste.php b/cis/private/tools/zeitaufzeichnung_projektliste.php index 4621c4a66..ce00eabc1 100644 --- a/cis/private/tools/zeitaufzeichnung_projektliste.php +++ b/cis/private/tools/zeitaufzeichnung_projektliste.php @@ -559,9 +559,11 @@ $totalworktimewidth = 13; $worktimewidth = 14; $timecolumnswidth = 2 * $daywidth + $totalworktimewidth + $worktimewidth; -if ($nrProjects < 1)//no projekts - merge all cells and write notice +if ($nrProjects < 1) //no projekts - write notice { - $projektnames[] = "Keine Projekte vorhanden"; + $worksheet =& $workbook->addWorksheet('Tabelle'); + $worksheet->setInputEncoding('utf-8'); + $worksheet->write(0,0,'Für diesen Zeitraum sind keine Projekte zugeordnet'); } foreach ($projektnames as $projektname) @@ -748,7 +750,7 @@ foreach ($projektnames as $projektname) } $worksheet->setColumn($spalte, $spalte, $phasewidth); - $worksheet->write($zeile, $spalte++, $projekt->beschreibung, $format_cell_leftrightline); + $worksheet->writeString($zeile, $spalte++, $projekt->beschreibung, $format_cell_leftrightline); } } else diff --git a/cis/private/tools/zeitaufzeichnung_projektphasen.php b/cis/private/tools/zeitaufzeichnung_projektphasen.php index 4e4671367..cd0acc0bd 100644 --- a/cis/private/tools/zeitaufzeichnung_projektphasen.php +++ b/cis/private/tools/zeitaufzeichnung_projektphasen.php @@ -1,18 +1,59 @@ + Andreas Oesterreicher + Manuela Thamer + */ require_once('../../../config/cis.config.inc.php'); require_once('../../../include/functions.inc.php'); require_once('../../../include/basis_db.class.php'); require_once('../../../include/projektphase.class.php'); require_once('../../../include/datum.class.php'); +require_once('../../../include/benutzerberechtigung.class.php'); +require_once('../../../include/phrasen.class.php'); if (!$db = new basis_db()) die('Es konnte keine Verbindung zum Server aufgebaut werden.'); + $user = get_uid(); +//Wenn User Administrator ist und UID uebergeben wurde, dann die Phasen +//des uebergebenen Users anzeigen +if (isset($_GET['uid']) && $user != $_GET['uid']) +{ + $rechte = new benutzerberechtigung(); + $rechte->getBerechtigungen($user); + + if ($rechte->isBerechtigt('admin')) + { + $user = $_GET['uid']; + } + else + { + $p = new phrasen(); + die($p->t('global/FuerDieseAktionBenoetigenSieAdministrationsrechte')); + } +} + $datum_obj = new datum(); -if(isset($_GET['projekt_kurzbz'])) // TODO maybe check that phasen only shown if projekt is projekt of logged in user +if (isset($_GET['projekt_kurzbz'])) { $projekt_kurzbz = $_GET['projekt_kurzbz']; $projektphase = new projektphase(); @@ -28,12 +69,12 @@ if(isset($_GET['projekt_kurzbz'])) // TODO maybe check that phasen only shown if array_push($pp_user_ids, $pp_user->projektphase_id); } - if($projektphase->getProjektphasen($projekt_kurzbz)) + if ($projektphase->getProjektphasen($projekt_kurzbz)) { $result_obj = array(); - foreach($projektphase->result as $row) + foreach ($projektphase->result as $row) { - if(in_array($row->projektphase_id, $pp_user_ids)) + if (in_array($row->projektphase_id, $pp_user_ids)) { $item['projektphase_id'] = $row->projektphase_id; $item['bezeichnung'] = $row->bezeichnung; diff --git a/cis/testtool/admin/auswertung_detail.php b/cis/testtool/admin/auswertung_detail.php index 05a6143ee..775234670 100644 --- a/cis/testtool/admin/auswertung_detail.php +++ b/cis/testtool/admin/auswertung_detail.php @@ -104,9 +104,11 @@ if(isset($_GET['show'])) SELECT distinct on(tbl_frage.frage_id) *, tbl_gebiet.kurzbz as gebiet FROM - testtool.tbl_frage - JOIN testtool.tbl_ablauf USING(gebiet_id) - JOIN testtool.tbl_frage_sprache USING(frage_id) + testtool.tbl_frage "; + if($stg_kz!='') + $qry.=" JOIN testtool.tbl_ablauf USING(gebiet_id) "; + + $qry.=" JOIN testtool.tbl_frage_sprache USING(frage_id) JOIN testtool.tbl_gebiet USING(gebiet_id) WHERE demo=false"; diff --git a/cis/testtool/login.php b/cis/testtool/login.php index b7cbc02b5..a738c0a88 100644 --- a/cis/testtool/login.php +++ b/cis/testtool/login.php @@ -1,734 +1,736 @@ -, - * Andreas Oesterreicher , - * Rudolf Hangl , - * Manfred Kindl - * Cristina Hainberger - */ - -require_once('../../config/cis.config.inc.php'); -require_once('../../config/global.config.inc.php'); -require_once('../../include/person.class.php'); -require_once('../../include/prestudent.class.php'); -require_once('../../include/pruefling.class.php'); -require_once('../../include/studiengang.class.php'); -require_once('../../include/studienplan.class.php'); -require_once('../../include/ablauf.class.php'); -require_once('../../include/reihungstest.class.php'); -require_once('../../include/sprache.class.php'); -require_once '../../include/phrasen.class.php'; -require_once '../../include/datum.class.php'; - -if (!$db = new basis_db()) - die('Fehler beim Oeffnen der Datenbankverbindung'); - -// Start session -session_start(); - -// Logout (triggered by logout button in menu.php) -if (isset($_GET['logout']) && $_GET['logout'] == true) -{ - // Unset global vars - unset($_GET['logout']); - unset($_GET['sprache_user']); - $_POST = []; - $_SESSION = []; - - // Destroy session - session_destroy(); - - echo ' - - '; -} - -$gebdatum=''; -$date = new datum(); - -$reload_menu=false; -$alertmsg = ''; - -$sg_var = new studiengang(); - -if (isset($_POST['gebdatum']) && $_POST['gebdatum']!='') -{ - $gebdatum = $date->formatDatum($_POST['gebdatum'],'Y-m-d'); -} -else - $gebdatum=''; - -if (isset($_REQUEST['prestudent'])) -{ - $ps = new prestudent($_REQUEST['prestudent']); - - $login_ok = false; - if (defined('TESTTOOL_LOGIN_BEWERBUNGSTOOL') && TESTTOOL_LOGIN_BEWERBUNGSTOOL && isset($_GET['confirmation'])) - { - if (isset($_SESSION['bewerbung/personId']) && $ps->person_id == $_SESSION['bewerbung/personId']) - { - $login_ok = true; - } - else - { - $alertmsg .= '
Login ist nicht korrekt. - Bitte schließen Sie ihren Browser und versuchen es erneut -
'; - } - } - elseif(!defined('TESTTOOL_LOGIN_BEWERBUNGSTOOL') || TESTTOOL_LOGIN_BEWERBUNGSTOOL == false) - { - //Geburtsdatum Pruefen - if (isset($gebdatum) && $gebdatum == $ps->gebdatum) - { - $login_ok = true; - } - else - { - $alertmsg .= '
'.$p->t('testtool/geburtsdatumStimmtNichtUeberein').'
'; - } - } - - if ($login_ok) - { - $reihungstest_id=''; - //Freischaltung fuer zugeteilten Reihungstest pruefen - $rt = new reihungstest(); - - // Wenns der Dummy ist dann extra laden - // An der FHTW gibt es 3 Testuser für den Camus International - $prestudent_id_dummy_student = (defined('PRESTUDENT_ID_DUMMY_STUDENT')?PRESTUDENT_ID_DUMMY_STUDENT:''); - if ($prestudent_id_dummy_student==$ps->prestudent_id || - (CAMPUS_NAME == 'FH Technikum Wien' && $ps->prestudent_id == 30891) || - (CAMPUS_NAME == 'FH Technikum Wien' && $ps->prestudent_id == 30890) || - (CAMPUS_NAME == 'FH Technikum Wien' && $ps->prestudent_id == 30889)) - { - $rt->getReihungstestPerson($ps->person_id); - if (isset($rt->result[0])) - $reihungstest_id = $rt->result[0]->reihungstest_id; - else - { - $alertmsg .= '
'.$p->t('testtool/reihungstestKannNichtGeladenWerden').'
'; - } - } - else - { - if ($rt->getReihungstestPersonDatum($ps->prestudent_id, date('Y-m-d'))) - { - // TODO Was ist wenn da mehrere Zurueckkommen?! - if (isset($rt->result[0])) - $reihungstest_id = $rt->result[0]->reihungstest_id; - else - { - $alertmsg .= '
'.$p->t('testtool/reihungstestKannNichtGeladenWerden').'
'; - } - } - else - { - echo 'Failed:'.$rt->errormsg; - } - } - if ($reihungstest_id != '' && $rt->load($reihungstest_id)) - { - if ($rt->freigeschaltet) - { - // regenerate Session ID after Login - session_regenerate_id(); - - $pruefling = new pruefling(); - if ($pruefling->getPruefling($ps->prestudent_id)) - { - $studiengang = $pruefling->studiengang_kz; - $semester = $pruefling->semester; - } - else - { - $studiengang = $ps->studiengang_kz; - $ps->getLastStatus($ps->prestudent_id); - $semester = $ps->ausbildungssemester; - } - if ($semester=='') - $semester=1; - - $_SESSION['prestudent_id']=$_REQUEST['prestudent']; - $_SESSION['studiengang_kz']=$studiengang; - $_SESSION['nachname']=$ps->nachname; - $_SESSION['vorname']=$ps->vorname; - $_SESSION['gebdatum']=$ps->gebdatum; - $stg_obj = new studiengang($studiengang); - - $_SESSION['semester']=$semester; - $_SESSION['reihungstestID'] = $reihungstest_id; - $stg_obj->getStudiengangTyp($stg_obj->typ); - - // STG und Studienplan mit der höchsten Prio ermitteln - $firstPrio_studienplan_id = ''; - $firstPrio_studiengang_kz = ''; - - // * wenn STG des eingeloggten Prestudenten vom Typ Bachelor ist, dann höchste Prio aller - // Bachelor-STG ermitteln, an denen die Person noch interessiert ist - // Wenn STG vom Typ Master, dann wird als firstPrio der STPL bzw. der STG des MasterSTG gesetzt. - if ($stg_obj->typ == 'b') - { - $ps->getActualInteressenten($_REQUEST['prestudent'], true); - } - elseif ($stg_obj->typ == 'm') - { - $ps->getActualInteressenten($_REQUEST['prestudent'], false, 'm', $studiengang); - } - - foreach($ps->result as $row) - { - if (isset($row->studiengang_kz)) - { - $firstPrio_studienplan_id = $row->studienplan_id; - break; - } - } - foreach($ps->result as $row) - { - if (isset($row->studiengang_kz)) - { - $firstPrio_studiengang_kz = $row->studiengang_kz; - break; - } - } - // Sprachvorgaben zu STG mit höchster Prio ermitteln - - // * 1. Sprache über Ablauf Vorgaben ermitteln - $ablauf = new Ablauf(); - $ablauf->getAblaufGebiete($firstPrio_studiengang_kz, $firstPrio_studienplan_id); - $rt_sprache = ''; - - if (empty($ablauf->result[0])) - { - $ablauf->getAblaufGebiete($firstPrio_studiengang_kz); - } - - if (!empty($ablauf->result[0])) - { - $rt_sprache = $ablauf->result[0]->sprache; - } - - // * 2. falls keine Sprache vorhanden -> Sprache über Studienplan ermitteln - if (empty($rt_sprache)) - { - $stpl = new Studienplan(); - $stpl->loadStudienplan($firstPrio_studienplan_id); - $rt_sprache = $stpl->sprache; - } - - // * 3. falls keine Sprache vorhanden -> Sprache über Studiengang ermitteln - if (empty($rt_sprache)) - { - $stg = new Studiengang($firstPrio_studiengang_kz); - $rt_sprache = $stg->sprache; - } - - // * 4. Sprache setzen. Falls keine Sprache vorhanden -> DEFAULT language verwenden - if (empty($rt_sprache)) - { - $_SESSION['sprache_user'] = DEFAULT_LANGUAGE; - } - else - { - $_SESSION['sprache_user'] = $rt_sprache; - } - } - else - { - $alertmsg .= '
'.$p->t('testtool/reihungstestNichtFreigeschalten').'
'; - } - } - else - { - $alertmsg .= '
'.$p->t('testtool/reihungstestKannNichtGeladenWerden').'
'; - } - } -} - -// Set language of user. -// NOTE: don't move the code in order to check first the right studies' reihungstest language -// (in case it was overruled by other STG with higher priority) - -// Start with default language on first login (before any prestudent has been selected) -$sprache_user = DEFAULT_LANGUAGE; -if (isset($_SESSION['sprache_user']) && !empty($_SESSION['sprache_user'])) -{ - // If session var already exists, overwrite language var - // (session var changes e.g. when user selects other language with language-select-menu) - $sprache_user = $_SESSION['sprache_user']; -} -elseif (isset($_SESSION['prestudent_id'])) -{ - // If session var does not exist but prestudent is known, set the session var - $_SESSION['sprache_user'] = DEFAULT_LANGUAGE; -} - -// If language is changed by language select menu, reset language variables -if (isset($_GET['sprache_user']) && !empty($_GET['sprache_user'])) -{ - $sprache_user = $_GET['sprache_user']; - $_SESSION['sprache_user'] = $_GET['sprache_user']; -} - -// NOTE: leave phrasen here, as the final users language is not defined until here -$p = new phrasen($sprache_user); - -if (isset($_SESSION['prestudent_id'])) -{ - $prestudent_id=$_SESSION['prestudent_id']; -} -else -{ - //$prestudent_id=null; - $ps=new prestudent(); - $datum=date('Y-m-d'); - // An der FHTW wird ein Bewerber nur einmal ausgegeben (1. Prio) falls es mehrere Bewerbungen gibt - /*if (CAMPUS_NAME == 'FH Technikum Wien') - { - $ps->getFirstPrioPrestudentRT($datum); - } - else*/ - { - $ps->getPrestudentRT($datum); - } -} - - -if (isset($_SESSION['prestudent_id']) && !isset($_SESSION['pruefling_id'])) -{ - $pruefling = new pruefling(); - - //wenn kein Prüfling geladen werden kann - if (!$pruefling->getPruefling($_SESSION['prestudent_id'])) - $pruefling->new = true; - else - $pruefling->new = false; - - $pruefling->studiengang_kz = $_SESSION['studiengang_kz']; - $pruefling->semester = $_SESSION['semester']; - - $pruefling->idnachweis = ''; - $pruefling->registriert = date('Y-m-d H:i:s'); - $pruefling->prestudent_id = $_SESSION['prestudent_id']; - if ($pruefling->save()) - { - $_SESSION['pruefling_id']=$pruefling->pruefling_id; - $reload_menu=true; - } -} - -if (isset($_POST['save']) && isset($_SESSION['prestudent_id'])) -{ - $pruefling = new pruefling(); - if ($_POST['pruefling_id']!='') - if (!$pruefling->load($_POST['pruefling_id'])) - die('Pruefling wurde nicht gefunden'); - else - $pruefling->new=false; - else - $pruefling->new=true; - - $pruefling->studiengang_kz = $_SESSION['studiengang_kz']; - $pruefling->idnachweis = isset($_POST['idnachweis'])?$_POST['idnachweis']:''; - $pruefling->registriert = date('Y-m-d H:i:s'); - $pruefling->prestudent_id = $_SESSION['prestudent_id']; - $pruefling->semester = $_POST['semester']; - if ($pruefling->save()) - { - $_SESSION['pruefling_id']=$pruefling->pruefling_id; - $_SESSION['semester']=$pruefling->semester; - $reload_menu=true; - } -} -?> - - - - - - - - - - - -parent.menu.location.reload();'; -?> - - - -
- -studiengang_kz); - $pruefling = new pruefling(); - $typ = new studiengang($prestudent->studiengang_kz); - $typ->getStudiengangTyp($stg_obj->typ); - - // STG mit der höchsten Prio ermitteln - $ps = new Prestudent(); - - // * prinzipiell STG der session übernehmem - $firstPrio_studiengang_kz = $prestudent->studiengang_kz; - - // * wenn STG des eingeloggten Prestudenten vom Typ Bachelor ist, dann höchste Prio aller - // Bachelor-STG ermitteln, an denen die Person noch interessiert ist - if ($typ->typ == 'b') - { - $ps->getActualInteressenten($prestudent_id, true, 'b'); - foreach($ps->result as $row_prio) - { - if (isset($row_prio->studiengang_kz)) - { - $firstPrio_studiengang_kz = $row_prio->studiengang_kz; - $firstPrio_studienplan_id = $row_prio->studienplan_id; - break; - } - } - } - - // Sprachwahl zu STG mit höchster Prio ermitteln - $ablauf = new Ablauf(); - $sprachwahl = false; - - $ablauf->getAblaufGebiete($firstPrio_studiengang_kz, $firstPrio_studienplan_id); - - if (empty($ablauf->result[0])) - { - $ablauf->getAblaufGebiete($firstPrio_studiengang_kz); - } - - if (isset($ablauf->result[0]) - && is_bool($ablauf->result[0]->sprachwahl)) - { - $sprachwahl = $ablauf->result[0]->sprachwahl; - } - - // If language can be switched, display language select menu on the top - if ($sprachwahl) - { - $_SESSION['sprache_auswahl'] = true; - ?> - - '; - echo ' -

'. $p->t('testtool/begruessungstext'). '


-

'. $p->t('testtool/anmeldedaten'). '


- '; - - echo ' - - - - - - - - - - - - - -
'.$p->t('zeitaufzeichnung/id').''.$_SESSION['prestudent_id'].'
'.$p->t('global/name').''.$_SESSION['vorname'].' '.$_SESSION['nachname'].'
'.$p->t('global/geburtsdatum').''.$date->formatDatum($_SESSION["gebdatum"],"d.m.Y").'
- '; - echo '
'; - echo ' -

'. $p->t('testtool/fuerFolgendeStgAngemeldet'). '


- - - - - - - - - - '; - - // * wenn Prestudent an 1 - n Bachelor-Studiengängen interessiert ist, dann STG anführen - if ($typ->typ == 'b') - { - $ps_arr = new Prestudent(); - $ps_arr->getActualInteressenten($prestudent_id, false, 'b'); - - if (count($ps_arr->result) > 0) - { - // Jeweils letzten Status ermitteln (ob Interessent oder Abgewiesener) - foreach ($ps_arr->result as $ps_obj) - { - $ps_tmp = new Prestudent(); - $ps_tmp->getLastStatus($ps_obj->prestudent_id); - - $ps_obj->lastStatus = $ps_tmp->status_kurzbz; // letzten Status dem result array hinzufügen - $ps_obj->status_mehrsprachig = $ps_tmp->status_mehrsprachig; - } - - // Falls Status 'Abgewiesene' vorhanden, nach hinten reihen - usort($ps_arr->result, function($a, $b){ - return strcmp($b->lastStatus, $a->lastStatus); // Order by DESC - }); - foreach ($ps_arr->result as $ps_obj) - { - echo ''; - $stg = new Studiengang($ps_obj->studiengang_kz); - - if ($ps_obj->lastStatus == "Interessent" - || $ps_obj->lastStatus == "Bewerber" - || $ps_obj->lastStatus == "Wartender" - || $ps_obj->lastStatus == "Aufgenommener") - { - echo ''; - if ($ps_obj->ausbildungssemester == '1') - { - echo ''; - } - elseif ($ps_obj->ausbildungssemester == '3') - { - echo ''; - } - } - // wenn letzter Status \'Abgewiesener\' ist, dann als solchen kennzeichnen - elseif ($ps_obj->lastStatus == "Abgewiesener") - { - echo ' - - - '; - } - echo ''; - } - } - } - // * wenn Prestudent an einem Master-Studiengang interessiert ist, dann nur den einen STG anführen - else - { - // Letzten Status für des Prestudenten einholen - $ps_master = new Prestudent(); - $ps_master->getLastStatus($prestudent_id); - echo ''; - echo ''; - } - - echo ' - -
'. $p->t('global/studiengang'). 'Status
'. $ps_obj->typ_bz .' '. ($sprache_user == 'English' ? $stg->english : $stg->bezeichnung). ' ('.$ps_obj->orgform_bezeichnung[$sprache_user].')'. $p->t('testtool/regulaererEinstieg'). ' (1. Semester)'. $p->t('testtool/quereinstieg'). ' (3. Semester)'. $ps_obj->typ_bz .' '. ($sprache_user == 'English' ? $stg->english : $stg->bezeichnung). ''. $ps_obj->status_mehrsprachig[$sprache_user]. '
'. $typ->bezeichnung.' '.($sprache_user=='English'?$stg_obj->english:$stg_obj->bezeichnung).''. $ps_master->status_mehrsprachig[$sprache_user]. '
- '; - - echo '
'; - - if ($pruefling->getPruefling($prestudent_id)) - { - echo '
'; - echo ''; - echo ''; - //echo ''; - //echo ''; - //echo ''; - echo '
'.$p->t('global/semester').': 
ID Nachweis:
'; - echo '
'; - echo '

'; - echo ' -
- '.$p->t('testtool/klickenSieAufEinTeilgebiet').' -
- '; - if ($pruefling->pruefling_id!='') - { - $_SESSION['pruefling_id']=$pruefling->pruefling_id; - } - } - else - { - echo ''.$p->t('testtool/keinPrueflingseintragVorhanden').''; - } - echo '
'; -} -else // LOGIN Site (vor Login) -{ - if (defined('TESTTOOL_LOGIN_BEWERBUNGSTOOL') && TESTTOOL_LOGIN_BEWERBUNGSTOOL) - { - echo '
'; - echo '
'.$alertmsg.'
'; - echo $p->t('testtool/einfuehrungsText'); - - if (isset($_SESSION['bewerbung/personId'])) - { - echo ''; - echo '
- '.$p->t('testtool/loginNoetig').'

-
- - - '.$p->t('testtool/confirmationText').' -

- -
'; - } - else - { - echo '
- '.$p->t('testtool/loginNoetig').'

-
- -
'; - } - echo ' -
'; - echo '
'; - } - else - { - $prestudent_id_dummy_student = (defined('PRESTUDENT_ID_DUMMY_STUDENT')?PRESTUDENT_ID_DUMMY_STUDENT:''); - echo '
'; - - // Welcome text - echo '
'.$alertmsg.'
'; - echo ' -
-
-

Herzlich Willkommen zum Reihungstest



- Bitte warten Sie mit dem Login auf die Anweisung der Aufsichtsperson.

- Wir wünschen Ihnen einen erfolgreichen Start ins Studium. -
-
-

Welcome to the placement test



- Please wait for the tutor\'s instructions before you log in.

- We wish you a good start to your studies. -
-
- '; - - // Begin form - echo '
'; - echo '
'; - - // Name select menu - echo '
'; - echo ''; - echo '
'; - echo ''; - echo '
'; // end col-xs - echo '
'; // end form-group - - // Datepicker input - echo '
'; - echo ''; - echo '
'; - echo ''; - echo '
'; // end col-xs - echo '
'; // end form-group - - // Login button - echo ''; - - echo '
'; // end form - - echo '
'; // end row - echo '
'; // end col-xs-11 - } -} - -?> -
- - +, + * Andreas Oesterreicher , + * Rudolf Hangl , + * Manfred Kindl + * Cristina Hainberger + */ + +require_once('../../config/cis.config.inc.php'); +require_once('../../config/global.config.inc.php'); +require_once('../../include/person.class.php'); +require_once('../../include/prestudent.class.php'); +require_once('../../include/pruefling.class.php'); +require_once('../../include/studiengang.class.php'); +require_once('../../include/studienplan.class.php'); +require_once('../../include/ablauf.class.php'); +require_once('../../include/reihungstest.class.php'); +require_once('../../include/sprache.class.php'); +require_once '../../include/phrasen.class.php'; +require_once '../../include/datum.class.php'; + +if (!$db = new basis_db()) + die('Fehler beim Oeffnen der Datenbankverbindung'); + +// Start session +session_start(); + +// Logout (triggered by logout button in menu.php) +if (isset($_GET['logout']) && $_GET['logout'] == true) +{ + // Unset global vars + unset($_GET['logout']); + unset($_GET['sprache_user']); + $_POST = []; + $_SESSION = []; + + // Destroy session + session_destroy(); + + echo ' + + '; +} + +$gebdatum=''; +$date = new datum(); + +$reload_menu=false; +$alertmsg = ''; + +$sg_var = new studiengang(); + +if (isset($_POST['gebdatum']) && $_POST['gebdatum']!='') +{ + $gebdatum = $date->formatDatum($_POST['gebdatum'],'Y-m-d'); +} +else + $gebdatum=''; + +if (isset($_REQUEST['prestudent'])) +{ + $ps = new prestudent($_REQUEST['prestudent']); + + $login_ok = false; + if (defined('TESTTOOL_LOGIN_BEWERBUNGSTOOL') && TESTTOOL_LOGIN_BEWERBUNGSTOOL && isset($_GET['confirmation'])) + { + if (isset($_SESSION['bewerbung/personId']) && $ps->person_id == $_SESSION['bewerbung/personId']) + { + $login_ok = true; + } + else + { + $alertmsg .= '
Login ist nicht korrekt. + Bitte schließen Sie ihren Browser und versuchen es erneut +
'; + } + } + elseif(!defined('TESTTOOL_LOGIN_BEWERBUNGSTOOL') || TESTTOOL_LOGIN_BEWERBUNGSTOOL == false) + { + //Geburtsdatum Pruefen + if (isset($gebdatum) && $gebdatum == $ps->gebdatum) + { + $login_ok = true; + } + else + { + $alertmsg .= '
'.$p->t('testtool/geburtsdatumStimmtNichtUeberein').'
'; + } + } + + if ($login_ok) + { + $reihungstest_id=''; + //Freischaltung fuer zugeteilten Reihungstest pruefen + $rt = new reihungstest(); + + // Wenns der Dummy ist dann extra laden + // An der FHTW gibt es 3 Testuser für den Camus International + $prestudent_id_dummy_student = (defined('PRESTUDENT_ID_DUMMY_STUDENT')?PRESTUDENT_ID_DUMMY_STUDENT:''); + if ($prestudent_id_dummy_student==$ps->prestudent_id || + (CAMPUS_NAME == 'FH Technikum Wien' && $ps->prestudent_id == 30891) || + (CAMPUS_NAME == 'FH Technikum Wien' && $ps->prestudent_id == 30890) || + (CAMPUS_NAME == 'FH Technikum Wien' && $ps->prestudent_id == 30889)) + { + $rt->getReihungstestPerson($ps->person_id); + if (isset($rt->result[0])) + $reihungstest_id = $rt->result[0]->reihungstest_id; + else + { + $alertmsg .= '
'.$p->t('testtool/reihungstestKannNichtGeladenWerden').'
'; + } + } + else + { + if ($rt->getReihungstestPersonDatum($ps->prestudent_id, date('Y-m-d'))) + { + // TODO Was ist wenn da mehrere Zurueckkommen?! + if (isset($rt->result[0])) + $reihungstest_id = $rt->result[0]->reihungstest_id; + else + { + $alertmsg .= '
'.$p->t('testtool/reihungstestKannNichtGeladenWerden').'
'; + } + } + else + { + echo 'Failed:'.$rt->errormsg; + } + } + if ($reihungstest_id != '' && $rt->load($reihungstest_id)) + { + if ($rt->freigeschaltet) + { + // regenerate Session ID after Login + session_regenerate_id(); + + $pruefling = new pruefling(); + if ($pruefling->getPruefling($ps->prestudent_id)) + { + $studiengang = $pruefling->studiengang_kz; + $semester = $pruefling->semester; + } + else + { + $studiengang = $ps->studiengang_kz; + $ps->getLastStatus($ps->prestudent_id); + $semester = $ps->ausbildungssemester; + } + if ($semester=='') + $semester=1; + + $_SESSION['prestudent_id']=$_REQUEST['prestudent']; + $_SESSION['studiengang_kz']=$studiengang; + $_SESSION['nachname']=$ps->nachname; + $_SESSION['vorname']=$ps->vorname; + $_SESSION['gebdatum']=$ps->gebdatum; + $stg_obj = new studiengang($studiengang); + + $_SESSION['semester']=$semester; + $_SESSION['reihungstestID'] = $reihungstest_id; + $stg_obj->getStudiengangTyp($stg_obj->typ); + + // STG und Studienplan mit der höchsten Prio ermitteln + $firstPrio_studienplan_id = ''; + $firstPrio_studiengang_kz = ''; + + // * wenn STG des eingeloggten Prestudenten vom Typ Bachelor ist, dann höchste Prio aller + // Bachelor-STG ermitteln, an denen die Person noch interessiert ist + // Wenn STG vom Typ Master, dann wird als firstPrio der STPL bzw. der STG des MasterSTG gesetzt. + if ($stg_obj->typ == 'b') + { + $ps->getActualInteressenten($_REQUEST['prestudent'], true); + } + elseif ($stg_obj->typ == 'm') + { + $ps->getActualInteressenten($_REQUEST['prestudent'], false, 'm', $studiengang); + } + + foreach($ps->result as $row) + { + if (isset($row->studiengang_kz)) + { + $firstPrio_studienplan_id = $row->studienplan_id; + break; + } + } + foreach($ps->result as $row) + { + if (isset($row->studiengang_kz)) + { + $firstPrio_studiengang_kz = $row->studiengang_kz; + break; + } + } + // Sprachvorgaben zu STG mit höchster Prio ermitteln + + // * 1. Sprache über Ablauf Vorgaben ermitteln + $ablauf = new Ablauf(); + $ablauf->getAblaufGebiete($firstPrio_studiengang_kz, $firstPrio_studienplan_id); + $rt_sprache = ''; + + if (empty($ablauf->result[0])) + { + $ablauf->getAblaufGebiete($firstPrio_studiengang_kz); + } + + if (!empty($ablauf->result[0])) + { + $rt_sprache = $ablauf->result[0]->sprache; + } + + // * 2. falls keine Sprache vorhanden -> Sprache über Studienplan ermitteln + if (empty($rt_sprache)) + { + $stpl = new Studienplan(); + $stpl->loadStudienplan($firstPrio_studienplan_id); + $rt_sprache = $stpl->sprache; + } + + // * 3. falls keine Sprache vorhanden -> Sprache über Studiengang ermitteln + if (empty($rt_sprache)) + { + $stg = new Studiengang($firstPrio_studiengang_kz); + $rt_sprache = $stg->sprache; + } + + // * 4. Sprache setzen. Falls keine Sprache vorhanden -> DEFAULT language verwenden + if (empty($rt_sprache)) + { + $_SESSION['sprache_user'] = DEFAULT_LANGUAGE; + } + else + { + $_SESSION['sprache_user'] = $rt_sprache; + } + } + else + { + $alertmsg .= '
'.$p->t('testtool/reihungstestNichtFreigeschalten').'
'; + } + } + else + { + $alertmsg .= '
'.$p->t('testtool/reihungstestKannNichtGeladenWerden').'
'; + } + } +} + +// Set language of user. +// NOTE: don't move the code in order to check first the right studies' reihungstest language +// (in case it was overruled by other STG with higher priority) + +// Start with default language on first login (before any prestudent has been selected) +$sprache_user = DEFAULT_LANGUAGE; +if (isset($_SESSION['sprache_user']) && !empty($_SESSION['sprache_user'])) +{ + // If session var already exists, overwrite language var + // (session var changes e.g. when user selects other language with language-select-menu) + $sprache_user = $_SESSION['sprache_user']; +} +elseif (isset($_SESSION['prestudent_id'])) +{ + // If session var does not exist but prestudent is known, set the session var + $_SESSION['sprache_user'] = DEFAULT_LANGUAGE; +} + +// If language is changed by language select menu, reset language variables +if (isset($_GET['sprache_user']) && !empty($_GET['sprache_user'])) +{ + $sprache_user = $_GET['sprache_user']; + $_SESSION['sprache_user'] = $_GET['sprache_user']; +} + +// NOTE: leave phrasen here, as the final users language is not defined until here +$p = new phrasen($sprache_user); + +if (isset($_SESSION['prestudent_id'])) +{ + $prestudent_id=$_SESSION['prestudent_id']; +} +else +{ + //$prestudent_id=null; + $ps=new prestudent(); + $datum=date('Y-m-d'); + // An der FHTW wird ein Bewerber nur einmal ausgegeben (1. Prio) falls es mehrere Bewerbungen gibt + /*if (CAMPUS_NAME == 'FH Technikum Wien') + { + $ps->getFirstPrioPrestudentRT($datum); + } + else*/ + { + $ps->getPrestudentRT($datum); + } +} + + +if (isset($_SESSION['prestudent_id']) && !isset($_SESSION['pruefling_id'])) +{ + $pruefling = new pruefling(); + + //wenn kein Prüfling geladen werden kann + if (!$pruefling->getPruefling($_SESSION['prestudent_id'])) + $pruefling->new = true; + else + $pruefling->new = false; + + $pruefling->studiengang_kz = $_SESSION['studiengang_kz']; + $pruefling->semester = $_SESSION['semester']; + + $pruefling->idnachweis = ''; + $pruefling->registriert = date('Y-m-d H:i:s'); + $pruefling->prestudent_id = $_SESSION['prestudent_id']; + if ($pruefling->save()) + { + $_SESSION['pruefling_id']=$pruefling->pruefling_id; + $reload_menu=true; + } +} + +if (isset($_POST['save']) && isset($_SESSION['prestudent_id'])) +{ + $pruefling = new pruefling(); + if ($_POST['pruefling_id']!='') + if (!$pruefling->load($_POST['pruefling_id'])) + die('Pruefling wurde nicht gefunden'); + else + $pruefling->new=false; + else + $pruefling->new=true; + + $pruefling->studiengang_kz = $_SESSION['studiengang_kz']; + $pruefling->idnachweis = isset($_POST['idnachweis'])?$_POST['idnachweis']:''; + $pruefling->registriert = date('Y-m-d H:i:s'); + $pruefling->prestudent_id = $_SESSION['prestudent_id']; + $pruefling->semester = $_POST['semester']; + if ($pruefling->save()) + { + $_SESSION['pruefling_id']=$pruefling->pruefling_id; + $_SESSION['semester']=$pruefling->semester; + $reload_menu=true; + } +} +?> + + + + + + + + + + + +parent.menu.location.reload();'; +?> + + + +
+ +studiengang_kz); + $pruefling = new pruefling(); + $typ = new studiengang($prestudent->studiengang_kz); + $typ->getStudiengangTyp($stg_obj->typ); + + // STG mit der höchsten Prio ermitteln + $ps = new Prestudent(); + + // * prinzipiell STG der session übernehmem + $firstPrio_studiengang_kz = $prestudent->studiengang_kz; + + // * wenn STG des eingeloggten Prestudenten vom Typ Bachelor ist, dann höchste Prio aller + // Bachelor-STG ermitteln, an denen die Person noch interessiert ist + $firstPrio_studienplan_id = ''; + $firstPrio_studiengang_kz = ''; + if ($typ->typ == 'b') + { + $ps->getActualInteressenten($prestudent_id, true, 'b'); + foreach($ps->result as $row_prio) + { + if (isset($row_prio->studiengang_kz)) + { + $firstPrio_studiengang_kz = $row_prio->studiengang_kz; + $firstPrio_studienplan_id = $row_prio->studienplan_id; + break; + } + } + } + + // Sprachwahl zu STG mit höchster Prio ermitteln + $ablauf = new Ablauf(); + $sprachwahl = false; + + $ablauf->getAblaufGebiete($firstPrio_studiengang_kz, $firstPrio_studienplan_id); + + if (empty($ablauf->result[0])) + { + $ablauf->getAblaufGebiete($firstPrio_studiengang_kz); + } + + if (isset($ablauf->result[0]) + && is_bool($ablauf->result[0]->sprachwahl)) + { + $sprachwahl = $ablauf->result[0]->sprachwahl; + } + + // If language can be switched, display language select menu on the top + if ($sprachwahl) + { + $_SESSION['sprache_auswahl'] = true; + ?> + + '; + echo ' +

'. $p->t('testtool/begruessungstext'). '


+

'. $p->t('testtool/anmeldedaten'). '


+ '; + + echo ' + + + + + + + + + + + + + +
'.$p->t('zeitaufzeichnung/id').''.$_SESSION['prestudent_id'].'
'.$p->t('global/name').''.$_SESSION['vorname'].' '.$_SESSION['nachname'].'
'.$p->t('global/geburtsdatum').''.$date->formatDatum($_SESSION["gebdatum"],"d.m.Y").'
+ '; + echo '
'; + echo ' +

'. $p->t('testtool/fuerFolgendeStgAngemeldet'). '


+ + + + + + + + + + '; + + // * wenn Prestudent an 1 - n Bachelor-Studiengängen interessiert ist, dann STG anführen + if ($typ->typ == 'b') + { + $ps_arr = new Prestudent(); + $ps_arr->getActualInteressenten($prestudent_id, false, 'b'); + + if (count($ps_arr->result) > 0) + { + // Jeweils letzten Status ermitteln (ob Interessent oder Abgewiesener) + foreach ($ps_arr->result as $ps_obj) + { + $ps_tmp = new Prestudent(); + $ps_tmp->getLastStatus($ps_obj->prestudent_id); + + $ps_obj->lastStatus = $ps_tmp->status_kurzbz; // letzten Status dem result array hinzufügen + $ps_obj->status_mehrsprachig = $ps_tmp->status_mehrsprachig; + } + + // Falls Status 'Abgewiesene' vorhanden, nach hinten reihen + usort($ps_arr->result, function($a, $b){ + return strcmp($b->lastStatus, $a->lastStatus); // Order by DESC + }); + foreach ($ps_arr->result as $ps_obj) + { + echo ''; + $stg = new Studiengang($ps_obj->studiengang_kz); + + if ($ps_obj->lastStatus == "Interessent" + || $ps_obj->lastStatus == "Bewerber" + || $ps_obj->lastStatus == "Wartender" + || $ps_obj->lastStatus == "Aufgenommener") + { + echo ''; + if ($ps_obj->ausbildungssemester == '1') + { + echo ''; + } + elseif ($ps_obj->ausbildungssemester == '3') + { + echo ''; + } + } + // wenn letzter Status \'Abgewiesener\' ist, dann als solchen kennzeichnen + elseif ($ps_obj->lastStatus == "Abgewiesener") + { + echo ' + + + '; + } + echo ''; + } + } + } + // * wenn Prestudent an einem Master-Studiengang interessiert ist, dann nur den einen STG anführen + else + { + // Letzten Status für des Prestudenten einholen + $ps_master = new Prestudent(); + $ps_master->getLastStatus($prestudent_id); + echo ''; + echo ''; + } + + echo ' + +
'. $p->t('global/studiengang'). 'Status
'. $ps_obj->typ_bz .' '. ($sprache_user == 'English' ? $stg->english : $stg->bezeichnung). ' ('.$ps_obj->orgform_bezeichnung[$sprache_user].')'. $p->t('testtool/regulaererEinstieg'). ' (1. Semester)'. $p->t('testtool/quereinstieg'). ' (3. Semester)'. $ps_obj->typ_bz .' '. ($sprache_user == 'English' ? $stg->english : $stg->bezeichnung). ''. $ps_obj->status_mehrsprachig[$sprache_user]. '
'. $typ->bezeichnung.' '.($sprache_user=='English'?$stg_obj->english:$stg_obj->bezeichnung).''. $ps_master->status_mehrsprachig[$sprache_user]. '
+ '; + + echo '
'; + + if ($pruefling->getPruefling($prestudent_id)) + { + echo '
'; + echo ''; + echo ''; + //echo ''; + //echo ''; + //echo ''; + echo '
'.$p->t('global/semester').': 
ID Nachweis:
'; + echo '
'; + echo '

'; + echo ' +
+ '.$p->t('testtool/klickenSieAufEinTeilgebiet').' +
+ '; + if ($pruefling->pruefling_id!='') + { + $_SESSION['pruefling_id']=$pruefling->pruefling_id; + } + } + else + { + echo ''.$p->t('testtool/keinPrueflingseintragVorhanden').''; + } + echo '
'; +} +else // LOGIN Site (vor Login) +{ + if (defined('TESTTOOL_LOGIN_BEWERBUNGSTOOL') && TESTTOOL_LOGIN_BEWERBUNGSTOOL) + { + echo '
'; + echo '
'.$alertmsg.'
'; + echo $p->t('testtool/einfuehrungsText'); + + if (isset($_SESSION['bewerbung/personId'])) + { + echo ''; + echo '
+ '.$p->t('testtool/loginNoetig').'

+
+ + + '.$p->t('testtool/confirmationText').' +

+ +
'; + } + else + { + echo '
+ '.$p->t('testtool/loginNoetig').'

+
+ +
'; + } + echo ' +
'; + echo '
'; + } + else + { + $prestudent_id_dummy_student = (defined('PRESTUDENT_ID_DUMMY_STUDENT')?PRESTUDENT_ID_DUMMY_STUDENT:''); + echo '
'; + + // Welcome text + echo '
'.$alertmsg.'
'; + echo ' +
+
+

Herzlich Willkommen zum Reihungstest



+ Bitte warten Sie mit dem Login auf die Anweisung der Aufsichtsperson.

+ Wir wünschen Ihnen einen erfolgreichen Start ins Studium. +
+
+

Welcome to the placement test



+ Please wait for the tutor\'s instructions before you log in.

+ We wish you a good start to your studies. +
+
+ '; + + // Begin form + echo '
'; + echo '
'; + + // Name select menu + echo '
'; + echo ''; + echo '
'; + echo ''; + echo '
'; // end col-xs + echo '
'; // end form-group + + // Datepicker input + echo '
'; + echo ''; + echo '
'; + echo ''; + echo '
'; // end col-xs + echo '
'; // end form-group + + // Login button + echo ''; + + echo '
'; // end form + + echo '
'; // end row + echo '
'; // end col-xs-11 + } +} + +?> +
+ + diff --git a/cms/tinymce_dms.php b/cms/tinymce_dms.php index c54fcc385..f15695be8 100644 --- a/cms/tinymce_dms.php +++ b/cms/tinymce_dms.php @@ -33,7 +33,7 @@ $rechte->getBerechtigungen($user); if (! $rechte->isberechtigt('basis/dms', null, 's', null)) die($rechte->errormsg); -?> +?> @@ -160,6 +160,17 @@ if (! $rechte->isberechtigt('basis/dms', null, 's', null)) beschreibungstext = beschreibungstext.replace(/Ze1l3numxbr/g, "\r\n"); document.getElementById("beschreibung-textarea").value = beschreibungstext; } + function updateSchlagworte(schlagworte) + { + document.getElementById("schlagworte-textarea").value = schlagworte; + } + function updateCisSuche(cisSuche) + { + if (cisSuche == true) + document.getElementById("cis_suche_checkbox").checked = true; + else + document.getElementById("cis_suche_checkbox").checked = false; + } var __js_page_array = new Array(); function js_toggle_container(conid) @@ -216,7 +227,7 @@ if (! $rechte->isberechtigt('basis/dms', null, 's', null)) } - + insertamum = date('Y-m-d H:i:s'); $dms->insertvon = $user; - $dms->mimetype = finfo_file($finfo, $uploadfile); // Davor deprecated: $_FILES['userfile']['type']; + if ($mimetype != '') + { + $dms->mimetype = $mimetype; + } + else + { + $dms->mimetype = finfo_file($finfo, $uploadfile); + } $dms->filename = $filename; $dms->name = $_FILES['userfile']['name']; $dms->beschreibung = $beschreibung; @@ -393,6 +412,7 @@ if (isset($_POST['action']) && $_POST['action'] == 'rename') $version = $_POST['version']; $beschreibung = $_POST['beschreibung']; $schlagworte = $_POST['schlagworte']; + $mimetype = isset($_POST['mimetype']) ? $_POST['mimetype'] : ''; $cis_suche = isset($_POST['cis_suche']) ? true : false; $dms = new dms(); @@ -402,6 +422,14 @@ if (isset($_POST['action']) && $_POST['action'] == 'rename') $dms->beschreibung = $beschreibung; $dms->schlagworte = $schlagworte; $dms->cis_suche = $cis_suche; + if ($mimetype != '') + { + $dms->mimetype = $mimetype; + } + else + { + $dms->mimetype = finfo_file($finfo, $uploadfile); + } $dms->updateamum = date('Y-m-d H:i:s'); $dms->updatevon = $user; @@ -542,14 +570,14 @@ elseif ($chkatID != '') else { // Suche anzeigen - echo '

Dokument Auswählen

-
- - + echo '

Dokument Auswählen

+ + +
'; - echo ' - + echo '
+ + echo ' - + echo ' + +
'; // Link zu Admin-Oberfläche @@ -564,31 +592,31 @@ else echo '
    '; drawKategorieMenue($dms->result); echo '
'; - echo ''; - echo '
'; // Dokumente der Ausgewaehlten Kategorie laden und Anzeigen $dms = new dms(); @@ -714,7 +742,7 @@ else echo '&dpp='.$_GET['dpp']; } echo '&searching=true&searchstring='.$searchstring.'" method="POST" style="float:left">'; - echo '
+ echo ' - - + echo '"> + + Elemente pro Seite  + echo ' + Elemente pro Seite 
'; } else @@ -898,7 +926,7 @@ else echo '&dpp='.$_GET['dpp']; } echo '" method="POST" style="float:left">'; - echo '
+ echo ' + echo '"> Elemente pro Seite  + echo ' + Elemente pro Seite 
'; } else @@ -965,21 +993,21 @@ else } // drawFilesThumb($dms->result); - echo ' -
'; if ($rechte->isberechtigt('basis/dms', $kategorie->kategorie_oe_kurzbz, 'sui')) { - echo ' -
- Neue Datei hochladen -
- -

-
-
+ echo ' +
+ Neue Datei hochladen +
+ +

+
+
'; if (isset($_REQUEST['searching']) && $_REQUEST['searching'] == 'true') { @@ -989,31 +1017,35 @@ else { echo '
'; } - echo ' - - - - - - + echo ' + + +
Beschreibung
+ + + + + + + - - - - - - -
Beschreibung
Schlagworte
(Semikolon getrennt)
Mimetype
CIS-Suche
- - - -
+ + + + + + + + + + +
'; $files = scandir(IMPORT_PATH); $files_count = count($files) - 2; // Minus zwei wegen "." und ".." @@ -1023,9 +1055,9 @@ else } if ($openupload) { - echo ''; } } @@ -1057,56 +1089,58 @@ function drawAllVersions($id) $dms = new dms(); $dms->getAllVersions($id); - echo ' - - - - - + echo ' +
VersionName
+ + + + - + - - - - + + + + + '; foreach ($dms->result as $dms_help) { - echo ' - - + echo ' + + - + - - - - + + + + + echo ' + + + '; } echo '
VersionName Beschreibung SchlagworteCIS-SucheCIS-Suche KategorieFilename internDatumUser
Filename internMimetypeDatumUser
'.$dms_help->version.''.$dms_help->name.'
'.$dms_help->version.''.$dms_help->name.' '.$dms_help->beschreibung.' '.$dms_help->schlagworte.''.($dms_help->cis_suche == 'true'?'Ja':'Nein').''.($dms_help->cis_suche == 'true'?'Ja':'Nein').' '.$dms_help->kategorie_kurzbz.''.$dms_help->filename.''.$dms_help->insertamum.''.$dms_help->insertvon.' - '.$dms_help->filename.''.$dms_help->mimetype.''.$dms_help->insertamum.''.$dms_help->insertvon.' +
    +
  • Erweitert +
    • Herunterladen
    • '; if ($rechte->isberechtigt('basis/dms', $kategorie->kategorie_oe_kurzbz, 'su')) echo '
    • Datei umbenennen
    • '; if ($rechte->isberechtigt('basis/dms', $kategorie->kategorie_oe_kurzbz, 'suid')) echo '
    • Löschen
    • '; - echo '
    -
  • -
-
'; @@ -1121,41 +1155,41 @@ function drawFilesFromImport() if ($handle = opendir(IMPORT_PATH)) { - echo ''; - echo '

Files im Import Ordner

- + echo '

Files im Import Ordner

+
'; while (false !== ($file = readdir($handle))) { if ($file != '.' && $file != '..') { - echo ' - - - + echo ' + + + '; } } - echo ' - - - - - + echo ' + + + + +
File
- '.$file.' - - Upload -
+ '.$file.' + + Upload +
'; closedir($handle); } @@ -1247,44 +1281,44 @@ function drawFilesList($rows) if (count($rows) > 0) { - echo ' - + echo ' + widgets: ["zebra"] + }); + }); + '; } - echo ' - - - - + echo ' +
Titel
+ + + '; if ($suche == true) { echo ''; } - echo ' - - + echo ' + + - - - - + + + + '; $i = 0; foreach ($rows as $row) @@ -1295,8 +1329,8 @@ function drawFilesList($rows) else $i++; - echo ' - + echo ' + '; $datum = new datum(); @@ -1335,10 +1369,10 @@ function drawFilesList($rows) echo ''; echo ''; @@ -1540,29 +1577,33 @@ function drawRenameForm($dms_id, $version, $page = NULL, $dpp = NULL, $searching echo '&dpp='.$dpp; echo '" method="POST">'; } - echo ' -
Titel VKategorie ID ID Beschreibung SchlagworteCIS-Suche
CIS-Suche
'; if (array_key_exists($row->mimetype, $mimetypes)) echo ''; @@ -1312,9 +1346,9 @@ function drawFilesList($rows) $newerVersionAlert = 'alert(\'Achtung!! Es gibt eine neuere Version dieses Dokuments. Es wird die aktuellste eingefügt.\');'; } - echo ' - - '.$newVersion.' '.$row->name.' + echo ' + + '.$newVersion.' '.$row->name.' '; // Upload einer neuen Version - echo '
    -
  • Erweitert -
      -
    • Auswählen
    • + echo '
        +
      • Erweitert +
          +
        • Auswählen
        • Herunterladen
        • '; if ($rechte->isberechtigt('basis/dms', $kategorie->kategorie_oe_kurzbz, 'sui')) { @@ -1348,7 +1382,10 @@ function drawFilesList($rows) $beschreibungstext = str_replace('"', "D4n7ührung", $beschreibungstext); $beschreibungstext = str_replace("\\", "6Sl4sh", $beschreibungstext); $beschreibungstext = str_replace("\r\n", "Ze1l3numxbr", $beschreibungstext); - echo $beschreibungstext.'\'); return upload(\''.$row->dms_id.'\',\''.$row->name.'\');" style="font-size:small">Neue Version hochladen'; + echo $beschreibungstext.'\'); + updateSchlagworte(\''.$row->schlagworte.'\'); + updateCisSuche(\''.$row->cis_suche.'\'); + return upload(\''.$row->dms_id.'\',\''.$row->name.'\');" style="font-size:small">Neue Version hochladen'; } if (isset($_REQUEST['searching']) && $_REQUEST['searching'] == 'true') { @@ -1490,9 +1527,9 @@ function drawFilesList($rows) if ($rechte->isberechtigt('basis/dms', $kategorie->kategorie_oe_kurzbz, 'suid')) echo '
        • Löschen
        • '; } - echo ' -
        -
      • + echo ' +
      +
    '; echo '
'.$row->dms_id.'
- - - - - - - + echo ' +
Dateiname:
Beschreibung:
+ + + + + + + + + + + - -
Dateiname:
Beschreibung:
Schlagworte
(Semikolon getrennt):
Mimetype
CIS-Suche: cis_suche == 'true'?'checked="checked"':'').'>
- - + + + + '; - echo ' + echo ' '; } else @@ -1603,8 +1644,8 @@ function drawChangeKategorie($dms_id, $page = NULL, $dpp = NULL) echo '&dpp='.$dpp; echo '" method="POST">'; } - echo ' - '; foreach ($allKategorien->result as $kategorienResult) @@ -1619,8 +1660,8 @@ function drawChangeKategorie($dms_id, $page = NULL, $dpp = NULL) echo ''; } - echo ' - + echo ' + '; if (! is_null($page)) echo ''; @@ -1629,6 +1670,6 @@ function drawChangeKategorie($dms_id, $page = NULL, $dpp = NULL) echo ''; } -?> - - +?> + + diff --git a/content/fasoverlay.js.php b/content/fasoverlay.js.php index 9504285ce..db26a9180 100644 --- a/content/fasoverlay.js.php +++ b/content/fasoverlay.js.php @@ -907,8 +907,10 @@ function StatistikPrintLVPlanungExcel() col = tree.columns ? tree.columns["stg_kz"] : "stg_kz"; var studiengang_kz=tree.view.getCellText(tree.currentIndex,col); col = tree.columns ? tree.columns["sem"] : "sem"; - var semester=tree.view.getCellText(tree.currentIndex,col); - var url = 'content/statistik/lvplanung.xls.php?studiengang_kz='+studiengang_kz+'&semester='+semester+'&studiensemester_kurzbz='+studiensemester; + var semester = tree.view.getCellText(tree.currentIndex,col); + col = tree.columns ? tree.columns["tree-verband-col-orgform"] : "tree-verband-col-orgform"; + var orgform = tree.view.getCellText(tree.currentIndex,col); + var url = 'content/statistik/lvplanung.xls.php?studiengang_kz='+studiengang_kz+'&semester='+semester+'&studiensemester_kurzbz='+studiensemester+'&orgform_kurzbz='+orgform; } else if(document.getElementById('menu-content-tabs').selectedItem == document.getElementById('tab-organisationseinheit')) { diff --git a/content/funktionen.js.php b/content/funktionen.js.php index e77c47548..ae9edd2af 100644 --- a/content/funktionen.js.php +++ b/content/funktionen.js.php @@ -270,7 +270,7 @@ function FunktionDelete() // **** // * Speichert die Daten // **** -function FunktionDetailSpeichern() +function FunktionDetailSpeichern(kopie) { var funktion_kurzbz = document.getElementById('funktion-menulist-funktion').value; var oe_kurzbz = document.getElementById('funktion-menulist-oe_kurzbz').value; @@ -283,6 +283,9 @@ function FunktionDetailSpeichern() var bezeichnung = document.getElementById('funktion-textbox-bezeichnung').value; var wochenstunden = document.getElementById('funktion-textbox-wochenstunden').value; + if(kopie == true) + var neu = true; + //Bei Mitarbeitern wird kein Studiengang mitgeschickt if(window.parent.document.getElementById('main-content-tabs').selectedItem==window.parent.document.getElementById('tab-mitarbeiter')) studiengang_kz_berecht=''; @@ -412,6 +415,7 @@ function FunktionDetailDisableFields(val) document.getElementById('funktion-menulist-semester').disabled=val; document.getElementById('funktion-menulist-funktion').disabled=val; document.getElementById('funktion-button-speichern').disabled=val; + document.getElementById('funktion-button-kopiespeichern').disabled=val; document.getElementById('funktion-box-datum_von').disabled=val; document.getElementById('funktion-box-datum_bis').disabled=val; document.getElementById('funktion-textbox-bezeichnung').disabled=val; diff --git a/content/funktionen.xul.php b/content/funktionen.xul.php index 9bbe10686..b80cdd455 100644 --- a/content/funktionen.xul.php +++ b/content/funktionen.xul.php @@ -289,7 +289,8 @@ else -  " + + " "+ + ""; + + $("#oehbeitraegeTbl tbody").prepend(newRowHtml); + $("#addOeh_"+Oehbeitrag.newBeitragId).click( + function() + { + // get form data into object + let oehbeitrag = { + "von_studiensemester_kurzbz": $("#input_von_studiensemester_kurzbz_"+nextOehbeitragId).val(), + "bis_studiensemester_kurzbz": $("#input_bis_studiensemester_kurzbz_"+nextOehbeitragId).val(), + "studierendenbeitrag": $("#input_studierendenbeitrag_"+nextOehbeitragId).val().replace(",", "."), + "versicherung": $("#input_versicherung_"+nextOehbeitragId).val().replace(",", ".") + } + + let studiensemester_von_bis = { + "von_semester_with_date": $("#input_von_studiensemester_kurzbz_"+nextOehbeitragId+" option:selected").text(), + "bis_semester_with_date": $("#input_bis_studiensemester_kurzbz_"+nextOehbeitragId+" option:selected").text() + } + + Oehbeitrag.addOehbeitrag(oehbeitrag, studiensemester_von_bis, nextOehbeitragId); + } + ); + + // remove html row if delete button clicked + $("#delete_"+nextOehbeitragId).click( + function() + { + $(this).parent('td').parent('tr').remove(); + } + ); + + // increase counter for newly added rows id + Oehbeitrag.newBeitragId++; + } + else + FHC_DialogLib.alertInfo("ÖH-Beiträge für alle Studiensemester festgelegt"); + } + + Oehbeitrag.getValidStudiensemester(callback); + } + ) +}); + +var Oehbeitrag = { + newBeitragId: 0, + // ----------------------------------------------------------------------------------------------------------------- + // ajax calls + getOehBeitraege: function() + { + FHC_AjaxClient.ajaxCallGet( + CALLED_PATH + "/getOehbeitraege", + null, + { + successCallback: function(data, textStatus, jqXHR) + { + if (FHC_AjaxClient.isError(data)) + { + FHC_DialogLib.alertError(FHC_AjaxClient.getError(data)); + } + else if (FHC_AjaxClient.hasData(data)) + { + let oehbeitraege = FHC_AjaxClient.getData(data); + + let oehbeitrStr = ''; + for (let idx in oehbeitraege) + { + let oehbeitrag = oehbeitraege[idx]; + + // add Öhbeitrag row + oehbeitrStr += '' + + '' + + Oehbeitrag._formatDateToGerman(oehbeitrag.von_datum) + '/' + oehbeitrag.von_studiensemester_kurzbz + + ' '+ + '' + + '' + (oehbeitrag.bis_studiensemester_kurzbz == null ? 'unbeschränkt' : + Oehbeitrag._formatDateToGerman(oehbeitrag.bis_datum) + '/' + oehbeitrag.bis_studiensemester_kurzbz) + + ' '+ + '' + + '' + Oehbeitrag._formatDecimal(oehbeitrag.studierendenbeitrag) + + ' '+ + '' + + '' + Oehbeitrag._formatDecimal(oehbeitrag.versicherung) + + ' '+ + '' + + '' + + '' + + ' ' + + '' + + ''; + } + $("#oehbeitraegeTbl tbody").html(oehbeitrStr); + + // set events for editing, deleting etc. + Oehbeitrag._setUpdateEvents(); + + //initialise table sorter + Oehbeitrag._addTablesorter(); + } + }, + errorCallback: function() + { + FHC_DialogLib.alertError('Fehler beim Holen der Öhbeiträge'); + } + } + ); + }, + // get all Studiensemester which are valid for assignment (where no Öhbeitrag is assigned) + getValidStudiensemester: function(callback, oehbeitrag_id) + { + let params = oehbeitrag_id ? {"oehbeitrag_id": oehbeitrag_id} : null; + + FHC_AjaxClient.ajaxCallGet( + CALLED_PATH + "/getValidStudiensemester", + params, + { + successCallback: callback, + errorCallback: function() + { + FHC_DialogLib.alertError('Fehler beim Holen der Semester'); + } + } + ); + }, + addOehbeitrag: function(oehbeitrag, studiensemester_von_bis, nextOehbeitragId) + { + FHC_AjaxClient.ajaxCallPost( + CALLED_PATH + '/addOehbeitrag', + oehbeitrag, + { + successCallback: function(data, textStatus, jqXHR) { + if (FHC_AjaxClient.isError(data)) + { + FHC_DialogLib.alertError(FHC_AjaxClient.getError(data)); + } + else if (FHC_AjaxClient.hasData(data)) + { + // refresh Öhbeitragstable + Oehbeitrag.getOehBeitraege(); + } + else + { + FHC_DialogLib.alertError('Fehler beim Hinzufügen des Öhbeitrags'); + } + }, + errorCallback: function() + { + FHC_DialogLib.alertError('Fehler beim Hinzufügen des Öhbeitrags'); + } + } + ); + }, + // update whole Öhbeitrag + updateOehbeitrag: function(oehbeitrag_id, oehbeitragData) + { + FHC_AjaxClient.ajaxCallPost( + CALLED_PATH + '/updateOehbeitrag', + { + "oehbeitrag_id": oehbeitrag_id, + "data": oehbeitragData + }, + { + successCallback: function(data, textStatus, jqXHR) { + if (FHC_AjaxClient.isError(data)) + { + FHC_DialogLib.alertError(FHC_AjaxClient.getError(data)); + } + else if (FHC_AjaxClient.hasData(data)) + { + // refresh Öhbeitragstable + Oehbeitrag.getOehBeitraege(); + } + else + { + FHC_DialogLib.alertError('Fehler beim Aktualisieren des Öhbeitrags'); + } + }, + errorCallback: function() + { + FHC_DialogLib.alertError('Fehler beim Aktualisieren des Öhbeitrags'); + } + } + ); + }, + // update one field of Öhbeitrag (e.g. only semester or only Betrag) + updateOehbeitragField: function(oehbeitrag_id, fieldname, fieldelement, inputtype) + { + let oehbeitragdata = {}; + let fieldvalue = fieldelement.val(); + + if (inputtype != 'semester') // formal number as decimal with point separator + fieldvalue = Oehbeitrag._formatDecimal(fieldvalue, "."); + + oehbeitragdata[fieldname] = fieldvalue; + + FHC_AjaxClient.ajaxCallPost( + CALLED_PATH + '/updateOehbeitrag', + { + "oehbeitrag_id": oehbeitrag_id, + "data": oehbeitragdata + }, + { + successCallback: function(data, textStatus, jqXHR) { + if (FHC_AjaxClient.isError(data)) + { + FHC_DialogLib.alertError(FHC_AjaxClient.getError(data)); + } + else if (FHC_AjaxClient.hasData(data)) + { + // refresh table cell with correct value and set edit event and tablesorter + if (inputtype == 'semester') + fieldvalue = $(fieldelement).find("option:selected").text(); + else + fieldvalue = Oehbeitrag._formatDecimal(fieldvalue); + $("#confirm_"+fieldname+"_"+oehbeitrag_id).parent('td').html( + fieldvalue+" " + ); + $("#edit_"+fieldname+"_"+oehbeitrag_id).click( + function() + { + Oehbeitrag._makeFieldEditable($(this).prop("id"), fieldname, inputtype, true); + } + ); + + Oehbeitrag._addTablesorter(); + } + else + { + FHC_DialogLib.alertError('Fehler beim Aktualisieren des Öhbeitrags'); + } + }, + errorCallback: function() + { + FHC_DialogLib.alertError('Fehler beim Aktualisieren des Öhbeitrags'); + } + } + ); + }, + deleteOehbeitrag: function(oehbeitrag_id) + { + FHC_AjaxClient.ajaxCallPost( + CALLED_PATH + '/deleteOehbeitrag', + {"oehbeitrag_id": oehbeitrag_id}, + { + successCallback: function(data, textStatus, jqXHR) { + if (FHC_AjaxClient.hasData(data)) + { + $("#delete_"+oehbeitrag_id).closest("tr").remove(); + Oehbeitrag._addTablesorter(); + } + else + { + FHC_DialogLib.alertError('Fehler beim Löschen des Öhbeitrags'); + } + }, + errorCallback: function() + { + FHC_DialogLib.alertError('Fehler beim Löschen des Öhbeitrags'); + } + } + ); + }, + + // ----------------------------------------------------------------------------------------------------------------- + /** + * Sets click events for updating, deleting Oehbeitrag + */ + _setUpdateEvents: function() + { + // set edit event for whole row + $(".editBtn").click( + function() + { + let id = $(this).prop("id"); + let oehbeitrag_id = id.substr(id.lastIndexOf('_')+1); + Oehbeitrag._makeFieldEditable(id, 'von_studiensemester_kurzbz', 'semester'); + Oehbeitrag._makeFieldEditable(id, 'bis_studiensemester_kurzbz', 'semester'); + Oehbeitrag._makeFieldEditable(id, 'studierendenbeitrag'); + Oehbeitrag._makeFieldEditable(id, 'versicherung'); + $(this).after(" "); + $(this).remove(); + $("#delete_" + oehbeitrag_id).remove(); + + $("#save_"+oehbeitrag_id).click( + function() + { + let von_studiensemester_kurzbz = $("#input_von_studiensemester_kurzbz_"+oehbeitrag_id+" option:selected").val(); + let bis_studiensemester_kurzbz = $("#input_bis_studiensemester_kurzbz_"+oehbeitrag_id+" option:selected").val(); + let studierendenbeitrag = Oehbeitrag._formatDecimal($("#input_studierendenbeitrag_"+oehbeitrag_id).val(), '.'); + let versicherung = Oehbeitrag._formatDecimal($("#input_versicherung_"+oehbeitrag_id).val(), '.'); + + let oehbeitragData = { + "von_studiensemester_kurzbz": von_studiensemester_kurzbz, + "bis_studiensemester_kurzbz": bis_studiensemester_kurzbz, + "studierendenbeitrag": studierendenbeitrag, + "versicherung": versicherung + } + + Oehbeitrag.updateOehbeitrag(oehbeitrag_id, oehbeitragData); + } + ) + } + ); + + // set delete event for all rows + $(".deleteBtn").click( + function() + { + let oehbeitrag_id_prefixed = $(this).prop("id"); + let oehbeitrag_id = oehbeitrag_id_prefixed.substr(oehbeitrag_id_prefixed.lastIndexOf('_')+1); + + Oehbeitrag.deleteOehbeitrag(oehbeitrag_id); + } + ) + + // set edit events for single cells + $(".editStudierendenbeitrag").off('click').click( + function() + { + Oehbeitrag._makeFieldEditable($(this).prop("id"), 'studierendenbeitrag', null, true); + } + ); + + $(".editVersicherung").off('click').click( + function() + { + Oehbeitrag._makeFieldEditable($(this).prop("id"), 'versicherung', null, true); + } + ); + + $(".editBisStudiensemester").off('click').click( + function() + { + Oehbeitrag._makeFieldEditable($(this).prop("id"), 'bis_studiensemester_kurzbz', 'semester', true); + } + ); + + $(".editVonStudiensemester").off('click').click( + function() + { + Oehbeitrag._makeFieldEditable($(this).prop("id"), 'von_studiensemester_kurzbz', 'semester', true); + } + ); + }, + // make Öhbeitrag field editable, i.e. show input field instead of text + _makeFieldEditable: function(oehbeitrag_id_prefixed, fieldname, inputtype, singleUpdate) + { + let oehbeitrag_id = oehbeitrag_id_prefixed.substr(oehbeitrag_id_prefixed.lastIndexOf('_')+1); + let initElement = $("#cell_"+fieldname+"_"+oehbeitrag_id); // clicked element triggering event + let currFieldvalue = initElement.text().trim(); + + let callback = function(validSemesterData) + { + let inputHtml = ""; + + // if semester dropdown, retrieve valid semester + if (inputtype === 'semester') + { + if (FHC_AjaxClient.hasData(validSemesterData)) + { + let studiensemester = FHC_AjaxClient.getData(validSemesterData); + + inputHtml = Oehbeitrag._getStudiensemesterDropdown(oehbeitrag_id, fieldname, studiensemester, currFieldvalue, 'inline-inputfield'); + } + } + else // otherwise display textfield + { + inputHtml = ""; + } + + if (singleUpdate === true) + inputHtml += " "; + + initElement.html(inputHtml); + + if (singleUpdate === true) + { + // set the update event if single field update + $("#confirm_" + fieldname + "_" + oehbeitrag_id).click( + function() + { + Oehbeitrag.updateOehbeitragField(oehbeitrag_id, fieldname, $("#input_" + fieldname + "_" + oehbeitrag_id), inputtype); + } + ); + } + } + + // get valid Studiensemester with no Öhbeitrag assigned + if (inputtype == 'semester') + { + Oehbeitrag.getValidStudiensemester(callback, oehbeitrag_id); + } + else + callback(null); + }, + _getStudiensemesterDropdown(oehbeitrag_id, name, studiensemester, selectedDateSemester, formatclass) + { + let selectedDateSemesterArr = null; + if (selectedDateSemester) + { + selectedDateSemesterArr = selectedDateSemester.split('/'); + } + + let rowHtml = ""; + let inlineClass = formatclass != null ? ' '+formatclass : ''; + + rowHtml += ""; + + return rowHtml; + }, + _compareGermanDates: function(datea, dateb) + { + return datea.split(".").reverse().join("") < dateb.split(".").reverse().join(""); + }, + _addTablesorter: function() + { + // add parser through the tablesorter addParser method + $.tablesorter.addParser({ + // set a unique id + id: 'germandatesort', + is: function(s, table, cell, $cell) { + // return false so this parser is not auto detected + return false; + }, + format: function(s, table, cell, cellIndex) { + // format data, should sort by leading german date + return s.substring(0, 10).split(".").reverse().join(""); + }, + // set type, either numeric or text + type: 'numeric' + }); + + let headers = {headers: { 0: {sorter: "germandatesort"}, 1: {sorter: "germandatesort"}, 4: {sorter: false}}}; + + Tablesort.addTablesorter("oehbeitraegeTbl", [[0,1]], ["zebra"], 8, headers); + }, + // Formats a numeric value as a float with two decimals + _formatDecimal: function(value, decSeparator) + { + let dec = null; + let prevSeparator = "."; + + if (decSeparator === ".") + prevSeparator = ","; + else + decSeparator = ","; + + dec = value.split(prevSeparator); + if (dec.length === 2) + { + dec = parseFloat(dec[0] + '.' + dec[1]).toFixed(2); + dec = dec.replace(prevSeparator, decSeparator); + } + else if (Math.floor(value) == value) // if integer, add zeros + dec = value + decSeparator + '00'; + else + dec = value; + + return dec; + }, + // formats english date to as german + _formatDateToGerman: function(date) + { + return date.substring(8, 10) + "." + date.substring(5, 7) + "." + date.substring(0, 4); + } +}; diff --git a/public/js/infocenter/infocenterDetails.js b/public/js/infocenter/infocenterDetails.js index 70f5ed982..79129f3e2 100644 --- a/public/js/infocenter/infocenterDetails.js +++ b/public/js/infocenter/infocenterDetails.js @@ -10,6 +10,7 @@ const RTFREIGABE_MESSAGE_VORLAGE_QUER_KURZ = "InfocenterRTfreigegQuerKurz"; const STGFREIGABE_MESSAGE_VORLAGE = "InfocenterSTGfreigegeben"; const STGFREIGABE_MESSAGE_VORLAGE_MASTER = "InfocenterSTGfreigegebenM"; const STGFREIGABE_MESSAGE_VORLAGE_MASTER_ENGLISCH = "InfocenterSTGfreigegebenMEng"; +const STGFREIGABE_MESSAGE_VORLAGE_ANDERES_SEMESTER = "InfocenterSTGfreigegebenSemester"; //Statusgründe for which no Studiengang Freigabe Message should be sent const FIT_PROGRAMM_STUDIENGAENGE = [10021, 10027]; @@ -653,7 +654,7 @@ var InfocenterDetails = { } else { - if (receiverPrestudent.studiengangtyp === 'm' && (freigabedata.statusgrundbezeichnung === 'Ergänzungsprüfungen' || freigabedata.statusgrundbezeichnung === 'Supplementary exams')) + if (receiverPrestudent.studiengangtyp === 'm' && freigabedata.statuskurzbz === 'ergPruefung') { msgvars = { 'studiengangbezeichnung': studiengangbezeichnung, @@ -671,7 +672,11 @@ var InfocenterDetails = { //if Freigabe to Studiengang, send StgFreigabe Message if not already sent and allowed to send else if (!stgFreigegeben && receiverPrestudent.sendStgFreigabeMsg === true) { - InfocenterDetails.sendFreigabeMessage(prestudent_id, STGFREIGABE_MESSAGE_VORLAGE, msgvars); + if (receiverPrestudent.studiengangtyp === 'b' && freigabedata.statuskurzbz === 'anderesSemester') + vorlage = STGFREIGABE_MESSAGE_VORLAGE_ANDERES_SEMESTER + else + vorlage = STGFREIGABE_MESSAGE_VORLAGE + InfocenterDetails.sendFreigabeMessage(prestudent_id, vorlage, msgvars); } } }; @@ -847,7 +852,8 @@ var InfocenterDetails = { var statusgrundel = $("#frgstatusgrselect_" + prestudent_id + " select[name=frgstatusgrund]"); var statusgrund_id = statusgrundel.val(); var statusgrundbezeichnung = statusgrundel.find("option[value="+statusgrund_id+"]").text(); - var data = {"prestudent_id": prestudent_id, "statusgrund_id": statusgrund_id, "statusgrundbezeichnung": statusgrundbezeichnung}; + var statuskurzbz = statusgrundel.find(':selected').data('kurzbz'); + var data = {"prestudent_id": prestudent_id, "statusgrund_id": statusgrund_id, "statusgrundbezeichnung": statusgrundbezeichnung, "statuskurzbz" : statuskurzbz}; InfocenterDetails.saveFreigabe(data);//Studiengangfreigabe } ); diff --git a/public/js/infocenter/infocenterPersonDataset.js b/public/js/infocenter/infocenterPersonDataset.js index 252f6ac1f..bdeed1770 100644 --- a/public/js/infocenter/infocenterPersonDataset.js +++ b/public/js/infocenter/infocenterPersonDataset.js @@ -49,6 +49,11 @@ var InfocenterPersonDataset = { '' + + '' + ''; InfocenterPersonDataset.getAbsageData(); @@ -327,6 +332,7 @@ var InfocenterPersonDataset = { var statusgrund = $('.absgstatusgrund').val(); var studiengang = $('.auswahlAbsageStg').val(); + var abgeschickt = $('.auswahlAbsageAbgeschickt').val(); var personen = []; @@ -340,7 +346,8 @@ var InfocenterPersonDataset = { { 'statusgrund': statusgrund, 'studiengang': studiengang, - 'personen' : personen + 'personen' : personen, + 'abgeschickt' : abgeschickt }, { successCallback: function(data, textStatus, jqXHR) { diff --git a/public/js/issues/issuesDataset.js b/public/js/issues/issuesDataset.js new file mode 100644 index 000000000..b102a3f96 --- /dev/null +++ b/public/js/issues/issuesDataset.js @@ -0,0 +1,151 @@ +/** + * Javascript file for issues overview page + */ + +var IssuesDataset = { + + /** + * adds person table additional actions html (above and beneath it) + */ + appendTableActionsHtml: function() + { + let auswahlStatus = + '
' + + '' + + '' + + '' + + '' + + '
'; + + let selectAllHtml = + '' + + ' Alle  ' + + '' + + ' Keinen    '; + + let issuescount = 0; + + FHC_AjaxClient.ajaxCallGet( + 'widgets/Filters/rowNumber', + { + filterUniqueId: FHC_FilterWidget.getFilterUniqueIdPrefix() + }, + { + successCallback: function(data, textStatus, jqXHR) { + if (FHC_AjaxClient.hasData(data)) + { + issuescount = FHC_AjaxClient.getData(data); + + if (issuescount > 0) + { + var countHtml = issuescount + " Fehler"; + + // Count Records after Filtering + $("#filterTableDataset").bind("filterEnd", function() { + var cnt = $("#filterTableDataset tr:visible").length - 2; + $(".filterTableDatasetCntFiltered").html(cnt + ' / '); + }); + + $("#datasetActionsTop, #datasetActionsBottom").append( + "
"+ + "
" + selectAllHtml + "
"+ + "
" + auswahlStatus + "
"+ + "
" + + "" + + countHtml + "
"+ + "
"+ + "
"+ + "
"+ + "
" + ); + $("#datasetActionsBottom").append("

"); + + IssuesDataset.setTableActions(); + } + } + }, + errorCallback: function(jqXHR, textStatus, errorThrown) { + FHC_DialogLib.alertError(textStatus); + } + } + ); + }, + + /** + * sets functionality for the actions above and beneath the person table + */ + setTableActions: function() + { + $(".setStatus").click(function() + { + let status_kurzbz = $(".auswahlStatus").val(); + let issue_ids_sel = $("#filterTableDataset input:checked[name=issue_id\\[\\]]"); + + if(status_kurzbz.length <= 0) + return FHC_DialogLib.alertInfo("Bitte wählen Sie den Status aus."); + + if(issue_ids_sel.length <= 0) + return FHC_DialogLib.alertInfo("Bitte wählen Sie die Fehler aus."); + + let issue_ids = []; + + for (let i = 0; i < issue_ids_sel.length; i++) + { + issue_ids.push($(issue_ids_sel[i]).val()); + } + + FHC_AjaxClient.ajaxCallPost( + 'system/issues/Issues/changeIssueStatus', + { + "issue_ids": issue_ids, + "status_kurzbz": status_kurzbz + }, + { + successCallback: function(data, textStatus, jqXHR) { + if (FHC_AjaxClient.isError(data)) + FHC_DialogLib.alertError("Fehler beim Status Ändern: " + FHC_AjaxClient.getError(data)); + else if (FHC_AjaxClient.hasData(data)) + { + FHC_FilterWidget.reloadDataset(); + FHC_DialogLib.alertSuccess(FHC_AjaxClient.getData(data)); + } + else + FHC_DialogLib.alertError("Unbekannter Fehler beim Status Ändern"); + }, + errorCallback: function(jqXHR, textStatus, errorThrown) { + FHC_DialogLib.alertError("Fehler beim Status Ändern: " + textStatus); + } + } + ); + } + ); + + $(".selectAll").click(function() + { + //select only trs if not filtered by tablesorter + var trs = $("#filterTableDataset tbody tr").not(".filtered"); + trs.find("input[name=issue_id\\[\\]]").prop("checked", true); + } + ); + + $(".unselectAll").click(function() + { + var trs = $("#filterTableDataset tbody tr").not(".filtered"); + trs.find("input[name=issue_id\\[\\]]").prop("checked", false); + } + ); + } +}; + +/** + * When JQuery is up + */ +$(document).ready(function() { + + IssuesDataset.appendTableActionsHtml(); + +}); diff --git a/public/js/lehre/anrechnung/approveAnrechnungDetail.js b/public/js/lehre/anrechnung/approveAnrechnungDetail.js index 3b80da205..c2c2899ee 100644 --- a/public/js/lehre/anrechnung/approveAnrechnungDetail.js +++ b/public/js/lehre/anrechnung/approveAnrechnungDetail.js @@ -24,6 +24,9 @@ $(function(){ // Set status alert color approveAnrechnungDetail.setStatusAlertColor(); + // Set Empfehlungstext + approveAnrechnungDetail.setEmpfehlungstext(); + // Init tooltips approveAnrechnungDetail.initTooltips(); @@ -34,14 +37,23 @@ $(function(){ if (genehmigung_panel.is(":hidden")) { - // Show begruendung panel if is hidden - genehmigung_panel.slideDown('slow'); + // Show genehmigung panel if is hidden + genehmigung_panel.css('display', 'block'); + genehmigung_panel.slideDown(400, function() { + $('html, body').animate({ + scrollTop: genehmigung_panel.offset().top // Move genehmigung panel bottom up to be visible within window screen + }, 400); + }); + return; } }); // Approve Anrechnungen - $("#approveAnrechnungDetail-approve-anrechnung-confirm").click(function(){ + $("#approveAnrechnungDetail-approve-anrechnung-confirm").click(function(e){ + + // Avoid bubbling click event to sibling break button + e.stopImmediatePropagation(); // Get form data let form_data = $('form').serializeArray(); @@ -93,13 +105,22 @@ $(function(){ if (begruendung_panel.is(":hidden")) { // Show begruendung panel if is hidden - begruendung_panel.slideDown('slow'); + begruendung_panel.css('display', 'block'); + begruendung_panel.slideDown(400, function() { + $('html, body').animate({ + scrollTop: begruendung_panel.offset().top // Move begruendung panel bottom up to be visible within window screen + }, 400); + }); + return; } }); // Reject Anrechnungen - $("#approveAnrechnungDetail-reject-anrechnung-confirm").click(function(){ + $("#approveAnrechnungDetail-reject-anrechnung-confirm").click(function(e){ + + // Avoid bubbling click event to sibling break button + e.stopImmediatePropagation(); let begruendung = $('#approveAnrechnungDetail-begruendung').val(); @@ -110,9 +131,6 @@ $(function(){ return; } - // Avoid form redirecting automatically - event.preventDefault(); - // Get form data let form_data = $('form').serializeArray(); @@ -158,10 +176,12 @@ $(function(){ }); // Request Recommendation for Anrechnungen - $("#approveAnrechnungDetail-request-recommendation").click(function(){ + $("#approveAnrechnungDetail-request-recommendation").click(function(e){ + + e.preventDefault(); // Get form data - let form_data = $('form').serializeArray(); + let form_data = $('#form-empfehlung').serializeArray(); // Prepare data object for ajax call @@ -186,8 +206,9 @@ $(function(){ if (!data.error && data.retval != null) { approveAnrechnungDetail.formatEmpfehlungIsRequested( - data.retval[0].empfehlung_angefordert_am, - data.retval[0].status_bezeichnung + data.retval[0].status_bezeichnung, + data.retval[0].empfehlungsanfrageAm, + data.retval[0].empfehlungsanfrageAn ); } }, @@ -199,6 +220,139 @@ $(function(){ ); }); + // Withdraw approvement or rejection + $("#approveAnrechnungDetail-withdraw-anrechnung-approvement").click(function(){ + + if(!confirm(FHC_PhrasesLib.t("anrechnung", "genehmigungAblehnungWirklichZuruecknehmen"))) + { + return; + } + + // Get form data + let form_data = $('form').serializeArray(); + + // Prepare data object for ajax call + let data = { + 'anrechnung_id' : form_data[0].value + }; + + FHC_AjaxClient.ajaxCallPost( + FHC_JS_DATA_STORAGE_OBJECT.called_path + "/withdraw", + data, + { + successCallback: function (data, textStatus, jqXHR) + { + console.log(data); + if (data.error && data.retval != null) + { + console.log('inside error'); + // Print error message + FHC_DialogLib.alertWarning(data.retval); + } + + if (!data.error && data.retval != null) + { + console.log('inside success'); + approveAnrechnungDetail.formatGenehmigungIsWithdrawed( + data.retval.status_bezeichnung + ); + + FHC_DialogLib.alertSuccess(FHC_PhrasesLib.t("anrechnung", "erfolgreichZurueckgenommen")); + + } + }, + errorCallback: function (jqXHR, textStatus, errorThrown) + { + FHC_DialogLib.alertError(FHC_PhrasesLib.t("ui", "systemfehler")); + } + } + ); + }); + + // Withdraw request for recommendation + $("#approveAnrechnungDetail-withdraw-request-recommedation").click(function(e){ + + e.preventDefault(); + + if(!confirm(FHC_PhrasesLib.t("anrechnung", "empfehlungsanforderungWirklichZuruecknehmen"))) + { + return; + } + + // Get form data + let form_data = $('#form-empfehlung').serializeArray(); + + // Prepare data object for ajax call + let data = { + 'anrechnung_id' : form_data[0].value + }; + + FHC_AjaxClient.ajaxCallPost( + FHC_JS_DATA_STORAGE_OBJECT.called_path + "/withdrawRequestRecommendation", + data, + { + successCallback: function (data, textStatus, jqXHR) + { + console.log(data); + if (data.error && data.retval != null) + { + // Print error message + FHC_DialogLib.alertWarning(data.retval); + } + + if (!data.error && data.retval != null) + { + approveAnrechnungDetail.formatEmpfehlungIsWithdrawed( + data.retval.status_bezeichnung + ); + + FHC_DialogLib.alertSuccess( + FHC_PhrasesLib.t("anrechnung", "erfolgreichZurueckgenommen") + ); + + } + }, + errorCallback: function (jqXHR, textStatus, errorThrown) + { + FHC_DialogLib.alertError(FHC_PhrasesLib.t("ui", "systemfehler")); + } + } + ); + }); + + $('#form-empfehlungNotiz').submit(function(e){ + + e.preventDefault(); + + FHC_AjaxClient.ajaxCallPost( + FHC_JS_DATA_STORAGE_OBJECT.called_path + "/saveEmpfehlungsNotiz", + { + anrechnung_id: this.anrechnung_id.value, + notiz_id: this.notiz_id.value, + empfehlung_text: this.empfehlungText.value + }, + { + successCallback: function (data){ + + if (FHC_AjaxClient.isError(data)){ + + // Print error message + FHC_DialogLib.alertWarning(FHC_AjaxClient.getError(data)); + } + + if (FHC_AjaxClient.hasData(data)){ + + // Print success message + FHC_DialogLib.alertSuccess((FHC_AjaxClient.getData(data))) + } + }, + errorCallback(){ + FHC_DialogLib.alertError(FHC_PhrasesLib.t("ui", "systemfehler")); + } + } + ) + }) + // Copy Begruendung into textarea $(".btn-copyIntoTextarea").click(function(){ approveAnrechnungDetail.copyIntoTextarea(this); @@ -212,7 +366,7 @@ $(function(){ // Break Begruendung abgeben $('#approveAnrechnungDetail-begruendung-abbrechen').click(function(){ - $('#approveAnrechnungDetail-begruendung').val(''); + begruendung_panel.slideUp('slow'); }) @@ -238,6 +392,24 @@ var approveAnrechnungDetail = { $('#approveAnrechnungDetail-status_kurzbz').closest('div').addClass('alert-warning'); } }, + setEmpfehlungstext: function () { + let empfehlung = $('#approveAnrechnungDetail-empfehlung').data('empfehlung'); + + switch (empfehlung) { + case true: + $('#approveAnrechnungDetail-empfehlungDetail-empfehlung') + .addClass('text-success') + .html(FHC_PhrasesLib.t("anrechnung", "empfehlungPositivConfirmed")); + break; + case false: + $('#approveAnrechnungDetail-empfehlungDetail-empfehlung') + .addClass('text-danger') + .html(FHC_PhrasesLib.t("anrechnung", "empfehlungNegativConfirmed")); + break; + default: + $('#approveAnrechnungDetail-empfehlungDetail-empfehlung').html('-'); + } + }, initTooltips: function (){ $('[data-toggle="tooltip"]').tooltip({ delay: { "show": 200, "hide": 200 }, @@ -250,20 +422,30 @@ var approveAnrechnungDetail = { // Find closest textarea let textarea = $(elem).closest('div').find('textarea'); - // Copy begruendung into textarea - textarea.val($.trim($(elem).parent().find('span:first').text())); + if (elem.id.length && elem.id == 'empfehlungstextUebernehmen') + { + // Copy Empfehlungstext into textarea + textarea.val($.trim($('#approveAnrechnungDetail-empfehlungDetail-begruendung').text())); + return; + } + else + { + // Copy begruendung into textarea + textarea.val($.trim($(elem).parent().find('span:first').text())); + } }, - formatEmpfehlungIsRequested: function(empfehlungAngefordertAm, statusBezeichnung) { - $('#approveAnrechnungDetail-empfehlungDetail').children().addClass('hidden'); - $('#approveAnrechnungDetail-empfehlungDetail-empfehlungIsAngefordert').removeClass('hidden'); - $('#approveAnrechnungDetail-empfehlungDetail-empfehlungAngefordertAm').text(empfehlungAngefordertAm); + formatEmpfehlungIsRequested: function(statusBezeichnung, empfehlungsanfrageAm, empfehlungsanfrageAn) { + $('#approveAnrechnungDetail-empfehlungDetail-empfehlungsanfrageAm').html(empfehlungsanfrageAm); + $('#approveAnrechnungDetail-empfehlungDetail-empfehlungsanfrageAn').html(empfehlungsanfrageAn); $('#approveAnrechnungDetail-status_kurzbz').text(statusBezeichnung); $('#approveAnrechnungDetail-request-recommendation').prop('disabled', true); $('#approveAnrechnungDetail-approve-anrechnung-ask').prop('disabled', true); $('#approveAnrechnungDetail-reject-anrechnung-ask').prop('disabled', true); + $('#approveAnrechnungDetail-withdraw-request-recommedation').removeClass('hidden'); }, formatGenehmigungIsPositiv: function(abgeschlossenAm, abgeschlossenVon, statusBezeichnung){ - $('#approveAnrechnungDetail-genehmigungDetail').children().addClass('hidden'); + $('#approveAnrechnungDetail-genehmigungDetail-genehmigungIsNull').addClass('hidden'); + $('#approveAnrechnungDetail-genehmigungDetail-genehmigungIsNegativ').addClass('hidden'); $('#approveAnrechnungDetail-genehmigungDetail-genehmigungIsPositiv').removeClass('hidden'); $('#approveAnrechnungDetail-status_kurzbz').text(statusBezeichnung); $('#approveAnrechnungDetail-status_kurzbz').closest('div').removeClass('alert-warning').addClass('alert-success'); @@ -272,9 +454,13 @@ var approveAnrechnungDetail = { $('#approveAnrechnungDetail-request-recommendation').prop('disabled', true); $('#approveAnrechnungDetail-approve-anrechnung-ask').prop('disabled', true); $('#approveAnrechnungDetail-reject-anrechnung-ask').prop('disabled', true); + + // Show button to withdraw approval + $('#approveAnrechnungDetail-withdraw-anrechnung-approvement').removeClass('hidden'); }, formatGenehmigungIsNegativ: function(abgeschlossenAm, abgeschlossenVon, statusBezeichnung, begruendung){ - $('#approveAnrechnungDetail-genehmigungDetail').children().addClass('hidden'); + $('#approveAnrechnungDetail-genehmigungDetail-genehmigungIsNull').addClass('hidden'); + $('#approveAnrechnungDetail-genehmigungDetail-genehmigungIsPositiv').addClass('hidden'); $('#approveAnrechnungDetail-genehmigungDetail-genehmigungIsNegativ').removeClass('hidden'); $('#approveAnrechnungDetail-status_kurzbz').text(statusBezeichnung); $('#approveAnrechnungDetail-status_kurzbz').closest('div').removeClass('alert-warning').addClass('alert-danger'); @@ -284,5 +470,45 @@ var approveAnrechnungDetail = { $('#approveAnrechnungDetail-request-recommendation').prop('disabled', true); $('#approveAnrechnungDetail-approve-anrechnung-ask').prop('disabled', true); $('#approveAnrechnungDetail-reject-anrechnung-ask').prop('disabled', true); + + // Show button to withdraw approval + $('#approveAnrechnungDetail-withdraw-anrechnung-approvement').removeClass('hidden'); + }, + formatGenehmigungIsWithdrawed: function (statusBezeichnung){ + let empfehlung = $('#approveAnrechnungDetail-empfehlung').data('empfehlung'); // null / false / true + + $('#approveAnrechnungDetail-status_kurzbz').text(statusBezeichnung); + $('#approveAnrechnungDetail-status_kurzbz').closest('div').removeClass('alert-danger').removeClass('alert-success'); + $('#approveAnrechnungDetail-status_kurzbz').closest('div').addClass('alert-warning'); + + $('#approveAnrechnungDetail-genehmigungDetail-genehmigungIsNull').removeClass('hidden'); + $('#approveAnrechnungDetail-genehmigungDetail-genehmigungIsPositiv').addClass('hidden'); + $('#approveAnrechnungDetail-genehmigungDetail-genehmigungIsNegativ').addClass('hidden'); + + $('#approveAnrechnungDetail-abgeschlossenAm').text('-'); + $('#approveAnrechnungDetail-abgeschlossenVon').text('-'); + + // Only enable recommendation button again if no recommendation was submitted until now + if (empfehlung === null) + { + $('#approveAnrechnungDetail-request-recommendation').prop('disabled', false); + } + $('#approveAnrechnungDetail-approve-anrechnung-ask').prop('disabled', false); + $('#approveAnrechnungDetail-reject-anrechnung-ask').prop('disabled', false); + // Hide button to withdraw approval + $('#approveAnrechnungDetail-withdraw-anrechnung-approvement').addClass('hidden'); + }, + formatEmpfehlungIsWithdrawed: function (statusBezeichnung){ + $('#approveAnrechnungDetail-status_kurzbz').text(statusBezeichnung); + + $('#approveAnrechnungDetail-empfehlungDetail-empfehlungIsNull').removeClass('hidden'); + $('#approveAnrechnungDetail-empfehlungDetail-empfehlungsanfrageAm').html('-'); + $('#approveAnrechnungDetail-empfehlungDetail-empfehlungsanfrageAn').html('-'); + + $('#approveAnrechnungDetail-request-recommendation').prop('disabled', false); + $('#approveAnrechnungDetail-approve-anrechnung-ask').prop('disabled', false); + $('#approveAnrechnungDetail-reject-anrechnung-ask').prop('disabled', false); + // Hide button to withdraw approval + $('#approveAnrechnungDetail-withdraw-request-recommedation').addClass('hidden'); } } \ No newline at end of file diff --git a/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js b/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js index 28c3b74e1..ff3235e52 100644 --- a/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js +++ b/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js @@ -9,6 +9,20 @@ const ANRECHNUNGSTATUS_REJECTED = 'rejected'; const COLOR_LIGHTGREY = "#f5f5f5"; +// ----------------------------------------------------------------------------------------------------------------- +// Mutators - setter methods to manipulate table data when entering the tabulator +// ----------------------------------------------------------------------------------------------------------------- + +// Converts string date postgre style to string DD.MM.YYYY. +// This will allow correct filtering. +var mut_formatStringDate = function(value, data, type, params, component) { + if (value != null) + { + var d = new Date(value); + return ("0" + (d.getDate())).slice(-2) + "." + ("0" + (d.getMonth() + 1)).slice(-2) + "." + d.getFullYear(); + } +} + // TABULATOR FUNCTIONS // --------------------------------------------------------------------------------------------------------------------- // Returns relative height (depending on screen size) @@ -36,6 +50,7 @@ function hf_filterTrueFalse(headerValue, rowValue){ } // Adds column details +// Sets focus on filterbutton, if table starts with stored filter. function func_tableBuilt(table) { table.addColumn( { @@ -49,10 +64,16 @@ function func_tableBuilt(table) { url:function(cell){ return BASE_URL + "/" + APPROVE_ANRECHNUNG_DETAIL_URI + "?anrechnung_id=" + cell.getData().anrechnung_id }, - // target:"_blank" + target:"_blank" } }, false, "status" // place column after status ); + + // Set focus on filterbutton + let filters = table.getFilters(); + if (filters.length > 0){ + approveAnrechnung.focusFilterbuttonIfTableStartsWithStoredFilter(filters); + } } // Formats the rows @@ -156,6 +177,26 @@ $(function(){ ); }); + // Show only rows that are in progress by lector + $("#show-inProgressLektor").click(function(){ + $('#tableWidgetTabulator').tabulator('setFilter', + [ + {field: 'status_kurzbz', type: '=', value: ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR}, + {field: 'empfehlung_anrechnung', type: '=', value: null} + ] + ); + }); + + // Show only rows with empfohlene + noch nicht genehmigte/abgelehnte anrechnungen + $("#show-recommended").click(function(){ + $('#tableWidgetTabulator').tabulator('setFilter', + [ + {field: 'status_kurzbz', type: '=', value: ANRECHNUNGSTATUS_PROGRESSED_BY_STGL}, + {field: 'empfehlung_anrechnung', type: '=', value: 'true'} + ] + ); + }); + // Show only rows with nicht empfohlene + noch nicht genehmigte/abgelehnte anrechnungen $("#show-not-recommended").click(function(){ $('#tableWidgetTabulator').tabulator('setFilter', [ @@ -205,13 +246,21 @@ $(function(){ if (genehmigung_panel.is(":hidden")) { // Show begruendung panel if is hidden - genehmigung_panel.slideDown('slow'); + genehmigung_panel.slideDown(400, function() { + $('html, body').animate({ + scrollTop: genehmigung_panel.offset().top // Move genehmigung panel bottom up to be visible within window screen + }, 400); + }); + return; } }); // Approve Anrechnungen - $("#approveAnrechnungUebersicht-approve-anrechnungen-confirm").click(function(){ + $("#approveAnrechnungUebersicht-approve-anrechnungen-confirm").click(function(e){ + + // Avoid bubbling click event to sibling break button + e.stopImmediatePropagation(); // Get selected rows data let selected_data = $('#tableWidgetTabulator').tabulator('getSelectedData') @@ -274,13 +323,21 @@ $(function(){ if (begruendung_panel.is(":hidden")) { // Show begruendung panel if is hidden - begruendung_panel.slideDown('slow'); + begruendung_panel.slideDown(400, function() { + $('html, body').animate({ + scrollTop: begruendung_panel.offset().top // Move begruendung panel bottom up to be visible within window screen + }, 400); + }); + return; } }); // Reject Anrechnungen - $("#approveAnrechnungUebersicht-reject-anrechnungen-confirm").click(function(){ + $("#approveAnrechnungUebersicht-reject-anrechnungen-confirm").click(function(e){ + + // Avoid bubbling click event to sibling break button + e.stopImmediatePropagation(); let begruendung = $('#approveAnrechnungUebersicht-begruendung').val(); @@ -310,9 +367,6 @@ $(function(){ return; } - // Avoid form redirecting automatically - event.preventDefault(); - // Prepare data object for ajax call let data = { 'data': selected_data @@ -352,6 +406,7 @@ $(function(){ // Request Recommendation for Anrechnungen $("#approveAnrechnungUebersicht-request-recommendation").click(function(){ + // Get selected rows data let selected_data = $('#tableWidgetTabulator').tabulator('getSelectedData'); @@ -398,12 +453,23 @@ $(function(){ if (!data.error && data.retval != null) { - // Update status 'genehmigt' - $('#tableWidgetTabulator').tabulator('updateData', data.retval); - - // Print success message - FHC_DialogLib.alertSuccess(FHC_PhrasesLib.t("ui", "empfehlungWurdeAngefordert")); + // Print info message, if not all selected recommendations were requested + if (data.retval.length < selected_data.length){ + FHC_DialogLib.alertInfo( + FHC_PhrasesLib.t( + "ui", "empfehlungWurdeAngefordertAusnahmeWoKeineLektoren", + [selected_data.length, data.retval.length, selected_data.length - data.retval.length]) + ); + } + else + { + // Print success message + FHC_DialogLib.alertSuccess(FHC_PhrasesLib.t("ui", "empfehlungWurdeAngefordert")); + } } + + //Update status 'genehmigt' + $('#tableWidgetTabulator').tabulator('updateData', data.retval); }, errorCallback: function (jqXHR, textStatus, errorThrown) { @@ -421,7 +487,7 @@ $(function(){ // Break Ablehnung abgeben $('#approveAnrechnungUebersicht-begruendung-abbrechen').click(function(){ - $('#approveAnrechnungUebersicht-begruendung').val(''); + begruendung_panel.slideUp('slow'); }) @@ -458,5 +524,40 @@ var approveAnrechnung = { // Copy begruendung into textarea textarea.val($.trim($(elem).parent().text())); + }, + focusFilterbuttonIfTableStartsWithStoredFilter(filters){ + switch (filters[0].value) { + case ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR: + $("#show-inProgressLektor").addClass('active'); + break; + case ANRECHNUNGSTATUS_APPROVED: + $("#show-approved").addClass('active'); + break; + case ANRECHNUNGSTATUS_REJECTED: + $("#show-rejected").addClass('active'); + break; + case ANRECHNUNGSTATUS_PROGRESSED_BY_STGL: + if (filters.length > 1) + { + if (filters[1].field == 'empfehlung_anrechnung') + { + if (filters[1].value === 'true') + { + $("#show-recommended").addClass('active'); + } + else + { + $("#show-not-recommended").addClass('active'); + } + } + } + else + { + $("#show-inProgressDP").addClass('active'); + } + + break; + + } } } \ No newline at end of file diff --git a/public/js/lehre/anrechnung/createAnrechnung.js b/public/js/lehre/anrechnung/createAnrechnung.js new file mode 100644 index 000000000..176821f2c --- /dev/null +++ b/public/js/lehre/anrechnung/createAnrechnung.js @@ -0,0 +1,159 @@ +$(function () { + + // Disable all form fields by default + createAnrechnung.disableFormFields(); + + // Create Anrechnung on form submit + $('#createAnrechnung-form').submit(function(e){ + + e.preventDefault(); + + FHC_AjaxClient.ajaxCallPost( + FHC_JS_DATA_STORAGE_OBJECT.called_path + "/create", + { + prestudent_id: this.prestudent_id.value, + studiensemester_kurzbz: this.studiensemester_kurzbz.value, + lehrveranstaltung_id: this.lehrveranstaltung_id.value, + begruendung_id: this.begruendung_id.value, + herkunftKenntnisse: this.herkunftKenntnisse.value, + uploadfile: this.uploadfile.files + }, + { + successCallback: function (data, textStatus, jqXHR) + { + if (FHC_AjaxClient.isError(data)) + { + FHC_DialogLib.alertWarning(FHC_AjaxClient.getError(data)); + } + + if (FHC_AjaxClient.hasData(data)) + { + FHC_DialogLib.alertSuccess(FHC_AjaxClient.getData(data).msg); + + // Display button to open Anrechnung in new tab + createAnrechnung.displayButtonToOpenAnrechnung(FHC_AjaxClient.getData(data).anrechnung_id); + } + }, + errorCallback: function (jqXHR, textStatus, errorThrown) + { + FHC_DialogLib.alertError(FHC_PhrasesLib.t("ui", "systemfehler")); + } + } + ); + }); +}) + +// TABULATOR FUNCTIONS +// --------------------------------------------------------------------------------------------------------------------- +/** + * Set form fields and populate selectmenu with LVs of student + * on row selection. + * + * @param row + */ +function func_rowSelected(row){ + let studiensemester_kurzbz = $('#studiensemester_kurzbz').val(); + let prestudent_id = row.getData().prestudent_id; + let vorname = row.getData().vorname; + let nachname = row.getData().nachname; + + // Set hidden form field Prestudent ID + $('#prestudent_id').val(prestudent_id); + + // Set field StudentIn + $('#student').text(vorname + ' ' + nachname); + + // Populate Select with LVs of student + createAnrechnung.populateSelectWithStudentLVs(prestudent_id, studiensemester_kurzbz); + + // Enable all form fields + createAnrechnung.enableFormFields(); +} + +/** + * Empty and disable form fields + * when none row selected. + * + * @param data + * @param rows + */ +function func_rowSelectionChanged(data, rows){ + + // If no student is selected in the table + if (rows.length == 0) + { + // ...empty form fields + createAnrechnung.emptyFormFields(); + + // ...disable form fields + createAnrechnung.disableFormFields(); + } +} + +// --------------------------------------------------------------------------------------------------------------------- + +var createAnrechnung = { + emptyFormFields: function(){ + + // Empty field StudentIn + $('#student').text(''); + + // Empty form fields (except hidden ones) + $('#createAnrechnung-form :input:not([type=hidden])').val(''); + + // Hide eventually displayed button to open Anrechnung + $('#createAnrechnung-openAnrechnung').addClass('hidden'); + }, + disableFormFields: function(){ + let prestudent_id = $('#prestudent_id').data('prestudent_id'); + + if (prestudent_id == '') + { + // Disable all form elements + $("#createAnrechnung-form :input").prop("disabled", true); + } + }, + enableFormFields: function(){ + $("#createAnrechnung-form :input").prop("disabled", false); + }, + populateSelectWithStudentLVs: function(prestudent_id, studiensemester_kurzbz){ + FHC_AjaxClient.ajaxCallPost( + FHC_JS_DATA_STORAGE_OBJECT.called_path + "/getLVsByStudent", + {'prestudent_id': prestudent_id, 'studiensemester_kurzbz': studiensemester_kurzbz}, + { + successCallback: function (data, textStatus, jqXHR) + { + if (FHC_AjaxClient.isError(data)) + { + // Print error message + FHC_DialogLib.alertWarning(FHC_AjaxClient.getError(data)); + } + + if (FHC_AjaxClient.hasData(data)) + { + let lehrveranstaltungen = FHC_AjaxClient.getData(data); + + // Remove previous Lehrveranstaltungen + $('#select-lehrveranstaltung option').slice(1).remove(); // Leave first option 'Bitte wählen' + + // Append Lehrveranstaltungen + for (let lv of lehrveranstaltungen){ + $('#select-lehrveranstaltung').append(''); + } + } + }, + errorCallback: function (jqXHR, textStatus, errorThrown) + { + FHC_DialogLib.alertError(FHC_PhrasesLib.t("ui", "systemfehler")); + } + } + ); + }, + displayButtonToOpenAnrechnung: function(anrechnung_id){ + // Display button to open Anrechnung in new tab + $('#createAnrechnung-openAnrechnung') + .removeClass('hidden') + .attr('href', 'ApproveAnrechnungDetail/?anrechnung_id=' + anrechnung_id) + .html(' ' + FHC_PhrasesLib.t("global", "antragBearbeiten")); + } +} \ No newline at end of file diff --git a/public/js/lehre/anrechnung/requestAnrechnung.js b/public/js/lehre/anrechnung/requestAnrechnung.js index 1f9f8b51b..fa7d02de8 100644 --- a/public/js/lehre/anrechnung/requestAnrechnung.js +++ b/public/js/lehre/anrechnung/requestAnrechnung.js @@ -1,14 +1,65 @@ const ANRECHNUNGSTATUS_APPROVED = 'approved'; const ANRECHNUNGSTATUS_REJECTED = 'rejected'; +const HERKUNFT_DER_KENNTNISSE_MAX_LENGTH = 125; $(function(){ // Set status alert color requestAnrechnung.setStatusAlertColor(); + // Disable Form fields if Anrechnung was already applied + requestAnrechnung.disableFormFieldsIfAntragIsApplied(); + + // Check Bestaetigung checkbox if Anrechnung was already applied + requestAnrechnung.markAsBestaetigtIfAntragIsApplied(); + // Init tooltips requestAnrechnung.initTooltips(); + // Set chars counter for textarea 'Herkunft der Kenntnisse' + requestAnrechnung.setCharsCounter(); + // If Sperregrund exists: display Sperre panel, hide Status panel and disable all form elements + requestAnrechnung.displaySperreIfHasSperregrund(); + + $('#requestAnrechnung-form').submit(function(e){ + + // Avoid form redirecting automatically + e.preventDefault(); + + FHC_AjaxClient.ajaxCallPost( + FHC_JS_DATA_STORAGE_OBJECT.called_path + "/apply", + { + anmerkung: this.anmerkung.value, + begruendung: this.begruendung.value, + lv_id: this.lv_id.value, + studiensemester: this.studiensemester.value, + bestaetigung: this.bestaetigung.value, + uploadfile: this.uploadfile.files + }, + { + successCallback:function(data, textStatus, jqXHR){ + if (FHC_AjaxClient.isError(data)) + { + FHC_DialogLib.alertWarning(FHC_AjaxClient.getError(data)); + } + + if (FHC_AjaxClient.hasData(data)) + { + requestAnrechnung.formatAnrechnungIsApplied( + data.retval.antragdatum, + data.retval.dms_id, + data.retval.filename + ); + + FHC_DialogLib.alertSuccess(FHC_PhrasesLib.t("global", "antragWurdeGestellt")); + } + }, + errorCallback: function(jqXHR, textStatus, errorThrown){ + FHC_DialogLib.alertWarning(FHC_PhrasesLib.t("ui", "systemfehler")); + } + } + ); + }); }) var requestAnrechnung = { @@ -24,9 +75,62 @@ var requestAnrechnung = { break; case '': $('#requestAnrechnung-status_kurzbz').closest('div').addClass('alert-info'); + $('#requestAnrechnung-status_kurzbz').text(FHC_PhrasesLib.t("ui", "neu")); break; default: $('#requestAnrechnung-status_kurzbz').closest('div').addClass('alert-warning'); + $('#requestAnrechnung-status_kurzbz').text(FHC_PhrasesLib.t("ui", "inBearbeitung")); + } + }, + disableFormFieldsIfAntragIsApplied: function(){ + let status_kurzbz = $('#requestAnrechnung-status_kurzbz').data('status_kurzbz'); + + if (status_kurzbz != '') + { + // Disable all form elements + requestAnrechnung.disableFormFields(); + } + }, + markAsBestaetigtIfAntragIsApplied: function(){ + let status_kurzbz = $('#requestAnrechnung-status_kurzbz').data('status_kurzbz'); + + if (status_kurzbz != '') + { + $("#requestAnrechnung-form :input[name='bestaetigung']").prop('checked', true); + } + }, + disableFormFields(){ + // Disable all form elements + $("#requestAnrechnung-form :input").prop("disabled", true); + }, + displaySperreIfHasSperregrund: function(){ + const anrechnung_id = $('#requestAnrechnung-sperre').data('anrechnung_id'); + const is_expired = $('#requestAnrechnung-sperre').data('expired'); + const is_blocked = $('#requestAnrechnung-sperre').data('blocked'); + + // If Deadline is expired or is blocked by grades of LV, AND not already angerechnet + if ((is_expired || is_blocked) && anrechnung_id == '') + { + // Hide status panel + $('#requestAnrechnung-status').hide(); + + // Show sperre panel + $('#requestAnrechnung-sperre') + .removeClass('hidden') + .html(function(){ + let sperregrund = FHC_PhrasesLib.t('global', 'bearbeitungGesperrt') + ': '; + + if (is_expired) { + sperregrund += FHC_PhrasesLib.t('anrechnung', 'deadlineUeberschritten'); + } + else if (is_blocked){ + sperregrund += FHC_PhrasesLib.t('anrechnung', 'benotungDerLV'); + } + return ""+ sperregrund + ""; + }) + + // Disable all form elements + requestAnrechnung.disableFormFields(); } }, initTooltips: function (){ @@ -35,5 +139,27 @@ var requestAnrechnung = { html: true } ); + }, + setCharsCounter: function(){ + $('#requestAnrechnung-herkunftDerKenntnisse').keyup(function() { + + let length = HERKUNFT_DER_KENNTNISSE_MAX_LENGTH - $(this).val().length; + + $('#requestAnrechnung-herkunftDerKenntnisse-charCounter').text(length); + }); + }, + formatAnrechnungIsApplied: function (antragdatum, dms_id, filename){ + $('#requestAnrechnung-antragdatum').text(antragdatum); + $('#requestAnrechnung-status_kurzbz').text(FHC_PhrasesLib.t("ui", "inBearbeitung")); + $('#requestAnrechnung-status_kurzbz').closest('div').addClass('alert-warning'); + + // Display File-Downloadlink + $('#requestAnrechnung-downloadDocLink') + .removeClass('hidden') + .attr('href', 'RequestAnrechnung/download?dms_id=' + dms_id) + .html(filename); + + // Disable all form elements + $("#requestAnrechnung-form :input").prop("disabled", true); } } \ No newline at end of file diff --git a/public/js/lehre/anrechnung/reviewAnrechnungDetail.js b/public/js/lehre/anrechnung/reviewAnrechnungDetail.js index 705e6c440..fc26f4577 100644 --- a/public/js/lehre/anrechnung/reviewAnrechnungDetail.js +++ b/public/js/lehre/anrechnung/reviewAnrechnungDetail.js @@ -25,6 +25,9 @@ $(function(){ // Set status alert color reviewAnrechnung.setStatusAlertColor(); + // Set Empfehlungstext + reviewAnrechnung.setEmpfehlungstext(); + // Init tooltips reviewAnrechnung.initTooltips(); @@ -41,13 +44,20 @@ $(function(){ if (empfehlung_panel.is(":hidden")) { // Show begruendung panel if is hidden - empfehlung_panel.slideDown('slow'); + empfehlung_panel.slideDown(400, function() { + $('html, body').animate({ + scrollTop: empfehlung_panel.offset().top // Move empfehlung panel bottom up to be visible within window screen + }, 400); + }); return; } }); // Recommend Anrechnung - $("#reviewAnrechnungDetail-recommend-anrechnung-confirm").click(function(){ + $("#reviewAnrechnungDetail-recommend-anrechnung-confirm").click(function(e){ + + // Avoid bubbling click event to sibling break button + e.stopImmediatePropagation(); // Get form data let form_data = $('form').serializeArray(); @@ -99,13 +109,20 @@ $(function(){ if (begruendung_panel.is(":hidden")) { // Show begruendung panel if is hidden - begruendung_panel.slideDown('slow'); + begruendung_panel.slideDown(400, function() { + $('html, body').animate({ + scrollTop: begruendung_panel.offset().top // Move begruendung panel bottom up to be visible within window screen + }, 400); + }); return; } }); // Dont recommend Anrechnung - $("#reviewAnrechnungDetail-dont-recommend-anrechnung-confirm").click(function(){ + $("#reviewAnrechnungDetail-dont-recommend-anrechnung-confirm").click(function(e){ + + // Avoid bubbling click event to sibling break button + e.stopImmediatePropagation(); let begruendung = $('#reviewAnrechnungDetail-begruendung').val(); @@ -116,9 +133,6 @@ $(function(){ return; } - // Avoid form redirecting automatically - event.preventDefault(); - // Get form data let form_data = $('form').serializeArray(); @@ -171,7 +185,7 @@ $(function(){ // Break Begruendung abgeben $('#reviewAnrechnungDetail-begruendung-abbrechen').click(function(){ - $('#reviewAnrechnungDetail-begruendung').val(''); + begruendung_panel.slideUp('slow'); }) @@ -196,6 +210,24 @@ var reviewAnrechnung = { $('#reviewAnrechnungDetail-status_kurzbz').closest('div').addClass('alert-warning'); } }, + setEmpfehlungstext: function () { + let empfehlung = $('#reviewAnrechnungDetail-empfehlung').data('empfehlung'); + + switch (empfehlung) { + case true: + $('#reviewAnrechnungDetail-empfehlungDetail-empfehlung') + .addClass('text-success') + .html(FHC_PhrasesLib.t("anrechnung", "empfehlungPositivConfirmed")); + break; + case false: + $('#reviewAnrechnungDetail-empfehlungDetail-empfehlung') + .addClass('text-danger') + .html(FHC_PhrasesLib.t("anrechnung", "empfehlungNegativConfirmed")); + break; + default: + $('#reviewAnrechnungDetail-empfehlungDetail-empfehlung').html('-'); + } + }, initTooltips: function (){ $('[data-toggle="tooltip"]').tooltip({ delay: { "show": 200, "hide": 200 }, @@ -213,22 +245,28 @@ var reviewAnrechnung = { textarea.val($.trim($(elem).parent().find('span:first').text())); }, formatEmpfehlungIsTrue: function(empfehlungAm, emfehlungVon, statusBezeichnung){ - $('#reviewAnrechnungDetail-empfehlungDetail').children().addClass('hidden'); - $('#reviewAnrechnungDetail-empfehlungDetail-empfehlungIsTrue').removeClass('hidden'); $('#reviewAnrechnungDetail-status_kurzbz').text(statusBezeichnung); $('#reviewAnrechnungDetail-recommend-anrechnung-ask').prop('disabled', true); $('#reviewAnrechnungDetail-dont-recommend-anrechnung-ask').prop('disabled', true); $('#reviewAnrechnungDetail-empfehlungAm').text(empfehlungAm); $('#reviewAnrechnungDetail-empfehlungVon').text(emfehlungVon); + $('#reviewAnrechnungDetail-empfehlungDetail-empfehlung') + .addClass('text-success') + .html(FHC_PhrasesLib.t("anrechnung", "empfehlungPositivConfirmed")); + $('#reviewAnrechnungDetail-empfehlungDetail-empfehlungAm').html(empfehlungAm); + $('#reviewAnrechnungDetail-empfehlungDetail-empfehlungVon').html(emfehlungVon); }, formatEmpfehlungIsFalse: function(empfehlungAm, emfehlungVon, statusBezeichnung, begruendung){ - $('#reviewAnrechnungDetail-empfehlungDetail').children().addClass('hidden'); - $('#reviewAnrechnungDetail-empfehlungDetail-empfehlungIsFalse').removeClass('hidden'); $('#reviewAnrechnungDetail-status_kurzbz').text(statusBezeichnung); $('#reviewAnrechnungDetail-recommend-anrechnung-ask').prop('disabled', true); $('#reviewAnrechnungDetail-dont-recommend-anrechnung-ask').prop('disabled', true); $('#reviewAnrechnungDetail-empfehlungAm').text(empfehlungAm); $('#reviewAnrechnungDetail-empfehlungVon').text(emfehlungVon); + $('#reviewAnrechnungDetail-empfehlungDetail-empfehlung') + .addClass('text-danger') + .html(FHC_PhrasesLib.t("anrechnung", "empfehlungNegativConfirmed")); + $('#reviewAnrechnungDetail-empfehlungDetail-empfehlungAm').html(empfehlungAm); + $('#reviewAnrechnungDetail-empfehlungDetail-empfehlungVon').html(emfehlungVon); $('#reviewAnrechnungDetail-empfehlungDetail-begruendung').text(begruendung); } } \ No newline at end of file diff --git a/public/js/lehre/anrechnung/reviewAnrechnungUebersicht.js b/public/js/lehre/anrechnung/reviewAnrechnungUebersicht.js index f9bbbc310..2cf7c1623 100644 --- a/public/js/lehre/anrechnung/reviewAnrechnungUebersicht.js +++ b/public/js/lehre/anrechnung/reviewAnrechnungUebersicht.js @@ -9,6 +9,20 @@ const ANRECHNUNGSTATUS_REJECTED = 'rejected'; const COLOR_LIGHTGREY = "#f5f5f5"; +// ----------------------------------------------------------------------------------------------------------------- +// Mutators - setter methods to manipulate table data when entering the tabulator +// ----------------------------------------------------------------------------------------------------------------- + +// Converts string date postgre style to string DD.MM.YYYY. +// This will allow correct filtering. +var mut_formatStringDate = function(value, data, type, params, component) { + if (value != null) + { + var d = new Date(value); + return ("0" + (d.getDate())).slice(-2) + "." + ("0" + (d.getMonth() + 1)).slice(-2) + "." + d.getFullYear(); + } +} + // TABULATOR FUNCTIONS // --------------------------------------------------------------------------------------------------------------------- // Returns relative height (depending on screen size) @@ -48,8 +62,8 @@ function func_tableBuilt(table) { label:"Details", url:function(cell){ return BASE_URL + "/" + APPROVE_ANRECHNUNG_DETAIL_URI + "?anrechnung_id=" + cell.getData().anrechnung_id - } - // target:"_blank" + }, + target:"_blank" } }, false, "status" // place column after status ); @@ -213,13 +227,20 @@ $(function(){ if (empfehlung_panel.is(":hidden")) { // Show begruendung panel if is hidden - empfehlung_panel.slideDown('slow'); + empfehlung_panel.slideDown(400, function() { + $('html, body').animate({ + scrollTop: empfehlung_panel.offset().top // Move empfehlung panel bottom up to be visible within window screen + }, 400); + }); return; } }); // Recommend Anrechnungen - $("#reviewAnrechnungUebersicht-recommend-anrechnungen-confirm").click(function(){ + $("#reviewAnrechnungUebersicht-recommend-anrechnungen-confirm").click(function(e){ + + // Avoid bubbling click event to sibling break button + e.stopImmediatePropagation(); // Get selected rows data let selected_data = $('#tableWidgetTabulator').tabulator('getSelectedData') @@ -283,13 +304,20 @@ $(function(){ if (begruendung_panel.is(":hidden")) { // Show begruendung panel if is hidden - begruendung_panel.slideDown('slow'); + begruendung_panel.slideDown(400, function() { + $('html, body').animate({ + scrollTop: begruendung_panel.offset().top // Move genehmigung panel bottom up to be visible within window screen + }, 400); + }); return; } }); // Dont recommend Anrechnungen - $("#reviewAnrechnungUebersicht-dont-recommend-anrechnungen-confirm").click(function(){ + $("#reviewAnrechnungUebersicht-dont-recommend-anrechnungen-confirm").click(function(e){ + + // Avoid bubbling click event to sibling break button + e.stopImmediatePropagation(); let begruendung = $('#reviewAnrechnungUebersicht-begruendung').val(); @@ -319,9 +347,6 @@ $(function(){ return; } - // Avoid form redirecting automatically - event.preventDefault(); - // Prepare data object for ajax call let data = { 'data': selected_data @@ -367,7 +392,7 @@ $(function(){ // Break Begruendung abgeben $('#reviewAnrechnungUebersicht-begruendung-abbrechen').click(function(){ - $('#reviewAnrechnungUebersicht-begruendung').val(''); + begruendung_panel.slideUp('slow'); }) diff --git a/rdf/abschlusspruefung.rdf.php b/rdf/abschlusspruefung.rdf.php index f28319599..8c2764d86 100644 --- a/rdf/abschlusspruefung.rdf.php +++ b/rdf/abschlusspruefung.rdf.php @@ -129,7 +129,19 @@ function draw_content_xml($row) if($person->load($row->pruefer3)) $pruefer3 = trim($person->titelpre.' '.$person->vorname.' '.$person->nachname.' '.$person->titelpost); - $qry = "SELECT * FROM public.tbl_benutzerfunktion JOIN campus.vw_mitarbeiter USING(uid) WHERE funktion_kurzbz='rek'"; + $qry = "SELECT * + FROM PUBLIC.tbl_benutzerfunktion + JOIN campus.vw_mitarbeiter USING (uid) + WHERE funktion_kurzbz = 'rek' + AND ( + tbl_benutzerfunktion.datum_von <= now() + OR tbl_benutzerfunktion.datum_von IS NULL + ) + AND ( + tbl_benutzerfunktion.datum_bis >= now() + OR tbl_benutzerfunktion.datum_bis IS NULL + ) + ORDER BY tbl_benutzerfunktion.insertamum DESC LIMIT 1"; $rektor = ''; $db = new basis_db(); $db2 = new basis_db(); diff --git a/rdf/anrechnung.rdf.php b/rdf/anrechnung.rdf.php index 5d50c3161..14fc1fd1a 100644 --- a/rdf/anrechnung.rdf.php +++ b/rdf/anrechnung.rdf.php @@ -28,10 +28,27 @@ $anrechnung = new anrechnung(); if(is_numeric($anrechnung_id)) { $anrechnung->getAnrechnung($anrechnung_id); + + // Add last Anrechnungstatus + $anrechnungstatus = new Anrechnung(); + $anrechnungstatus->getLastAnrechnungstatus($anrechnung_id); + + $anrechnung->result[0]->status = $anrechnungstatus->result[0]->bezeichnung_mehrsprachig[DEFAULT_LANGUAGE]; } elseif(is_numeric($prestudent_id)) { $anrechnung->getAnrechnungPrestudent($prestudent_id); + + // Add last Anrechnungstatus to each Anrechnung of Prestudent + if(is_array($anrechnung->result)) + { + foreach ($anrechnung->result as $row) + { + $anrechnungstatus = new Anrechnung(); + $status = $anrechnungstatus->getLastAnrechnungstatus($row->anrechnung_id); + $row->status = $anrechnungstatus->result[0]->bezeichnung_mehrsprachig[DEFAULT_LANGUAGE]; + } + } } else { @@ -80,6 +97,7 @@ if(is_array($anrechnung->result)) insertvon.']]> updateamum.']]> updatevon.']]> + status.']]> '; @@ -88,4 +106,4 @@ if(is_array($anrechnung->result)) ?> - \ No newline at end of file + diff --git a/rdf/bisstandort.rdf.php b/rdf/bisstandort.rdf.php new file mode 100644 index 000000000..17afcde46 --- /dev/null +++ b/rdf/bisstandort.rdf.php @@ -0,0 +1,75 @@ +. + */ +// header für no cache +header("Cache-Control: no-cache"); +header("Cache-Control: post-check=0, pre-check=0",false); +header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); +header("Pragma: no-cache"); +// content type setzen +header("Content-type: application/xhtml+xml"); +// xml +echo ''; +// DAO +require_once('../config/vilesci.config.inc.php'); +require_once('../include/basis_db.class.php'); + +$rdf_url='http://www.technikum-wien.at/bisstandort'; + +?> + + + + + + + + + -- keine Auswahl -- + + +'; +} +$qry = "SELECT * FROM bis.tbl_bisstandort WHERE aktiv ORDER BY bezeichnung"; +$db = new basis_db(); + +if($db->db_query($qry)) +{ + while($row = $db->db_fetch_object()) + { +?> + + + standort_code; ?>]]> + bezeichnung; ?>]]> + + + + + \ No newline at end of file diff --git a/rdf/bisverwendung.rdf.php b/rdf/bisverwendung.rdf.php index 16e6daba5..cc15efe81 100644 --- a/rdf/bisverwendung.rdf.php +++ b/rdf/bisverwendung.rdf.php @@ -94,6 +94,11 @@ function draw_row($row) $azgrelevant = $row->azgrelevant?'Ja':'Nein'; else $azgrelevant = ''; + + if(is_bool($row->homeoffice)) + $homeoffice = $row->homeoffice?'Ja':'Nein'; + else + $homeoffice = ''; echo ' @@ -125,6 +130,7 @@ function draw_row($row) inkludierte_lehre.']]> + '; diff --git a/rdf/diplomasupplement.xml.php b/rdf/diplomasupplement.xml.php index 14352a3c3..d55187c6c 100644 --- a/rdf/diplomasupplement.xml.php +++ b/rdf/diplomasupplement.xml.php @@ -389,7 +389,7 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml") echo "".$datum->convertISODate($row1->bis).""; echo "$row1->zweck"; echo "$row1->ort"; - echo "$row1->universitaet"; + echo "universitaet]]>"; echo ""; } echo ""; diff --git a/rdf/organisationseinheit.rdf.php b/rdf/organisationseinheit.rdf.php index f31d542ce..ee66697a9 100644 --- a/rdf/organisationseinheit.rdf.php +++ b/rdf/organisationseinheit.rdf.php @@ -35,7 +35,7 @@ require_once('../include/organisationseinheit.class.php'); // raumtypen holen $org=new organisationseinheit(); -$org->getAll(); +$org->getAll(null, null, 'organisationseinheittyp_kurzbz, bezeichnung'); $rdf_url='http://www.technikum-wien.at/organisationseinheit'; @@ -64,4 +64,4 @@ foreach ($org->result as $oe) ?> - \ No newline at end of file + diff --git a/rdf/student.rdf.php b/rdf/student.rdf.php index 3771f7d5e..1836ae55b 100644 --- a/rdf/student.rdf.php +++ b/rdf/student.rdf.php @@ -61,8 +61,9 @@ function convdate($date) function checkfilter($row, $filter2, $buchungstyp = null) { - global $studiensemester_kurzbz, $kontofilterstg; + global $studiensemester_kurzbz, $kontofilterstg, $studiengang_kz; $db = new basis_db(); + $studstatusgrund = array(); if($filter2=='dokumente') { @@ -157,6 +158,21 @@ function checkfilter($row, $filter2, $buchungstyp = null) } } } + elseif ( preg_match('/^stud-statusgrund-([0-9]+)$/', $filter2, $studstatusgrund) ) + { + // Alle Studenten mit Statusgrund in tbl_prestudentstatus + $qry = "SELECT count(*) AS anzahl FROM public.tbl_prestudentstatus ps JOIN + public.tbl_prestudent p ON p.prestudent_id = ps.prestudent_id AND + ps. studiensemester_kurzbz=".$db->db_add_param($studiensemester_kurzbz)." AND + p. person_id=".$db->db_add_param($row->person_id, FHC_INTEGER)." AND + p.studiengang_kz=" . $db->db_add_param($studiengang_kz, FHC_INTEGER) . " AND + ps.statusgrund_id = " . $db->db_add_param($studstatusgrund[1], FHC_INTEGER); + //echo $qry . "\n"; + $filtered = ( $db->db_query($qry) && ($row_filter = $db->db_fetch_object()) && ($row_filter->anzahl > 0) ) + ? true + : false; + return $filtered; + } return true; } @@ -339,44 +355,141 @@ function draw_prestudent($row) $prioRelativ = $prioRelativ->getRelativePriorisierungFromAbsolut($row->prestudent_id, $row->priorisierung); if($row->prestudent_id!='') { - echo ' - prestudent_id.']]> - studiengang_kz.']]> - studiengang_kz.']]> - aufmerksamdurch_kurzbz.']]> - studiengang_kz].']]> - berufstaetigkeit_code.']]> - ausbildungcode.']]> - zgv_code.']]> - zgvort.']]> - convertISODate($row->zgvdatum).']]> - zgvdatum.']]> - zgvnation.']]> - zgvmas_code.']]> - zgvmaort.']]> - convertISODate($row->zgvmadatum).']]> - zgvmadatum.']]> - zgvmanation.']]> - ausstellungsstaat.']]> - aufnahmeschluessel.']]> - facheinschlberuf?'true':'false').']]> - reihungstest_id.']]> - convertISODate($row->anmeldungreihungstest).']]> - anmeldungreihungstest.']]> - reihungstestangetreten?'true':'false').']]> - punkte.']]> - bismelden?'true':'false').']]> - dual?'true':'false').']]> - dual?'Ja':'Nein').']]> - anmerkung.']]> - mentor.']]> - gsstudientyp_kurzbz.']]> - aufnahmegruppe_kurzbz.']]> - priorisierung.']]> - priorisierung.')'.']]> + $foerderrelevant = ''; + + if ($row->foerderrelevant === true) + $foerderrelevant = 'true'; + elseif ($row->foerderrelevant === false) + $foerderrelevant = 'false'; + + echo ' + prestudent_id.']]> + studiengang_kz.']]> + studiengang_kz.']]> + aufmerksamdurch_kurzbz.']]> + studiengang_kz].']]> + berufstaetigkeit_code.']]> + ausbildungcode.']]> + zgv_code.']]> + zgvort.']]> + convertISODate($row->zgvdatum).']]> + zgvdatum.']]> + zgvnation.']]> + zgvmas_code.']]> + zgvmaort.']]> + convertISODate($row->zgvmadatum).']]> + zgvmadatum.']]> + zgvmanation.']]> + ausstellungsstaat.']]> + aufnahmeschluessel.']]> + facheinschlberuf?'true':'false').']]> + reihungstest_id.']]> + convertISODate($row->anmeldungreihungstest).']]> + anmeldungreihungstest.']]> + reihungstestangetreten?'true':'false').']]> + punkte.']]> + bismelden?'true':'false').']]> + + dual?'true':'false').']]> + dual?'Ja':'Nein').']]> + anmerkung.']]> + mentor.']]> + gsstudientyp_kurzbz.']]> + aufnahmegruppe_kurzbz.']]> + priorisierung.']]> + priorisierung.')'.']]> + standort_code.']]> + + '; + } +} + +function draw_empty_content() +{ + echo ' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + '; - } } // ******* Init ************************** @@ -750,19 +863,22 @@ if($xmlformat=='rdf') if($db->db_query($qry)) { - while($row = $db->db_fetch_object()) + while ($row = $db->db_fetch_object()) { - $student=new student(); - if($uid = $student->getUid($row->prestudent_id)) + $student = new student(); + if ($uid = $student->getUid($row->prestudent_id)) { //Wenn kein Eintrag fuers aktuelle Studiensemester da ist, dann //nochmal laden aber ohne studiensemester - if(!$student->load($uid, $studiensemester_kurzbz)) + if (!$student->load($uid, $studiensemester_kurzbz)) + { $student->load($uid); + } } $prestd = new prestudent(); $prestd->load($row->prestudent_id); - if($uid!='') + + if ($uid != '') { draw_content($student); draw_prestudent($prestd); @@ -807,29 +923,38 @@ if($xmlformat=='rdf') matr_nr = ".$db->db_add_param($searchItems_string_orig)." OR svnr = ".$db->db_add_param($searchItems_string_orig).";"; } - if($db->db_query($qry)) + if($result = $db->db_query($qry)) { - while($row = $db->db_fetch_object()) + if ($db->db_num_rows($result) == 0) { - $student=new student(); - if($uid = $student->getUid($row->prestudent_id)) + draw_empty_content(); + } + else + { + while ($row = $db->db_fetch_object()) { - //Wenn kein Eintrag fuers aktuelle Studiensemester da ist, dann - //nochmal laden aber ohne studiensemester - if(!$student->load($uid, $studiensemester_kurzbz)) - $student->load($uid); - } - $prestd = new prestudent(); - $prestd->load($row->prestudent_id); - if($uid!='') - { - draw_content($student); - draw_prestudent($prestd); - } - else - { - draw_content($prestd); - draw_prestudent($prestd); + $student = new student(); + if ($uid = $student->getUid($row->prestudent_id)) + { + //Wenn kein Eintrag fuers aktuelle Studiensemester da ist, dann + //nochmal laden aber ohne studiensemester + if (!$student->load($uid, $studiensemester_kurzbz)) + { + $student->load($uid); + } + } + $prestd = new prestudent(); + $prestd->load($row->prestudent_id); + if ($uid != '') + { + draw_content($student); + draw_prestudent($prestd); + } + else + { + draw_content($prestd); + draw_prestudent($prestd); + } } } } @@ -901,7 +1026,19 @@ else default: $typ = 'FH-Studiengang'; } - $qry = "SELECT * FROM campus.vw_benutzer JOIN public.tbl_benutzerfunktion USING(uid) WHERE funktion_kurzbz='rek'"; + $qry = "SELECT * + FROM PUBLIC.tbl_benutzerfunktion + JOIN campus.vw_mitarbeiter USING (uid) + WHERE funktion_kurzbz = 'rek' + AND ( + tbl_benutzerfunktion.datum_von <= now() + OR tbl_benutzerfunktion.datum_von IS NULL + ) + AND ( + tbl_benutzerfunktion.datum_bis >= now() + OR tbl_benutzerfunktion.datum_bis IS NULL + ) + ORDER BY tbl_benutzerfunktion.insertamum DESC LIMIT 1"; $rektor = ''; if($db->db_query($qry)) { diff --git a/rdf/studienblatt.xml.php b/rdf/studienblatt.xml.php index 0aa752637..790f351e5 100644 --- a/rdf/studienblatt.xml.php +++ b/rdf/studienblatt.xml.php @@ -154,6 +154,8 @@ foreach($uid_arr as $uid) echo "\t\t"; echo "\t\tects."]]>"; echo "\t\tregelstudiendauer!=0?$studienordnung->ects/$studienplan->regelstudiendauer:0)."]]>"; + echo "\t\tects_stpl."]]>"; + echo "\t\tregelstudiendauer!=0?$studienplan->ects_stpl/$studienplan->regelstudiendauer:0)."]]>"; echo "\t\t"; $status_aktuell = ($prestudent->getLastStatus($student->prestudent_id,null,null))?$prestudent->status_kurzbz:''; diff --git a/soap/datenverbund_client.php b/soap/datenverbund_client.php index a3b0982f8..01cdddaa2 100644 --- a/soap/datenverbund_client.php +++ b/soap/datenverbund_client.php @@ -26,6 +26,8 @@ require_once('../include/basis_db.class.php'); require_once('../include/benutzerberechtigung.class.php'); require_once('../include/dvb.class.php'); require_once('../include/errorhandler.class.php'); +require_once('../include/person.class.php'); +require_once('../include/adresse.class.php'); $uid = get_uid(); $rechte = new benutzerberechtigung(); @@ -63,12 +65,80 @@ $ausstellbehoerde = filter_input(INPUT_POST, 'ausstellbehoerde'); $ausstellland = filter_input(INPUT_POST, 'ausstellland'); $dokumentnr = filter_input(INPUT_POST, 'dokumentnr'); +$getPersonData = filter_input(INPUT_POST, 'getPersonData', FILTER_VALIDATE_BOOLEAN); +$data_person_id = filter_input(INPUT_POST, 'data_person_id'); +if ($getPersonData) +{ + $person = new person($data_person_id); + $adresse = new adresse(); + $adresse->loadZustellAdresse($person->person_id); + $svnr = $person->svnr; + if ($svnr == '' && $person->ersatzkennzeichen != '') + { + $svnr = $person->ersatzkennzeichen; + } + + echo json_encode(array( + 'status'=>'ok', + 'matrikelnummer'=>$person->matr_nr, + 'nachname'=>$person->nachname, + 'vorname'=>$person->vorname, + 'geburtsdatum'=>str_replace('-','',$person->gebdatum), + 'geschlecht'=>strtoupper($person->geschlecht), + 'postleitzahl'=>$adresse->plz, + 'staat'=>$adresse->nation, + 'sozialversicherungsnummer'=>$svnr + )); + + exit(); +} + ?> Datenverbund-Client + +

Testclient für Datenverbund-Webservice

    @@ -195,6 +265,7 @@ $dokumentnr = filter_input(INPUT_POST, 'dokumentnr'); break; case 'setMatrikelnummer': + echo '

    '; printSetMatrikelnrRows(); printrow('staat', 'Staat', $staat, '1-3 Stellen Codex (zb A für Österreich)', 3); printrow('svnr', 'SVNR', $svnr); diff --git a/soap/stip.class.php b/soap/stip.class.php index 2787dfac3..2c17ad77f 100644 --- a/soap/stip.class.php +++ b/soap/stip.class.php @@ -173,7 +173,7 @@ class stip extends basis_db * Suche Studenten anhand PersonKz * @param $PersonKz */ - function searchMatrikelnummerStg($Matrikelnummer, $StgKz) + function searchMatrikelnummerStg($Matrikelnummer, $StgKz, $studSemester) { $qry = "SELECT prestudent_id, vorname, nachname, svnr, matrikelnr, student.studiengang_kz, person.matr_nr @@ -183,20 +183,35 @@ class stip extends basis_db JOIN public.tbl_person person using(person_id) WHERE person.matr_nr = ".$this->db_add_param($Matrikelnummer)." - AND student.studiengang_kz=".$this->db_add_param(ltrim($StgKz,0)).";"; + AND student.studiengang_kz=".$this->db_add_param(ltrim($StgKz,0))." + AND EXISTS( + SELECT 1 FROM public.tbl_prestudentstatus + WHERE + prestudent_id=student.prestudent_id + AND studiensemester_kurzbz=".$this->db_add_param($studSemester)." + );"; if($this->db_query($qry)) { - if($row = $this->db_fetch_object()) + // wenn mehr als 1 Datensatz gefunden wird --> Fehler + if($this->db_num_rows() == 1 ) { - $this->Vorname_Antwort = $row->vorname; - $this->Familienname_Antwort = $row->nachname; - $this->SVNR_Antwort = $row->svnr; - $this->PersKz_Antwort = trim($row->matrikelnr); - $this->StgKz_Antwort = str_pad($row->studiengang_kz, 4,'0', STR_PAD_LEFT); - $this->Matrikelnummer_Antwort = $row->matr_nr; - $this->AntwortStatusCode = 1; - return $row->prestudent_id; + if($row = $this->db_fetch_object()) + { + $this->Vorname_Antwort = $row->vorname; + $this->Familienname_Antwort = $row->nachname; + $this->SVNR_Antwort = $row->svnr; + $this->PersKz_Antwort = trim($row->matrikelnr); + $this->StgKz_Antwort = str_pad($row->studiengang_kz, 4,'0', STR_PAD_LEFT); + $this->Matrikelnummer_Antwort = $row->matr_nr; + $this->AntwortStatusCode = 1; + return $row->prestudent_id; + } + else + { + $this->AntwortStatusCode = 2; + return false; + } } else { @@ -215,7 +230,7 @@ class stip extends basis_db * Suche Studenten anhand Sozialversicherungsnummer * @param $Svnr */ - function searchSvnr($Svnr) + function searchSvnr($Svnr, $StgKz, $studSemester) { $qry = "SELECT prestudent_id, vorname, nachname, svnr, matrikelnr, student.studiengang_kz, person.matr_nr @@ -223,7 +238,18 @@ class stip extends basis_db public.tbl_student student JOIN public.tbl_benutzer benutzer on(benutzer.uid=student.student_uid) JOIN public.tbl_person person using(person_id) - WHERE person.svnr = ".$this->db_add_param($Svnr).";"; + WHERE person.svnr = ".$this->db_add_param($Svnr); + + if ($StgKz != '') + $qry.=" AND student.studiengang_kz=".$this->db_add_param($StgKz); + + if ($studSemester != '') + $qry.=" AND EXISTS( + SELECT 1 FROM public.tbl_prestudentstatus + WHERE + prestudent_id=student.prestudent_id + AND studiensemester_kurzbz=".$this->db_add_param($studSemester)." + )"; if($this->db_query($qry)) { @@ -266,7 +292,7 @@ class stip extends basis_db * Suche Studenten anhand Vor- und Nachname * @param $Svnr */ - function searchVorNachname($Vorname, $Nachname) + function searchVorNachname($Vorname, $Nachname, $StgKz, $studSemester) { $qry = "SELECT prestudent_id, vorname, nachname, svnr, matrikelnr, student.studiengang_kz, person.matr_nr @@ -276,7 +302,18 @@ class stip extends basis_db JOIN public.tbl_person person using(person_id) WHERE person.vorname = ".$this->db_add_param($Vorname)." - AND person.nachname = ".$this->db_add_param($Nachname).";"; + AND person.nachname = ".$this->db_add_param($Nachname); + + if ($StgKz != '') + $qry.=" AND student.studiengang_kz=".$this->db_add_param($StgKz); + + if ($studSemester != '') + $qry.=" AND EXISTS( + SELECT 1 FROM public.tbl_prestudentstatus + WHERE + prestudent_id=student.prestudent_id + AND studiensemester_kurzbz=".$this->db_add_param($studSemester)." + )"; if($this->db_query($qry)) { diff --git a/soap/stip.soap.php b/soap/stip.soap.php index c2ae5eeea..8962dc103 100644 --- a/soap/stip.soap.php +++ b/soap/stip.soap.php @@ -117,11 +117,11 @@ function GetStipendienbezieherStip($parameters) if(!$prestudentID = $StipBezieher->searchPersonKz($BezieherStip->PersKz)) { - if(!$prestudentID = $StipBezieher->searchMatrikelnummerStg($BezieherStip->Matrikelnummer, $BezieherStip->StgKz)) + if(!$prestudentID = $StipBezieher->searchMatrikelnummerStg($BezieherStip->Matrikelnummer, $BezieherStip->StgKz, $studSemester)) { - if(!$prestudentID = $StipBezieher->searchSvnr($BezieherStip->SVNR)) + if(!$prestudentID = $StipBezieher->searchSvnr($BezieherStip->SVNR, $BezieherStip->StgKz, $studSemester)) { - $prestudentID = $StipBezieher->searchVorNachname($BezieherStip->Vorname, $BezieherStip->Familienname); + $prestudentID = $StipBezieher->searchVorNachname($BezieherStip->Vorname, $BezieherStip->Familienname, $BezieherStip->StgKz, $studSemester); } } } diff --git a/system/account_deaktivierung_mail.php b/system/account_deaktivierung_mail.php index 8668290d7..ede3f1f2f 100644 --- a/system/account_deaktivierung_mail.php +++ b/system/account_deaktivierung_mail.php @@ -1,5 +1,7 @@ and * Rudolf Hangl . */ -/* - * - Dieses Script versendet automatisch Mails an Accounts die Deaktiviert wurden. - * und informiert die Benutzer ueber die Folgen der Deaktivierung - * + +/** + * Dieses Script versendet automatisch Mails an Accounts die Deaktiviert wurden. + * und informiert die Benutzer ueber die Folgen der Deaktivierung */ -require_once('../config/vilesci.config.inc.php'); -require_once('../include/basis_db.class.php'); -require_once('../include/mail.class.php'); + +require_once(dirname(__FILE__).'/../config/vilesci.config.inc.php'); +require_once(dirname(__FILE__).'/../include/basis_db.class.php'); +require_once(dirname(__FILE__).'/../include/mail.class.php'); $db = new basis_db(); -$text=''; -$wochen_zum_entfernen=1; -echo ' - - - Account Deaktivierung - Infomails - - - -

    Account Deaktivierung - Infomails

    '; +$text = ''; +$wochen_zum_entfernen = 1; // Alle die vor einer Woche inaktiv gesetzt wurden darueber informieren -$qry = "SELECT uid, (SELECT mitarbeiter_uid FROM public.tbl_mitarbeiter WHERE mitarbeiter_uid=uid) as mitarbeiter FROM public.tbl_benutzer WHERE aktiv=false AND updateaktivam=CURRENT_DATE- interval '".$wochen_zum_entfernen." week'"; -if($result = $db->db_query($qry)) +$qry = "SELECT uid, + (SELECT mitarbeiter_uid FROM public.tbl_mitarbeiter WHERE mitarbeiter_uid = uid) as mitarbeiter + FROM public.tbl_benutzer + WHERE aktiv = false + AND updateaktivam = CURRENT_DATE - interval '".$wochen_zum_entfernen." week'"; + +if ($result = $db->db_query($qry)) { - while($row = $db->db_fetch_object($result)) + while ($row = $db->db_fetch_object($result)) { - if($row->mitarbeiter!='') + if ($row->mitarbeiter != '') { - //Mitarbeiter + // Mitarbeiter $message = "Dies ist eine automatische Nachricht!\n"; $message .= "\n"; - $message .= "Wir möchten Sie darauf aufmerksam machen, dass Ihr Benutzerdatensatz deaktiviert wurde. Durch diese Deaktivierung wurden Sie auch aus allen Email-Verteilern gelöscht. \n\n"; - $message .= "Sollte innerhalb von 12 Monaten nach der Deaktivierung keine neuerliche Aktivierung Ihres Benutzerdatensatzes erfolgen, dann werden automatisch auch\n"; + $message .= "Wir möchten Sie darauf aufmerksam machen, dass Ihr Benutzerdatensatz deaktiviert wurde. + Durch diese Deaktivierung wurden Sie auch aus allen Email-Verteilern gelöscht. \n\n"; + $message .= "Sollte innerhalb von 12 Monaten nach der Deaktivierung keine neuerliche Aktivierung Ihres + Benutzerdatensatzes erfolgen, dann werden automatisch auch\n"; $message .= " - Ihr Account, \n"; $message .= " - Ihre Mailbox (inkl. aller E-Mails) und\n"; $message .= " - Ihr Home-Verzeichnis (inkl. aller Dateien) gelöscht werden.\n"; $message .= "\n"; - $message .= "Falls es sich bei der Deaktivierung um einen Irrtum handelt, würden wir Sie bitten, sich umgehend mit den KollegInnen in der Personalabteilung in Verbindung zu setzen: "; + $message .= "Falls es sich bei der Deaktivierung um einen Irrtum handelt, würden wir Sie bitten, + sich umgehend mit den KollegInnen in der Personalabteilung in Verbindung zu setzen: "; $message .= "Frau Natalie König, natalie.koenig@technikum-wien.at\n"; $message .= "\n"; $message .= "Mit freundlichen Grüßen\n"; @@ -66,21 +69,25 @@ if($result = $db->db_query($qry)) $message .= "Höchstädtplatz 6\n"; $message .= "1200 Wien \n"; $message .= "\n"; - $message .= "Falls Sie weiterhin über Neuigkeiten an der FH Technikum Wien informiert werden wollen, können Sie unter www.technikum-wien.at/newsletter den kostenlosen Newsletter abonnieren."; + $message .= "Falls Sie weiterhin über Neuigkeiten an der FH Technikum Wien informiert werden wollen, + können Sie unter www.technikum-wien.at/newsletter den kostenlosen Newsletter abonnieren."; } else { - //Student + // Student $message = "Dies ist eine automatische Nachricht!\n"; $message .= "\n"; - $message .= "Wir möchten Sie darauf aufmerksam machen, dass Ihr Benutzerdatensatz deaktiviert wurde. Durch diese Deaktivierung wurden Sie auch aus allen Email-Verteilern gelöscht.\n"; + $message .= "Wir möchten Sie darauf aufmerksam machen, dass Ihr Benutzerdatensatz deaktiviert wurde. + Durch diese Deaktivierung wurden Sie auch aus allen Email-Verteilern gelöscht.\n"; $message .= "\n"; - $message .= "Sollte innerhalb von 6 Monaten (für Studierende) bzw. 3 Wochen (für AbbrecherInnen) nach der Deaktivierung keine neuerliche Aktivierung Ihres Benutzerdatensatzes erfolgen, dann werden automatisch auch\n"; + $message .= "Sollte innerhalb von 6 Monaten (für Studierende) bzw. 3 Wochen (für AbbrecherInnen) nach der + Deaktivierung keine neuerliche Aktivierung Ihres Benutzerdatensatzes erfolgen, dann werden automatisch auch\n"; $message .= " - Ihr Account,\n"; $message .= " - Ihre Mailbox (inkl. aller E-Mails) und\n"; $message .= " - Ihr Home-Verzeichnis (inkl. aller Dateien) gelöscht werden.\n"; $message .= "\n"; - $message .= "Falls es sich bei der Deaktivierung um einen Irrtum handelt, würden wir Sie bitten, sich umgehend mit Ihrer Studiengangsassistenz in Verbindung zu setzen.\n"; + $message .= "Falls es sich bei der Deaktivierung um einen Irrtum handelt, würden wir Sie bitten, + sich umgehend mit Ihrer Studiengangsassistenz in Verbindung zu setzen.\n"; $message .= "\n"; $message .= "Mit freundlichen Grüßen\n"; $message .= "\n"; @@ -88,35 +95,44 @@ if($result = $db->db_query($qry)) $message .= "Höchstädtplatz 6\n"; $message .= "1200 Wien\n"; $message .= "\n"; - $message .= "Falls Sie weiterhin über Neuigkeiten an der FH Technikum Wien informiert werden wollen, können Sie unter www.technikum-wien.at/newsletter den kostenlosen Newsletter abonnieren.\n"; + $message .= "Falls Sie weiterhin über Neuigkeiten an der FH Technikum Wien informiert werden wollen, + können Sie unter www.technikum-wien.at/newsletter den kostenlosen Newsletter abonnieren.\n"; } $to = $row->uid.'@'.DOMAIN; - $mail = new mail($to,'no-reply@'.DOMAIN,'Ihr Datensatz wurde deaktiviert! '.$row->uid, $message); - $mail->send(); - $text.= "Warnung zur Accountloeschung wurde an $row->uid verschickt\n"; + $mail = new mail($to, 'no-reply@'.DOMAIN, 'Ihr Datensatz wurde deaktiviert! '.$row->uid, $message); + if ($mail->send()) + $text .= "Warnung zur Accountloeschung wurde an $row->uid verschickt\n"; + else + $text .= "Fehler beim Senden des Mails an $to: ".$message; } } // Letzte Warnung vor Accountloeschung verschicken // Abbrecher -$qry = "SELECT uid FROM public.tbl_benutzer JOIN public.tbl_student ON(uid=student_uid) WHERE - aktiv=false AND updateaktivam=CURRENT_DATE- interval '".DEL_ABBRECHER_WEEKS." week' - AND get_rolle_prestudent (prestudent_id, NULL)='Abbrecher' "; -if($result = $db->db_query($qry)) +$qry = "SELECT uid + FROM public.tbl_benutzer + JOIN public.tbl_student ON(uid=student_uid) + WHERE aktiv = false + AND updateaktivam = CURRENT_DATE - interval '".DEL_ABBRECHER_WEEKS." week' + AND get_rolle_prestudent (prestudent_id, NULL) = 'Abbrecher'"; + +if ($result = $db->db_query($qry)) { - while($row = $db->db_fetch_object($result)) + while ($row = $db->db_fetch_object($result)) { $message = "Dies ist eine automatische Nachricht!\n"; $message .= "\n"; - $message .= "ACHTUNG: Ihr Benutzerdatensatz wurde vor ".(DEL_ABBRECHER_WEEKS > 1?DEL_ABBRECHER_WEEKS." Wochen ":"einer Woche ")."deaktiviert! Sollte innerhalb der nächsten Tage keine neuerliche Aktivierung Ihres Benutzerdatensatzes erfolgen, dann werden automatisch auch\n"; + $message .= "ACHTUNG: Ihr Benutzerdatensatz wurde vor ".(DEL_ABBRECHER_WEEKS > 1?DEL_ABBRECHER_WEEKS." Wochen ":"einer Woche ")."deaktiviert! + Sollte innerhalb der nächsten Tage keine neuerliche Aktivierung Ihres Benutzerdatensatzes erfolgen, dann werden automatisch auch\n"; $message .= " - Ihr Account,\n"; $message .= " - Ihre Mailbox (inkl. aller E-Mails) und\n"; $message .= " - Ihr Home-Verzeichnis (inkl. aller Dateien) gelöscht werden.\n"; $message .= "\n"; - $message .= "Falls es sich bei der Deaktivierung um einen Irrtum handelt, würden wir Sie bitten, sich umgehend mit Ihrer Studiengangsassistenz in Verbindung zu setzen.\n"; + $message .= "Falls es sich bei der Deaktivierung um einen Irrtum handelt, würden wir Sie bitten, sich umgehend mit Ihrer + Studiengangsassistenz in Verbindung zu setzen.\n"; $message .= "\n"; $message .= "Mit freundlichen Grüßen\n"; $message .= "\n"; @@ -124,61 +140,84 @@ if($result = $db->db_query($qry)) $message .= "Höchstädtplatz 6\n"; $message .= "1200 Wien \n"; $message .= "\n"; - $message .= "Falls Sie weiterhin über Neuigkeiten an der FH Technikum Wien informiert werden wollen, können Sie unter www.technikum-wien.at/newsletter den kostenlosen Newsletter abonnieren.\n"; + $message .= "Falls Sie weiterhin über Neuigkeiten an der FH Technikum Wien informiert werden wollen, + können Sie unter www.technikum-wien.at/newsletter den kostenlosen Newsletter abonnieren.\n"; $to = $row->uid.'@'.DOMAIN; - $mail = new mail($to,'no-reply@'.DOMAIN,'Ihr Datensatz wurde deaktiviert! Letzte Warnung '.$row->uid, $message); - $mail->send(); - $text.= "Letzte Warnung zur Accountloeschung wurde an $row->uid verschickt\n"; + $mail = new mail($to, 'no-reply@'.DOMAIN, 'Ihr Datensatz wurde deaktiviert! Letzte Warnung '.$row->uid, $message); + if ($mail->send()) + $text .= "Letzte Warnung zur Accountloeschung wurde an $row->uid verschickt\n"; + else + $text .= "Fehler beim Senden des Mails an $to: ".$message; } } - // Abbrecher an Bibliothek melden wenn diese inaktiv gesetzt wurden -$qry = "SELECT uid, vorname, nachname, titelpre, titelpost FROM public.tbl_benutzer JOIN public.tbl_student ON(uid=student_uid) JOIN public.tbl_person USING(person_id) WHERE - tbl_benutzer.aktiv=false AND tbl_benutzer.updateaktivam=(CURRENT_DATE - '1 day'::interval)::date - AND get_rolle_prestudent (prestudent_id, NULL)='Abbrecher' "; -if($result = $db->db_query($qry)) + +$qry = "SELECT uid, + vorname, + nachname, + titelpre, + titelpost + FROM public.tbl_benutzer + JOIN public.tbl_student ON (uid = student_uid) + JOIN public.tbl_person USING (person_id) + WHERE tbl_benutzer.aktiv = false + AND tbl_benutzer.updateaktivam = (CURRENT_DATE - '1 day'::interval)::date + AND get_rolle_prestudent (prestudent_id, NULL) = 'Abbrecher'"; + +if ($result = $db->db_query($qry)) { - if($db->db_num_rows($result)>0) + if ($db->db_num_rows($result) > 0) { $message = "Dies ist eine automatische Nachricht!\n\n"; - $message.= "Die folgenden Studierenden wurden als Abbrecher eingetragen:\n\n"; - while($row = $db->db_fetch_object($result)) + $message .= "Die folgenden Studierenden wurden als Abbrecher eingetragen:\n\n"; + + while ($row = $db->db_fetch_object($result)) { - $message.=trim($row->titelpre.' '.$row->vorname.' '.$row->nachname.' '.$row->titelpost).' ( '.$row->uid.'@'.DOMAIN." )\n"; + $message .= trim($row->titelpre.' '.$row->vorname.' '.$row->nachname.' '.$row->titelpost).' ( '.$row->uid.'@'.DOMAIN." )\n"; } + $message .= "\nMit freundlichen Grüßen\n"; $message .= "\n"; $message .= "Fachhochschule Technikum Wien\n"; $message .= "Höchstädtplatz 6\n"; $message .= "1200 Wien \n"; $to = 'wienerro@technikum-wien.at, astfaell@technikum-wien.at, olensky@technikum-wien.at'; - $mail = new mail($to,'no-reply@'.DOMAIN,'Abbrecher Information', $message); - if($mail->send()) - $text.="Abbrecher Infomail an $to verschickt\n"; + + $mail = new mail($to, 'no-reply@'.DOMAIN, 'Abbrecher Information', $message); + if ($mail->send()) + $text .= "Abbrecher Infomail an $to verschickt\n"; else - $text.="Fehler beim Versenden des Abbrecher Infomails an $to !\n"; + $text .= "Fehler beim Senden des Mails an $to: ".$message; } } // Studenten -$qry = "SELECT uid FROM public.tbl_benutzer JOIN public.tbl_student ON(uid=student_uid) WHERE - aktiv=false AND updateaktivam=CURRENT_DATE- interval '".DEL_STUDENT_WEEKS." week' - AND get_rolle_prestudent (prestudent_id, NULL)<>'Abbrecher'"; -if($result = $db->db_query($qry)) + +$qry = "SELECT uid + FROM public.tbl_benutzer + JOIN public.tbl_student ON (uid=student_uid) + WHERE aktiv = false + AND updateaktivam = CURRENT_DATE - interval '".DEL_STUDENT_WEEKS." week' + AND get_rolle_prestudent (prestudent_id, NULL) <> 'Abbrecher'"; + +if ($result = $db->db_query($qry)) { - while($row = $db->db_fetch_object($result)) + while ($row = $db->db_fetch_object($result)) { $message = "Dies ist eine automatische Nachricht!\n"; $message .= "\n"; - $message .= "ACHTUNG: Ihr Benutzerdatensatz wurde vor ".(DEL_STUDENT_WEEKS > 1?DEL_STUDENT_WEEKS." Wochen ":"einer Woche ")."deaktiviert! Sollte innerhalb der nächsten Tage keine neuerliche Aktivierung Ihres Benutzerdatensatzes erfolgen, dann werden automatisch auch\n"; + $message .= "ACHTUNG: Ihr Benutzerdatensatz wurde vor ".(DEL_STUDENT_WEEKS > 1?DEL_STUDENT_WEEKS." Wochen ":"einer Woche "). + "deaktiviert! Sollte innerhalb der nächsten Tage keine neuerliche Aktivierung Ihres Benutzerdatensatzes erfolgen, + dann werden automatisch auch\n"; $message .= " - Ihr Account,\n"; $message .= " - Ihre Mailbox (inkl. aller E-Mails) und\n"; $message .= " - Ihr Home-Verzeichnis (inkl. aller Dateien) gelöscht werden\n"; $message .= "\n"; - $message .= "Falls es sich bei der Deaktivierung um einen Irrtum handelt, würden wir Sie bitten, sich umgehend mit Ihrer Studiengangsassistenz in Verbindung zu setzen.\n"; + $message .= "Falls es sich bei der Deaktivierung um einen Irrtum handelt, würden wir Sie bitten, + sich umgehend mit Ihrer Studiengangsassistenz in Verbindung zu setzen.\n"; $message .= "\n"; $message .= "Mit freundlichen Grüßen\n"; $message .= "\n"; @@ -186,32 +225,42 @@ if($result = $db->db_query($qry)) $message .= "Höchstädtplatz 6\n"; $message .= "1200 Wien \n"; $message .= "\n"; - $message .= "Falls Sie weiterhin über Neuigkeiten an der FH Technikum Wien informiert werden wollen, können Sie unter www.technikum-wien.at/newsletter den kostenlosen Newsletter abonnieren.\n"; + $message .= "Falls Sie weiterhin über Neuigkeiten an der FH Technikum Wien informiert werden wollen, + können Sie unter www.technikum-wien.at/newsletter den kostenlosen Newsletter abonnieren.\n"; $to = $row->uid.'@'.DOMAIN; - $mail = new mail($to,'no-reply@'.DOMAIN,'Ihr Datensatz wurde deaktiviert! Letzte Warnung '.$row->uid, $message); - $mail->send(); - $text.= "Letzte Warnung zur Accountloeschung wurde an $row->uid verschickt\n"; + $mail = new mail($to, 'no-reply@'.DOMAIN, 'Ihr Datensatz wurde deaktiviert! Letzte Warnung '.$row->uid, $message); + if ($mail->send()) + $text .= "Letzte Warnung zur Accountloeschung wurde an $row->uid verschickt\n"; + else + $text .= "Fehler beim Versenden des Abbrecher Infomails an $to !\n"; } } // Mitarbeiter -$qry = "SELECT uid FROM public.tbl_benutzer JOIN public.tbl_mitarbeiter ON(uid=mitarbeiter_uid) WHERE - aktiv=false AND updateaktivam=CURRENT_DATE- interval '".DEL_MITARBEITER_WEEKS." week' "; -if($result = $db->db_query($qry)) +$qry = "SELECT uid + FROM public.tbl_benutzer + JOIN public.tbl_mitarbeiter ON (uid = mitarbeiter_uid) + WHERE aktiv = false + AND updateaktivam = CURRENT_DATE - interval '".DEL_MITARBEITER_WEEKS." week' "; + +if ($result = $db->db_query($qry)) { - while($row = $db->db_fetch_object($result)) + while ($row = $db->db_fetch_object($result)) { $message = "Dies ist eine automatische Nachricht!\n"; $message .= "\n"; - $message .= "ACHTUNG: Ihr Benutzerdatensatz wurde vor ".(DEL_MITARBEITER_WEEKS > 1?DEL_MITARBEITER_WEEKS." Wochen ":"einer Woche ")."deaktiviert! Sollte innerhalb der nächsten Tage keine neuerliche Aktivierung Ihres Benutzerdatensatzes erfolgen, dann werden automatisch auch\n"; + $message .= "ACHTUNG: Ihr Benutzerdatensatz wurde vor ".(DEL_MITARBEITER_WEEKS > 1?DEL_MITARBEITER_WEEKS." Wochen ":"einer Woche "). + "deaktiviert! Sollte innerhalb der nächsten Tage keine neuerliche Aktivierung Ihres Benutzerdatensatzes erfolgen, + dann werden automatisch auch\n"; $message .= " - Ihr Account,\n"; $message .= " - Ihre Mailbox (inkl. aller E-Mails) und\n"; $message .= " - Ihr Home-Verzeichnis (inkl. aller Dateien) gelöscht werden\n"; $message .= "\n"; - $message .= "Falls es sich bei der Deaktivierung um einen Irrtum handelt, würden wir Sie bitten, sich umgehend mit den KollegInnen in der Personalabteilung in Verbindung zu setzen: "; + $message .= "Falls es sich bei der Deaktivierung um einen Irrtum handelt, würden wir Sie bitten, + sich umgehend mit den KollegInnen in der Personalabteilung in Verbindung zu setzen: "; $message .= "Frau Natalie König, natalie.koenig@technikum-wien.at\n"; $message .= "\n"; $message .= "Mit freundlichen Grüßen\n"; @@ -220,22 +269,20 @@ if($result = $db->db_query($qry)) $message .= "Höchstädtplatz 6\n"; $message .= "1200 Wien \n"; $message .= "\n"; - $message .= "Falls Sie weiterhin über Neuigkeiten an der FH Technikum Wien informiert werden wollen, können Sie unter www.technikum-wien.at/newsletter den kostenlosen Newsletter abonnieren.\n"; + $message .= "Falls Sie weiterhin über Neuigkeiten an der FH Technikum Wien informiert werden wollen, + können Sie unter www.technikum-wien.at/newsletter den kostenlosen Newsletter abonnieren.\n"; $to = $row->uid.'@'.DOMAIN; - $mail = new mail($to,'no-reply@'.DOMAIN, 'Ihr Datensatz wurde deaktiviert! Letzte Warnung '.$row->uid, $message); - $mail->send(); - $text.= "Letzte Warnung zur Accountloeschung wurde an $row->uid verschickt\n"; + $mail = new mail($to, 'no-reply@'.DOMAIN, 'Ihr Datensatz wurde deaktiviert! Letzte Warnung '.$row->uid, $message); + if ($mail->send()) + $text .= "Letzte Warnung zur Accountloeschung wurde an $row->uid verschickt\n"; + else + $text .= "Fehler beim Versenden des Abbrecher Infomails an $to !\n"; } } -echo nl2br($text); -if($text!='') -{ - $mail = new mail(MAIL_IT.', vilesci@technikum-wien.at', 'vilesci@'.DOMAIN, 'Account Deaktivierung', "Dies ist eine automatische Mail!\nFolgende Warnungen zur Accountloeschung wurden versandt:\n\n".$text); - $mail->send(); -} +echo $text; -echo ''; ?> + diff --git a/system/ampel_erinnerungsmail.php b/system/ampel_erinnerungsmail.php index 02b882965..ae7efc3e1 100644 --- a/system/ampel_erinnerungsmail.php +++ b/system/ampel_erinnerungsmail.php @@ -43,6 +43,12 @@ foreach($ampel->result as $a) $uid = $row->uid; $mail = new mail($uid.'@'.DOMAIN, 'cis@'.DOMAIN, $subject, $message); + + // If message has HTML content + if($message != strip_tags($message)) { + $mail->setHTMLContent(sprintf('%s', $message)); + } + if($mail->send()) echo "Email an $uid versandt\n"; else diff --git a/system/check_neue_lektoren.php b/system/check_neue_lektoren.php index e84953998..43bb38bf5 100644 --- a/system/check_neue_lektoren.php +++ b/system/check_neue_lektoren.php @@ -1,5 +1,7 @@ and * Rudolf Hangl . */ -/* + +/** * Prueft ob am Vortag neue Lektoren einen Lehrauftrag bekommen haben * die vorher noch keinen hatten. * Diese werden dann an die Geschaeftsstelle gemeldet damit diese @@ -27,18 +30,19 @@ * Wenn kein aktuelles Studiensemester vorhanden ist, wird keine * Nachricht versendet. */ -require_once('../config/vilesci.config.inc.php'); -require_once('../include/studiensemester.class.php'); -require_once('../include/mail.class.php'); + +require_once(dirname(__FILE__).'/../config/vilesci.config.inc.php'); +require_once(dirname(__FILE__).'/../include/studiensemester.class.php'); +require_once(dirname(__FILE__).'/../include/mail.class.php'); $stsem = new studiensemester(); -if(!$studiensemester = $stsem->getakt()) +if (!$studiensemester = $stsem->getakt()) die('Es ist kein aktuelles Studiensemester vorhanden -> Versand nicht noetig'); $db = new basis_db(); -//Alle Lektoren holen die am Vortag zu einer Lehreinheit zugeteilt wurden -//und in diesem Studiensemester noch keinen Lehrauftrag haben. +// Alle Lektoren holen die am Vortag zu einer Lehreinheit zugeteilt wurden +// und in diesem Studiensemester noch keinen Lehrauftrag haben. $qry=" SELECT vorname, nachname, titelpre, titelpost, uid FROM public.tbl_person JOIN public.tbl_benutzer USING(person_id) @@ -56,29 +60,33 @@ WHERE uid IN( ) "; -if($result = $db->db_query($qry)) +if ($result = $db->db_query($qry)) { - if($db->db_num_rows($result)>0) + if ($db->db_num_rows($result) > 0) { - $mitarbeiter=''; - while($row = $db->db_fetch_object($result)) + $mitarbeiter = ''; + + while ($row = $db->db_fetch_object($result)) { $mitarbeiter .= trim($row->titelpre.' '.$row->vorname.' '.$row->nachname.' '.$row->titelpost)." ($row->uid)\n"; } + $message = "Dies ist eine automatische Mail!\n"; - $message.= "Folgende Lektoren haben in diesem Studiensemester zum ersten Mal einen Lehrauftrag erhalten:\n\n"; - $message.=$mitarbeiter; + $message .= "Folgende Lektoren haben in diesem Studiensemester zum ersten Mal einen Lehrauftrag erhalten:\n\n"; + $message .= $mitarbeiter; $to = MAIL_GST; - $mail = new mail($to,'vilesci@'.DOMAIN,'Neue Lektoren mit Lehrauftrag', $message); - if($mail->send()) - echo "Mail wurde an $to versandt:
    ".nl2br($message); + $mail = new mail($to, 'vilesci@'.DOMAIN, 'Neue Lektoren mit Lehrauftrag', $message); + if ($mail->send()) + echo "Mail wurde an $to versandt: ".$message; else - echo "Fehler beim Senden des Mails an $to:
    ".nl2br($message); + echo "Fehler beim Senden des Mails an $to: ".$message; } else { echo 'Es sind keine neuen Lektoren hinzugefuegt worden'; } } -?> \ No newline at end of file + +?> + diff --git a/system/check_studentlehrverband.php b/system/check_studentlehrverband.php index 60728ab6f..6546dc872 100644 --- a/system/check_studentlehrverband.php +++ b/system/check_studentlehrverband.php @@ -1,5 +1,7 @@ and * Gerald Simane-Sequens */ -// ************************************ -// * Script zur Pruefung und Korrektur -// * moeglicher Inkonsistenzen -// * -// * - Studenten ohne Prestudent_id werden korrigiert -// * - Inkonsistenzen der Tabellen tbl_studentlehrverband, tbl_student werden korrigiert -// ********************************** + +/** + * Script zur Pruefung und Korrektur + * moeglicher Inkonsistenzen + * + * - Studenten ohne Prestudent_id werden korrigiert + * - Inkonsistenzen der Tabellen tbl_studentlehrverband, tbl_student werden korrigiert + */ + require_once(dirname(__FILE__).'/../config/vilesci.config.inc.php'); require_once(dirname(__FILE__).'/../include/studiensemester.class.php'); require_once(dirname(__FILE__).'/../include/person.class.php'); @@ -38,34 +42,41 @@ require_once(dirname(__FILE__).'/../include/mail.class.php'); $db = new basis_db(); -$anzahl_neue_prestudent_id=0; -$anzahl_fehler_prestudent=0; -$anzahl_gruppenaenderung=0; -$anzahl_gruppenaenderung_fehler=0; -$text=''; -$statistik =''; -$abunterbrecher_verschoben_error=0; -$abunterbrecher_verschoben=0; +$anzahl_neue_prestudent_id = 0; +$anzahl_fehler_prestudent = 0; +$anzahl_gruppenaenderung = 0; +$anzahl_gruppenaenderung_fehler = 0; +$text = ''; +$statistik = ''; +$abunterbrecher_verschoben_error = 0; +$abunterbrecher_verschoben = 0; -// **** -// * Bei Studenten mit fehlener Prestudent_id wird die passende id ermittelt und Eingetragen -// **** -$qry = "SELECT student_uid, studiengang_kz FROM public.tbl_student WHERE prestudent_id is null"; -if($result = $db->db_query($qry)) +// Bei Studenten mit fehlener Prestudent_id wird die passende id ermittelt und Eingetragen +$qry = "SELECT student_uid, studiengang_kz FROM public.tbl_student WHERE prestudent_id IS NULL"; + +if ($result = $db->db_query($qry)) { - $text.="Suche Studenten mit fehlender Prestudent_id ...\n\n"; + $text .= "Suche Studenten mit fehlender Prestudent_id ...\n\n"; - while($row = $db->db_fetch_object($result)) + while ($row = $db->db_fetch_object($result)) { - $qry_id = "SELECT tbl_prestudent.prestudent_id FROM campus.vw_student JOIN public.tbl_prestudent USING(person_id) WHERE uid=".$db->db_add_param($row->student_uid)." AND tbl_prestudent.studiengang_kz=".$db->db_add_param($row->studiengang_kz); - if($result_id = $db->db_query($qry_id)) + $qry_id = "SELECT tbl_prestudent.prestudent_id + FROM campus.vw_student + JOIN public.tbl_prestudent USING(person_id) + WHERE uid = ".$db->db_add_param($row->student_uid)." + AND tbl_prestudent.studiengang_kz = ".$db->db_add_param($row->studiengang_kz); + + if ($result_id = $db->db_query($qry_id)) { - if($db->db_num_rows($result_id)==1) + if ($db->db_num_rows($result_id) == 1) { - if($row_id = $db->db_fetch_object($result_id)) + if ($row_id = $db->db_fetch_object($result_id)) { - $qry_upd = "UPDATE public.tbl_student SET prestudent_id=".$db->db_add_param($row_id->prestudent_id)." WHERE student_uid=".$db->db_add_param($row->student_uid); - if($db->db_query($qry_upd)) + $qry_upd = "UPDATE public.tbl_student + SET prestudent_id = ".$db->db_add_param($row_id->prestudent_id)." + WHERE student_uid = ".$db->db_add_param($row->student_uid); + + if ($db->db_query($qry_upd)) { $text .= "Prestudent_id von $row->student_uid wurde auf $row_id->prestudent_id gesetzt\n"; $anzahl_neue_prestudent_id++; @@ -77,12 +88,12 @@ if($result = $db->db_query($qry)) $anzahl_fehler_prestudent++; } } - elseif($db->db_num_rows($result_id)>1) + elseif ($db->db_num_rows($result_id) > 1) { $text .= "Student $row->student_uid hat keine Prestudent_id und MEHRERE passende Prestudenteintraege\n"; $anzahl_fehler_prestudent++; } - elseif($db->db_num_rows($result_id)==0) + elseif( $db->db_num_rows($result_id) == 0) { $text .= "Student $row->student_uid hat keine Prestudent_id und KEINE passenden Prestudenteintraege\n"; $anzahl_fehler_prestudent++; @@ -90,20 +101,18 @@ if($result = $db->db_query($qry)) } else { - $text.="Fehler bei Abfrage:".$db->db_last_error()."\n"; + $text .= "Fehler bei Abfrage:".$db->db_last_error()."\n"; $anzahl_fehler_prestudent++; } } } -// ***** -// * Gruppenzuteilung von Abbrechern und Unterbrechern korrigieren. -// * Abbrecher werden in die Gruppe 0A verschoben -// * Unterbrecher in die Gruppe 0B -// ***** -$text.="\n\nKorrigiere Gruppenzuteilungen von Ab-/Unterbrechern\n"; +// Gruppenzuteilung von Abbrechern und Unterbrechern korrigieren. +// Abbrecher werden in die Gruppe 0A verschoben +// Unterbrecher in die Gruppe 0B +$text .= "\n\nKorrigiere Gruppenzuteilungen von Ab-/Unterbrechern\n"; -//Alle Ab-/Unterbrecher holen die nicht im 0. Semester sind +// Alle Ab-/Unterbrecher holen die nicht im 0. Semester sind $qry = "SELECT student_uid, tbl_student.studiengang_kz, @@ -133,19 +142,19 @@ $qry = "SELECT ) "; -if($result = $db->db_query($qry)) +if ($result = $db->db_query($qry)) { - while($row = $db->db_fetch_object($result)) + while ($row = $db->db_fetch_object($result)) { - //Eintrag nur korrigieren wenn der Abbrecher/Unterbrecher Status der letzte in diesem Studiensemester ist + // Eintrag nur korrigieren wenn der Abbrecher/Unterbrecher Status der letzte in diesem Studiensemester ist $prestd = new prestudent(); $prestd->getLastStatus($row->prestudent_id, $row->studiensemester_kurzbz); - if($prestd->status_kurzbz=='Unterbrecher' || $prestd->status_kurzbz=='Abbrecher') + if ($prestd->status_kurzbz == 'Unterbrecher' || $prestd->status_kurzbz == 'Abbrecher') { - //Studentlehrverbandeintrag aktualisieren + // Studentlehrverbandeintrag aktualisieren $student = new student(); - if($student->studentlehrverband_exists($row->student_uid, $row->studiensemester_kurzbz)) + if ($student->studentlehrverband_exists($row->student_uid, $row->studiensemester_kurzbz)) $student->new = false; else { @@ -158,47 +167,45 @@ if($result = $db->db_query($qry)) $student->studiensemester_kurzbz=$row->studiensemester_kurzbz; $student->studiengang_kz = $row->studiengang_kz; $student->semester = '0'; - $student->verband = ($prestd->status_kurzbz=='Unterbrecher'?'B':'A'); + $student->verband = ($prestd->status_kurzbz == 'Unterbrecher' ? 'B' : 'A'); $student->gruppe = ' '; $student->updateamum = date('Y-m-d H:i:s'); $student->updatevon = 'chkstudentlvb'; - //Pruefen ob der Lehrverband exisitert, wenn nicht dann wird er angelegt + // Pruefen ob der Lehrverband exisitert, wenn nicht dann wird er angelegt $lehrverband = new lehrverband(); - if(!$lehrverband->exists($student->studiengang_kz, $student->semester, $student->verband, $student->gruppe)) + if (!$lehrverband->exists($student->studiengang_kz, $student->semester, $student->verband, $student->gruppe)) { $lehrverband->studiengang_kz = $student->studiengang_kz; $lehrverband->semester = $student->semester; $lehrverband->verband = $student->verband; $lehrverband->gruppe = $student->gruppe; - $lehrverband->bezeichnung = ($student->verband=='A'?'Abbrecher':'Unterbrecher'); + $lehrverband->bezeichnung = ($student->verband == 'A' ? 'Abbrecher' : 'Unterbrecher'); $lehrverband->save(true); } - if($student->save_studentlehrverband()) + if ($student->save_studentlehrverband()) { - $text.="Student $student->uid wurde im $row->studiensemester_kurzbz in die Gruppe $student->semester$student->verband verschoben\n"; + $text .= "Student $student->uid wurde im $row->studiensemester_kurzbz in die Gruppe $student->semester$student->verband verschoben\n"; $abunterbrecher_verschoben++; } else { - $text.="Fehler biem Speichern des Lehrverbandeintrages bei $student->student_uid:".$student->errormsg."\n"; + $text .= "Fehler biem Speichern des Lehrverbandeintrages bei $student->student_uid:".$student->errormsg."\n"; $abunterbrecher_verschoben_error++; } } } } -// ***** -// * Unterschiedliche Gruppenzuteilungen in tbl_studentlehrverband - tbl_student korrigieren -// ***** +// Unterschiedliche Gruppenzuteilungen in tbl_studentlehrverband - tbl_student korrigieren $stsem = new studiensemester(); $stsem = $stsem->getNearest(); -$text.="\n\nKorrigiere Inkonsitenzen in den Tabellen tbl_studentlehrverband, tbl_student (Verwendetes Studiensemester: $stsem)\n\n"; +$text .= "\n\nKorrigiere Inkonsitenzen in den Tabellen tbl_studentlehrverband, tbl_student (Verwendetes Studiensemester: $stsem)\n\n"; $qry = "SELECT tbl_student.studiengang_kz as studiengang_kz_old, @@ -221,25 +228,33 @@ $qry = "SELECT tbl_student.gruppe<>tbl_studentlehrverband.gruppe )"; -if($result = $db->db_query($qry)) +if ($result = $db->db_query($qry)) { - while($row = $db->db_fetch_object($result)) + while ($row = $db->db_fetch_object($result)) { - $qry = "UPDATE public.tbl_student SET studiengang_kz=".$db->db_add_param($row->studiengang_kz).", semester=".$db->db_add_param($row->semester).", verband=".$db->db_add_param($row->verband).", gruppe=".$db->db_add_param($row->gruppe)." WHERE student_uid=".$db->db_add_param($row->student_uid); - if($db->db_query($qry)) + $qry = "UPDATE public.tbl_student + SET studiengang_kz = ".$db->db_add_param($row->studiengang_kz).", + semester = ".$db->db_add_param($row->semester).", + verband = ".$db->db_add_param($row->verband).", + gruppe = ".$db->db_add_param($row->gruppe)." + WHERE student_uid = ".$db->db_add_param($row->student_uid); + + if ($db->db_query($qry)) { - $text .= "Bei Student $row->student_uid wurde die Gruppenzuordnung von $row->studiengang_kz_old/$row->semester_old/$row->verband_old/$row->gruppe_old auf $row->studiengang_kz/$row->semester/$row->verband/$row->gruppe geaendert\n"; + $text .= "Bei Student $row->student_uid wurde die Gruppenzuordnung + von $row->studiengang_kz_old/$row->semester_old/$row->verband_old/$row->gruppe_old + auf $row->studiengang_kz/$row->semester/$row->verband/$row->gruppe geaendert\n"; $anzahl_gruppenaenderung++; } else { - $text.="Fehler beim Aendern der Gruppe: ".$db->db_last_error()."\n"; + $text .= "Fehler beim Aendern der Gruppe: ".$db->db_last_error()."\n"; $anzahl_gruppenaenderung_fehler++; } } } else - $text.="Fehler bei Abfrage".$db->db_last_error(); + $text .= "Fehler bei Abfrage: ".$db->db_last_error(); $statistik .= "Prestudent_id wurde bei $anzahl_neue_prestudent_id Studenten korrigiert\n"; $statistik .= "$anzahl_fehler_prestudent Fehler sind bei der Korrektur der Prestudent_id aufgetreten\n"; @@ -250,11 +265,12 @@ $statistik .= "$anzahl_gruppenaenderung_fehler Fehler sind bei der Korrektur der $statistik .= "\n\n"; $mail = new mail(MAIL_ADMIN, 'vilesci@'.DOMAIN, 'CHECK Studentlehrverband', $statistik.$text); -if($mail->send()) +if ($mail->send()) echo 'Mail an '.MAIL_ADMIN.' wurde versandt'; else echo 'Fehler beim Versenden des Mails an '.MAIL_ADMIN; -echo nl2br("\n\n".$statistik.$text); +echo "\n\n".$statistik.$text; ?> + diff --git a/system/dbupdate_3.3.php b/system/dbupdate_3.3.php index bb8966879..db1f84ec4 100644 --- a/system/dbupdate_3.3.php +++ b/system/dbupdate_3.3.php @@ -532,6 +532,46 @@ if($result = @$db->db_query("SELECT 1 FROM lehre.tbl_note WHERE anmerkung = 'ue' } } +// Note "intern angerechnet" hinzufügen +if($result = @$db->db_query("SELECT 1 FROM lehre.tbl_note WHERE anmerkung = 'iar' AND (bezeichnung = 'intern angerechnet' OR bezeichnung = 'Intern angerechnet');")) +{ + if($db->db_num_rows($result) == 0) + { + $qry = " + INSERT INTO + lehre.tbl_note(note, bezeichnung, anmerkung, farbe, positiv, notenwert, aktiv, lehre, offiziell, bezeichnung_mehrsprachig, lkt_ueberschreibbar) + VALUES( + (SELECT max(note)+1 FROM lehre.tbl_note),'intern angerechnet', 'iar', NULL, TRUE, NULL, TRUE, FALSE, FALSE, '{\"intern angerechnet\",\"internally credited\"}', FALSE + ); + "; + + if(!$db->db_query($qry)) + echo 'lehre.tbl_note: '.$db->db_last_error().'
    '; + else + echo '
    lehre.tbl_note: Note intern angerechnet hinzugefuegt!
    '; + } +} + +// Note "nicht zugelassen" hinzufügen +if($result = @$db->db_query("SELECT 1 FROM lehre.tbl_note WHERE anmerkung = 'nz' AND (bezeichnung = 'nicht zugelassen' OR bezeichnung = 'Nicht zugelassen');")) +{ + if($db->db_num_rows($result) == 0) + { + $qry = " + INSERT INTO + lehre.tbl_note(note, bezeichnung, anmerkung, farbe, positiv, notenwert, aktiv, lehre, offiziell, bezeichnung_mehrsprachig, lkt_ueberschreibbar) + VALUES( + (SELECT max(note)+1 FROM lehre.tbl_note), 'nicht zugelassen', 'nz', NULL, TRUE, NULL, TRUE, FALSE, FALSE, '{\"nicht zugelassen\",\"not admitted\"}', FALSE + ); + "; + + if(!$db->db_query($qry)) + echo 'lehre.tbl_note: '.$db->db_last_error().'
    '; + else + echo '
    lehre.tbl_note: Note nicht zugelassen hinzugefuegt!
    '; + } +} + // Spalte offiziell in lehre.tbl_note if(!$result = @$db->db_query("SELECT offiziell FROM lehre.tbl_note LIMIT 1;")) { @@ -1315,7 +1355,7 @@ if (!$result = @$db->db_query("SELECT 1 FROM system.tbl_verarbeitungstaetigkeit" } // system.tbl_log.taetigkeit_kurzbz -if (!$result = @$db->db_query("SELECT taetigkeit_kurzbz FROM system.tbl_log")) +if (!$result = @$db->db_query("SELECT taetigkeit_kurzbz FROM system.tbl_log LIMIT 1")) { $qry = " ALTER TABLE system.tbl_log ADD COLUMN taetigkeit_kurzbz varchar(32); @@ -1685,6 +1725,20 @@ if($result = @$db->db_query("SELECT * FROM information_schema.role_table_grants } } +// UPDATE Berechtigungen fuer vilesci User erteilen fuer tbl_person_lock +if ($result = @$db->db_query("SELECT * FROM information_schema.role_table_grants WHERE table_name='tbl_person_lock' AND table_schema='system' AND grantee='vilesci' AND privilege_type='UPDATE'")) +{ + if ($db->db_num_rows($result) === 0) + { + $qry = "GRANT UPDATE ON system.tbl_person_lock TO vilesci;"; + + if(!$db->db_query($qry)) + echo 'system.tbl_person_lock Berechtigungen: '.$db->db_last_error().'
    '; + else + echo 'UPDATE Recht fuer system.tbl_person_lock fuer vilesci user gesetzt '; + } +} + /** * Kommentare fuer Datenbanktabellen @@ -4659,7 +4713,7 @@ if ($result = @$db->db_query("SELECT 1 FROM campus.tbl_dms_kategorie_gruppe WHER } } -// Add table anrechnung_status +// Add table anrechnungstatus if(!$result = @$db->db_query("SELECT 1 FROM lehre.tbl_anrechnungstatus LIMIT 1;")) { $qry = " @@ -4687,42 +4741,6 @@ if(!$result = @$db->db_query("SELECT 1 FROM lehre.tbl_anrechnungstatus LIMIT 1;" echo ' lehre.tbl_anrechnungstatus: Tabelle hinzugefuegt
    '; } -// GRANT INSERT, UPDATE, DELETE ON TABLE lehre.tbl_anrechnungstatus TO web; -$qry = 'GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE lehre.tbl_anrechnungstatus TO web;'; -if (!$db->db_query($qry)) - echo 'lehre.tbl_anrechnungstatus '.$db->db_last_error().'
    '; -else - echo '
    Granted privileges to web on lehre.tbl_anrechnungstatus'; - - -// SEQUENCE seq_anrechnungstatus_status_kurzbz -if ($result = $db->db_query("SELECT 0 FROM pg_class WHERE relname = 'seq_anrechnungstatus_status_kurzbz'")) -{ - if ($db->db_num_rows($result) == 0) - { - $qry = ' - CREATE SEQUENCE lehre.seq_anrechnungstatus_status_kurzbz - START WITH 1 - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - '; - - if(!$db->db_query($qry)) - echo 'lehre.seq_anrechnungstatus_status_kurzbz '.$db->db_last_error().'
    '; - else - echo '
    Created sequence: lehre.seq_anrechnungstatus_status_kurzbz'; - - // GRANT SELECT, UPDATE ON SEQUENCE lehre.tbl_anrechnungstatus_status_kurzbz_seq to web; - $qry = 'GRANT SELECT, UPDATE ON SEQUENCE lehre.seq_anrechnungstatus_status_kurzbz TO web;'; - if (!$db->db_query($qry)) - echo 'lehre.seq_anrechnungstatus_status_kurzbz '.$db->db_last_error().'
    '; - else - echo '
    Granted privileges to vilesci on lehre.seq_anrechnungstatus_status_kurzbz'; - } -} - // Add table anrechnung_anrechnungstatus // Für bestehende genehmigte Anrechnungsanträge wird ein Eintrag mit dem Status 'approved' angelegt if(!$result = @$db->db_query("SELECT 1 FROM lehre.tbl_anrechnung_anrechnungstatus LIMIT 1;")) @@ -4752,9 +4770,10 @@ if(!$result = @$db->db_query("SELECT 1 FROM lehre.tbl_anrechnung_anrechnungstatu INSERT INTO lehre.tbl_anrechnung_anrechnungstatus(anrechnung_id, status_kurzbz) SELECT anrechnung_id, 'approved' as status_kurzbz FROM lehre.tbl_anrechnung WHERE genehmigt_von is not null; - GRANT SELECT ON lehre.tbl_anrechnung_anrechnungstatus TO web; + GRANT SELECT, UPDATE, INSERT, DELETE ON lehre.tbl_anrechnung_anrechnungstatus TO web; GRANT SELECT, UPDATE, INSERT, DELETE ON lehre.tbl_anrechnung_anrechnungstatus TO vilesci; GRANT SELECT, UPDATE ON lehre.seq_anrechnung_anrechnungstatus_anrechnungstatus_id TO vilesci; + GRANT SELECT, UPDATE ON lehre.seq_anrechnung_anrechnungstatus_anrechnungstatus_id TO web; "; if(!$db->db_query($qry)) @@ -4818,6 +4837,19 @@ if($result = @$db->db_query("SELECT 1 FROM system.tbl_berechtigung WHERE berecht } } +// Add permission to create Anrechnung +if($result = @$db->db_query("SELECT 1 FROM system.tbl_berechtigung WHERE berechtigung_kurzbz = 'lehre/anrechnung_anlegen';")) +{ + if($db->db_num_rows($result) == 0) + { + $qry = "INSERT INTO system.tbl_berechtigung(berechtigung_kurzbz, beschreibung) VALUES('lehre/anrechnung_anlegen', 'Anrechnung anlegen');"; + + if(!$db->db_query($qry)) + echo 'system.tbl_berechtigung '.$db->db_last_error().'
    '; + else + echo ' system.tbl_berechtigung: Added permission for lehre/anrechnung_anlegen
    '; + } +} // INSERT,DELETE,UPDATE Berechtigung für tbl_dokumentprestudent hinzufügen if($result = @$db->db_query("SELECT * FROM information_schema.role_table_grants WHERE table_name='tbl_dokumentprestudent' AND table_schema='public' AND grantee='web' AND privilege_type in ('INSERT','DELETE','UPDATE')")) @@ -4842,13 +4874,11 @@ if(!$result = @$db->db_query("SELECT 1 FROM public.tbl_zgvpruefungstatus LIMIT 1 status_kurzbz character varying(32), bezeichnung character varying(256) ); - ALTER TABLE public.tbl_zgvpruefungstatus ADD CONSTRAINT status_kurzbz PRIMARY KEY (status_kurzbz); INSERT INTO public.tbl_zgvpruefungstatus(status_kurzbz, bezeichnung) VALUES('pruefung_stg', 'Wird vom Studiengang geprüft'); INSERT INTO public.tbl_zgvpruefungstatus(status_kurzbz, bezeichnung) VALUES('rejected', 'Vom Studiengang abgelehnt'); INSERT INTO public.tbl_zgvpruefungstatus(status_kurzbz, bezeichnung) VALUES('accepted', 'Vom Studiengang akzeptiert'); INSERT INTO public.tbl_zgvpruefungstatus(status_kurzbz, bezeichnung) VALUES('accepted_pruefung', 'Vom Studiengang akzeptiert mit Prüfung'); - GRANT SELECT, INSERT, UPDATE, DELETE ON public.tbl_zgvpruefungstatus TO vilesci; GRANT SELECT ON public.tbl_zgvpruefungstatus TO web; "; @@ -4872,8 +4902,7 @@ if(!$result = @$db->db_query("SELECT 1 FROM public.tbl_zgvpruefung LIMIT 1;")) updateamum timestamp without time zone, updatevon character varying(32) ); - - CREATE SEQUENCE public.tbl_zgvpruefung_id_seq + CREATE SEQUENCE public.tbl_zgvpruefung_id_seq INCREMENT BY 1 NO MAXVALUE NO MINVALUE @@ -4881,11 +4910,9 @@ if(!$result = @$db->db_query("SELECT 1 FROM public.tbl_zgvpruefung LIMIT 1;")) ALTER TABLE public.tbl_zgvpruefung ADD CONSTRAINT pk_tbl_zgvpruefung PRIMARY KEY (zgvpruefung_id); ALTER TABLE public.tbl_zgvpruefung ALTER COLUMN zgvpruefung_id SET DEFAULT nextval('public.tbl_zgvpruefung_id_seq'); ALTER TABLE public.tbl_zgvpruefung ADD CONSTRAINT fk_tbl_zgvpruefung_student FOREIGN KEY (prestudent_id) REFERENCES public.tbl_prestudent (prestudent_id) ON DELETE RESTRICT ON UPDATE CASCADE; - GRANT SELECT, UPDATE ON public.tbl_zgvpruefung_id_seq TO vilesci; GRANT SELECT, INSERT, UPDATE, DELETE ON public.tbl_zgvpruefung TO vilesci; GRANT SELECT ON public.tbl_zgvpruefung TO web; - "; if(!$db->db_query($qry)) @@ -4905,18 +4932,15 @@ if(!$result = @$db->db_query("SELECT 1 FROM public.tbl_zgvpruefungstatus_status status character varying(32), datum timestamp without time zone DEFAULT now() ); - - CREATE SEQUENCE public.tbl_zgvpruefungstatus_status_id_seq + CREATE SEQUENCE public.tbl_zgvpruefungstatus_status_id_seq INCREMENT BY 1 NO MAXVALUE NO MINVALUE CACHE 1; - ALTER TABLE public.tbl_zgvpruefungstatus_status ADD CONSTRAINT pk_tbl_zgvpruefungstatus_status PRIMARY KEY (zgv_pruefung_status_id); ALTER TABLE public.tbl_zgvpruefungstatus_status ALTER COLUMN zgv_pruefung_status_id SET DEFAULT nextval('tbl_zgvpruefungstatus_status_id_seq'); ALTER TABLE public.tbl_zgvpruefungstatus_status ADD CONSTRAINT fk_tbl_zgvpruefung_zgvpruefung FOREIGN KEY (zgvpruefung_id) REFERENCES public.tbl_zgvpruefung (zgvpruefung_id) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE public.tbl_zgvpruefungstatus_status ADD CONSTRAINT fk_tbl_zgvpruefung_status FOREIGN KEY (status) REFERENCES public.tbl_zgvpruefungstatus (status_kurzbz) ON DELETE RESTRICT ON UPDATE CASCADE; - GRANT SELECT, UPDATE ON public.tbl_zgvpruefungstatus_status_id_seq TO vilesci; GRANT SELECT, INSERT, UPDATE, DELETE ON public.tbl_zgvpruefungstatus_status TO vilesci; GRANT SELECT ON public.tbl_zgvpruefungstatus_status TO web; @@ -4928,8 +4952,7 @@ if(!$result = @$db->db_query("SELECT 1 FROM public.tbl_zgvpruefungstatus_status echo ' public.tbl_zgvpruefungstatus_status: Tabelle hinzugefuegt
    '; } - -// Add index to system.tbl_log +// Add index to lehre.tbl_pruefung if ($result = $db->db_query("SELECT * FROM pg_class WHERE relname='idx_tbl_pruefung_student_uid'")) { if ($db->db_num_rows($result) == 0) @@ -4955,6 +4978,556 @@ if ($result = @$db->db_query("SELECT 1 FROM public.tbl_buchungstyp WHERE buchung echo ' public.tbl_buchungstyp: Added buchungstyp "ZuschussIO"
    '; } } +//Add Column statusgrund_kurzbz to public.tbl_status_grund +if(!@$db->db_query("SELECT statusgrund_kurzbz FROM public.tbl_status_grund LIMIT 1")) +{ + $qry = "ALTER TABLE public.tbl_status_grund ADD COLUMN statusgrund_kurzbz varchar(32); + ALTER TABLE public.tbl_status_grund ADD CONSTRAINT uk_tbl_statusgrund_kurzbz UNIQUE (statusgrund_kurzbz); + "; + + if(!$db->db_query($qry)) + echo 'public.tbl_status_grund '.$db->db_last_error().'
    '; + else + echo '
    Neue Spalte statusgrund_kurzbz zu Tabelle public.tbl_status_grund hinzugefügt'; +} + +// Add permission to set gemeinde +if($result = @$db->db_query("SELECT 1 FROM system.tbl_berechtigung WHERE berechtigung_kurzbz = 'basis/gemeinde';")) +{ + if($db->db_num_rows($result) == 0) + { + $qry = "INSERT INTO system.tbl_berechtigung(berechtigung_kurzbz, beschreibung) VALUES('basis/gemeinde', 'Gemeindedaten pflegen');"; + + if(!$db->db_query($qry)) + echo 'bis.tbl_bisverwendung: '.$db->db_last_error().'
    '; + else + echo ' system.tbl_berechtigung: Added permission for basis/gemeinde
    '; + } +} + +// Add column homeoffice to bis.tbl_bisverwendung +if (!$result = @$db->db_query("SELECT homeoffice FROM bis.tbl_bisverwendung LIMIT 1")) +{ + $qry = "ALTER TABLE bis.tbl_bisverwendung ADD COLUMN homeoffice boolean NOT NULL DEFAULT FALSE"; + + if(!$db->db_query($qry)) + echo 'bis.tbl_bisverwendung: '.$db->db_last_error().'
    '; + else + echo '
    bis.tbl_bisverwendung: Spalte homeoffice hinzugefuegt'; +} + +// ADD COLUMN homeoffice to campus.tbl_zeitaufzeichnung +if(!$result = @$db->db_query("SELECT homeoffice FROM campus.tbl_zeitaufzeichnung LIMIT 1")) +{ + $qry = " + ALTER TABLE campus.tbl_zeitaufzeichnung ADD COLUMN homeoffice boolean NOT NULL DEFAULT false ; + "; + + if(!$db->db_query($qry)) + echo 'campus.tbl_zeitaufzeichnung: '.$db->db_last_error().'
    '; + else + echo '
    campus.tbl_zeitaufzeichnung Spalte homeoffice hinzugefügt.'; +} + +// INDEX idx_anrechnung_anrechnung_status_anrechnung_id +if ($result = $db->db_query("SELECT 0 FROM pg_class WHERE relname = 'idx_anrechnung_anrechnung_status_anrechnung_id'")) +{ + if ($db->db_num_rows($result) == 0) + { + $qry = 'CREATE INDEX idx_anrechnung_anrechnung_status_anrechnung_id ON lehre.tbl_anrechnung_anrechnungstatus USING btree (anrechnung_id)'; + if (!$db->db_query($qry)) + echo 'idx_anrechnung_anrechnung_status_anrechnung_id '.$db->db_last_error().'
    '; + else + echo '
    Created Index idx_anrechnung_anrechnung_status_anrechnung_id'; + } +} + +// Add Table lehre.tbl_lehrmodus +if(!$result = @$db->db_query("SELECT 1 FROM lehre.tbl_lehrmodus LIMIT 1;")) +{ + $qry = " + CREATE TABLE lehre.tbl_lehrmodus + ( + lehrmodus_kurzbz varchar(32) NOT NULL, + bezeichnung_mehrsprachig varchar(255)[], + aktiv boolean DEFAULT true + ); + ALTER TABLE lehre.tbl_lehrmodus ADD CONSTRAINT pk_lehrmodus PRIMARY KEY (lehrmodus_kurzbz); + INSERT INTO lehre.tbl_lehrmodus(lehrmodus_kurzbz, bezeichnung_mehrsprachig) VALUES('regulaer', '{\"regulaer\",\"regular\"}'); + INSERT INTO lehre.tbl_lehrmodus(lehrmodus_kurzbz, bezeichnung_mehrsprachig) VALUES('standardisiert', '{\"standardisiert\",\"standardized\"}'); + GRANT SELECT ON lehre.tbl_lehrmodus TO web; + GRANT SELECT, UPDATE, INSERT, DELETE ON lehre.tbl_lehrmodus TO vilesci; + "; + + if(!$db->db_query($qry)) + echo 'lehre.tbl_lehrmodus: '.$db->db_last_error().'
    '; + else + echo ' lehre.tbl_lehrmodus: Tabelle hinzugefuegt
    '; +} + +//Add Column lehrmodus_kurzbz to lehre.tbl_lehrveranstaltung +if(!@$db->db_query("SELECT lehrmodus_kurzbz FROM lehre.tbl_lehrveranstaltung LIMIT 1")) +{ + $qry = "ALTER TABLE lehre.tbl_lehrveranstaltung ADD COLUMN lehrmodus_kurzbz varchar(32); + ALTER TABLE lehre.tbl_lehrveranstaltung ADD CONSTRAINT fk_lehrveranstaltung_lehrmodus FOREIGN KEY (lehrmodus_kurzbz) REFERENCES lehre.tbl_lehrmodus(lehrmodus_kurzbz) ON UPDATE CASCADE ON DELETE RESTRICT; + "; + + if(!$db->db_query($qry)) + echo 'lehre.tbl_lehrveranstaltung '.$db->db_last_error().'
    '; + else + echo '
    Spalte lehrmodus_kurzbz in lehre.tbl_lehrveranstaltung hinzugefügt'; +} + +// Spalte matr_aktiv in tbl_person zum Markieren von noch nicht scharfgeschaltenen Matrikelnummern vom Datenverbund +if(!$result = @$db->db_query("SELECT matr_aktiv FROM public.tbl_person LIMIT 1")) +{ + $qry = "ALTER TABLE public.tbl_person ADD COLUMN matr_aktiv boolean NOT NULL DEFAULT false; + COMMENT ON COLUMN public.tbl_person.matr_aktiv IS 'Zeigt an, ob Matrikelnummer aktiv oder nur vorläufig ist.';"; + + if(!$db->db_query($qry)) + echo 'public.tbl_person: '.$db->db_last_error().'
    '; + else + echo '
    public.tbl_person: Spalte matr_aktiv hinzugefuegt'; + + $qry = "UPDATE public.tbl_person SET matr_aktiv = TRUE WHERE matr_nr IS NOT NULL;"; + + if(!$db->db_query($qry)) + echo 'public.tbl_person: '.$db->db_last_error().'
    '; + else + echo '
    public.tbl_person: Spalte matr_aktiv auf true gesetzt'; +} + +// Creates table bis.tbl_oehbeitrag if it doesn't exist and grants privileges +if (!$result = @$db->db_query('SELECT 1 FROM bis.tbl_oehbeitrag LIMIT 1')) +{ + $qry = 'CREATE TABLE bis.tbl_oehbeitrag ( + oehbeitrag_id integer NOT NULL, + studierendenbeitrag numeric(5,2) NOT NULL, + versicherung numeric(5,2) NOT NULL, + von_studiensemester_kurzbz varchar(16) NOT NULL, + bis_studiensemester_kurzbz varchar(16), + insertamum timestamp DEFAULT NOW(), + insertvon varchar(32), + updateamum timestamp, + updatevon varchar(32) + ); + + COMMENT ON TABLE bis.tbl_oehbeitrag IS \'Table to save amount of Oehbeitrag and Versicherung.\'; + COMMENT ON COLUMN bis.tbl_oehbeitrag.studierendenbeitrag IS \'Amount of Studierendenbeitrag, Oehbeitrag without Versicherung.\'; + COMMENT ON COLUMN bis.tbl_oehbeitrag.versicherung IS \'Amount of Versicherung as part of the Oehbeitrag\'; + COMMENT ON COLUMN bis.tbl_oehbeitrag.von_studiensemester_kurzbz IS \'Semester from which amounts are valid\'; + COMMENT ON COLUMN bis.tbl_oehbeitrag.bis_studiensemester_kurzbz IS \'Semester until which amounts are valid\'; + + CREATE SEQUENCE bis.seq_oehbeitrag_oehbeitrag_id + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + ALTER TABLE bis.tbl_oehbeitrag ALTER COLUMN oehbeitrag_id SET DEFAULT nextval(\'bis.seq_oehbeitrag_oehbeitrag_id\'::regclass); + + GRANT SELECT, UPDATE ON SEQUENCE bis.seq_oehbeitrag_oehbeitrag_id TO vilesci; + GRANT SELECT, UPDATE ON SEQUENCE bis.seq_oehbeitrag_oehbeitrag_id TO fhcomplete; + + ALTER TABLE bis.tbl_oehbeitrag ADD CONSTRAINT pk_oehbeitrag PRIMARY KEY (oehbeitrag_id); + + ALTER TABLE bis.tbl_oehbeitrag ADD CONSTRAINT fk_oehbeitrag_von_studiensemester_kurzbz FOREIGN KEY (von_studiensemester_kurzbz) REFERENCES public.tbl_studiensemester(studiensemester_kurzbz) ON UPDATE CASCADE ON DELETE RESTRICT; + ALTER TABLE bis.tbl_oehbeitrag ADD CONSTRAINT fk_oehbeitrag_bis_studiensemester_kurzbz FOREIGN KEY (bis_studiensemester_kurzbz) REFERENCES public.tbl_studiensemester(studiensemester_kurzbz) ON UPDATE CASCADE ON DELETE RESTRICT; + + ALTER TABLE bis.tbl_oehbeitrag ADD CONSTRAINT uk_oehbeitrag_von_studiensemester_kurzbz UNIQUE (von_studiensemester_kurzbz);'; + + if (!$db->db_query($qry)) + echo 'bis.tbl_oehbeitrag: '.$db->db_last_error().'
    '; + else + echo '
    bis.tbl_oehbeitrag table created'; + + $qry = 'GRANT SELECT ON TABLE bis.tbl_oehbeitrag TO web;'; + if (!$db->db_query($qry)) + echo 'bis.tbl_oehbeitrag: '.$db->db_last_error().'
    '; + else + echo '
    Granted privileges to web on bis.tbl_oehbeitrag'; + + $qry = 'GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE bis.tbl_oehbeitrag TO vilesci;'; + if (!$db->db_query($qry)) + echo 'bis.tbl_oehbeitrag: '.$db->db_last_error().'
    '; + else + echo '
    Granted privileges to vilesci on bis.tbl_oehbeitrag'; +} + +// Add column melderelevant to public.tbl_studiengang and prefill values +if (!$result = @$db->db_query("SELECT melderelevant FROM public.tbl_studiengang LIMIT 1")) +{ + $qry = "ALTER TABLE public.tbl_studiengang ADD COLUMN melderelevant boolean NOT NULL DEFAULT FALSE; + UPDATE public.tbl_studiengang SET melderelevant = TRUE WHERE tbl_studiengang.studiengang_kz < 10000 AND tbl_studiengang.studiengang_kz <> 0; + COMMENT ON COLUMN public.tbl_studiengang.melderelevant IS 'Zeigt an, ob Studierende aus Studiengang an Ministerien gemeldet werden müssen'"; + + if(!$db->db_query($qry)) + echo 'public.tbl_studiengang: '.$db->db_last_error().'
    '; + else + echo '
    public.tbl_studiengang: Neue Spalte melderelevant hinzugefuegt.'; +} + +// TABLE bis.tbl_bisstandort +if (!@$db->db_query("SELECT 1 FROM bis.tbl_bisstandort LIMIT 1")) +{ + $qry = "CREATE TABLE bis.tbl_bisstandort ( + standort_code integer, + bezeichnung character varying(256), + aktiv boolean NOT NULL DEFAULT TRUE, + insertamum timestamp DEFAULT NOW(), + insertvon varchar(32), + updateamum timestamp, + updatevon varchar(32) + ); + ALTER TABLE bis.tbl_bisstandort ADD CONSTRAINT pk_bisstandort PRIMARY KEY (standort_code); + COMMENT ON TABLE bis.tbl_bisstandort IS 'Key-Table of Locations';"; + + if (!$db->db_query($qry)) + echo 'bis.tbl_bisstandort '.$db->db_last_error().'
    '; + else + echo '
    Created table bis.tbl_bisstandort'; + + // GRANT SELECT ON TABLE bis.tbl_bisstandort TO web; + $qry = 'GRANT SELECT ON TABLE bis.tbl_bisstandort TO web;'; + if (!$db->db_query($qry)) + echo 'bis.tbl_bisstandort '.$db->db_last_error().'
    '; + else + echo '
    Granted privileges to web on bis.tbl_bisstandort'; + + // GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE bis.tbl_bisstandort TO vilesci; + $qry = 'GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE bis.tbl_bisstandort TO vilesci;'; + if (!$db->db_query($qry)) + echo 'bis.tbl_bisstandort '.$db->db_last_error().'
    '; + else + echo '
    Granted privileges to vilesci on bis.tbl_bisstandort'; +} + +// Add columns foerderrelevant and standort to public.tbl_studiengang +if (!$result = @$db->db_query("SELECT foerderrelevant, standort_code FROM public.tbl_studiengang LIMIT 1")) +{ + $qry = "ALTER TABLE public.tbl_studiengang ADD COLUMN foerderrelevant boolean NOT NULL DEFAULT TRUE; + ALTER TABLE public.tbl_studiengang ADD COLUMN standort_code integer; + ALTER TABLE public.tbl_studiengang ADD CONSTRAINT fk_studiengang_standort_code FOREIGN KEY (standort_code) REFERENCES bis.tbl_bisstandort(standort_code) ON DELETE RESTRICT ON UPDATE CASCADE; + COMMENT ON COLUMN public.tbl_studiengang.foerderrelevant IS 'Zeigt an, ob Studierende aus Studiengang bei Meldung für Förderungen relevant sind'; + COMMENT ON COLUMN public.tbl_studiengang.standort_code IS 'Zu meldender Standortcode der Studierenden des Studiengangs'"; + + if(!$db->db_query($qry)) + echo 'public.tbl_studiengang: '.$db->db_last_error().'
    '; + else + echo '
    public.tbl_studiengang: Neue Spalten foerderrelevant, standort_code hinzugefuegt.'; +} + +// Add columns foerderrelevant and standort to public.tbl_prestudent +if (!$result = @$db->db_query("SELECT foerderrelevant, standort_code FROM public.tbl_prestudent LIMIT 1")) +{ + $qry = "ALTER TABLE public.tbl_prestudent ADD COLUMN foerderrelevant boolean; + ALTER TABLE public.tbl_prestudent ADD COLUMN standort_code integer; + ALTER TABLE public.tbl_prestudent ADD CONSTRAINT fk_prestudent_standort_code FOREIGN KEY (standort_code) REFERENCES bis.tbl_bisstandort(standort_code) ON DELETE RESTRICT ON UPDATE CASCADE; + UPDATE public.tbl_prestudent ps -- set foerderrelevant false for incoming, ausserordentlich, gsextern + SET foerderrelevant = FALSE + WHERE EXISTS (SELECT 1 FROM public.tbl_prestudentstatus WHERE prestudent_id = ps.prestudent_id AND status_kurzbz = 'Incoming') -- incoming + OR EXISTS (SELECT 1 FROM public.tbl_prestudent + JOIN public.tbl_person USING (person_id) + LEFT JOIN public.tbl_student USING (prestudent_id) + LEFT JOIN bis.tbl_gsstudientyp USING (gsstudientyp_kurzbz) + WHERE prestudent_id = ps.prestudent_id + AND (SUBSTRING(matrikelnr, 4, 1) = '9' -- ausserordentlich + OR studientyp_code = 'E')); -- extern + COMMENT ON COLUMN public.tbl_prestudent.foerderrelevant IS 'Zeigt an, ob Studierende bei Meldung für Förderungen relevant sind. Überschreibt förderrelevant auf Studienganglevel.'; + COMMENT ON COLUMN public.tbl_prestudent.standort_code IS 'Zu meldender Standortcode des Studierenden. Überschreibt standort auf Studienganglevel.';"; + + if(!$db->db_query($qry)) + echo 'public.tbl_prestudent: '.$db->db_last_error().'
    '; + else + echo '
    public.tbl_prestudent: Neue Spalten foerderrelevant, standort_code hinzugefuegt.'; +} + +// App 'dvuh' hinzufügen +if($result = $db->db_query("SELECT 1 FROM system.tbl_app WHERE app='dvuh'")) +{ + if($db->db_num_rows($result)==0) + { + $qry = "INSERT INTO system.tbl_app(app) VALUES('dvuh');"; + + if(!$db->db_query($qry)) + echo 'App: '.$db->db_last_error().'
    '; + else + echo '
    Neue App dvuh in system.tbl_app hinzugefügt'; + } +} + +// Add table issue_status +if(!$result = @$db->db_query("SELECT 1 FROM system.tbl_issue_status LIMIT 1;")) +{ + $qry = "CREATE TABLE system.tbl_issue_status ( + status_kurzbz character varying(32), + bezeichnung_mehrsprachig varchar(32)[] + ); + + COMMENT ON TABLE system.tbl_issue_status IS 'Tabelle zur Pflege von Bearbeitungsstatus von issues.'; + + ALTER TABLE system.tbl_issue_status ADD CONSTRAINT pk_tbl_issue_status PRIMARY KEY (status_kurzbz); + + INSERT INTO system.tbl_issue_status (status_kurzbz, bezeichnung_mehrsprachig) VALUES('new', '{\"neu\",\"new\"}'); + INSERT INTO system.tbl_issue_status (status_kurzbz, bezeichnung_mehrsprachig) VALUES('inProgress', '{\"in Bearbeitung\",\"in progress\"}'); + INSERT INTO system.tbl_issue_status (status_kurzbz, bezeichnung_mehrsprachig) VALUES('resolved', '{\"behoben\",\"resolved\"}');"; + + if(!$db->db_query($qry)) + echo 'system.tbl_issue_status: '.$db->db_last_error().'
    '; + else + echo '
    system.tbl_issue_status: Tabelle hinzugefuegt'; + + // GRANT SELECT ON TABLE bis.tbl_bisstandort TO web; + $qry = 'GRANT SELECT ON TABLE system.tbl_issue_status TO web;'; + if (!$db->db_query($qry)) + echo 'system.tbl_issue_status '.$db->db_last_error().'
    '; + else + echo '
    Granted privileges to web on system.tbl_issue_status'; + + // GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE bis.tbl_issue_status TO vilesci; + $qry = 'GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE system.tbl_issue_status TO vilesci;'; + if (!$db->db_query($qry)) + echo 'system.tbl_issue_status '.$db->db_last_error().'
    '; + else + echo '
    Granted privileges to vilesci on system.tbl_issue_status'; +} + +// Add table fehlertyp +if(!$result = @$db->db_query("SELECT 1 FROM system.tbl_fehlertyp LIMIT 1;")) +{ + $qry = "CREATE TABLE system.tbl_fehlertyp ( + fehlertyp_kurzbz character varying(32), + bezeichnung_mehrsprachig varchar(32)[] + ); + + COMMENT ON TABLE system.tbl_fehlertyp IS 'Tabelle mit fehlertyp für tbl_fehler'; + + ALTER TABLE system.tbl_fehlertyp ADD CONSTRAINT pk_tbl_fehlertyp PRIMARY KEY (fehlertyp_kurzbz); + + INSERT INTO system.tbl_fehlertyp (fehlertyp_kurzbz, bezeichnung_mehrsprachig) VALUES('warning', '{\"warnung\",\"warning\"}'); + INSERT INTO system.tbl_fehlertyp (fehlertyp_kurzbz, bezeichnung_mehrsprachig) VALUES('error', '{\"fehler\",\"error\"}'); + INSERT INTO system.tbl_fehlertyp (fehlertyp_kurzbz, bezeichnung_mehrsprachig) VALUES('info', '{\"info\",\"info\"}');"; + + if(!$db->db_query($qry)) + echo 'system.tbl_fehlertyp: '.$db->db_last_error().'
    '; + else + echo '
    system.tbl_fehlertyp: Tabelle hinzugefuegt'; + + // GRANT SELECT ON TABLE bis.tbl_bisstandort TO web; + $qry = 'GRANT SELECT ON TABLE system.tbl_fehlertyp TO web;'; + if (!$db->db_query($qry)) + echo 'system.tbl_fehlertyp '.$db->db_last_error().'
    '; + else + echo '
    Granted privileges to web on system.tbl_fehlertyp'; + + // GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE bis.tbl_bisstandort TO vilesci; + $qry = 'GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE system.tbl_fehlertyp TO vilesci;'; + if (!$db->db_query($qry)) + echo 'system.tbl_fehlertyp '.$db->db_last_error().'
    '; + else + echo '
    Granted privileges to vilesci on system.tbl_fehlertyp'; +} + +// Add table fehler +if(!$result = @$db->db_query("SELECT 1 FROM system.tbl_fehler LIMIT 1;")) +{ + $qry = "CREATE TABLE system.tbl_fehler ( + fehlercode character varying(64), + fehler_kurzbz character varying(64) UNIQUE, + fehlercode_extern character varying(64), + fehlertext text, + fehlertyp_kurzbz character varying(32) NOT NULL, + app character varying(32) NOT NULL + ); + + COMMENT ON TABLE system.tbl_fehler IS 'Tabelle zur Pflege von Fehlerfällen'; + COMMENT ON COLUMN system.tbl_fehler.fehlercode IS 'Eindeutiger interner Fehlercode'; + COMMENT ON COLUMN system.tbl_fehler.fehler_kurzbz IS 'Eindeutige Kurzbezeichnung für den Fehler'; + COMMENT ON COLUMN system.tbl_fehler.fehlercode_extern IS 'Code für von vordefinierte, von externen Systemen produzierte Fehler'; + COMMENT ON COLUMN system.tbl_fehler.fehlertext IS 'Interner, eigens definierter Fehlertext mit Platzhaltern für Parameter'; + COMMENT ON COLUMN system.tbl_fehler.fehlertyp_kurzbz IS 'Typ bzw Schweregrad (z.B. warnung, fehler)'; + COMMENT ON COLUMN system.tbl_fehler.app IS 'Ursprungsapp des Fehlers'; + + ALTER TABLE system.tbl_fehler ADD CONSTRAINT pk_tbl_fehler PRIMARY KEY (fehlercode); + ALTER TABLE system.tbl_fehler ADD CONSTRAINT fk_tbl_fehler_fehlertyp_kurzbz FOREIGN KEY (fehlertyp_kurzbz) REFERENCES system.tbl_fehlertyp(fehlertyp_kurzbz) ON UPDATE CASCADE ON DELETE RESTRICT; + ALTER TABLE system.tbl_fehler ADD CONSTRAINT fk_tbl_fehler_app FOREIGN KEY (app) REFERENCES system.tbl_app(app) ON UPDATE CASCADE ON DELETE RESTRICT; + ALTER TABLE system.tbl_fehler ADD CONSTRAINT uk_tbl_fehler_fehlercode_fehler_kurzbz UNIQUE (fehlercode, fehler_kurzbz); -- for upsert ON CONFLICT + ALTER TABLE system.tbl_fehler ADD CONSTRAINT uk_tbl_fehler_fehlercode_extern_app UNIQUE (fehlercode_extern, app); -- for recognizing external errors + + INSERT INTO system.tbl_fehler (fehlercode, fehlertext, fehlertyp_kurzbz, app) VALUES ('UNKNOWN_ERROR', 'Fehler ist aufgetreten', 'error', 'core'); + "; + + + if(!$db->db_query($qry)) + echo 'system.tbl_fehler: '.$db->db_last_error().'
    '; + else + echo '
    system.tbl_fehler: Tabelle hinzugefuegt'; + + // GRANT SELECT ON TABLE bis.tbl_issue TO web; + $qry = 'GRANT SELECT, UPDATE ON TABLE system.tbl_fehler TO web;'; + if (!$db->db_query($qry)) + echo 'system.tbl_fehler '.$db->db_last_error().'
    '; + else + echo '
    Granted privileges to web on system.tbl_fehler'; + + // GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE bis.tbl_issue TO vilesci; + $qry = 'GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE system.tbl_fehler TO vilesci;'; + if (!$db->db_query($qry)) + echo 'system.tbl_fehler '.$db->db_last_error().'
    '; + else + echo '
    Granted privileges to vilesci on system.tbl_fehler'; +} + +// Add table fehler_zustaendigkeiten +if(!$result = @$db->db_query("SELECT 1 FROM system.tbl_fehler_zustaendigkeiten LIMIT 1;")) +{ + $qry = "CREATE TABLE system.tbl_fehler_zustaendigkeiten ( + fehlerzustaendigkeiten_id character varying(64) NOT NULL, + fehlercode character varying(64) NOT NULL, + person_id integer, + oe_kurzbz character varying(32), + funktion_kurzbz character varying(16) + ); + + COMMENT ON TABLE system.tbl_fehler_zustaendigkeiten IS 'Tabelle zum Hinzufügen für Zuständigkeiten für einzelne Fehler'; + COMMENT ON COLUMN system.tbl_fehler_zustaendigkeiten.fehlercode IS 'Eindeutiger interner Fehlercode'; + COMMENT ON COLUMN system.tbl_fehler_zustaendigkeiten.person_id IS 'person_id der zuständigen Person'; + COMMENT ON COLUMN system.tbl_fehler_zustaendigkeiten.oe_kurzbz IS 'Zuständigkeit für einen fehlercode für eine ganze OE'; + COMMENT ON COLUMN system.tbl_fehler_zustaendigkeiten.funktion_kurzbz IS 'Zusätzliche Einschränkung der OE Zuständigkeit nach funktion'; + + CREATE SEQUENCE system.seq_fehlerzustaendigkeiten_id + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + ALTER TABLE ONLY system.tbl_fehler_zustaendigkeiten ALTER COLUMN fehlerzustaendigkeiten_id SET DEFAULT nextval('system.seq_fehlerzustaendigkeiten_id'::regclass); + + GRANT SELECT, UPDATE ON SEQUENCE system.seq_fehlerzustaendigkeiten_id TO vilesci; + GRANT SELECT, UPDATE ON SEQUENCE system.seq_fehlerzustaendigkeiten_id TO fhcomplete; + + ALTER TABLE system.tbl_fehler_zustaendigkeiten ADD CONSTRAINT pk_tbl_fehler_zustaendigkeiten PRIMARY KEY (fehlerzustaendigkeiten_id); + ALTER TABLE system.tbl_fehler_zustaendigkeiten ADD CONSTRAINT fk_tbl_fehler_zustaendigkeiten_fehlercode FOREIGN KEY (fehlercode) REFERENCES system.tbl_fehler(fehlercode) ON UPDATE CASCADE ON DELETE RESTRICT; + ALTER TABLE system.tbl_fehler_zustaendigkeiten ADD CONSTRAINT fk_tbl_fehler_zustaendigkeiten_person_id FOREIGN KEY (person_id) REFERENCES public.tbl_person(person_id) ON UPDATE CASCADE ON DELETE RESTRICT; + ALTER TABLE system.tbl_fehler_zustaendigkeiten ADD CONSTRAINT fk_tbl_fehler_zustaendigkeiten_oe_kurzbz FOREIGN KEY (oe_kurzbz) REFERENCES public.tbl_organisationseinheit(oe_kurzbz) ON UPDATE CASCADE ON DELETE RESTRICT; + ALTER TABLE system.tbl_fehler_zustaendigkeiten ADD CONSTRAINT fk_tbl_fehler_zustaendigkeiten_funktion_kurzbz FOREIGN KEY (funktion_kurzbz) REFERENCES public.tbl_funktion(funktion_kurzbz) ON UPDATE CASCADE ON DELETE RESTRICT; + + ALTER TABLE system.tbl_fehler_zustaendigkeiten ADD CONSTRAINT uk_tbl_fehler_zustaendigkeiten_fehlercode_person_id UNIQUE (fehlercode, person_id); + ALTER TABLE system.tbl_fehler_zustaendigkeiten ADD CONSTRAINT uk_tbl_fehler_zustaendigkeiten_fehlercode_oe_kurzbz_funktion_kurzbz UNIQUE (fehlercode, oe_kurzbz, funktion_kurzbz);"; + + if(!$db->db_query($qry)) + echo 'system.tbl_fehler_zustaendigkeiten: '.$db->db_last_error().'
    '; + else + echo '
    system.tbl_fehler_zustaendigkeiten: Tabelle hinzugefuegt'; + + // GRANT SELECT ON TABLE bis.tbl_issue TO web; + $qry = 'GRANT SELECT ON TABLE system.tbl_fehler_zustaendigkeiten TO web;'; + if (!$db->db_query($qry)) + echo 'system.tbl_fehler_zustaendigkeiten '.$db->db_last_error().'
    '; + else + echo '
    Granted privileges to web on system.tbl_fehler_zustaendigkeiten'; + + // GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE bis.tbl_issue TO vilesci; + $qry = 'GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE system.tbl_fehler_zustaendigkeiten TO vilesci;'; + if (!$db->db_query($qry)) + echo 'system.tbl_fehler_zustaendigkeiten '.$db->db_last_error().'
    '; + else + echo '
    Granted privileges to vilesci on system.tbl_fehler_zustaendigkeiten'; +} + +// Add table issue +if(!$result = @$db->db_query("SELECT 1 FROM system.tbl_issue LIMIT 1;")) +{ + $qry = "CREATE TABLE system.tbl_issue ( + issue_id integer, + fehlercode character varying(64) NOT NULL, + inhalt text, + fehlercode_extern character varying(64), + inhalt_extern text, + person_id integer, + oe_kurzbz character varying(32), + datum timestamp without time zone NOT NULL, + verarbeitetvon character varying(32), + verarbeitetamum timestamp without time zone, + status_kurzbz character varying(32) NOT NULL, + insertvon character varying(32), + insertamum timestamp without time zone DEFAULT now(), + updatevon character varying(32), + updateamum timestamp without time zone + ); + + COMMENT ON TABLE system.tbl_issue IS 'Tabelle zur Verfolgung von Problemen/Fehlern von verschiedenen Systemen'; + COMMENT ON COLUMN system.tbl_issue.issue_id IS 'Primärschlüssel'; + COMMENT ON COLUMN system.tbl_issue.fehlercode IS 'Identifikationscode des Problems/Fehlers, kann von anderem System kommen oder eigens definiert sein'; + COMMENT ON COLUMN system.tbl_issue.inhalt IS 'Fehlertext'; + COMMENT ON COLUMN system.tbl_issue.fehlercode_extern IS 'Externer, von App geschriebener Fehlercode. Zum Auseinanderhalten der externen Fehler, die nicht in tbl_fehler definiert sind.'; + COMMENT ON COLUMN system.tbl_issue.inhalt_extern IS 'von externem System kommender Fehlermeldungstext'; + COMMENT ON COLUMN system.tbl_issue.datum IS 'Tag und Zeit des Auftritts des Problems'; + COMMENT ON COLUMN system.tbl_issue.verarbeitetvon IS 'uid des Nutzers, der das Problem verarbeitet hat'; + COMMENT ON COLUMN system.tbl_issue.verarbeitetamum IS 'Tag und Zeit der Problemverarbeitung'; + COMMENT ON COLUMN system.tbl_issue.person_id IS 'Id der Person, für welche das issue besteht'; + COMMENT ON COLUMN system.tbl_issue.oe_kurzbz IS 'Betroffene Organisationseinheit'; + COMMENT ON COLUMN system.tbl_issue.status_kurzbz IS 'Verarbeitsungsstatus'; + + CREATE SEQUENCE system.seq_issue_id + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + ALTER TABLE ONLY system.tbl_issue ALTER COLUMN issue_id SET DEFAULT nextval('system.seq_issue_id'::regclass); + + GRANT SELECT, UPDATE ON SEQUENCE system.seq_issue_id TO vilesci; + GRANT SELECT, UPDATE ON SEQUENCE system.seq_issue_id TO fhcomplete; + + ALTER TABLE system.tbl_issue ADD CONSTRAINT pk_tbl_issue PRIMARY KEY (issue_id); + + ALTER TABLE system.tbl_issue ADD CONSTRAINT fk_tbl_issue_fehlercode FOREIGN KEY (fehlercode) REFERENCES system.tbl_fehler(fehlercode) ON UPDATE CASCADE ON DELETE RESTRICT; + ALTER TABLE system.tbl_issue ADD CONSTRAINT fk_tbl_issue_verarbeitetvon FOREIGN KEY (verarbeitetvon) REFERENCES public.tbl_benutzer(uid) ON UPDATE CASCADE ON DELETE RESTRICT; + ALTER TABLE system.tbl_issue ADD CONSTRAINT fk_tbl_issue_person_id FOREIGN KEY (person_id) REFERENCES public.tbl_person(person_id) ON UPDATE CASCADE ON DELETE RESTRICT; + ALTER TABLE system.tbl_issue ADD CONSTRAINT fk_tbl_issue_oe_kurzbz FOREIGN KEY (oe_kurzbz) REFERENCES public.tbl_organisationseinheit(oe_kurzbz) ON UPDATE CASCADE ON DELETE RESTRICT; + + ALTER TABLE system.tbl_issue ADD CONSTRAINT chk_tbl_issue_person_id_oe_kurzbz CHECK (person_id IS NOT NULL OR oe_kurzbz IS NOT NULL); + + CREATE INDEX idx_tbl_issue_person_id ON system.tbl_issue USING btree (person_id); + CREATE INDEX idx_tbl_issue_oe_kurzbz ON system.tbl_issue USING btree (oe_kurzbz);"; + + if(!$db->db_query($qry)) + echo 'system.tbl_issue: '.$db->db_last_error().'
    '; + else + echo '
    system.tbl_issue: Tabelle hinzugefuegt'; + + // GRANT SELECT ON TABLE bis.tbl_issue TO web; + $qry = 'GRANT SELECT, UPDATE ON TABLE system.tbl_issue TO web;'; + if (!$db->db_query($qry)) + echo 'system.tbl_issue '.$db->db_last_error().'
    '; + else + echo '
    Granted privileges to web on system.tbl_issue'; + + // GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE bis.tbl_issue TO vilesci; + $qry = 'GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE system.tbl_issue TO vilesci;'; + if (!$db->db_query($qry)) + echo 'system.tbl_issue '.$db->db_last_error().'
    '; + else + echo '
    Granted privileges to vilesci on system.tbl_issue'; +} + +// Add permission to manage issues +if($result = @$db->db_query("SELECT 1 FROM system.tbl_berechtigung WHERE berechtigung_kurzbz = 'system/issues_verwalten';")) +{ + if($db->db_num_rows($result) == 0) + { + $qry = "INSERT INTO system.tbl_berechtigung(berechtigung_kurzbz, beschreibung) VALUES('system/issues_verwalten', 'Issues verwalten');"; + + if(!$db->db_query($qry)) + echo 'system.tbl_berechtigung '.$db->db_last_error().'
    '; + else + echo '
    system.tbl_berechtigung: Added permission for system/issues_verwalten'; + } +} // *** Pruefung und hinzufuegen der neuen Attribute und Tabellen echo '

    Pruefe Tabellen und Attribute!

    '; @@ -4973,7 +5546,8 @@ $tabellen=array( "bis.tbl_bisfunktion" => array("bisverwendung_id","studiengang_kz","sws","updateamum","updatevon","insertamum","insertvon","ext_id"), "bis.tbl_bisio" => array("bisio_id","mobilitaetsprogramm_code","nation_code","von","bis","zweck_code","student_uid","updateamum","updatevon","insertamum","insertvon","ext_id","ort","universitaet","lehreinheit_id","ects_erworben","ects_angerechnet"), "bis.tbl_bisio_zweck" => array("bisio_id","zweck_code"), - "bis.tbl_bisverwendung" => array("bisverwendung_id","ba1code","ba2code","vertragsstunden","beschausmasscode","verwendung_code","mitarbeiter_uid","hauptberufcode","hauptberuflich","habilitation","beginn","ende","updateamum","updatevon","insertamum","insertvon","ext_id","dv_art","inkludierte_lehre","zeitaufzeichnungspflichtig","azgrelevant"), + "bis.tbl_bisstandort" => array("standort_code","bezeichnung","aktiv","insertamum","insertvon","updateamum","updatevon"), + "bis.tbl_bisverwendung" => array("bisverwendung_id","ba1code","ba2code","vertragsstunden","beschausmasscode","verwendung_code","mitarbeiter_uid","hauptberufcode","hauptberuflich","habilitation","beginn","ende","updateamum","updatevon","insertamum","insertvon","ext_id","dv_art","inkludierte_lehre","zeitaufzeichnungspflichtig","azgrelevant", "homeoffice"), "bis.tbl_bundesland" => array("bundesland_code","kurzbz","bezeichnung"), "bis.tbl_entwicklungsteam" => array("mitarbeiter_uid","studiengang_kz","besqualcode","beginn","ende","updateamum","updatevon","insertamum","insertvon","ext_id"), "bis.tbl_gemeinde" => array("gemeinde_id","plz","name","ortschaftskennziffer","ortschaftsname","bulacode","bulabez","kennziffer"), @@ -4987,6 +5561,7 @@ $tabellen=array( "bis.tbl_mobilitaetsprogramm" => array("mobilitaetsprogramm_code","kurzbz","beschreibung","sichtbar","sichtbar_outgoing"), "bis.tbl_nation" => array("nation_code","entwicklungsstand","eu","ewr","kontinent","kurztext","langtext","engltext","sperre","nationengruppe_kurzbz", "iso3166_1_a2","iso3166_1_a3"), "bis.tbl_nationengruppe" => array("nationengruppe_kurzbz","nationengruppe_bezeichnung","aktiv"), + "bis.tbl_oehbeitrag" => array("oehbeitrag_id","studierendenbeitrag","versicherung","von_studiensemester_kurzbz","bis_studiensemester_kurzbz","insertamum","insertvon","updateamum","updatevon"), "bis.tbl_orgform" => array("orgform_kurzbz","code","bezeichnung","rolle","bisorgform_kurzbz","bezeichnung_mehrsprachig"), "bis.tbl_verwendung" => array("verwendung_code","verwendungbez"), "bis.tbl_zgv" => array("zgv_code","zgv_bez","zgv_kurzbz","bezeichnung"), @@ -5042,7 +5617,7 @@ $tabellen=array( "campus.tbl_uebung" => array("uebung_id","gewicht","punkte","angabedatei","freigabevon","freigabebis","abgabe","beispiele","statistik","bezeichnung","positiv","defaultbemerkung","lehreinheit_id","maxstd","maxbsp","liste_id","prozent","nummer","updateamum","updatevon","insertamum","insertvon"), "campus.tbl_veranstaltung" => array("veranstaltung_id","titel","beschreibung","veranstaltungskategorie_kurzbz","inhalt","start","ende","freigabevon","freigabeamum","updateamum","updatevon","insertamum","insertvon"), "campus.tbl_veranstaltungskategorie" => array("veranstaltungskategorie_kurzbz","bezeichnung","bild","farbe"), - "campus.tbl_zeitaufzeichnung" => array("zeitaufzeichnung_id","uid","aktivitaet_kurzbz","projekt_kurzbz","start","ende","beschreibung","oe_kurzbz_1","oe_kurzbz_2","insertamum","insertvon","updateamum","updatevon","ext_id","service_id","kunde_uid","projektphase_id"), + "campus.tbl_zeitaufzeichnung" => array("zeitaufzeichnung_id","uid","aktivitaet_kurzbz","projekt_kurzbz","start","ende","beschreibung","oe_kurzbz_1","oe_kurzbz_2","insertamum","insertvon","updateamum","updatevon","ext_id","service_id","kunde_uid","projektphase_id","homeoffice"), "campus.tbl_zeitaufzeichnung_gd" => array("zeitaufzeichnung_gd_id","uid","studiensemester_kurzbz","selbstverwaltete_pause","insertamum","insertvon","updateamum","updatevon"), "campus.tbl_zeitsperre" => array("zeitsperre_id","zeitsperretyp_kurzbz","mitarbeiter_uid","bezeichnung","vondatum","vonstunde","bisdatum","bisstunde","vertretung_uid","updateamum","updatevon","insertamum","insertvon","erreichbarkeit_kurzbz","freigabeamum","freigabevon"), "campus.tbl_zeitsperretyp" => array("zeitsperretyp_kurzbz","beschreibung","farbe"), @@ -5073,8 +5648,9 @@ $tabellen=array( "lehre.tbl_lehrform" => array("lehrform_kurzbz","bezeichnung","verplanen","bezeichnung_kurz","bezeichnung_lang"), "lehre.tbl_lehrfunktion" => array("lehrfunktion_kurzbz","beschreibung","standardfaktor","sort"), "lehre.tbl_lehrmittel" => array("lehrmittel_kurzbz","beschreibung","ort_kurzbz"), + "lehre.tbl_lehrmodus" => array("lehrmodus_kurzbz","bezeichnung_mehrsprachig","aktiv"), "lehre.tbl_lehrtyp" => array("lehrtyp_kurzbz","bezeichnung"), - "lehre.tbl_lehrveranstaltung" => array("lehrveranstaltung_id","kurzbz","bezeichnung","lehrform_kurzbz","studiengang_kz","semester","sprache","ects","semesterstunden","anmerkung","lehre","lehreverzeichnis","aktiv","planfaktor","planlektoren","planpersonalkosten","plankostenprolektor","koordinator","sort","zeugnis","projektarbeit","updateamum","updatevon","insertamum","insertvon","ext_id","bezeichnung_english","orgform_kurzbz","incoming","lehrtyp_kurzbz","oe_kurzbz","raumtyp_kurzbz","anzahlsemester","semesterwochen","lvnr","farbe","semester_alternativ","old_lehrfach_id","sws","lvs","alvs","lvps","las","benotung","lvinfo","lehrauftrag"), + "lehre.tbl_lehrveranstaltung" => array("lehrveranstaltung_id","kurzbz","bezeichnung","lehrform_kurzbz","studiengang_kz","semester","sprache","ects","semesterstunden","anmerkung","lehre","lehreverzeichnis","aktiv","planfaktor","planlektoren","planpersonalkosten","plankostenprolektor","koordinator","sort","zeugnis","projektarbeit","updateamum","updatevon","insertamum","insertvon","ext_id","bezeichnung_english","orgform_kurzbz","incoming","lehrtyp_kurzbz","oe_kurzbz","raumtyp_kurzbz","anzahlsemester","semesterwochen","lvnr","farbe","semester_alternativ","old_lehrfach_id","sws","lvs","alvs","lvps","las","benotung","lvinfo","lehrauftrag","lehrmodus_kurzbz"), "lehre.tbl_lehrveranstaltung_kompatibel" => array("lehrveranstaltung_id","lehrveranstaltung_id_kompatibel"), "lehre.tbl_lvangebot" => array("lvangebot_id","lehrveranstaltung_id","studiensemester_kurzbz","gruppe_kurzbz","incomingplaetze","gesamtplaetze","anmeldefenster_start","anmeldefenster_ende","insertamum","insertvon","updateamum","updatevon"), "lehre.tbl_lvregel" => array("lvregel_id","lvregeltyp_kurzbz","operator","parameter","lvregel_id_parent","lehrveranstaltung_id","studienplan_lehrveranstaltung_id","insertamum","insertvon","updateamum","updatevon"), @@ -5155,7 +5731,7 @@ $tabellen=array( "public.tbl_ortraumtyp" => array("ort_kurzbz","hierarchie","raumtyp_kurzbz"), "public.tbl_organisationseinheit" => array("oe_kurzbz", "oe_parent_kurzbz", "bezeichnung","organisationseinheittyp_kurzbz", "aktiv","mailverteiler","freigabegrenze","kurzzeichen","lehre","standort","warn_semesterstunden_frei","warn_semesterstunden_fix","standort_id"), "public.tbl_organisationseinheittyp" => array("organisationseinheittyp_kurzbz", "bezeichnung", "beschreibung"), - "public.tbl_person" => array("person_id","staatsbuergerschaft","geburtsnation","sprache","anrede","titelpost","titelpre","nachname","vorname","vornamen","gebdatum","gebort","gebzeit","foto","anmerkung","homepage","svnr","ersatzkennzeichen","familienstand","geschlecht","anzahlkinder","aktiv","insertamum","insertvon","updateamum","updatevon","ext_id","bundesland_code","kompetenzen","kurzbeschreibung","zugangscode", "foto_sperre","matr_nr","zugangscode_timestamp","udf_values","bpk"), + "public.tbl_person" => array("person_id","staatsbuergerschaft","geburtsnation","sprache","anrede","titelpost","titelpre","nachname","vorname","vornamen","gebdatum","gebort","gebzeit","foto","anmerkung","homepage","svnr","ersatzkennzeichen","familienstand","geschlecht","anzahlkinder","aktiv","insertamum","insertvon","updateamum","updatevon","ext_id","bundesland_code","kompetenzen","kurzbeschreibung","zugangscode", "foto_sperre","matr_nr","zugangscode_timestamp","udf_values","bpk","matr_aktiv"), "public.tbl_person_fotostatus" => array("person_fotostatus_id","person_id","fotostatus_kurzbz","datum","insertamum","insertvon","updateamum","updatevon"), "public.tbl_personfunktionstandort" => array("personfunktionstandort_id","funktion_kurzbz","person_id","standort_id","position","anrede"), "public.tbl_preincoming" => array("preincoming_id","person_id","mobilitaetsprogramm_code","zweck_code","firma_id","universitaet","aktiv","bachelorthesis","masterthesis","von","bis","uebernommen","insertamum","insertvon","updateamum","updatevon","anmerkung","zgv","zgv_ort","zgv_datum","zgv_name","zgvmaster","zgvmaster_datum","zgvmaster_ort","zgvmaster_name","program_name","bachelor","master","jahre","person_id_emergency","person_id_coordinator_dep","person_id_coordinator_int","code","deutschkurs1","deutschkurs2","research_area","deutschkurs3","ext_id"), @@ -5167,7 +5743,7 @@ $tabellen=array( "public.tbl_preoutgoing_lehrveranstaltung" => array("preoutgoing_lehrveranstaltung_id","preoutgoing_id","bezeichnung","ects","endversion","insertamum","insertvon","updateamum","updatevon","wochenstunden","unitcode"), "public.tbl_preoutgoing_preoutgoing_status" => array("status_id","preoutgoing_status_kurzbz","preoutgoing_id","datum","insertamum","insertvon","updateamum","updatevon"), "public.tbl_preoutgoing_status" => array("preoutgoing_status_kurzbz","bezeichnung"), - "public.tbl_prestudent" => array("prestudent_id","aufmerksamdurch_kurzbz","person_id","studiengang_kz","berufstaetigkeit_code","ausbildungcode","zgv_code","zgvort","zgvdatum","zgvmas_code","zgvmaort","zgvmadatum","aufnahmeschluessel","facheinschlberuf","reihungstest_id","anmeldungreihungstest","reihungstestangetreten","rt_gesamtpunkte","rt_punkte1","rt_punkte2","bismelden","anmerkung","dual","insertamum","insertvon","updateamum","updatevon","ext_id","ausstellungsstaat","rt_punkte3", "zgvdoktor_code", "zgvdoktorort", "zgvdoktordatum","mentor","zgvnation","zgvmanation","zgvdoktornation","gsstudientyp_kurzbz","aufnahmegruppe_kurzbz","udf_values","priorisierung"), + "public.tbl_prestudent" => array("prestudent_id","aufmerksamdurch_kurzbz","person_id","studiengang_kz","berufstaetigkeit_code","ausbildungcode","zgv_code","zgvort","zgvdatum","zgvmas_code","zgvmaort","zgvmadatum","aufnahmeschluessel","facheinschlberuf","reihungstest_id","anmeldungreihungstest","reihungstestangetreten","rt_gesamtpunkte","rt_punkte1","rt_punkte2","bismelden","anmerkung","dual","insertamum","insertvon","updateamum","updatevon","ext_id","ausstellungsstaat","rt_punkte3", "zgvdoktor_code", "zgvdoktorort", "zgvdoktordatum","mentor","zgvnation","zgvmanation","zgvdoktornation","gsstudientyp_kurzbz","aufnahmegruppe_kurzbz","udf_values","priorisierung","foerderrelevant","standort_code"), "public.tbl_prestudentstatus" => array("prestudent_id","status_kurzbz","studiensemester_kurzbz","ausbildungssemester","datum","orgform_kurzbz","insertamum","insertvon","updateamum","updatevon","ext_id","studienplan_id","bestaetigtam","bestaetigtvon","fgm","faktiv", "anmerkung","bewerbung_abgeschicktamum","rt_stufe","statusgrund_id"), "public.tbl_raumtyp" => array("raumtyp_kurzbz","beschreibung","kosten"), "public.tbl_reihungstest" => array("reihungstest_id","studiengang_kz","ort_kurzbz","anmerkung","datum","uhrzeit","updateamum","updatevon","insertamum","insertvon","ext_id","freigeschaltet","max_teilnehmer","oeffentlich","studiensemester_kurzbz","aufnahmegruppe_kurzbz","stufe","anmeldefrist"), @@ -5175,7 +5751,7 @@ $tabellen=array( "public.tbl_rt_person" => array("rt_person_id","person_id","rt_id","studienplan_id","anmeldedatum","teilgenommen","ort_kurzbz","punkte","insertamum","insertvon","updateamum","updatevon"), "public.tbl_rt_studienplan" => array("reihungstest_id","studienplan_id"), "public.tbl_status" => array("status_kurzbz","beschreibung","anmerkung","ext_id","bezeichnung_mehrsprachig"), - "public.tbl_status_grund" => array("statusgrund_id","status_kurzbz","aktiv","bezeichnung_mehrsprachig","beschreibung"), + "public.tbl_status_grund" => array("statusgrund_id","status_kurzbz","aktiv","bezeichnung_mehrsprachig","beschreibung","statusgrund_kurzbz"), "public.tbl_semesterwochen" => array("semester","studiengang_kz","wochen"), "public.tbl_service" => array("service_id", "bezeichnung","beschreibung","ext_id","oe_kurzbz","content_id","design_uid","betrieb_uid","operativ_uid","servicekategorie_kurzbz"), "public.tbl_servicekategorie" => array("servicekategorie_kurzbz", "bezeichnung","sort"), @@ -5184,7 +5760,7 @@ $tabellen=array( "public.tbl_statistik" => array("statistik_kurzbz","bezeichnung","url","gruppe","sql","content_id","insertamum","insertvon","updateamum","updatevon","berechtigung_kurzbz","publish","preferences"), "public.tbl_student" => array("student_uid","matrikelnr","prestudent_id","studiengang_kz","semester","verband","gruppe","updateamum","updatevon","insertamum","insertvon","ext_id"), "public.tbl_studentlehrverband" => array("student_uid","studiensemester_kurzbz","studiengang_kz","semester","verband","gruppe","updateamum","updatevon","insertamum","insertvon","ext_id"), - "public.tbl_studiengang" => array("studiengang_kz","kurzbz","kurzbzlang","typ","bezeichnung","english","farbe","email","telefon","max_semester","max_verband","max_gruppe","erhalter_kz","bescheid","bescheidbgbl1","bescheidbgbl2","bescheidgz","bescheidvom","orgform_kurzbz","titelbescheidvom","aktiv","ext_id","zusatzinfo_html","moodle","sprache","testtool_sprachwahl","studienplaetze","oe_kurzbz","lgartcode","mischform","projektarbeit_note_anzeige", "onlinebewerbung"), + "public.tbl_studiengang" => array("studiengang_kz","kurzbz","kurzbzlang","typ","bezeichnung","english","farbe","email","telefon","max_semester","max_verband","max_gruppe","erhalter_kz","bescheid","bescheidbgbl1","bescheidbgbl2","bescheidgz","bescheidvom","orgform_kurzbz","titelbescheidvom","aktiv","ext_id","zusatzinfo_html","moodle","sprache","testtool_sprachwahl","studienplaetze","oe_kurzbz","lgartcode","mischform","projektarbeit_note_anzeige", "onlinebewerbung","melderelevant","foerderrelevant","standort_code"), "public.tbl_studiengangstyp" => array("typ","bezeichnung","beschreibung","bezeichnung_mehrsprachig"), "public.tbl_studienjahr" => array("studienjahr_kurzbz","bezeichnung"), "public.tbl_studiensemester" => array("studiensemester_kurzbz","bezeichnung","start","ende","studienjahr_kurzbz","ext_id","beschreibung","onlinebewerbung"), @@ -5215,6 +5791,11 @@ $tabellen=array( "system.tbl_benutzerrolle" => array("benutzerberechtigung_id","rolle_kurzbz","berechtigung_kurzbz","uid","funktion_kurzbz","oe_kurzbz","art","studiensemester_kurzbz","start","ende","negativ","updateamum", "updatevon","insertamum","insertvon","kostenstelle_id","anmerkung"), "system.tbl_berechtigung" => array("berechtigung_kurzbz","beschreibung"), "system.tbl_extensions" => array("extension_id","name","version","description","license","url","core_version","dependencies","enabled"), + "system.tbl_fehler" => array("fehlercode","fehler_kurzbz","fehlercode_extern","fehlertext","fehlertyp_kurzbz","app"), + "system.tbl_fehlertyp" => array("fehlertyp_kurzbz","bezeichnung_mehrsprachig"), + "system.tbl_fehler_zustaendigkeiten" => array("fehlerzustaendigkeiten_id","fehlercode","person_id","oe_kurzbz","funktion_kurzbz"), + "system.tbl_issue" => array("issue_id","fehlercode","fehlercode_extern","inhalt","inhalt_extern","person_id","oe_kurzbz","datum","verarbeitetvon","verarbeitetamum","status_kurzbz","insertvon","insertamum","updatevon","updateamum"), + "system.tbl_issue_status" => array("status_kurzbz","bezeichnung_mehrsprachig"), "system.tbl_log" => array("log_id","person_id","zeitpunkt","app","oe_kurzbz","logtype_kurzbz","logdata","insertvon","taetigkeit_kurzbz"), "system.tbl_logtype" => array("logtype_kurzbz", "data_schema"), "system.tbl_filters" => array("filter_id","app","dataset_name","filter_kurzbz","person_id","description","sort","default_filter","filter","oe_kurzbz","statistik_kurzbz"), diff --git a/system/erinnerungsmail_coodle.php b/system/erinnerungsmail_coodle.php index caec9a9cb..963fa19ac 100644 --- a/system/erinnerungsmail_coodle.php +++ b/system/erinnerungsmail_coodle.php @@ -1,4 +1,5 @@ */ + /** * Cronjob zur Versendung von Infomails wenn Coodle Umfragen Beendet sind */ -require_once('../config/vilesci.config.inc.php'); -require_once('../include/coodle.class.php'); -require_once('../include/phrasen.class.php'); -require_once('../include/benutzer.class.php'); -require_once('../include/mail.class.php'); + +require_once(dirname(__FILE__).'/../config/vilesci.config.inc.php'); +require_once(dirname(__FILE__).'/../include/coodle.class.php'); +require_once(dirname(__FILE__).'/../include/phrasen.class.php'); +require_once(dirname(__FILE__).'/../include/benutzer.class.php'); +require_once(dirname(__FILE__).'/../include/mail.class.php'); $coodle = new coodle(); $coodle->getCoodleBeendet(); @@ -33,10 +36,10 @@ $p = new phrasen(); foreach($coodle->result as $row) { $benutzer = new benutzer($row->ersteller_uid); - $subject='Ablauf der Coodle Umfrage'; - - $mailtext=''; - $mailtexthtml=''; + $subject = 'Ablauf der Coodle Umfrage'; + $mailtext = ''; + $mailtexthtml = ''; + switch($benutzer->geschlecht) { case 'm': @@ -53,19 +56,23 @@ foreach($coodle->result as $row) break; } - $mailtext.="Ihre Terminumfrage zum Thema \"".$row->titel."\" ist beendet.\n"; - $mailtext.="Bitte folgen sie dem Link um die Terminumfrage abzuschließen: ".CIS_ROOT."cis/public/coodle.php?coodle_id=".$row->coodle_id."\n\n"; - $mailtext.= $p->t('mail/signatur'); + $mailtext .= "Ihre Terminumfrage zum Thema \"".$row->titel."\" ist beendet.\n"; + $mailtext .= "Bitte folgen sie dem Link um die Terminumfrage abzuschließen: ".CIS_ROOT."cis/public/coodle.php?coodle_id=".$row->coodle_id."\n\n"; + $mailtext .= $p->t('mail/signatur'); - $mailtexthtml.="Ihre Terminumfrage zum Thema \"".$row->titel."\" ist beendet.
    "; - $mailtexthtml.="Bitte folgen sie dem Link um die Terminumfrage abzuschließen: coodle_id."\">Link zur Umfrage

    "; - $mailtexthtml.= nl2br($p->t('mail/signatur')); + $mailtexthtml .= "Ihre Terminumfrage zum Thema \"".$row->titel."\" ist beendet.
    "; + $mailtexthtml .= "Bitte folgen sie dem Link um die Terminumfrage abzuschließen: coodle_id."\">Link zur Umfrage

    "; + $mailtexthtml .= nl2br($p->t('mail/signatur')); $mail = new mail($row->ersteller_uid.'@'.DOMAIN, 'no-reply@'.DOMAIN, $subject, $mailtext); $mail->setHTMLContent($mailtexthtml); + if($mail->send()) - echo "Mail versandt an $row->ersteller_uid CoodleID $row->coodle_id
    \n"; + echo "Mail versandt an $row->ersteller_uid CoodleID $row->coodle_id\n"; else - echo "Fehler beim Mailversand an $row->ersteller_uid CoodleID $row->coodle_id
    \n"; + echo "Fehler beim Mailversand an $row->ersteller_uid CoodleID $row->coodle_id\n"; } -?> \ No newline at end of file + +?> + diff --git a/system/filtersupdate.php b/system/filtersupdate.php index 77e0c3e3a..2998640ed 100644 --- a/system/filtersupdate.php +++ b/system/filtersupdate.php @@ -122,10 +122,10 @@ $filters = array( ], "filters": [ { - "name": "SendDate", + "name": "AnzahlStgNichtAbgeschickt", "option": "", - "condition": "", - "operation": "nset" + "condition": "0", + "operation": "gt" } ] } @@ -856,6 +856,101 @@ $filters = array( } ', 'oe_kurzbz' => null, + ), + array( + 'app' => 'core', + 'dataset_name' => 'issues', + 'filter_kurzbz' => 'offeneFehler', + 'description' => '{Alle offenen}', + 'sort' => 1, + 'default_filter' => true, + 'filter' => ' + { + "name": "Alle offenen Fehler", + "columns": [ + {"name": "Datum"}, + {"name": "Inhalt"}, + {"name": "Vorname"}, + {"name": "Nachname"}, + {"name": "PersonId"}, + {"name": "Fehlerstatus"} + ], + "filters": [ + { + "name": "Fehlerstatus", + "operation": "ncontains", + "condition": "behoben" + } + ] + } + ', + 'oe_kurzbz' => null, + ), + array( + 'app' => 'core', + 'dataset_name' => 'issues', + 'filter_kurzbz' => 'FehlerLetze7Tage', + 'description' => '{Letzten 7 Tage}', + 'sort' => 2, + 'default_filter' => false, + 'filter' => ' + { + "name": "Alle in den letzten 7 Tagen aufgetretenen Fehler", + "columns": [ + {"name": "Datum"}, + {"name": "Inhalt"}, + {"name": "Vorname"}, + {"name": "Nachname"}, + {"name": "PersonId"}, + {"name": "Fehlerstatus"} + ], + "filters": [ + { + "name": "Datum", + "operation": "lt", + "condition": "7", + "option": "days" + } + ] + } + ', + 'oe_kurzbz' => null, + ), + array( + 'app' => 'core', + 'dataset_name' => 'issues', + 'filter_kurzbz' => 'FehlerLetzte7TageBearbeitet', + 'description' => '{Letzten 7 Tage bearbeitet}', + 'sort' => 3, + 'default_filter' => false, + 'filter' => ' + { + "name": "Alle in den letzten 7 Tagen bearbeiteten Fehler", + "columns": [ + {"name": "Datum"}, + {"name": "Inhalt"}, + {"name": "Vorname"}, + {"name": "Nachname"}, + {"name": "PersonId"}, + {"name": "Fehlerstatus"}, + {"name": "Verarbeitet von"} + ], + "filters": [ + { + "name": "Verarbeitet am", + "operation": "lt", + "condition": "7", + "option": "days" + }, + { + "name": "Fehlerstatus", + "operation": "contains", + "condition": "behoben" + } + ] + } + ', + 'oe_kurzbz' => null, ) ); diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 9c0f931cf..17befb2fb 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -568,6 +568,26 @@ $phrases = array( ) ) ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'anzahlNichtGesendet', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Anzahl (nicht gesendet)', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'amount (not sent)', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), array( 'app' => 'core', 'category' => 'global', @@ -788,6 +808,26 @@ $phrases = array( ) ) ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'notizDerSTGL', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Notiz der STGL', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Note of the study course director', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), array( 'app' => 'core', 'category' => 'global', @@ -848,6 +888,26 @@ $phrases = array( ) ) ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'bewerberVorhanden', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'BewerberIn bereits vorhanden', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Applicant already available', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), array( 'app' => 'core', 'category' => 'global', @@ -1494,7 +1554,26 @@ $phrases = array( ) ) ), - + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'benotungDerLV', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Benotung der Lehrveranstaltung', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Grading of the course', + 'description' => '', + 'insertvon' => 'system' + ) + ) +), //*************************** CORE/filter array( @@ -8168,7 +8247,7 @@ Any unusual occurrences 'insertvon' => 'system' ) ) - ), + ), array( 'app' => 'core', 'category' => 'ui', @@ -9920,7 +9999,7 @@ Any unusual occurrences 'phrases' => array( array( 'sprache' => 'German', - 'text' => 'Deadline ist überschritten', + 'text' => 'Außerhalb der Einreichfrist', 'description' => '', 'insertvon' => 'system' ), @@ -10672,6 +10751,26 @@ Any unusual occurrences ) ) ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'empfehlungAm', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => ' Empfehlung am', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Recommended on', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), array( 'app' => 'core', 'category' => 'anrechnung', @@ -11212,6 +11311,46 @@ Any unusual occurrences ) ) ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'zgv', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'ZGV', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'ZGV', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'antragWurdeAngelegt', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Antrag wurde angelegt', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Application was created', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), array( 'app' => 'core', 'category' => 'anrechnung', @@ -11364,10 +11503,10 @@ Any unusual occurrences 'sprache' => 'German', 'text' => "Bitte laden Sie den Antrag in deutscher oder englischer Sprache für das
      -
    • Wintersemester spätestens bis 15. September
    • +
    • Wintersemester spätestens bis 22. September
    • Sommersemester spätestens bis 22. Februar hoch.
    -
    Die Entscheidung über den Antrag erfolgt in der Regel innerhalb von zwei Wochen ab dem 15. September +
    Die Entscheidung über den Antrag erfolgt in der Regel innerhalb von zwei Wochen ab dem 22. September bzw. 22. Februar.

    Für jede Lehrveranstaltung ist ein gesonderter Antrag beizubringen.", 'description' => '', @@ -11377,10 +11516,10 @@ Any unusual occurrences 'sprache' => 'English', 'text' => "Please upload the application in German or English
      -
    • by September 15th for the winter semester
    • +
    • by September 22nd for the winter semester
    • by February 22nd for the summer semester at the latest.
    -
    The decision on the application is usually made within two weeks from September 15 (winter semester) or February 22 (summer semester). +
    The decision on the application is usually made within two weeks from September 22 (winter semester) or February 22 (summer semester).

    A separate application must be submitted for each course.", 'description' => '', 'insertvon' => 'system' @@ -11416,17 +11555,17 @@ array( array( 'sprache' => 'German', 'text' => "Bitte laden Sie mehrere Nachweis-Dokumente zusammengefasst in einem PDF-Dokument hoch. -

    Falls Sie für den Nachweis der Gleichwertigkeit in Bundesgesetzblättern veröffentlichte Lehrpläne (vgl. HTL, HAK…) verwenden, - laden Sie bitte nur die für die Anrechnung relevanten Teile hoch oder markieren Sie diese entsprechend. -

    Falls diese Informationen nicht enthalten sind, kann der Antrag auch abgelehnt werden.", +

    Falls für den Nachweis der Gleichwertigkeit in Bundesgesetzblättern veröffentlichte Lehrpläne (vgl. HTL, HAK…) verwendet werden, + sind die für die Anrechnung relevanten Teile entsprechend zu markieren. +

    Falls das nicht gemacht wird, wird der Antrag aus formalen Gründen abgelehnt.", 'description' => '', 'insertvon' => 'system' ), array( 'sprache' => 'English', 'text' => "Please combine and upload more than one verification document in one PDF document. -

    If you use curricula published in federal law gazettes (cf. HTL, HAK ...) to prove equivalence, please upload only the parts relevant for recognition or mark them accordingly. -

    If this information is not included, the application might be rejected.", +

    If you use curricula published in federal law gazettes (cf. HTL, HAK ...) to prove equivalence, please mark the parts relevant for recognition accordingly. +

    If this information is not included, the application must be rejected.", 'description' => '', 'insertvon' => 'system' ) @@ -11512,7 +11651,7 @@ array( 'sprache' => 'German', 'text' => "Die Entscheidung über den Antrag durch die Studiengangsleitung sollte
      -
    • innerhalb von zwei Wochen ab dem 15. September (Wintersemester)
    • +
    • innerhalb von zwei Wochen ab dem 22. September (Wintersemester)
    • innerhalb von zwei Wochen ab dem 22. Februar (Sommersemester) erfolgen.
    ", 'description' => '', @@ -11522,7 +11661,7 @@ array( 'sprache' => 'English', 'text' => "The decision on the application is usually made by the program director
      -
    • within two weeks from September 15 (winter semester)
    • +
    • within two weeks from September 22 (winter semester)
    • within two weeks from February 22 (summer semester).
    ", 'description' => '', @@ -11853,6 +11992,26 @@ array( ) ) ), + array( + 'app' => 'core', + 'category' => 'ui', + 'phrase' => 'empfehlungWurdeAngefordertAusnahmeWoKeineLektoren', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Empfehlungsanfragen: {0}
    Abgeschickt: {1}
    Nicht abgeschickt: {2}
    Grund: Keine Lektoren zu LV zugeteilt.", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "Requests for recommendation: {0}
    Sent: {1}
    Not sent: {2}
    Reason: No lectors assigned to the course yet.", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), array( 'app' => 'core', 'category' => 'ui', @@ -11873,7 +12032,866 @@ array( ) ) ), - + array( + 'app' => 'core', + 'category' => 'ui', + 'phrase' => 'alleInBearbeitungLektor', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Alle anzeigen, die auf Empfehlung von LektorIn warten.", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "Show all that are waiting for recommendation.", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'zuruecknehmen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Zurücknehmen", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "Withdraw", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'genehmigungAblehnungWirklichZuruecknehmen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Ihre Genehmigung / Ablehnung wirklich zurücknehmen?", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "Do you really want to withdraw your approval / rejection?", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'erfolgreichZurueckgenommen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Erfolgreich zurückgenommen.", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "Successfully withdrawn.", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'empfehlungsanforderungWirklichZuruecknehmen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Empfehlungsanforderung wirklich zurücknehmen?", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "Do you really want to withdraw your request for recommendation?", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'antragNurImAktSS', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Der Antrag kann nur für das aktuelle Semester gestellt werden", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "You only can apply for the actual study semester", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'ui', + 'phrase' => 'neu', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Neu", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "New", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'ui', + 'phrase' => 'inBearbeitung', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "in Bearbeitung", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "in process", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'antragWurdeGestellt', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Antrag wurde gestellt.", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "Application was submitted successfully.", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'antragBereitsGestellt', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Der Antrag wurde bereits gestellt.", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "Application has already been submitted.", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'genehmigungNegativEmpfehlungstextUebernehmen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Empfehlungstext des Lektors als Begründung übernehmen.", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "Copy the lectors recommendation text as reason for the rejection.", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'ui', + 'phrase' => 'errorFelderFehlen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Daten fehlen.
    Bitte füllen Sie alle Formularfelder aus", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "Missing data.
    Please fill in all form fields", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'ui', + 'phrase' => 'errorUploadFehlt', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Dokument fehlt.
    Bitte laden Sie noch die entsprechenden Dokumente hoch.", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "Missing document.
    Please upload the required documents.", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'ui', + 'phrase' => 'errorNichtAusgefuehrt', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Ihre Anfrage konnte nicht ausgefuehrt werden.
    Bitte wenden Sie sich an den IT-Support.", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "Your request could not be processed.
    Please contact the IT Support team.", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'empfehlungsanfrageAn', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Anfrage an", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "Requested to", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'empfehlungsanfrageAm', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Empfehlung angefragt am", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "Requested on", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'ui', + 'phrase' => 'maxZeichen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Max. Zeichen", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "Max. Characters", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'bestaetigungstext', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Hiermit bestätige ich, dass ich die relevanten Prozess-Informationen gelesen habe und bestätige hiermit auch die Vollständigkeit und Richtigkeit meiner Angaben.
    Ich nehme zur Kenntnis, dass der Antrag nur einmal hochgeladen werden kann und dass Unterlagen nicht nachgereicht werden können.", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "I hereby confirm that I have read the relevant process information and hereby also confirm the accuracy and completeness of the information I have provided above.
    I acknowledge that the application can only be uploaded once and that documents cannot be submitted later.", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'ui', + 'phrase' => 'errorBestaetigungFehlt', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Ihre Bestaetigung fehlt.
    Bitte aktivieren Sie das entsprechende Feld.", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "Your confirmation is missing.
    Please confirm the corresponding field.", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'neueAnrechnung', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Neue Anrechnung", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "New Exemption", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'antragAnlegen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Antrag anlegen", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "Create Application", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'ui', + 'phrase' => 'keineLVzugeteilt', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Dem Studierenden sind keine Lehrveranstaltungen zugeteilt.", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "No courses assigned to this student yet.", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'antragBearbeiten', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Antrag bearbeiten", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "Go to application", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'anrechnung', + 'phrase' => 'antragBenotungBlockiert', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Antrag kann aufgrund der vorhandenen Benotung nicht erstellt werden.", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "Application can not be created due to existing grade.", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'eucovidqr', + 'phrase' => '3gNachweis', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Zertifikat hochladen", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "upload certificate", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'eucovidqr', + 'phrase' => 'QrViaWebcam', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "QR-Code via Webcam scannen", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "scan qr code via webcam", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'eucovidqr', + 'phrase' => 'oder', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "oder", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "or", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'eucovidqr', + 'phrase' => 'ZertifikatAlsPdfHochladen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Zertifikat als PDF hochladen (nur mit QR-Code, kein gescanntes Zertifikat)", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "upload certificate pdf (only with qrcode, no scanned certificate)", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'eucovidqr', + 'phrase' => 'ValidierungsergebnisAktuellesGueltigkeitsdatum', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Validierungsergebnis / gespeichertes Gültigkeitsdatum", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "validation result / stored valid date", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'eucovidqr', + 'phrase' => 'DateiZiehenUndAblegen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Datei hier hinziehen und ablegen", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "drag & drop file here", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'eucovidqr', + 'phrase' => 'KeinZugriffWebcam', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Zugriff auf die Webcam nicht möglich!", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "webcam access denied", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'eucovidqr', + 'phrase' => 'gueltigBis', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "gültig bis", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "valid to", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'eucovidqr', + 'phrase' => 'ZertifikatUngueltig', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Zertifikat ungültig", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "certificate invalid", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'eucovidqr', + 'phrase' => 'ZertifikatKonnteNichtGeprueftWerden', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Das Zertifikat konnte nicht verifiziert werden. Stellen Sie bitte sicher, dass ein QR-Code enthalten ist.", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "certificate could not be verified. Please make sure it contains a qr-code.", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'eucovidqr', + 'phrase' => 'Laedt', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Lädt", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "loading", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'eucovidqr', + 'phrase' => '3G', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Covid19 Gültigkeitsdatum", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "covid19 valid date", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'eucovidqr', + 'phrase' => 'FehlerBeimSpeichernDesGueltigkeitsdatums', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Fehler beim Speichern des Gültigkeitsdatum", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "error saving valid date", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'eucovidqr', + 'phrase' => 'PersondatenInFH-CompleteStimmenNichtMitDemZertifikatUeberein', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Personendaten aus dem Zertifikat stimmen nicht dem angemeldeten Benutzer überein", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "person data from certificate does not match the logged in user", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'eucovidqr', + 'phrase' => 'UploadSuccessful', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Das Gültigkeitsdatum wurde erfolgreich gespeichert.", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "validity date has been successfully stored.", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'eucovidqr', + 'phrase' => 'UploadFailed', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Es wurde kein Gültigkeitsdatum gespeichert.", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "validity date has not been stored.", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'eucovidqr', + 'phrase' => 'uploadbeschreibung', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Hier kann ein Digitales COVID-Zertifikat der EU mit QR-Code selbst erfasst werden.", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "an EU Digital COVID Certificate with QR code can be self registered here.", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'eucovidqr', + 'phrase' => 'manualbeschreibung', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Falls das Zertifikat keinen QR-Code enthält oder die Selbst-Erfassung fehlschlägt, kann das Zertifkat beim Empfang manuell erfasst werden.", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "if the certificate does not contain a QR code or self registration fails, the certificate can be manually registered at the front desk.", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'eucovidqr', + 'phrase' => 'supportbeschreibung', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Bei technischen Problemen kontaktieren Sie bitte: ", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "in case of technical issues please contact: ", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), ); diff --git a/system/sync/sync_stpldev_stpl.php b/system/sync/sync_stpldev_stpl.php index fedc9794c..ae5adc25d 100644 --- a/system/sync/sync_stpldev_stpl.php +++ b/system/sync/sync_stpldev_stpl.php @@ -1,4 +1,5 @@ and * Rudolf Hangl . */ + /** * Syncronisiert die Tabelle Stundenplandev mit der Tabelle Stundenplan - * und versendet Benachrichtigungsmails mit den geänderten Stunden + * und versendet Benachrichtigungsmails mit den geaenderten Stunden * an die Betroffenen Lektoren und Studenten * Uebersichtsmails werden an LV-Planung und Administration geschickt */ + require_once(dirname(__FILE__).'/../../config/vilesci.config.inc.php'); require_once(dirname(__FILE__).'/../../config/global.config.inc.php'); require_once(dirname(__FILE__).'/../../include/functions.inc.php'); @@ -36,109 +39,101 @@ require_once(dirname(__FILE__).'/../../include/phrasen.class.php'); $p_de = new phrasen('German'); $p_en = new phrasen('English'); -echo ' - - - LV-Plan-Synchro (stpldev-stpl) - -'; +$sendmail = (boolean)true; if (isset($_GET['sendmail'])) { if ($_GET['sendmail']=='true') - $sendmail=(boolean)true; + $sendmail = (boolean)true; else - $sendmail=(boolean)false; + $sendmail = (boolean)false; } -else - $sendmail=(boolean)true; -$mailstudents=(boolean)true; +$mailstudents = (boolean)true; // Commandline Paramter parsen bei Aufruf ueber Cronjob // zb php sync_stpldev_stpl.php --sendmail false $longopt = array( - "sendmail:", + "sendmail:", ); + $commandlineparams = getopt('', $longopt); -if(isset($commandlineparams['sendmail']) && $commandlineparams['sendmail']=='false') - $sendmail=false; +if (isset($commandlineparams['sendmail']) && $commandlineparams['sendmail']=='false') + $sendmail = false; $datum = new datum(); -$count_del=0; -$count_ins=0; -$count_upd=0; -$count_err=0; +$count_del = 0; +$count_ins = 0; +$count_upd = 0; +$count_err = 0; -// error log fuer jeden Studiengang -$error_log=array(); // Mails an die Lektoren und Verbaende -$message=array(); +$message = array(); + // Nachrichten fuer die LV-Planung -$message_stpl=' -'; -// error_log -$message_sync=''; +$message_stpl = ' + '; - -// Mail Headers festlegen -$headers= "MIME-Version: 1.0\r\n"; -$headers.="Content-Type: text/html; charset=UTF-8\r\n"; +$message_sync = ''; $stsem = new studiensemester(); $studiensemester = $stsem->getaktorNearest(); -$ss=new studiensemester($studiensemester); -$datum_begin=$ss->start; -$datum_ende=$ss->ende; +$ss = new studiensemester($studiensemester); +$datum_begin = $ss->start; +$datum_ende = $ss->ende; //$datum_begin='2012-08-03'; //$datum_ende='2013-02-02'; // $ss->ende -if(defined('LVPLAN_SYNC_ENDE') && LVPLAN_SYNC_ENDE!='') - $datum_ende=LVPLAN_SYNC_ENDE; +if (defined('LVPLAN_SYNC_ENDE') && LVPLAN_SYNC_ENDE != '') + $datum_ende = LVPLAN_SYNC_ENDE; -$db =new basis_db(); +$db = new basis_db(); $stgwhere = ''; $stgwheredev = ''; -if(isset($_GET['custom'])) + +if (isset($_GET['custom'])) { $sendmail = isset($_GET['mail']); $mailstudents = (isset($_GET['nostudentmail'])?false:true); - $studiengang_kz=$_GET['studiengang_kz']; + $studiengang_kz = $_GET['studiengang_kz']; $stgwhere = " AND studiengang_kz=".$db->db_add_param($studiengang_kz, FHC_INTEGER); $stgwheredev = " AND vw_stundenplandev.studiengang_kz=".$db->db_add_param($studiengang_kz, FHC_INTEGER); $datum_begin = $datum->formatDatum($_GET['von'],'Y-m-d'); $datum_ende = $datum->formatDatum($_GET['bis'],'Y-m-d'); } + $message_summary = ''; // Beginnzeiten holen $qry = "SELECT stunde,to_char(beginn, 'HH24:MI') AS beginn FROM lehre.tbl_stunde"; -$beginnzeit_arr=array(); -if($result = $db->db_query($qry)) +$beginnzeit_arr = array(); + +if ($result = $db->db_query($qry)) { - while($row = $db->db_fetch_object($result)) + while ($row = $db->db_fetch_object($result)) { - $beginnzeit_arr[$row->stunde]=$row->beginn; + $beginnzeit_arr[$row->stunde] = $row->beginn; } } + // ************* FUNCTIONS **************** // function getStudentsFromGroup($studiengang_kz, $semester, $verband, $gruppe, $gruppe_kurzbz, $studiensemester_kurzbz) @@ -146,7 +141,7 @@ function getStudentsFromGroup($studiengang_kz, $semester, $verband, $gruppe, $gr $db = new basis_db(); $students = array(); - if($gruppe_kurzbz=='') + if ($gruppe_kurzbz=='') { $qry = "SELECT distinct student_uid @@ -159,12 +154,13 @@ function getStudentsFromGroup($studiengang_kz, $semester, $verband, $gruppe, $gr studiensemester_kurzbz=".$db->db_add_param($studiensemester_kurzbz)." AND studiengang_kz = ".$db->db_add_param($studiengang_kz)." AND semester = ".$db->db_add_param($semester); - if(trim($verband)!='') + + if (trim($verband) != '') { - $qry.=" AND verband = ".$db->db_add_param($verband); - if(trim($gruppe)!='') + $qry .= " AND verband = ".$db->db_add_param($verband); + if (trim($gruppe) != '') { - $qry.=" AND gruppe = ".$db->db_add_param($gruppe); + $qry .= " AND gruppe = ".$db->db_add_param($gruppe); } } } @@ -184,11 +180,11 @@ function getStudentsFromGroup($studiengang_kz, $semester, $verband, $gruppe, $gr } - if($db->db_query($qry)) + if ($db->db_query($qry)) { - while($row = $db->db_fetch_object()) + while ($row = $db->db_fetch_object()) { - $students[]=$row->student_uid; + $students[] = $row->student_uid; } } @@ -196,125 +192,145 @@ function getStudentsFromGroup($studiengang_kz, $semester, $verband, $gruppe, $gr } // **************************************** // -$message_begin=' - -'.$p_de->t('lvplan/automatischeMail').'
    '.$p_de->t('lvplan/folgendeAenderungen').'
    -'.$p_en->t('lvplan/automatischeMail').'
    '.$p_en->t('lvplan/folgendeAenderungen').'
    '; -/************************************************** +$message_begin = ' + + '.$p_de->t('lvplan/automatischeMail').'
    '.$p_de->t('lvplan/folgendeAenderungen').'
    + '.$p_en->t('lvplan/automatischeMail').'
    '.$p_en->t('lvplan/folgendeAenderungen').'
    '; + +/** * Datensaetze holen die neu sind */ -echo 'Neue Datensätze werden geholt. ('.date('H:i:s').')
    ';flush(); + +echo 'Neue Datensaetze werden geholt. ('.date('H:i:s').')'."\n"; +flush(); + $message_stpl .= 'Neue Datensätze werden geholt. ('.date('H:i:s').')'; -$sql_query="SELECT * FROM lehre.vw_stundenplandev - WHERE +$sql_query = "SELECT * + FROM lehre.vw_stundenplandev + WHERE datum>=".$db->db_add_param($datum_begin)." AND datum<=".$db->db_add_param($datum_ende)." ".$stgwhere." - AND NOT EXISTS - (SELECT stundenplan_id FROM lehre.tbl_stundenplan - WHERE - datum>=".$db->db_add_param($datum_begin)." - AND datum<=".$db->db_add_param($datum_ende)." - AND stundenplan_id=stundenplandev_id) - ORDER BY datum, stunde;"; - + AND NOT EXISTS + (SELECT stundenplan_id FROM lehre.tbl_stundenplan + WHERE + datum>=".$db->db_add_param($datum_begin)." + AND datum<=".$db->db_add_param($datum_ende)." + AND stundenplan_id=stundenplandev_id) + ORDER BY datum, stunde;"; if (!$result = $db->db_query($sql_query)) { - echo $sql_query.' fehlgeschlagen!
    '.$db->db_last_error(); - $message_sync.=$sql_query.' fehlgeschlagen!
    '.$db->db_last_error(); + echo $sql_query.' fehlgeschlagen!'.$db->db_last_error()."\n"; + $message_sync .= $sql_query.' fehlgeschlagen!'.$db->db_last_error(); } else { - echo 'Neue Datensätze werden angelegt.
    ';flush(); + echo 'Neue Datensaetze werden angelegt.'."\n"; + flush(); + while ($row = $db->db_fetch_object($result)) { - //echo '.';flush(); $sql_query='INSERT INTO lehre.tbl_stundenplan - (stundenplan_id,unr,mitarbeiter_uid,datum,stunde,ort_kurzbz,studiengang_kz,semester,verband,gruppe, - gruppe_kurzbz,titel,'.(LVPLAN_ANMERKUNG_ANZEIGEN?'anmerkung,':'').'fix,updateamum,updatevon,insertamum,insertvon,lehreinheit_id) VALUES'; //spalte anmerkung nur syncen, wenn im Config aktiv - $sql_query.="(".$db->db_add_param($row->stundenplandev_id).",". - $db->db_add_param($row->unr).",". - $db->db_add_param($row->uid).",". - $db->db_add_param($row->datum).",". - $db->db_add_param($row->stunde).",". - $db->db_add_param($row->ort_kurzbz).",". - $db->db_add_param($row->studiengang_kz).",". + (stundenplan_id, unr, mitarbeiter_uid, datum, stunde,ort_kurzbz, studiengang_kz, semester, verband,gruppe, + gruppe_kurzbz,titel,'.(LVPLAN_ANMERKUNG_ANZEIGEN?'anmerkung,':'').'fix,updateamum,updatevon,insertamum,insertvon,lehreinheit_id) + VALUES'; //spalte anmerkung nur syncen, wenn im Config aktiv + + $sql_query .= "(".$db->db_add_param($row->stundenplandev_id).", ". + $db->db_add_param($row->unr).", ". + $db->db_add_param($row->uid).", ". + $db->db_add_param($row->datum).", ". + $db->db_add_param($row->stunde).", ". + $db->db_add_param($row->ort_kurzbz).", ". + $db->db_add_param($row->studiengang_kz).", ". $db->db_add_param($row->semester); - if ($row->verband==null) - $sql_query.=',NULL'; + + if ($row->verband == null) + $sql_query .= ', NULL'; else - $sql_query.=",".$db->db_add_param($row->verband); - if ($row->gruppe==null) - $sql_query.=',NULL'; + $sql_query .= ", ".$db->db_add_param($row->verband); + + if ($row->gruppe == null) + $sql_query .= ', NULL'; else - $sql_query.=",".$db->db_add_param($row->gruppe); - if ($row->gruppe_kurzbz==null) - $sql_query.=',NULL'; + $sql_query .= ", ".$db->db_add_param($row->gruppe); + + if ($row->gruppe_kurzbz == null) + $sql_query .= ', NULL'; else - $sql_query.=",".$db->db_add_param($row->gruppe_kurzbz); - $sql_query.=",".$db->db_add_param($row->titel); + $sql_query .= ", ".$db->db_add_param($row->gruppe_kurzbz); + + $sql_query .= ", ".$db->db_add_param($row->titel); + if (LVPLAN_ANMERKUNG_ANZEIGEN) //spalte anmerkung nur syncen, wenn im Config aktiv - $sql_query.=",".$db->db_add_param($row->anmerkung); - if ($row->fix=='t') - $sql_query.=',TRUE'; + $sql_query .= ", ".$db->db_add_param($row->anmerkung); + + if ($row->fix == 't') + $sql_query .= ', TRUE'; else - $sql_query.=',FALSE'; - $sql_query.=",".$db->db_add_param($row->updateamum).','. - $db->db_add_param($row->updatevon).','. - $db->db_add_param($row->insertamum).','. + $sql_query .= ', FALSE'; + + $sql_query .= ", ".$db->db_add_param($row->updateamum).', '. + $db->db_add_param($row->updatevon).', '. + $db->db_add_param($row->insertamum).', '. $db->db_add_param($row->insertvon); - if ($row->lehreinheit_id==null) - $sql_query.=',NULL'; + + if ($row->lehreinheit_id == null) + $sql_query .= ', NULL'; else - $sql_query.=','.$db->db_add_param($row->lehreinheit_id); - $sql_query.=');'; - //echo $sql_query; + $sql_query .= ', '.$db->db_add_param($row->lehreinheit_id); + + $sql_query .= ');'; + if (!$result_insert = $db->db_query($sql_query)) { - echo $sql_query.' fehlgeschlagen!
    '.$db->db_last_error(); - $message_sync.=$sql_query.' fehlgeschlagen!
    '.$db->db_last_error(); + echo $sql_query.' fehlgeschlagen!'.$db->db_last_error()."\n"; + $message_sync .= $sql_query.' fehlgeschlagen!'.$db->db_last_error(); $count_err++; } else { $count_ins++; - if ($count_ins%10==0) + + if ($count_ins % 10 == 0) { echo '-'; flush(); } + // Mails vorbereiten // Lektoren - if (mb_substr($row->uid,0,1)!='_') + if (mb_substr($row->uid, 0, 1) != '_') { if (!isset($message[$row->uid]->isneu)) { if(!isset($message[$row->uid])) $message[$row->uid] = new stdClass(); - $message[$row->uid]->isneu=true; - $message[$row->uid]->mailadress=$row->uid.'@'.DOMAIN; - $message[$row->uid]->message_begin=$message_begin.'
    '; - $message[$row->uid]->message=''.$p_de->t('lvplan/neueStunden').' / '.$p_en->t('lvplan/neueStunden').'
    + $message[$row->uid]->isneu = true; + $message[$row->uid]->mailadress = $row->uid.'@'.DOMAIN; + $message[$row->uid]->message_begin = $message_begin.'
    '; + $message[$row->uid]->message = ' + '.$p_de->t('lvplan/neueStunden').' / '.$p_en->t('lvplan/neueStunden').' +
    @@ -326,114 +342,156 @@ else '; } - $message[$row->uid]->message.="\n"; - $message[$row->uid]->message.=''; - $message[$row->uid]->message.=''; - $message[$row->uid]->message.=''; - $message[$row->uid]->message.=''; - $message[$row->uid]->message.=''; - $message[$row->uid]->message.=''; - $message[$row->uid]->message.=''; + + $message[$row->uid]->message .= "\n"; + $message[$row->uid]->message .= ''; + $message[$row->uid]->message .= ''; + $message[$row->uid]->message .= ''; + $message[$row->uid]->message .= ''; + $message[$row->uid]->message .= ''; + $message[$row->uid]->message .= ''; + $message[$row->uid]->message .= ''; } + // Verband if ($mailstudents) { - $studenten = getStudentsFromGroup($row->studiengang_kz, $row->semester, $row->verband, $row->gruppe, $row->gruppe_kurzbz, $ss->studiensemester_kurzbz); + $studenten = getStudentsFromGroup( + $row->studiengang_kz, + $row->semester, + $row->verband, + $row->gruppe, + $row->gruppe_kurzbz, + $ss->studiensemester_kurzbz + ); foreach ($studenten as $student) { if (!isset($message[$student]->isneu)) { - if(!isset($message[$student])) + if (!isset($message[$student])) $message[$student] = new stdClass(); - $message[$student]->isneu=true; - $message[$student]->mailadress=$student.'@'.DOMAIN; - $message[$student]->message_begin=$message_begin.'
    '; - $message[$student]->message=''.$p_de->t('lvplan/neueStunden').' / '.$p_en->t('lvplan/neueStunden').'
    + $message[$student]->isneu = true; + $message[$student]->mailadress = $student.'@'.DOMAIN; + $message[$student]->message_begin = $message_begin.'
    '; + $message[$student]->message = ' + + '.$p_de->t('lvplan/neueStunden').' / '.$p_en->t('lvplan/neueStunden').' +
    '.$p_de->t('lvplan/raum').'
    '.$p_en->t('lvplan/raum').'
    '.$p_de->t('lvplan/info').'
    '.$p_en->t('lvplan/info').'
    '.$row->ort_kurzbz.''.mb_strtoupper($row->stg_typ.$row->stg_kurzbz).'-'.$row->semester.$row->verband.$row->gruppe.' '.$row->gruppe_kurzbz.''.$row->lektor.''.$row->datum.''.$row->stunde.' ('.$beginnzeit_arr[$row->stunde].')'.$row->lehrfach.'-'.$row->lehrform.' ('.$row->lehrfach_bez.')'.$row->titel.'
    '.$row->ort_kurzbz.''. + mb_strtoupper($row->stg_typ.$row->stg_kurzbz).'-'.$row->semester.$row->verband.$row->gruppe.' '.$row->gruppe_kurzbz + .''.$row->lektor.''.$row->datum.''.$row->stunde.' ('.$beginnzeit_arr[$row->stunde].')'.$row->lehrfach.'-'.$row->lehrform.' ('.$row->lehrfach_bez.')'.$row->titel.'
    - + - - - + + + '; } - $message[$student]->message.="\n"; - $message[$student]->message.=''; - $message[$student]->message.=''; - $message[$student]->message.=''; - $message[$student]->message.=''; - $message[$student]->message.=''; - $message[$student]->message.=''; - $message[$student]->message.=''; + $message[$student]->message .= "\n"; + $message[$student]->message .= ''; + $message[$student]->message .= ''; + $message[$student]->message .= ''; + $message[$student]->message .= ''; + $message[$student]->message .= ''; + $message[$student]->message .= ''; + $message[$student]->message .= ''; } } } } + foreach($message as $msg) - if($msg->isneu) - $msg->message.='
    '.$p_de->t('lvplan/raum').'
    '.$p_en->t('lvplan/raum').'
    '.$p_de->t('lvplan/lehrverband').'
    '.$p_en->t('lvplan/lehrverband').'
    '. + $p_de->t('lvplan/lehrverband').'
    '. + $p_en->t('lvplan/lehrverband').' +
    '.$p_de->t('lvplan/lektor').'
    '.$p_en->t('lvplan/lektor').'
    '.$p_de->t('global/datum').'
    '.$p_en->t('global/datum').'
    '.$p_de->t('lvplan/stdBeginn').'
    '.$p_en->t('lvplan/stdBeginn').'
    '.$p_de->t('lvplan/lehrfach').'
    '.$p_en->t('lvplan/lehrfach').'
    '. + $p_de->t('global/datum').'
    '.$p_en->t('global/datum').' +
    '. + $p_de->t('lvplan/stdBeginn').'
    '. + $p_en->t('lvplan/stdBeginn').' +
    '. + $p_de->t('lvplan/lehrfach').'
    '.$p_en->t('lvplan/lehrfach').' +
    '.$p_de->t('lvplan/info').'
    '.$p_en->t('lvplan/info').'
    '.$row->ort_kurzbz.''.mb_strtoupper($row->stg_typ.$row->stg_kurzbz).'-'.$row->semester.$row->verband.$row->gruppe.' '.$row->gruppe_kurzbz.''.$row->lektor.''.$row->datum.''.$row->stunde.' ('.$beginnzeit_arr[$row->stunde].')'.$row->lehrfach.'-'.$row->lehrform.' ('.$row->lehrfach_bez.')'.$row->titel.'
    '.$row->ort_kurzbz.''. + mb_strtoupper($row->stg_typ.$row->stg_kurzbz).'-'.$row->semester.$row->verband.$row->gruppe.' '.$row->gruppe_kurzbz. + ''.$row->lektor.''.$row->datum.''.$row->stunde.' ('.$beginnzeit_arr[$row->stunde].')'.$row->lehrfach.'-'.$row->lehrform.' ('.$row->lehrfach_bez.')'.$row->titel.'

    '; + if ($msg->isneu) + $msg->message .= '
    '; } /************************************************** * Datensaetze holen die alt sind */ -echo '
    Alte Datensätze werden geholt.('.date('H:i:s').')
    ';flush(); +echo 'Alte Datensaetze werden geholt.('.date('H:i:s').')'."\n"; +flush(); + $message_stpl .='
    Alte Datensätze werden geholt.('.date('H:i:s').')
    '; -$sql_query="SELECT * FROM lehre.vw_stundenplan - WHERE datum>=".$db->db_add_param($datum_begin)." - AND datum<=".$db->db_add_param($datum_ende)." ".$stgwhere." - AND NOT EXISTS - (SELECT stundenplandev_id FROM lehre.tbl_stundenplandev - WHERE datum>=".$db->db_add_param($datum_begin)." - AND datum<=".$db->db_add_param($datum_ende)." - AND stundenplandev_id=stundenplan_id);"; + +$sql_query = "SELECT * + FROM lehre.vw_stundenplan + WHERE datum>=".$db->db_add_param($datum_begin)." + AND datum<=".$db->db_add_param($datum_ende)." ".$stgwhere." + AND NOT EXISTS + (SELECT stundenplandev_id FROM lehre.tbl_stundenplandev + WHERE datum>=".$db->db_add_param($datum_begin)." + AND datum<=".$db->db_add_param($datum_ende)." + AND stundenplandev_id=stundenplan_id);"; + if (!$result = $db->db_query($sql_query)) { - echo $sql_query.' fehlgeschlagen!
    '.$db->db_last_error(); + echo $sql_query.' fehlgeschlagen!
    '.$db->db_last_error()."\n"; + $message_sync.=$sql_query.' fehlgeschlagen!
    '.$db->db_last_error(); } else { - echo '
    Alte Datensätze werden gelöscht.
    ';flush(); + echo 'Alte Datensaetze werden geloescht.'."\n"; + flush(); + while ($row = $db->db_fetch_object($result)) { - $sql_query='DELETE FROM lehre.tbl_stundenplan WHERE stundenplan_id='.$db->db_add_param($row->stundenplan_id); + $sql_query = 'DELETE FROM lehre.tbl_stundenplan WHERE stundenplan_id='.$db->db_add_param($row->stundenplan_id); - if (!$result_delete=$db->db_query($sql_query)) + if (!$result_delete = $db->db_query($sql_query)) { - echo $sql_query.' fehlgeschlagen!
    '.$db->db_last_error(); - $message_sync.=$sql_query.' fehlgeschlagen!
    '.$db->db_last_error(); + echo $sql_query.' fehlgeschlagen!'.$db->db_last_error()."\n"; + + $message_sync .= $sql_query.' fehlgeschlagen!'.$db->db_last_error(); $count_err++; } else { $count_del++; - if ($count_del%10==0) + + if ($count_del % 10 == 0) { echo '-'; flush(); } + // Mails vorbereiten // Lektoren - if (mb_substr($row->uid,0,1)!='_') + if (mb_substr($row->uid,0,1) != '_') { if (!isset($message[$row->uid]->isalt)) { - if(!isset($message[$row->uid])) + if (!isset($message[$row->uid])) $message[$row->uid] = new stdClass(); - $message[$row->uid]->isalt=true; - $message[$row->uid]->mailadress=$row->uid.'@'.DOMAIN; - $message[$row->uid]->message_begin=$message_begin.'
    '; - if(!isset($message[$row->uid]->message)) - $message[$row->uid]->message=''; - $message[$row->uid]->message.=''.$p_de->t('lvplan/geloeschteStunden').' / '.$p_en->t('lvplan/geloeschteStunden').'
    + $message[$row->uid]->isalt = true; + $message[$row->uid]->mailadress = $row->uid.'@'.DOMAIN; + $message[$row->uid]->message_begin = $message_begin.'
    '; + + if (!isset($message[$row->uid]->message)) + $message[$row->uid]->message = ''; + + $message[$row->uid]->message .= ' + + '.$p_de->t('lvplan/geloeschteStunden').' / '.$p_en->t('lvplan/geloeschteStunden').'
    @@ -445,68 +503,93 @@ else '; } - $message[$row->uid]->message.="\n"; - $message[$row->uid]->message.=''; - $message[$row->uid]->message.=''; - $message[$row->uid]->message.=''; - $message[$row->uid]->message.=''; - $message[$row->uid]->message.=''; - $message[$row->uid]->message.=''; - $message[$row->uid]->message.=''; + $message[$row->uid]->message .= "\n"; + $message[$row->uid]->message .= ''; + $message[$row->uid]->message .= ''; + $message[$row->uid]->message .= ''; + $message[$row->uid]->message .= ''; + $message[$row->uid]->message .= ''; + $message[$row->uid]->message .= ''; + $message[$row->uid]->message .= ''; } + // Verband if ($mailstudents) { - $studenten = getStudentsFromGroup($row->studiengang_kz, $row->semester, $row->verband, $row->gruppe, $row->gruppe_kurzbz, $ss->studiensemester_kurzbz); + $studenten = getStudentsFromGroup( + $row->studiengang_kz, $row->semester, $row->verband, $row->gruppe, $row->gruppe_kurzbz, $ss->studiensemester_kurzbz + ); foreach ($studenten as $student) { if (!isset($message[$student]->isalt)) { - if(!isset($message[$student])) + if (!isset($message[$student])) $message[$student] = new stdClass(); - $message[$student]->isalt=true; - $message[$student]->mailadress=$student.'@'.DOMAIN; - $message[$student]->message_begin=$message_begin.'
    '; - if(!isset($message[$student]->message)) - $message[$student]->message=''; - $message[$student]->message.=''.$p_de->t('lvplan/geloeschteStunden').' / '.$p_en->t('lvplan/geloeschteStunden').'
    + $message[$student]->isalt = true; + $message[$student]->mailadress = $student.'@'.DOMAIN; + $message[$student]->message_begin = $message_begin.'
    '; + + if (!isset($message[$student]->message)) + $message[$student]->message = ''; + + $message[$student]->message .= + ' + '.$p_de->t('lvplan/geloeschteStunden').' / '.$p_en->t('lvplan/geloeschteStunden'). + '
    '.$p_de->t('lvplan/raum').'
    '.$p_en->t('lvplan/raum').'
    '.$p_de->t('lvplan/info').'
    '.$p_en->t('lvplan/info').'
    '.$row->ort_kurzbz.''.strtoupper($row->stg_typ.$row->stg_kurzbz).'-'.$row->semester.$row->verband.$row->gruppe.' '.$row->gruppe_kurzbz.''.$row->lektor.''.$row->datum.''.$row->stunde.' ('.$beginnzeit_arr[$row->stunde].')'.$row->lehrfach.'-'.$row->lehrform.' ('.$row->lehrfach_bez.')'.$row->titel.'
    '.$row->ort_kurzbz.''. + strtoupper($row->stg_typ.$row->stg_kurzbz).'-'.$row->semester.$row->verband.$row->gruppe.' '.$row->gruppe_kurzbz.''.$row->lektor.''.$row->datum.''.$row->stunde.' ('.$beginnzeit_arr[$row->stunde].')'.$row->lehrfach.'-'.$row->lehrform.' ('.$row->lehrfach_bez.')'.$row->titel.'
    - + - - + + '; } - $message[$student]->message.="\n"; - $message[$student]->message.=''; - $message[$student]->message.=''; - $message[$student]->message.=''; - $message[$student]->message.=''; - $message[$student]->message.=''; - $message[$student]->message.=''; - $message[$student]->message.=''; + + $message[$student]->message .= "\n"; + $message[$student]->message .= ''; + $message[$student]->message .= ''; + $message[$student]->message .= ''; + $message[$student]->message .= ''; + $message[$student]->message .= ''; + $message[$student]->message .= ''; + $message[$student]->message .= ''; } } } } - foreach($message as $msg) - if(isset($msg->isalt)) - $msg->message.='
    '.$p_de->t('lvplan/raum').'
    '.$p_en->t('lvplan/raum').'
    '.$p_de->t('lvplan/lehrverband').'
    '.$p_en->t('lvplan/lehrverband').'
    ' + .$p_de->t('lvplan/lehrverband').'
    '.$p_en->t('lvplan/lehrverband'). + ' +
    '.$p_de->t('lvplan/lektor').'
    '.$p_en->t('lvplan/lektor').'
    '.$p_de->t('global/datum').'
    '.$p_en->t('global/datum').'
    '.$p_de->t('lvplan/stdBeginn').'
    '.$p_en->t('lvplan/stdBeginn').'
    '.$p_de->t('lvplan/lehrfach').'
    '.$p_en->t('lvplan/lehrfach').'
    '. + $p_de->t('lvplan/stdBeginn').'
    '.$p_en->t('lvplan/stdBeginn'). + ' +
    '. + $p_de->t('lvplan/lehrfach').'
    '.$p_en->t('lvplan/lehrfach'). + ' +
    '.$p_de->t('lvplan/info').'
    '.$p_en->t('lvplan/info').'
    '.$row->ort_kurzbz.''.mb_strtoupper($row->stg_typ.$row->stg_kurzbz).'-'.$row->semester.$row->verband.$row->gruppe.' '.$row->gruppe_kurzbz.''.$row->lektor.''.$row->datum.''.$row->stunde.' ('.$beginnzeit_arr[$row->stunde].')'.$row->lehrfach.'-'.$row->lehrform.' ('.$row->lehrfach_bez.')'.$row->titel.'
    '.$row->ort_kurzbz.''. + mb_strtoupper($row->stg_typ.$row->stg_kurzbz).'-'.$row->semester.$row->verband.$row->gruppe.' '.$row->gruppe_kurzbz. + ''.$row->lektor.''.$row->datum.''.$row->stunde.' ('.$beginnzeit_arr[$row->stunde].')'.$row->lehrfach.'-'.$row->lehrform.' ('.$row->lehrfach_bez.')'.$row->titel.'

    '; + + foreach ($message as $msg) + if (isset($msg->isalt)) + $msg->message .= '
    '; } /************************************************** * Datensaetze holen die anders sind */ -echo '
    Geänderte Datensätze werden geholt.('.date('H:i:s').')
    ';flush(); -$message_stpl.='
    Geänderte Datensätze werden geholt.('.date('H:i:s').')
    '; -$sql_query="SELECT vw_stundenplandev.*, vw_stundenplan.datum AS old_datum, vw_stundenplan.stunde AS old_stunde, +echo 'Geaenderte Datensaetze werden geholt.('.date('H:i:s').')'."\n"; +flush(); + +$message_stpl .= '
    Geänderte Datensätze werden geholt.('.date('H:i:s').')
    '; + +$sql_query = "SELECT vw_stundenplandev.*, vw_stundenplan.datum AS old_datum, vw_stundenplan.stunde AS old_stunde, vw_stundenplan.ort_kurzbz AS old_ort_kurzbz, vw_stundenplan.lektor AS old_lektor, vw_stundenplan.uid AS old_uid, vw_stundenplan.titel AS old_titel, vw_stundenplan.anmerkung AS old_anmerkung @@ -524,103 +607,124 @@ $sql_query="SELECT vw_stundenplandev.*, vw_stundenplan.datum AS old_datum, vw_st vw_stundenplandev.gruppe_kurzbz!=vw_stundenplan.gruppe_kurzbz OR coalesce(vw_stundenplandev.titel,'')!=coalesce(vw_stundenplan.titel,'') OR vw_stundenplandev.fix!=vw_stundenplan.fix OR"; + if (LVPLAN_ANMERKUNG_ANZEIGEN) $sql_query .= " coalesce(vw_stundenplandev.anmerkung,'')!=coalesce(vw_stundenplan.anmerkung,'') OR"; + $sql_query .= " vw_stundenplandev.lehreinheit_id!=vw_stundenplan.lehreinheit_id ) AND vw_stundenplandev.datum>=".$db->db_add_param($datum_begin)." AND vw_stundenplandev.datum<=".$db->db_add_param($datum_ende)." ".$stgwheredev.";"; -//echo $sql_query.'
    '; - - if (!$result = $db->db_query($sql_query)) { - echo $sql_query.' fehlgeschlagen!
    '.$db->db_last_error(); - $message_sync.=$sql_query.' fehlgeschlagen!
    '.$db->db_last_error(); + echo $sql_query.' fehlgeschlagen!'.$db->db_last_error()."\n"; + + $message_sync .= $sql_query.' fehlgeschlagen!
    '.$db->db_last_error(); } else { - echo '
    Datensätze werden geändert.
    ';flush(); + echo 'Datensaetze werden geaendert.'."\n"; + flush(); + while ($row = $db->db_fetch_object($result)) { - //echo '.';flush(); // Alten Eintrag aus tbl_stundenplan holen - $sql_query="SELECT * FROM lehre.tbl_stundenplandev WHERE stundenplandev_id=".$db->db_add_param($row->stundenplandev_id).";"; + $sql_query = "SELECT * FROM lehre.tbl_stundenplandev WHERE stundenplandev_id=".$db->db_add_param($row->stundenplandev_id).";"; + if (!$result_old = $db->db_query($sql_query)) { - echo $sql_query.' fehlgeschlagen!
    '.$db->db_last_error(); - $message_sync.=$sql_query.' fehlgeschlagen!
    '.$db->db_last_error(); + echo $sql_query.' fehlgeschlagen!'.$db->db_last_error()."\n"; + + $message_sync .= $sql_query.' fehlgeschlagen!
    '.$db->db_last_error(); } else - $row_old=$db->db_fetch_object($result_old); + $row_old = $db->db_fetch_object($result_old); // Datensaetze aendern - $sql_query="UPDATE lehre.tbl_stundenplan SET - unr=".$db->db_add_param($row->unr). - ",mitarbeiter_uid=".$db->db_add_param($row->uid). - ",datum=".$db->db_add_param($row->datum). - ",stunde=".$db->db_add_param($row->stunde). - ",ort_kurzbz=".$db->db_add_param($row->ort_kurzbz). - ",studiengang_kz=".$db->db_add_param($row->studiengang_kz). - ",semester=".$db->db_add_param($row->semester); - if ($row->verband==null) - $sql_query.=',verband=NULL'; + $sql_query = "UPDATE lehre.tbl_stundenplan SET + unr = ".$db->db_add_param($row->unr). + ", mitarbeiter_uid = ".$db->db_add_param($row->uid). + ", datum = ".$db->db_add_param($row->datum). + ", stunde = ".$db->db_add_param($row->stunde). + ", ort_kurzbz = ".$db->db_add_param($row->ort_kurzbz). + ", studiengang_kz = ".$db->db_add_param($row->studiengang_kz). + ", semester = ".$db->db_add_param($row->semester); + + if ($row->verband == null) + $sql_query .= ', verband = NULL'; else - $sql_query.=",verband=".$db->db_add_param($row->verband); - if ($row->gruppe==null) - $sql_query.=',gruppe=NULL'; + $sql_query .= ", verband = ".$db->db_add_param($row->verband); + + if ($row->gruppe == null) + $sql_query .= ', gruppe = NULL'; else - $sql_query.=",gruppe=".$db->db_add_param($row->gruppe); - if ($row->gruppe_kurzbz==null) -// $sql_query.=",gruppe_kurzbz=NULL, titel=$row->titel"; --> Das war die urspruengliche query. row->titel von kindlm am 16.03.2012 entfernt und in eigenes if geschrieben. - $sql_query.=',gruppe_kurzbz=NULL'; + $sql_query .= ", gruppe = ".$db->db_add_param($row->gruppe); + + if ($row->gruppe_kurzbz == null) + $sql_query .= ', gruppe_kurzbz = NULL'; else - $sql_query.=",gruppe_kurzbz=".$db->db_add_param($row->gruppe_kurzbz); + $sql_query .= ", gruppe_kurzbz = ".$db->db_add_param($row->gruppe_kurzbz); + if (LVPLAN_ANMERKUNG_ANZEIGEN) //spalte anmerkung nur syncen, wenn im Config aktiv - $sql_query.=",anmerkung=".$db->db_add_param($row->anmerkung); - if ($row->titel=='') - $sql_query.=',titel=NULL'; + $sql_query .= ", anmerkung = ".$db->db_add_param($row->anmerkung); + + if ($row->titel == '') + $sql_query .= ', titel = NULL'; else - $sql_query.=",titel=".$db->db_add_param($row->titel); - if ($row->fix=='t') - $sql_query.=',fix=TRUE'; + $sql_query .= ", titel = ".$db->db_add_param($row->titel); + + if ($row->fix == 't') + $sql_query .= ', fix = TRUE'; else - $sql_query.=',fix=FALSE'; - $sql_query.=",updateamum=".$db->db_add_param($row->updateamum).",updatevon=".$db->db_add_param($row->updatevon); - if ($row->lehreinheit_id==null) - $sql_query.=',lehreinheit_id=NULL'; + $sql_query.=', fix = FALSE'; + + $sql_query .= ", updateamum = ".$db->db_add_param($row->updateamum).", updatevon = ".$db->db_add_param($row->updatevon); + + if ($row->lehreinheit_id == null) + $sql_query .= ', lehreinheit_id = NULL'; else - $sql_query.=",lehreinheit_id=".$db->db_add_param($row->lehreinheit_id); - $sql_query.=" WHERE stundenplan_id=".$db->db_add_param($row->stundenplandev_id).";"; - //echo $sql_query.'
    '; - if (!$result_update=$db->db_query($sql_query)) + $sql_query .= ", lehreinheit_id = ".$db->db_add_param($row->lehreinheit_id); + + $sql_query .= " WHERE stundenplan_id = ".$db->db_add_param($row->stundenplandev_id).";"; + + if (!$result_update = $db->db_query($sql_query)) { - echo $sql_query.' fehlgeschlagen!
    '.$db->db_last_error(); - $message_sync.=$sql_query.' fehlgeschlagen!
    '.$db->db_last_error(); + echo $sql_query.' fehlgeschlagen!'.$db->db_last_error()."\n"; + + $message_sync .= $sql_query.' fehlgeschlagen!
    '.$db->db_last_error(); $count_err++; } else { $count_upd++; - if ($count_upd%10==0) + + if ($count_upd % 10 == 0) { echo '-'; flush(); } + // Mails vorbereiten // Lektoren - if (mb_substr($row->uid,0,1)!='_') + if (mb_substr($row->uid, 0, 1) != '_') { if (!isset($message[$row->uid]->isset)) { - if(!isset($message[$row->uid])) + if (!isset($message[$row->uid])) $message[$row->uid] = new stdClass(); - $message[$row->uid]->isset=true; - $message[$row->uid]->mailadress=$row->uid.'@'.DOMAIN; - $message[$row->uid]->message_begin=$message_begin.'
    '; - if(!isset($message[$row->uid]->message)) - $message[$row->uid]->message=''; - $message[$row->uid]->message.=''.$p_de->t('lvplan/geaenderteStunden').' / '.$p_en->t('lvplan/geaenderteStunden').'
    + + $message[$row->uid]->isset = true; + $message[$row->uid]->mailadress = $row->uid.'@'.DOMAIN; + $message[$row->uid]->message_begin = $message_begin.'
    '; + + if (!isset($message[$row->uid]->message)) + $message[$row->uid]->message = ''; + + $message[$row->uid]->message .= ' + + '.$p_de->t('lvplan/geaenderteStunden').' / '.$p_en->t('lvplan/geaenderteStunden').' + +
    @@ -633,51 +737,64 @@ else '; } - $message[$row->uid]->message.="\n"; - $message[$row->uid]->message.=''; - $message[$row->uid]->message.=''; - $message[$row->uid]->message.=''; - $message[$row->uid]->message.=''; - $message[$row->uid]->message.=''; - $message[$row->uid]->message.=''; - $message[$row->uid]->message.=''; - $message[$row->uid]->message.=''; - - $message[$row->uid]->message.="\n"; - $message[$row->uid]->message.=''; - $myclass=($row->ort_kurzbz!=$row->old_ort_kurzbz?'marked':'unmarked'); - $message[$row->uid]->message.=''; + $message[$row->uid]->message .= "\n"; + $message[$row->uid]->message .= ''; + $message[$row->uid]->message .= ''; + $message[$row->uid]->message .= ''; + $message[$row->uid]->message .= ''; + $message[$row->uid]->message .= ''; + $message[$row->uid]->message .= ''; + $message[$row->uid]->message .= ''; + $message[$row->uid]->message .= ''; + $message[$row->uid]->message .= "\n"; + $message[$row->uid]->message .= ''; + $myclass=($row->ort_kurzbz != $row->old_ort_kurzbz?'marked':'unmarked'); + $message[$row->uid]->message .= ''; $myclass='unmarked'; - $message[$row->uid]->message.=''; - $myclass=($row->lektor!=$row->old_lektor?'marked':'unmarked'); - $message[$row->uid]->message.=''; - $myclass=(($row->datum!=$row->old_datum)?'marked':'unmarked'); - $message[$row->uid]->message.=''; - $myclass=(($row->stunde!=$row->old_stunde)?'marked':'unmarked'); - $message[$row->uid]->message.=''; - $myclass='unmarked'; - $message[$row->uid]->message.=''; - $myclass=($row->titel!=$row->old_titel?'marked':'unmarked'); - $message[$row->uid]->message.=''; + $message[$row->uid]->message .= ''; + $myclass = ($row->lektor != $row->old_lektor ? 'marked' : 'unmarked'); + $message[$row->uid]->message .= ''; + $myclass = (($row->datum != $row->old_datum) ? 'marked' : 'unmarked'); + $message[$row->uid]->message .= ''; + $myclass = (($row->stunde != $row->old_stunde) ? 'marked' : 'unmarked'); + $message[$row->uid]->message .= ''; + $myclass = 'unmarked'; + $message[$row->uid]->message .= ''; + $myclass = ($row->titel != $row->old_titel ? 'marked' : 'unmarked'); + $message[$row->uid]->message .= ''; } //wenn sich der Lektor geaendert hat dann auch den vorherigen lektor informieren //sofern es kein dummylektor ist - if($row->uid!=$row->old_uid) + if ($row->uid != $row->old_uid) { - if (mb_substr($row->old_uid,0,1)!='_') + if (mb_substr($row->old_uid, 0, 1) != '_') { if (!isset($message[$row->old_uid]->isset)) { - if(!isset($message[$row->old_uid])) + if (!isset($message[$row->old_uid])) $message[$row->old_uid] = new stdClass(); - $message[$row->old_uid]->isset=true; - $message[$row->old_uid]->mailadress=$row->old_uid.'@'.DOMAIN; - $message[$row->old_uid]->message_begin=$message_begin.'
    '; - if(!isset($message[$row->old_uid]->message)) + $message[$row->old_uid]->isset = true; + $message[$row->old_uid]->mailadress = $row->old_uid.'@'.DOMAIN; + $message[$row->old_uid]->message_begin = $message_begin.'
    '; + + if (!isset($message[$row->old_uid]->message)) $message[$row->old_uid]->message = ''; - $message[$row->old_uid]->message.=''.$p_de->t('lvplan/geaenderteStunden').' / '.$p_en->t('lvplan/geaenderteStunden').'
    + + $message[$row->old_uid]->message .= ' + + '.$p_de->t('lvplan/geaenderteStunden').' / '.$p_en->t('lvplan/geaenderteStunden').' + +
    '.$p_de->t('lvplan/status').'
    '.$p_en->t('lvplan/status').'
    '.$p_de->t('lvplan/info').'
    '.$p_en->t('lvplan/info').'
    '.$p_de->t('lvplan/vorher').' / '.$p_en->t('lvplan/vorher').': '.$row->old_ort_kurzbz.''.mb_strtoupper($row->stg_typ.$row->stg_kurzbz).'-'.$row->semester.$row->verband.$row->gruppe.' '.$row->gruppe_kurzbz.''.$row->old_lektor.''.$row->old_datum.''.$row->old_stunde.' ('.$beginnzeit_arr[$row->old_stunde].')'.$row->lehrfach.'-'.$row->lehrform.' ('.$row->lehrfach_bez.')'.$row->old_titel.'
    '.$p_de->t('lvplan/jetzt').' / '.$p_en->t('lvplan/jetzt').': '.$row->ort_kurzbz.'
    '.$p_de->t('lvplan/vorher').' / '.$p_en->t('lvplan/vorher').': '.$row->old_ort_kurzbz.''. + mb_strtoupper($row->stg_typ.$row->stg_kurzbz).'-'.$row->semester.$row->verband.$row->gruppe.' '.$row->gruppe_kurzbz. + ''.$row->old_lektor.''.$row->old_datum.''.$row->old_stunde.' ('.$beginnzeit_arr[$row->old_stunde].')'.$row->lehrfach.'-'.$row->lehrform.' ('.$row->lehrfach_bez.')'.$row->old_titel.'
    '.$p_de->t('lvplan/jetzt').' / '.$p_en->t('lvplan/jetzt').': '.$row->ort_kurzbz.''.strtoupper($row->stg_typ.$row->stg_kurzbz).'-'.$row->semester.$row->verband.$row->gruppe.' '.$row->gruppe_kurzbz.''.$row->lektor.''.$row->datum.''.$row->stunde.' ('.$beginnzeit_arr[$row->stunde].')'.$row->lehrfach.'-'.$row->lehrform.' ('.$row->lehrfach_bez.')'.$row->titel.'
    ----------------
    + '. + strtoupper($row->stg_typ.$row->stg_kurzbz).'-'.$row->semester.$row->verband.$row->gruppe.' '.$row->gruppe_kurzbz.' + + '.$row->lektor.''.$row->datum.''.$row->stunde.' ('.$beginnzeit_arr[$row->stunde].') + '.$row->lehrfach.'-'.$row->lehrform.' ('.$row->lehrfach_bez.') + '.$row->titel.'
    ----------------
    @@ -690,112 +807,148 @@ else '; } - $message[$row->old_uid]->message.="\n"; - $message[$row->old_uid]->message.=''; - $message[$row->old_uid]->message.=''; - $message[$row->old_uid]->message.=''; - $message[$row->old_uid]->message.=''; - $message[$row->old_uid]->message.=''; - $message[$row->old_uid]->message.=''; - $message[$row->old_uid]->message.=''; - $message[$row->old_uid]->message.=''; - $message[$row->old_uid]->message.="\n"; - $message[$row->old_uid]->message.=''; - $myclass=($row->ort_kurzbz!=$row->old_ort_kurzbz?'marked':'unmarked'); - $message[$row->old_uid]->message.=''; - $myclass='unmarked'; - $message[$row->old_uid]->message.=''; - $myclass=($row->lektor!=$row->old_lektor?'marked':'unmarked'); - $message[$row->old_uid]->message.=''; - $myclass=(($row->datum!=$row->old_datum)?'marked':'unmarked'); - $message[$row->old_uid]->message.=''; - $myclass=(($row->stunde!=$row->old_stunde)?'marked':'unmarked'); - $message[$row->old_uid]->message.=''; - $myclass='unmarked'; - $message[$row->old_uid]->message.=''; - $myclass=($row->titel!=$row->old_titel?'marked':'unmarked'); - $message[$row->old_uid]->message.=''; + $message[$row->old_uid]->message .= "\n"; + $message[$row->old_uid]->message .= ''; + $message[$row->old_uid]->message .= ''; + $message[$row->old_uid]->message .= ''; + $message[$row->old_uid]->message .= ''; + $message[$row->old_uid]->message .= ''; + $message[$row->old_uid]->message .= ''; + $message[$row->old_uid]->message .= ''; + $message[$row->old_uid]->message .= ''; + $message[$row->old_uid]->message .= "\n"; + $message[$row->old_uid]->message .= ''; + $myclass = ($row->ort_kurzbz!=$row->old_ort_kurzbz ? 'marked' : 'unmarked'); + $message[$row->old_uid]->message .= ''; + $myclass = 'unmarked'; + $message[$row->old_uid]->message .= ''; + $myclass = ($row->lektor != $row->old_lektor ? 'marked' : 'unmarked'); + $message[$row->old_uid]->message .= ''; + $myclass = (($row->datum != $row->old_datum) ? 'marked' : 'unmarked'); + $message[$row->old_uid]->message .= ''; + $myclass = (($row->stunde != $row->old_stunde) ? 'marked' : 'unmarked'); + $message[$row->old_uid]->message .= ''; + $myclass = 'unmarked'; + $message[$row->old_uid]->message .= ''; + $myclass = ($row->titel != $row->old_titel ? 'marked' : 'unmarked'); + $message[$row->old_uid]->message .= ''; } } + // Verband if ($mailstudents) { - $studenten = getStudentsFromGroup($row->studiengang_kz, $row->semester, $row->verband, $row->gruppe, $row->gruppe_kurzbz, $ss->studiensemester_kurzbz); + $studenten = getStudentsFromGroup( + $row->studiengang_kz, $row->semester, $row->verband, $row->gruppe, $row->gruppe_kurzbz, $ss->studiensemester_kurzbz + ); foreach ($studenten as $student) { if (!isset($message[$student]->isset)) { - if(!isset($message[$student])) + if (!isset($message[$student])) $message[$student] = new stdClass(); - $message[$student]->isset=true; - $message[$student]->mailadress=$student.'@'.DOMAIN; - $message[$student]->message_begin=$message_begin.'
    '; - if(!isset($message[$student]->message)) - $message[$student]->message=''; - $message[$student]->message.=''.$p_de->t('lvplan/geaenderteStunden').' / '.$p_en->t('lvplan/geaenderteStunden').'
    -
    '.$p_de->t('lvplan/status').'
    '.$p_en->t('lvplan/status').'
    '.$p_de->t('lvplan/info').'
    '.$p_en->t('lvplan/info').'
    '.$p_de->t('lvplan/vorher').' / '.$p_en->t('lvplan/vorher').': '.$row->old_ort_kurzbz.''.mb_strtoupper($row->stg_typ.$row->stg_kurzbz).'-'.$row->semester.$row->verband.$row->gruppe.' '.$row->gruppe_kurzbz.''.$row->old_lektor.''.$row->old_datum.''.$row->old_stunde.' ('.$beginnzeit_arr[$row->old_stunde].')'.$row->lehrfach.'-'.$row->lehrform.' ('.$row->lehrfach_bez.')'.$row->old_titel.'
    '.$p_de->t('lvplan/jetzt').' / '.$p_en->t('lvplan/jetzt').': '.$row->ort_kurzbz.''.strtoupper($row->stg_typ.$row->stg_kurzbz).'-'.$row->semester.$row->verband.$row->gruppe.' '.$row->gruppe_kurzbz.''.$row->lektor.''.$row->datum.''.$row->stunde.' ('.$beginnzeit_arr[$row->stunde].')'.$row->lehrfach.'-'.$row->lehrform.' ('.$row->lehrfach_bez.')'.$row->titel.'
    ----------------
    '.$p_de->t('lvplan/vorher').' / '.$p_en->t('lvplan/vorher').': '.$row->old_ort_kurzbz.''. + mb_strtoupper($row->stg_typ.$row->stg_kurzbz).'-'.$row->semester.$row->verband.$row->gruppe.' '.$row->gruppe_kurzbz. + ''.$row->old_lektor.''.$row->old_datum.''.$row->old_stunde.' ('.$beginnzeit_arr[$row->old_stunde].')'.$row->lehrfach.'-'.$row->lehrform.' ('.$row->lehrfach_bez.')'.$row->old_titel.'
    '.$p_de->t('lvplan/jetzt').' / '.$p_en->t('lvplan/jetzt').': '.$row->ort_kurzbz.' + '. + strtoupper($row->stg_typ.$row->stg_kurzbz).'-'.$row->semester.$row->verband.$row->gruppe.' '.$row->gruppe_kurzbz. + ' + '.$row->lektor.''.$row->datum.' + '.$row->stunde.' ('.$beginnzeit_arr[$row->stunde].') + + '.$row->lehrfach.'-'.$row->lehrform.' ('.$row->lehrfach_bez.') + + '.$row->titel.'
    ---------------- +
    - - - - - - - - - '; - } - $message[$student]->message.="\n"; - $message[$student]->message.=''; - $message[$student]->message.=''; - $message[$student]->message.=''; - $message[$student]->message.=''; - $message[$student]->message.=''; - $message[$student]->message.=''; - $message[$student]->message.=''; - $message[$student]->message.=''; + $message[$student]->isset = true; + $message[$student]->mailadress = $student.'@'.DOMAIN; + $message[$student]->message_begin = $message_begin.'
    '; - $message[$student]->message.="\n"; - $message[$student]->message.=''; - $myclass=($row->ort_kurzbz!=$row->old_ort_kurzbz?'marked':'unmarked'); - $message[$student]->message.=''; - $myclass='unmarked'; - $message[$student]->message.=''; - $myclass=($row->lektor!=$row->old_lektor?'marked':'unmarked'); - $message[$student]->message.=''; - $myclass=(($row->datum!=$row->old_datum)?'marked':'unmarked'); - $message[$student]->message.=''; - $myclass=(($row->stunde!=$row->old_stunde)?'marked':'unmarked'); - $message[$student]->message.=''; - $myclass='unmarked'; - $message[$student]->message.=''; - $myclass=($row->titel!=$row->old_titel?'marked':'unmarked'); - $message[$student]->message.=''; + if (!isset($message[$student]->message)) + $message[$student]->message = ''; + + $message[$student]->message .= ' + + '.$p_de->t('lvplan/geaenderteStunden').' / '.$p_en->t('lvplan/geaenderteStunden').' + +
    +
    '.$p_de->t('lvplan/status').'
    '.$p_en->t('lvplan/status').'
    '.$p_de->t('lvplan/raum').'
    '.$p_en->t('lvplan/raum').'
    '.$p_de->t('lvplan/lehrverband').'
    '.$p_en->t('lvplan/lehrverband').'
    '.$p_de->t('lvplan/lektor').'
    '.$p_en->t('lvplan/lektor').'
    '.$p_de->t('global/datum').'
    '.$p_en->t('global/datum').'
    '.$p_de->t('lvplan/stdBeginn').'
    '.$p_en->t('lvplan/stdBeginn').'
    '.$p_de->t('lvplan/lehrfach').'
    '.$p_en->t('lvplan/lehrfach').'
    '.$p_de->t('lvplan/info').'
    '.$p_en->t('lvplan/info').'
    '.$p_de->t('lvplan/vorher').' / '.$p_en->t('lvplan/vorher').': '.$row->old_ort_kurzbz.''.mb_strtoupper($row->stg_typ.$row->stg_kurzbz).'-'.$row->semester.$row->verband.$row->gruppe.' '.$row->gruppe_kurzbz.''.$row->old_lektor.''.$row->old_datum.''.$row->old_stunde.' ('.$beginnzeit_arr[$row->old_stunde].')'.$row->lehrfach.'-'.$row->lehrform.' ('.$row->lehrfach_bez.')'.$row->old_titel.'
    '.$p_de->t('lvplan/jetzt').' / '.$p_en->t('lvplan/jetzt').': '.$row->ort_kurzbz.''.mb_strtoupper($row->stg_typ.$row->stg_kurzbz).'-'.$row->semester.$row->verband.$row->gruppe.' '.$row->gruppe_kurzbz.''.$row->lektor.''.$row->datum.''.$row->stunde.' ('.$beginnzeit_arr[$row->stunde].')'.$row->lehrfach.'-'.$row->lehrform.' ('.$row->lehrfach_bez.')'.$row->titel.'
    ----------------
    + + + + + + + + + '; + } + + $message[$student]->message .= "\n"; + $message[$student]->message .= ''; + $message[$student]->message .= ''; + $message[$student]->message .= ''; + $message[$student]->message .= ''; + $message[$student]->message .= ''; + $message[$student]->message .= ''; + $message[$student]->message .= ''; + $message[$student]->message .= ''; + $message[$student]->message .= "\n"; + $message[$student]->message .= ''; + $myclass = ($row->ort_kurzbz != $row->old_ort_kurzbz ? 'marked' : 'unmarked'); + $message[$student]->message .= ''; + $myclass = 'unmarked'; + $message[$student]->message .= ''; + $myclass = ($row->lektor != $row->old_lektor ? 'marked' : 'unmarked'); + $message[$student]->message .= ''; + $myclass = (($row->datum != $row->old_datum) ? 'marked' : 'unmarked'); + $message[$student]->message .= ''; + $myclass = (($row->stunde != $row->old_stunde) ? 'marked' : 'unmarked'); + $message[$student]->message .= ''; + $myclass = 'unmarked'; + $message[$student]->message .= ''; + $myclass = ($row->titel!=$row->old_titel ? 'marked' : 'unmarked'); + $message[$student]->message .= ''; } } } } - foreach($message as $msg) - if(isset($msg->isset)) - $msg->message.='
    '.$p_de->t('lvplan/status').'
    '.$p_en->t('lvplan/status').'
    '.$p_de->t('lvplan/raum').'
    '.$p_en->t('lvplan/raum').'
    '.$p_de->t('lvplan/lehrverband').'
    '.$p_en->t('lvplan/lehrverband').'
    '.$p_de->t('lvplan/lektor').'
    '.$p_en->t('lvplan/lektor').'
    '.$p_de->t('global/datum').'
    '.$p_en->t('global/datum').'
    '.$p_de->t('lvplan/stdBeginn').'
    '.$p_en->t('lvplan/stdBeginn').'
    '.$p_de->t('lvplan/lehrfach').'
    '.$p_en->t('lvplan/lehrfach').'
    '.$p_de->t('lvplan/info').'
    '.$p_en->t('lvplan/info').'
    '.$p_de->t('lvplan/vorher').' / '.$p_en->t('lvplan/vorher').': '.$row->old_ort_kurzbz.''. + mb_strtoupper($row->stg_typ.$row->stg_kurzbz).'-'.$row->semester.$row->verband.$row->gruppe.' '.$row->gruppe_kurzbz. + ''.$row->old_lektor.''.$row->old_datum.''.$row->old_stunde.' ('.$beginnzeit_arr[$row->old_stunde].')'.$row->lehrfach.'-'.$row->lehrform.' ('.$row->lehrfach_bez.')'.$row->old_titel.'
    '.$p_de->t('lvplan/jetzt').' / '.$p_en->t('lvplan/jetzt').': '.$row->ort_kurzbz.' + '. + mb_strtoupper($row->stg_typ.$row->stg_kurzbz).'-'.$row->semester. + $row->verband.$row->gruppe.' '.$row->gruppe_kurzbz.' + + '.$row->lektor.''.$row->datum.''.$row->stunde.' ('.$beginnzeit_arr[$row->stunde].') + '.$row->lehrfach.'-'.$row->lehrform.' ('.$row->lehrfach_bez.') + '.$row->titel.'
    ----------------

    '; + + foreach ($message as $msg) + if (isset($msg->isset)) + $msg->message .= '
    '; } /************************************************** * Mails an Lektoren und Studenten schicken */ + $message_help = ''; + if ($sendmail) { foreach ($message as $msg) { - $mail = new mail($msg->mailadress,MAIL_LVPLAN,'LV-Plan Update','Sie muessen diese Mail als HTML-Mail anzeigen um die LV-Plan Änderungen anzuzeigen'); + $mail = new mail($msg->mailadress, MAIL_LVPLAN, 'LV-Plan Update', 'Sie muessen diese Mail als HTML-Mail anzeigen um die LV-Plan Änderungen anzuzeigen'); $mail->setHTMLContent($msg->message_begin.$msg->message); + if ($mail->send()) { - echo 'Mail an '.$msg->mailadress.' wurde verschickt!
    '; + echo 'Mail an '.$msg->mailadress.' wurde verschickt!'."\n"; + $message_stpl.='Mail an '.$msg->mailadress.' wurde verschickt!
    '; + if ($message_help != $msg->message) { $message_summary .= $msg->message; @@ -805,81 +958,99 @@ if ($sendmail) } else { - echo 'Mail an '.$msg->mailadress.' konnte nicht verschickt werden!
    '; - $message_sync.='Mail an '.$msg->mailadress.' konnte ***nicht*** verschickt werden!
    '; + echo 'Mail an '.$msg->mailadress.' konnte nicht verschickt werden!'."\n"; + + $message_sync .= 'Mail an '.$msg->mailadress.' konnte ***nicht*** verschickt werden!
    '; } } } -if(defined('LVPLAN_HORDE_SYNC') && LVPLAN_HORDE_SYNC===true) +if (defined('LVPLAN_HORDE_SYNC') && LVPLAN_HORDE_SYNC === true) { // Alle User bei denen sich der LVPlan veraendert hat // werden in ein File gesichert. Bei diesen Personen wird der LVPlan im Horde aktualisiert - $users=array(); - foreach ($message as $uid=>$msg) + $users = array(); + + foreach ($message as $uid => $msg) { - $users[]=$uid; + $users[] = $uid; } $uidfile = DOC_ROOT.'../system/hordelvplansync/lvplanupdate.txt'; // Letzte Durchlaufzeit des Scripts holen // anhand der Aenderungszeit des Textfiles mit den UIDs - if(!$lastmod = filemtime($uidfile)) - $lastmod=time()-86400; // Wenn die Zeit nicht ermittelt werden kann, werden die letzten 24 Std genommen + if (!$lastmod = filemtime($uidfile)) + $lastmod = time() - 86400; // Wenn die Zeit nicht ermittelt werden kann, werden die letzten 24 Std genommen // Zusaetzlich jene holen, bei denen sich die Reservierungen geaendert haben $qry = "SELECT * FROM campus.tbl_reservierung WHERE insertamum>'".date('Y-m-d H:i:s',$lastmod)."'"; - if($result = $db->db_query($qry)) + if ($result = $db->db_query($qry)) { - while($row = $db->db_fetch_object($result)) + while ($row = $db->db_fetch_object($result)) { $users[] = $row->uid; + //Wenn fuer eine Gruppe reserviert wurde, dann die Personen aus der Gruppe holen - if($row->semester!='' || $row->verband!='' || $row->gruppe!='' || $row->gruppe_kurzbz!='') + if ($row->semester != '' || $row->verband != '' || $row->gruppe != '' || $row->gruppe_kurzbz != '') { - $studenten = getStudentsFromGroup($row->studiengang_kz, $row->semester, $row->verband, $row->gruppe, $row->gruppe_kurzbz, $ss->studiensemester_kurzbz); + $studenten = getStudentsFromGroup( + $row->studiengang_kz, $row->semester, $row->verband, $row->gruppe, $row->gruppe_kurzbz, $ss->studiensemester_kurzbz + ); + $users = array_merge($users, $studenten); } } } + // geaenderte User in Textfile schreiben $users = array_unique($users); - if(count($users)>0) + + if (count($users) > 0) { - if($fp = fopen($uidfile, 'a')) + if ($fp = fopen($uidfile, 'a')) { foreach($users as $uid) { fwrite($fp, $uid."\n"); } - fclose($fp); - //Horde Syncro starten - //chdir(DOC_ROOT.'../system/hordelvplansync/'); - //exec('php5 synchordelvplan.php lvplanupdate.txt >>/var/log/sync/synchordelvplan.log 2>&1'); + fclose($fp); } } } + // Mail an Admin -$message_tmp=$count_upd.' Datensätze wurden geändert.
    +$message_tmp = $count_upd.' Datensätze wurden geändert.
    '.$count_ins.' Datensätze wurden hinzugefügt.
    '.$count_del.' Datensätze wurden gelöscht.
    '.$count_err.' Fehler sind dabei aufgetreten!

    '; -echo '
    '.$message_tmp; + +echo $count_upd.' Datensaetze wurden geaendert.'."\n". + $count_ins.' Datensaetze wurden hinzugefuegt.'."\n". + $count_del.' Datensaetze wurden geloescht.'."\n". + $count_err.' Fehler sind dabei aufgetreten!'."\n"; //Bricht den Code um, da es sonst zu Anzeigefehlern im Mail kommen kann $message_stpl = wordwrap($message_stpl, 70); $message_summary = wordwrap($message_summary, 70); -$message_sync=''.$message_tmp.$message_sync.$message_stpl.'

    Details

    '.$message_summary.''; -$mail = new mail(MAIL_ADMIN,MAIL_LVPLAN,'LV-Plan Update Zusammenfassung','Sie muessen diese Mail als HTML-Mail anzeigen um die LV-Plan Änderungen anzuzeigen'); + +// Message sync +$message_sync = ''.$message_tmp.$message_sync.$message_stpl.'

    Details

    '.$message_summary.''; + +$mail = new mail(MAIL_ADMIN, MAIL_LVPLAN, 'LV-Plan Update Zusammenfassung', 'Sie muessen diese Mail als HTML-Mail anzeigen um die LV-Plan Änderungen anzuzeigen'); $mail->setHTMLContent($message_sync); -$mail->send(); -$message_stpl=''.$message_tmp.$message_stpl.'

    Details

    '.$message_summary.''; +if (!$mail->send()) + echo 'Error occurred while sending email to '.MAIL_ADMIN."\n"; + +// Message stpl +$message_stpl = ''.$message_tmp.$message_stpl.'

    Details

    '.$message_summary.''; + $mail = new mail(MAIL_LVPLAN, MAIL_LVPLAN, 'LV-Plan Update Zusammenfassung', 'Sie muessen diese Mail als HTML-Mail anzeigen um die LV-Plan Änderungen anzuzeigen'); $mail->setHTMLContent($message_stpl); -$mail->send(); +if (!$mail->send()) + echo 'Error occurred while sending email to '.MAIL_LVPLAN."\n"; + ?> - - + diff --git a/vilesci/bis/lehrgangsmeldung.php b/vilesci/bis/lehrgangsmeldung.php index 9cc560d32..b9d6a2526 100644 --- a/vilesci/bis/lehrgangsmeldung.php +++ b/vilesci/bis/lehrgangsmeldung.php @@ -242,29 +242,37 @@ if($result = $db->db_query($qry)) $zustell_strasse = $rowzustelladr->strasse; $zustell_nation = $rowzustelladr->nation; } - - // eMail-Adresse - $qry_mail = " + + // FH eMail-Adresse FH aus UID@Domain + $email = ''; + if ($row->student_uid != '') + { + $email = $row->student_uid. '@'. DOMAIN; + } + + // private eMail-Adresse + $email_privat = ''; + $qry_privmail = " SELECT kontakt FROM public.tbl_kontakt - WHERE kontakttyp = 'email' - AND zustellung = TRUE - AND person_id = ". $db->db_add_param($row->pers_id). " - ORDER BY insertamum DESC LIMIT 1; + WHERE zustellung = TRUE + AND kontakttyp = 'email' + AND person_id=". $db->db_add_param($row->pers_id). " + ORDER BY insertamum DESC + LIMIT 1; "; - - $email = ''; - if ($result_email = $db->db_query($qry_mail)) + + if ($privmail_result = $db->db_query($qry_privmail)) { - if($db->db_num_rows($result_email) == 1) + if($db->db_num_rows($privmail_result) == 1) { - if($row_mail = $db->db_fetch_object($result_email)) + if ($row_privmail = $db->db_fetch_object($privmail_result)) { - $email = $row_mail->kontakt; + $email_privat = $row_privmail->kontakt; } } } - + if($row->gebdatum<'1920-01-01' OR $row->gebdatum==null OR $row->gebdatum=='') { $error_log.=(!empty($error_log)?', ':'')."Geburtsdatum ('".$row->gebdatum."')"; @@ -620,7 +628,8 @@ if($result = $db->db_query($qry)) $datei.=" ".$row->svnr.""; } - if($row->ersatzkennzeichen!='') + // Ersatzkennzeichen nur inkludieren wenn svnr nicht gesetzt + if($row->ersatzkennzeichen!='' && $row->svnr == null) { $datei.=" ".$row->ersatzkennzeichen.""; @@ -648,7 +657,8 @@ if($result = $db->db_query($qry)) } $datei.=" - ". $email. " + ". $email_privat. " + ". $email. " ".$row->zgv_code." ".date("dmY", $datumobj->mktime_fromdate($row->zgvdatum)).""; diff --git a/vilesci/bis/studentenmeldung.php b/vilesci/bis/studentenmeldung.php index fb723df75..901181a24 100644 --- a/vilesci/bis/studentenmeldung.php +++ b/vilesci/bis/studentenmeldung.php @@ -76,6 +76,7 @@ $stgart=''; $orgform_code=''; $status=''; $datei=''; +$dateiNurBewerber=''; $aktstatus=''; $aktstatus_datum=''; $mob=''; @@ -319,8 +320,7 @@ else if($result = $db->db_query($qry)) { - - $datei.=" + $header =" ".$erhalter." ".date("dmY", $datumobj->mktime_fromdate($bisdatum))." @@ -328,6 +328,10 @@ if($result = $db->db_query($qry)) ".$stg_kz.""; + + $datei .= $header; + $dateiNurBewerber .= $header; + while($row = $db->db_fetch_object($result)) { $datei.= GenerateXMLStudentBlock($row); @@ -343,17 +347,29 @@ if($result = $db->db_query($qry)) $orgcodes = array_unique($orgform_code_array); //Mischform foreach($orgcodes as $code) - $datei.= GenerateXMLBewerberBlock($code); + { + $bewerberBlock=GenerateXMLBewerberBlock($code); + $datei.=$bewerberBlock; + $dateiNurBewerber.=$bewerberBlock; + } } else - $datei.= GenerateXMLBewerberBlock(); + { + $bewerberBlock=GenerateXMLBewerberBlock(); + $datei.=$bewerberBlock; + $dateiNurBewerber.=$bewerberBlock; + } } } -$datei.=" +$footer=" "; + +$datei.=$footer; +$dateiNurBewerber.=$footer; + echo ' @@ -592,6 +608,12 @@ $dateiausgabe=fopen($ddd,'w'); fwrite($dateiausgabe,$datei); fclose($dateiausgabe); +$dddNurBew='bisdaten/bismeldung_bewerber_'.$ssem.'_Stg'.$stg_kz.'.xml'; + +$dateiausgabe=fopen($dddNurBew,'w'); +fwrite($dateiausgabe,$dateiNurBewerber); +fclose($dateiausgabe); + $eee='bisdaten/tabelle_'.$ssem.'_Stg'.$stg_kz.'.html'; $dateiausgabe=fopen($eee,'w'); @@ -602,6 +624,7 @@ if(file_exists($ddd)) { echo 'BIS-Meldung Stg '.$stg_kz.' archivieren
    '; echo 'XML-Datei für BIS-Meldung Stg '.$stg_kz.'
    '; + echo 'XML-Datei für BIS-Meldung Stg '.$stg_kz.' - nur Bewerberdaten
    '; } if(file_exists($eee)) { @@ -735,6 +758,29 @@ function GenerateXMLStudentBlock($row) $email = $row->student_uid. '@'. DOMAIN; } + // private eMail-Adresse + $email_privat = ''; + $qry_privmail = " + SELECT kontakt + FROM public.tbl_kontakt + WHERE zustellung = TRUE + AND kontakttyp = 'email' + AND person_id=". $db->db_add_param($row->pers_id). " + ORDER BY insertamum DESC + LIMIT 1; + "; + + if ($privmail_result = $db->db_query($qry_privmail)) + { + if($db->db_num_rows($privmail_result) == 1) + { + if ($row_privmail = $db->db_fetch_object($privmail_result)) + { + $email_privat = $row_privmail->kontakt; + } + } + } + if($row->gebdatum<'1920-01-01' OR $row->gebdatum==null OR $row->gebdatum=='') { $error_log.=(!empty($error_log)?', ':'')."Geburtsdatum ('".$row->gebdatum."')"; @@ -1240,7 +1286,9 @@ function GenerateXMLStudentBlock($row) $datei .= " " . $row->svnr . ""; } - if ($row->ersatzkennzeichen != '') + + // Ersatzkennzeichen nur inkludieren wenn svnr nicht gesetzt + if ($row->ersatzkennzeichen != '' && $row->svnr == null) { $datei .= " " . $row->ersatzkennzeichen . ""; @@ -1273,11 +1321,16 @@ function GenerateXMLStudentBlock($row) "; } + if ($email_privat != '') + { + $datei .= " + " . $email_privat . ""; + } + if ($email != '') { $datei .= " - " . $email . " - "; + " . $email . ""; } if(!$ausserordentlich) @@ -1508,12 +1561,12 @@ function GenerateXMLStudentBlock($row) if ($aktstatus != 'Incoming' && $rowio->ects_erworben != '') { $datei.=" - ".$rowio->ects_erworben.""; + ".round($rowio->ects_erworben).""; } if ($aktstatus != 'Incoming' && $rowio->ects_angerechnet != '') { $datei.=" - ".$rowio->ects_angerechnet.""; + ".round($rowio->ects_angerechnet).""; } foreach ($aufenthaltfoerderung_code_arr as $aufenthaltfoerderung_code) { diff --git a/vilesci/fhausweis/kartenruecknahme.php b/vilesci/fhausweis/kartenruecknahme.php index 7e67da753..00518a293 100644 --- a/vilesci/fhausweis/kartenruecknahme.php +++ b/vilesci/fhausweis/kartenruecknahme.php @@ -26,15 +26,20 @@ require_once('../../include/functions.inc.php'); require_once('../../include/person.class.php'); require_once('../../include/benutzer.class.php'); require_once('../../include/student.class.php'); +require_once('../../include/prestudent.class.php'); +require_once('../../include/mitarbeiter.class.php'); require_once('../../include/studiengang.class.php'); require_once('../../include/betriebsmittel.class.php'); require_once('../../include/betriebsmittelperson.class.php'); require_once('../../include/benutzerberechtigung.class.php'); +require_once('../../include/datum.class.php'); +require_once('../../include/studiensemester.class.php'); $uid = get_uid(); $rechte = new benutzerberechtigung(); $rechte->getBerechtigungen($uid); +$datum_obj = new datum(); echo ' @@ -44,22 +49,61 @@ echo ' - Kartentausch + Kartenrücknahme -

    Zutrittskarte - Ruecknahme

    '; +

    Zutrittskarte - Rücknahme

    '; -if(!$rechte->isBerechtigt('basis/fhausweis', 'suid')) +if(!$rechte->isBerechtigt('basis/fhausweis', 's')) die('Sie haben keine Berechtigung für diese Seite'); $db = new basis_db(); $kartennummer = (isset($_POST['kartennummer'])?$_POST['kartennummer']:''); $action=(isset($_POST['action'])?$_POST['action']:''); -if ($action == 'kartenruecknahme') +if ($action == 'karte_loeschen') +{ + if(!$rechte->isBerechtigt('basis/fhausweis', 'suid')) + die('Sie haben keine Berechtigung zum löschen von Karten'); + + $bmp = new betriebsmittelperson(); + if ($bmp->getKartenzuordnung($kartennummer, false)) + { + if ($bmp->betriebsmittelperson_id != '') + { + if ($bmp->delete($bmp->betriebsmittelperson_id)) + { + if ($bmp->delete_betriebsmittel($bmp->betriebsmittel_id)) + { + echo 'Karte erfolgreich gelöscht'; + } + else + { + echo 'Fehler beim löschen der Betriebsmittel_id: '.$bmp->betriebsmittel_id.''; + } + } + else + { + echo 'Fehler beim löschen der Betriebsmittelperson_id: '.$bmp->betriebsmittelperson_id.''; + } + } + else + { + echo 'Diese Karte ist derzeit nicht zugewiesen'; + } + } + else + { + echo 'Diese Karte ist derzeit nicht zugewiesen'; + } + + echo '


    '; +} + +if ($action == 'kartenabfrage' || $action == 'kartenruecknahme') { $bmp = new betriebsmittelperson(); - if ($bmp->getKartenzuordnung($kartennummer)) + if ($bmp->getKartenzuordnung($kartennummer, false)) { if ($bmp->uid != '') { @@ -72,25 +116,28 @@ if ($action == 'kartenruecknahme') } else { - $error=false; - //Neue Karte aktivieren $bmp = new betriebsmittelperson(); if ($bmp->getKartenzuordnungPerson($benutzer->person_id, $kartennummer)) { - if ($bmp->ausgegebenam != '' && $bmp->retouram == '') + if ($action == 'kartenruecknahme') { - $bmp->retouram=date('Y-m-d'); + if(!$rechte->isBerechtigt('basis/fhausweis', 'su')) + die('Sie haben keine Berechtigung zum aktualisieren von Kartendaten'); + + $bmp->retouram = date('Y-m-d'); $bmp->updateamum = date('Y-m-d H:i:s'); $bmp->updatevon = $uid; if(!$bmp->save(false)) { - echo 'Fehler beim Tauschen: '.$bmp->errormsg.''; - $error=true; + echo 'Fehler beim austragen der Karte'; } else - echo 'Karte wurde erfolgreich ausgetragen.
    - + echo 'Karte wurde erfolgreich ausgetragen.'; + } + else + { + echo '
    + UID: '.$benutzer->uid.'
    + Karte augegeben am: '.($bmp->ausgegebenam != '' ? $datum_obj->formatDatum($bmp->ausgegebenam,'d.m.Y') : 'Karte nicht ausgegeben').'
    + Karte retour am: '.($bmp->retouram != '' ? $datum_obj->formatDatum($bmp->retouram,'d.m.Y') : 'Karte nicht retourniert').'
    '; + if ($bmp->beschreibung != '') + { + echo 'Beschreibung: '.$bmp->beschreibung.'
    '; + } + $student = new student(); + $mitarbeiter = new mitarbeiter(); + if ($student->load($bmp->uid)) + { + $prestudent = new prestudent(); + if ($prestudent->getLastStatus($student->prestudent_id)) + { + echo '
    Letzter Status: '; + $style = ''; + if ($prestudent->status_kurzbz == 'Abbrecher' || $prestudent->status_kurzbz == 'Absolvent') + { + $style = 'style="color: red; font-weight: bold"'; + } + echo ''.$prestudent->status_kurzbz.' im '; + $style = ''; + $studiensemester = new studiensemester(); + if ($prestudent->studiensemester_kurzbz != $studiensemester->getakt()) + { + $style = 'style="color: red; font-weight: bold"'; + } + echo ''.$prestudent->studiensemester_kurzbz.'
    '; + } + } + elseif ($mitarbeiter->load($bmp->uid)) + { + echo '
    Letzter Status: '.($benutzer->bnaktiv ? 'Mitarbeiter*in aktiv' : 'Mitarbeiter*in inaktiv seit '.$datum_obj->formatDatum($benutzer->updateaktivam,'d.m.Y').'').'
    '; + } + else + { + echo '
    Kein/e Mitarbeiter*in oder Student*in
    '; + } + echo '
    -
    Vorname: '.$benutzer->vorname.'
    Nachname: '.$benutzer->nachname.'
    - UID: '.$benutzer->uid.'
    -
    '; - } - else - { - echo 'Karte ist nicht ausgegeben oder wurde bereits retourniert'; +
    '; + + if ($bmp->retouram == '') + { + echo '
    + + + +

    '; + } + + if($rechte->isBerechtigt('basis/fhausweis', 'suid')) + { + echo '
    + + + ausgegebenam != '' || $bmp->retouram != '') + { + echo ' onclick="return confirm(\'Die Karte wurde ausgegeben oder retourniert. Wollen Sie sie wirklich löschen?\')"'; + } + echo '/> +
    '; + } } } else @@ -116,7 +223,6 @@ if ($action == 'kartenruecknahme') Fehler beim Tauschen: Die Karte wurde dieser Person noch nicht zugeordnet ('.$benutzer->uid.' '.$kartennummer.') '; - $error = true; } } } @@ -144,10 +250,10 @@ Ziehen Sie die neue Karte über den Hitag Kartenleser um die Karte zu deaktivier

    - + Kartennummer: - +
    '; diff --git a/vilesci/fhausweis/kartezuweisen.php b/vilesci/fhausweis/kartezuweisen.php index 1a6ebfef6..1e2972d9e 100644 --- a/vilesci/fhausweis/kartezuweisen.php +++ b/vilesci/fhausweis/kartezuweisen.php @@ -44,13 +44,13 @@ echo ' - - - - - + + + + + - Kartentausch + Karte zuweisen +