From dd610c83d98da7c695a3bc9831878e19327b18ae Mon Sep 17 00:00:00 2001 From: Paolo Date: Fri, 9 Mar 2018 15:14:16 +0100 Subject: [PATCH 01/12] - Added navigation.php in application/config to configure menus used by NavigationWidget - Addded controller system/Navigation to retrive menus via ajax - Renamed method _setNavigationMenuArray to setNavigationMenuArray and set as public in system/infocenter/InfoCenter - Now the InfoCenter menu is stored in the session - The menu is generated by the widget NavigationWidget via JS - No need anymore to give as parameters to the views the menu arrays --- application/config/navigation.php | 75 +++++++++ application/controllers/system/Navigation.php | 98 +++++++++++ .../system/infocenter/InfoCenter.php | 53 +++--- application/views/home.php | 28 +--- .../views/system/infocenter/infocenter.php | 12 +- .../system/infocenter/infocenterDetails.php | 12 +- application/views/widgets/filter/filter.php | 29 +++- .../views/widgets/filter/saveFilter.php | 6 +- application/views/widgets/navigation.php | 4 +- .../views/widgets/navigationHeader.php | 44 ++++- application/views/widgets/navigationMenu.php | 157 ++++++++++++++---- .../widgets/NavigationHeaderWidget.php | 4 +- application/widgets/NavigationMenuWidget.php | 76 --------- application/widgets/NavigationWidget.php | 5 +- 14 files changed, 405 insertions(+), 198 deletions(-) create mode 100644 application/config/navigation.php create mode 100644 application/controllers/system/Navigation.php diff --git a/application/config/navigation.php b/application/config/navigation.php new file mode 100644 index 000000000..6e1c711ed --- /dev/null +++ b/application/config/navigation.php @@ -0,0 +1,75 @@ + array( + 'FH-Complete' => base_url('index.ci.php/'), + 'Vilesci' => base_url('/vilesci'), + 'CIS' => CIS_ROOT + ), + 'system/infocenter/InfoCenter/index' => array( + 'FH-Complete' => base_url('index.ci.php/'), + 'Vilesci' => base_url('/vilesci'), + 'CIS' => CIS_ROOT + ), + 'system/infocenter/InfoCenter/showDetails' => array( + 'FH-Complete' => base_url('index.ci.php/'), + 'Vilesci' => base_url('/vilesci'), + 'CIS' => CIS_ROOT + ) +); + +$config['navigation_menu'] = array(); + +$config['navigation_menu']['Vilesci/index'] = array( + 'Dashboard' => array( + 'link' => '#', + 'description' => 'Dashboard', + 'icon' => 'dashboard' + ), + 'Lehre' => array( + 'link' => '#', + 'icon' => 'graduation-cap', + 'description' => 'Lehre', + 'expand' => true, + 'children'=> array( + 'CIS' => array( + 'link' => CIS_ROOT, + 'icon' => '', + 'description' => 'CIS', + 'expand' => true + ), + 'Infocenter' => array( + 'link' => base_url('index.ci.php/system/infocenter/InfoCenter'), + 'icon' => 'info', + 'description' => 'Infocenter', + 'expand' => true + ), + ) + ), + 'Administration' => array( + 'link' => '#', + 'icon' => 'gear', + 'description' => 'Administration', + 'expand' => false, + 'children'=> array( + 'Vilesci' => array( + 'link' => base_url('vilesci/'), + 'icon' => '', + 'description' => 'Vilesci', + 'expand' => true + ), + 'Extensions' => array( + 'link' => base_url('index.ci.php/system/extensions/Manager'), + 'icon' => 'cubes', + 'description' => 'Extensions Manager', + 'expand' => true + ), + 'Datenschutz' => array( + 'link' => base_url('index.ci.php/extensions/FHC-Core-DSMS/export'), + 'description' => 'Datenschutz', + 'icon' => 'legal', + 'expand' => true + ) + ) + ) +); diff --git a/application/controllers/system/Navigation.php b/application/controllers/system/Navigation.php new file mode 100644 index 000000000..037a7d0f4 --- /dev/null +++ b/application/controllers/system/Navigation.php @@ -0,0 +1,98 @@ +config->load('navigation'); + + // Load session library + $this->load->library('session'); + } + + /** + * + */ + public function menu() + { + $navigation_widget_called = $this->input->get('navigation_widget_called'); + $json = array(); + + if (isset($navigation_widget_called)) + { + $navigationMenuArray = $this->config->item('navigation_menu'); + + if (isset($navigationMenuArray) && is_array($navigationMenuArray)) + { + if (isset($navigationMenuArray[$navigation_widget_called])) + { + $json = $navigationMenuArray[$navigation_widget_called]; + } + } + + if (isset($_SESSION['navigation_menu'])) + { + $navigationMenuSessionArray = $_SESSION['navigation_menu']; + + if (isset($navigationMenuSessionArray) && is_array($navigationMenuSessionArray)) + { + if (isset($navigationMenuSessionArray[$navigation_widget_called])) + { + $json = array_merge($json, $navigationMenuSessionArray[$navigation_widget_called]); + } + } + } + } + + $this->output->set_content_type('application/json')->set_output(json_encode($json)); + } + + /** + * + */ + public function header() + { + $navigation_widget_called = $this->input->get('navigation_widget_called'); + $json = array(); + + if (isset($navigation_widget_called)) + { + $navigationHeaderArray = $this->config->item('navigation_header'); + + if (isset($navigationHeaderArray) && is_array($navigationHeaderArray)) + { + if (isset($navigationHeaderArray[$navigation_widget_called])) + { + $json = $navigationHeaderArray[$navigation_widget_called]; + } + } + + if (isset($_SESSION['navigation_header'])) + { + $navigationHeaderSessionArray = $_SESSION['navigation_header']; + + if (isset($navigationHeaderSessionArray) && is_array($navigationHeaderSessionArray)) + { + if (isset($navigationHeaderSessionArray[$navigation_widget_called])) + { + $json = array_merge($json, $navigationHeaderSessionArray[$navigation_widget_called]); + } + } + } + } + + $this->output->set_content_type('application/json')->set_output(json_encode($json)); + } +} diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 216aa0619..24c90c908 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -45,8 +45,6 @@ class InfoCenter extends VileSci_Controller ) ); private $uid; // contains the UID of the logged user - private $navigationMenuArray; // contains all the voices for the navigation menu - private $navigationHeaderArray; /** * Constructor @@ -77,12 +75,7 @@ class InfoCenter extends VileSci_Controller if(!$this->permissionlib->isBerechtigt('basis/person')) show_error('You have no Permission! You need Infocenter Role'); - $this->_setNavigationMenuArray(); // sets property navigationMenuArray - - $this->navigationHeaderArray = array( - 'headertext' => 'Infocenter', - 'headertextlink' => base_url('index.ci.php/system/infocenter/InfoCenter') - ); + $this->setNavigationMenuArray(); // sets property navigationMenuArray } // ----------------------------------------------------------------------------------------------------------------- @@ -93,13 +86,7 @@ class InfoCenter extends VileSci_Controller */ public function index() { - $this->load->view( - 'system/infocenter/infocenter.php', - array( - 'navigationHeaderArray' => $this->navigationHeaderArray, - 'navigationMenuArray' => $this->navigationMenuArray - ) - ); + $this->load->view('system/infocenter/infocenter.php'); } /** @@ -131,11 +118,7 @@ class InfoCenter extends VileSci_Controller 'system/infocenter/infocenterDetails.php', array_merge( $persondata, - $prestudentdata, - array( - 'navigationHeaderArray' => $this->navigationHeaderArray, - 'navigationMenuArray' => $this->navigationMenuArray - ) + $prestudentdata ) ); } @@ -464,7 +447,7 @@ class InfoCenter extends VileSci_Controller /** * */ - private function _setNavigationMenuArray() + public function setNavigationMenuArray() { $listFiltersSent = array(); $listFiltersNotSent = array(); @@ -532,12 +515,22 @@ class InfoCenter extends VileSci_Controller $this->_fillCustomFilters($listCustomFilters, $filtersarray['personal']); } - $this->navigationMenuArray = array( - 'dashboard' => array( + if (!isset($_SESSION['navigation_menu'])) + { + $_SESSION['navigation_menu'] = array(); + } + + $_SESSION['navigation_menu']['system/infocenter/InfoCenter/index'] = array( + 'filters' => array( 'link' => '#', - 'description' => 'Dashboard', - 'icon' => 'dashboard' - ), + 'description' => 'Filter', + 'icon' => 'filter', + 'expand' => true, + 'children' => $filtersarray + ) + ); + + $_SESSION['navigation_menu']['system/infocenter/InfoCenter/showDetails'] = array( 'filters' => array( 'link' => '#', 'description' => 'Filter', @@ -565,11 +558,17 @@ class InfoCenter extends VileSci_Controller foreach ($filters as $filterId => $description) { $toPrint = "%s=%s"; + + if ($this->router->method != 'index') + { + + } + $tofill['children'][] = array( 'link' => sprintf($toPrint, base_url('index.ci.php/system/infocenter/InfoCenter?filter_id'), $filterId), 'description' => $description, 'subscriptDescription' => 'Remove', - 'subscriptLinkId' => 'removeFilterById', + 'subscriptLinkClass' => 'remove-filter', 'subscriptLinkValue' => $filterId ); } diff --git a/application/views/home.php b/application/views/home.php index 5e7deddb0..cd032bc71 100644 --- a/application/views/home.php +++ b/application/views/home.php @@ -11,35 +11,9 @@ $this->load->view('templates/FHC-Header', ?>
- 'FH-Complete', 'headertextlink' => base_url('index.ci.php/')); - $navigationMenuArray = array( - 'Dashboard' => array('link' => '#', 'description' => 'Dashboard', 'icon' => 'dashboard'), - 'Lehre' => array('link' => '#', 'icon' => 'graduation-cap', 'description' => 'Lehre', 'expand' => true, - 'children'=> array( - 'CIS' => array('link' => CIS_ROOT, 'icon' => '', 'description' => 'CIS', 'expand' => true), - 'Infocenter' => array('link' => base_url('index.ci.php/system/infocenter/InfoCenter'), 'icon' => 'info', 'description' => 'Infocenter', 'expand' => true), - ) - ), - 'Administration' => array('link' => '#', 'icon' => 'gear', 'description' => 'Administration', 'expand' => false, - 'children'=> array( - 'Vilesci' => array('link' => base_url('vilesci/'), 'icon' => '', 'description' => 'Vilesci', 'expand' => true), - 'Extensions' => array('link' => base_url('index.ci.php/system/extensions/Manager'), 'icon' => 'cubes', 'description' => 'Extensions Manager', 'expand' => true), - 'Datenschutz' => array('link' => base_url('index.ci.php/extensions/FHC-Core-DSMS/export'), 'description' => 'Datenschutz', 'icon' => 'legal','expand' => true) - ) - ), - ); + widgetlib->widget('NavigationWidget'); ?> - echo $this->widgetlib->widget( - 'NavigationWidget', - array( - 'navigationHeader' => $navigationHeaderArray, - 'navigationMenu' => $navigationMenuArray - ) - ); - - ?>
diff --git a/application/views/system/infocenter/infocenter.php b/application/views/system/infocenter/infocenter.php index 3ceaf1fa1..5963f77ca 100644 --- a/application/views/system/infocenter/infocenter.php +++ b/application/views/system/infocenter/infocenter.php @@ -17,15 +17,9 @@
- widgetlib->widget( - 'NavigationWidget', - array( - 'navigationHeader' => $navigationHeaderArray, - 'navigationMenu' => $navigationMenuArray - ) - ); - ?> + + widgetlib->widget('NavigationWidget'); ?> +
diff --git a/application/views/system/infocenter/infocenterDetails.php b/application/views/system/infocenter/infocenterDetails.php index 6ebf5494b..147f5d981 100755 --- a/application/views/system/infocenter/infocenterDetails.php +++ b/application/views/system/infocenter/infocenterDetails.php @@ -26,15 +26,9 @@ ?>
- widgetlib->widget( - 'NavigationWidget', - array( - 'navigationHeader' => $navigationHeaderArray, - 'navigationMenu' => $navigationMenuArray - ) - ); - ?> + + widgetlib->widget('NavigationWidget'); ?> +
diff --git a/application/views/widgets/filter/filter.php b/application/views/widgets/filter/filter.php index 15b9b4b26..606d19b60 100644 --- a/application/views/widgets/filter/filter.php +++ b/application/views/widgets/filter/filter.php @@ -94,9 +94,26 @@ + diff --git a/application/views/widgets/navigationMenu.php b/application/views/widgets/navigationMenu.php index 46905204f..f231bc67e 100644 --- a/application/views/widgets/navigationMenu.php +++ b/application/views/widgets/navigationMenu.php @@ -1,14 +1,3 @@ - - + + diff --git a/application/widgets/NavigationHeaderWidget.php b/application/widgets/NavigationHeaderWidget.php index 95daf33e1..9a1b48d5a 100644 --- a/application/widgets/NavigationHeaderWidget.php +++ b/application/widgets/NavigationHeaderWidget.php @@ -8,8 +8,8 @@ class NavigationHeaderWidget extends Widget /** * */ - public function display($data) + public function display($widgetData) { - $this->view('widgets/navigationHeader', $data); + $this->view('widgets/navigationHeader'); } } diff --git a/application/widgets/NavigationMenuWidget.php b/application/widgets/NavigationMenuWidget.php index b23054706..cabdeeb3f 100644 --- a/application/widgets/NavigationMenuWidget.php +++ b/application/widgets/NavigationMenuWidget.php @@ -5,87 +5,11 @@ */ class NavigationMenuWidget extends Widget { - private $navigationMenu; - - private static $navigationMenuWidgetInstance; - /** * */ public function display($widgetData) { - $this->navigationMenu = $widgetData; - - self::$navigationMenuWidgetInstance = $this; - $this->view('widgets/navigationMenu'); } - - /** - * - */ - public static function printNavigationMenu() - { - foreach (self::$navigationMenuWidgetInstance->navigationMenu as $item) - { - self::printNavItem($item); - } - } - - /** - * - */ - public static function printNavItem($item, $depth = 1) - { - $expanded = isset($item['expand']) && $item['expand'] === true ? ' active' : ''; - - echo '
  • '; - - if (isset($item['subscriptLinkId']) && isset($item['subscriptDescription'])) - { - echo ''; - } - - echo ''; - - if (isset($item['icon'])) - { - echo ' '; - } - - echo $item['description']; - - if (!empty($item['children'])) - { - echo ''; - } - - echo ''; - - if (isset($item['subscriptLinkId']) && isset($item['subscriptDescription'])) - { - echo ''.$item['subscriptDescription'].''; - } - - if (isset($item['subscriptLinkId']) && isset($item['subscriptDescription'])) - { - echo ''; - } - - if (!empty($item['children'])) - { - $level = ''; - if ($depth === 1) - $level = 'second'; - elseif ($depth > 1) - $level = 'third'; - - echo ''; - } - - echo '
  • '; - } } diff --git a/application/widgets/NavigationWidget.php b/application/widgets/NavigationWidget.php index 7835032ce..5ce5e95b5 100644 --- a/application/widgets/NavigationWidget.php +++ b/application/widgets/NavigationWidget.php @@ -5,14 +5,11 @@ */ class NavigationWidget extends Widget { - const NAVIGATION_HEADER = 'navigationHeader'; // - const NAVIGATION_MENU = 'navigationMenu'; // - /** * */ public function display($widgetData) { - $this->view('widgets/navigation', array('widgetData' => $widgetData)); + $this->view('widgets/navigation'); } } From 74a36682b803a3cbf8126476b7c6333423130ed3 Mon Sep 17 00:00:00 2001 From: oesi Date: Mon, 12 Mar 2018 14:51:26 +0100 Subject: [PATCH 02/12] =?UTF-8?q?Phrasen=20f=C3=BCr=20Notebookregistrierun?= =?UTF-8?q?g=20angepasst?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- locale/de-AT/notebookregister.php | 2 +- locale/en-US/notebookregister.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/de-AT/notebookregister.php b/locale/de-AT/notebookregister.php index d77071bb2..f954987a4 100644 --- a/locale/de-AT/notebookregister.php +++ b/locale/de-AT/notebookregister.php @@ -1,6 +1,6 @@ phrasen['notebookregister/notebook_absatz1']='Sollten Sie mehr als ein Notebook registrieren lassen wollen, wenden Sie sich bitte an support@technikum-wien.at, da nur ein Eintrag pro Person möglich ist.

    Geben Sie die MAC-Adresse in folgendem Format an: 00-50-DA-C2-32-1C, oder 00:50:DA:C2:32:1C'; -$this->phrasen['notebookregister/notebook_absatz2']='Die Änderungen werden in ca. 30 Minuten wirksam. Bitte haben Sie etwas Geduld.

    Um das Internet nutzen zu können, lassen Sie bitte die Netzwerkverbindungseinstellungen vom DHCP-Server zuweisen.
    In Ihrem Browser tragen Sie bitte den Proxy-Server: proxy.technikum-wien.at und den Port 3128 ein.'; +$this->phrasen['notebookregister/notebook_absatz2']='Die Änderungen werden in ca. 30 Minuten wirksam. Bitte haben Sie etwas Geduld.

    Um das Internet nutzen zu können, lassen Sie bitte die Netzwerkverbindungseinstellungen vom DHCP-Server zuweisen.'; $this->phrasen['notebookregister/notebook_anmerkung']='muss nur angegeben werden, wenn UID nicht gleich dem angemeldetem Benutzer'; $this->phrasen['notebookregister/titelNotebookRegistration']='LAN Zugang'; $this->phrasen['notebookregister/passwortEingebenWennUIDgeaendert']='Es muss ein Passwort eingegeben werden, wenn die UID geändert wird'; diff --git a/locale/en-US/notebookregister.php b/locale/en-US/notebookregister.php index 94dd2708f..589b53a05 100644 --- a/locale/en-US/notebookregister.php +++ b/locale/en-US/notebookregister.php @@ -1,6 +1,6 @@ phrasen['notebookregister/notebook_absatz1']='It is only possible to register one notebook PC per person.
    If you want to register more than one, please contact support at support@technikum-wien.at.

    Enter the MAC address in the following format: 00-50-DA-C2-32-1C, or 00:50:DA:C2:32:1C'; -$this->phrasen['notebookregister/notebook_absatz2']='The changes will take effect in about 30 minutes. Please be patient.

    In order to access the Internet, please allow the DHCP server to assign the network connection settings.
    Please enter the following proxy server in your browser: proxy.technikum-wien.at and set the port to 3128.'; +$this->phrasen['notebookregister/notebook_absatz2']='The changes will take effect in about 30 minutes. Please be patient.

    In order to access the Internet, please allow the DHCP server to assign the network connection settings.'; $this->phrasen['notebookregister/notebook_anmerkung']='only has to be entered if the UID is not the same as that of the logged-in user'; $this->phrasen['notebookregister/titelNotebookRegistration']='LAN Access'; $this->phrasen['notebookregister/passwortEingebenWennUIDgeaendert']='A password must be entered when the UID is changed.'; From e8f6bfc4e67222f83f2b3b679aaa80d906d924cd Mon Sep 17 00:00:00 2001 From: Gerald Raab Date: Tue, 13 Mar 2018 13:47:47 +0100 Subject: [PATCH 03/12] Betreuungen in der Anzeige der zu erfassenden Stunden inkludiert --- include/zeitaufzeichnung.class.php | 93 +++++++++++++++++++----------- 1 file changed, 60 insertions(+), 33 deletions(-) mode change 100644 => 100755 include/zeitaufzeichnung.class.php diff --git a/include/zeitaufzeichnung.class.php b/include/zeitaufzeichnung.class.php old mode 100644 new mode 100755 index c9b319316..7d8aec3cf --- a/include/zeitaufzeichnung.class.php +++ b/include/zeitaufzeichnung.class.php @@ -133,7 +133,7 @@ class zeitaufzeichnung extends basis_db //Variablen pruefen if(!$this->validate()) return false; - + // check ob identischer eintrag existiert $check_qry = 'SELECT count(*) from campus.tbl_zeitaufzeichnung where uid='.$this->db_add_param($this->uid).' and start = '.$this->db_add_param($this->start).' and ende = '.$this->db_add_param($this->ende); if($this->db_query($check_qry) && $this->new) @@ -142,13 +142,13 @@ class zeitaufzeichnung extends basis_db { if ($row->count) { - $this->errormsg = 'Identischer Eintrag existiert!'; + $this->errormsg = 'Identischer Eintrag existiert!'; return false; } } } - - + + if($this->new) { //Neuen Datensatz einfuegen @@ -339,7 +339,7 @@ class zeitaufzeichnung extends basis_db //zusätzlicher Tag - SQL rechnet letzten Tag nicht hinein $to = date('Y-m-d', strtotime($to. ' + 1 days')); - $where.= " AND ((start >= ".$this->db_add_param($from)."::DATE AND start <= ".$this->db_add_param($to)."::DATE) + $where.= " AND ((start >= ".$this->db_add_param($from)."::DATE AND start <= ".$this->db_add_param($to)."::DATE) OR (ende >= ".$this->db_add_param($from)."::DATE AND ende <= ".$this->db_add_param($to)."::DATE))"; $qry = "SELECT @@ -506,16 +506,16 @@ class zeitaufzeichnung extends basis_db return false; } } - + /** - * Löscht sämtliche Einträge eines Users für einen Tag + * Löscht sämtliche Einträge eines Users für einen Tag * @param string $user * @param string $tag Y-m-d */ public function deleteEntriesForUser($user, $tag) - { - $where = "uid=".$this->db_add_param($user); - + { + $where = "uid=".$this->db_add_param($user); + $qry = "delete from campus.tbl_zeitaufzeichnung where $where and date_trunc('day', start) = '$tag'"; if($result = $this->db_query($qry)) { @@ -529,28 +529,28 @@ class zeitaufzeichnung extends basis_db } /** - * Löscht Pauseneinträge eines Users für einen Tag, die außerhalb der Arbeitszeit liegen + * Löscht Pauseneinträge eines Users für einen Tag, die außerhalb der Arbeitszeit liegen * Löscht Pauseneinträge an Tagen ohne Arbeitszeit * @param string $user * @param string $tag Y-m-d */ public function cleanPausenForUser($user, $tag) - { - $where = "uid=".$this->db_add_param($user); - + { + $where = "uid=".$this->db_add_param($user); + $qry = " delete from campus.tbl_zeitaufzeichnung where aktivitaet_kurzbz = 'Pause' and start::date = '$tag' and $where and ( -start::time >= +start::time >= (SELECT max(ende::time) as endzeit from campus.tbl_zeitaufzeichnung where $where and start::date = '$tag' AND (aktivitaet_kurzbz != 'LehreExtern' or aktivitaet_kurzbz is null ) and aktivitaet_kurzbz != 'Pause') or ende::time<= (SELECT min(start::time) as startzeit from campus.tbl_zeitaufzeichnung where $where and start::date = '$tag' AND (aktivitaet_kurzbz != 'LehreExtern' or aktivitaet_kurzbz is null ) and aktivitaet_kurzbz != 'Pause') or not exists -(select 1 from campus.tbl_zeitaufzeichnung where aktivitaet_kurzbz != 'LehreExtern' and aktivitaet_kurzbz != 'Pause' and start::date = '$tag' and $where ) +(select 1 from campus.tbl_zeitaufzeichnung where aktivitaet_kurzbz != 'LehreExtern' and aktivitaet_kurzbz != 'Pause' and start::date = '$tag' and $where ) ) "; - + if($result = $this->db_query($qry)) { return true; @@ -563,52 +563,79 @@ or not exists } /** - * Holt alle ZA-Einträge Typ LehreIntern und LehreExtern eines Users + * Holt alle ZA-Einträge Typ LehreIntern und LehreExtern eines Users * für das laufende Studienjahr und gibt die Summen in einem Array zurück * @param string $user - * @return Array mit Keay: LehreIntern, LehreExtern, LehreAuftraege, LehreInkludiert - */ + * @return Array mit Key: LehreIntern, LehreExtern, LehreAuftraege, LehreInkludiert + */ public function getLehreForUser($user,$sem) { - $where = "uid=".$this->db_add_param($user); + $where = "uid=".$this->db_add_param($user); $where_sem = "studiensemester_kurzbz=".$this->db_add_param($sem); $lehre_arr = array("LehreIntern"=>0, "LehreExtern"=>0, "LehreAuftraege"=>0); - + $qry = " select sum(extract(epoch from ende-start))/3600 as lehre, aktivitaet_kurzbz from campus.tbl_zeitaufzeichnung where $where and aktivitaet_kurzbz in ('LehreIntern', 'LehreExtern') and start > (select start from public.tbl_studiensemester where $where_sem) group by aktivitaet_kurzbz "; - + if($result = $this->db_query($qry)) { - + while($row = $this->db_fetch_object($result)) { - $lehre_arr[$row->aktivitaet_kurzbz] = round($row->lehre,2); + $lehre_arr[$row->aktivitaet_kurzbz] = round($row->lehre,2); } } else { return false; - } + } $where = "mitarbeiter_uid=".$this->db_add_param($user); $where_sem = "l.studiensemester_kurzbz=".$this->db_add_param($sem); - $qry = " - select sum(m.semesterstunden) from lehre.tbl_lehreinheitmitarbeiter m, lehre.tbl_lehreinheit l where $where and $where_sem and l.lehreinheit_id = m.lehreinheit_id and m.stundensatz*m.semesterstunden > 0 + + $qry = " + SELECT sum(semstunden) AS stunden + FROM + ( + SELECT sum(m.semesterstunden) AS semstunden + FROM + lehre.tbl_lehreinheitmitarbeiter m, + lehre.tbl_lehreinheit l + WHERE + $where AND + $where_sem AND + l.lehreinheit_id = m.lehreinheit_id AND + m.stundensatz * m.semesterstunden > 0 + UNION + SELECT sum(pb.stunden) AS semstunden + FROM + lehre.tbl_projektarbeit pa, + lehre.tbl_projektbetreuer pb, + lehre.tbl_lehreinheit l, + public.tbl_benutzer b + WHERE + pa.lehreinheit_id = l.lehreinheit_id AND + pb.projektarbeit_id = pa.projektarbeit_id AND + pb.person_id = b.person_id AND + b.uid = ".$this->db_add_param($user)." AND + pb.stunden * pb.stundensatz > 0 AND + $where_sem + ) AS semstunden "; - + if($result = $this->db_query($qry)) { - + while($row = $this->db_fetch_object($result)) { - $lehre_arr["LehreAuftraege"] = round($row->sum); + $lehre_arr["LehreAuftraege"] = round($row->stunden); } } else { return false; - } - + } + return $lehre_arr; } } From 73131756dbf4f25488105e1b34a04c9bfe6134dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Tue, 13 Mar 2018 16:59:55 +0100 Subject: [PATCH 04/12] Removed useless Data --- locale/de-AT/zeitaufzeichnung.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locale/de-AT/zeitaufzeichnung.php b/locale/de-AT/zeitaufzeichnung.php index a1f247827..9a475bc1d 100644 --- a/locale/de-AT/zeitaufzeichnung.php +++ b/locale/de-AT/zeitaufzeichnung.php @@ -40,7 +40,7 @@ $this->phrasen['zeitaufzeichnung/alleAnzeigen']='Alle anzeigen'; $this->phrasen['zeitaufzeichnung/alleEintraege']='Alle Einträge'; $this->phrasen['zeitaufzeichnung/summeEintraege']='Summe Einträge'; $this->phrasen['zeitaufzeichnung/arbeitszeit']='Arbeitszeit'; -$this->phrasen['zeitaufzeichnung/pause']='Pausen';'inkl. 30 min. Pflichtpause'; +$this->phrasen['zeitaufzeichnung/pause']='Pausen'; $this->phrasen['zeitaufzeichnung/inklusivePflichtpause']='inkl. 30 min. Pflichtpause'; $this->phrasen['zeitaufzeichnung/handbuchZeitaufzeichnung']='Arbeitszeitaufzeichnung Leitfaden'; $this->phrasen['zeitaufzeichnung/fiktiveNormalarbeitszeit']='Vereinbarung der fiktiven Normalarbeitszeit'; From 95663c42aa96ef97b31c11487ba2b0a6ca237b1b Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 14 Mar 2018 09:45:26 +0100 Subject: [PATCH 05/12] added ZGV and document info to freigabe mail --- .../system/infocenter/InfoCenter.php | 29 +++++- .../mailtemplates/interessentFreigabe.php | 93 ++++++++++++------- 2 files changed, 85 insertions(+), 37 deletions(-) diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 24c90c908..5b13ce76d 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -816,6 +816,8 @@ class InfoCenter extends VileSci_Controller $prestudentstatus = $prestudent->prestudentstatus; $person_id = $prestudent->person_id; $person = $this->PersonModel->getPersonStammdaten($person_id, true)->retval; + $dokumente = $this->AkteModel->getAktenWithDokInfo($person_id, null, false)->retval; + $dokumenteNachzureichen = $this->AkteModel->getAktenWithDokInfo($person_id, null, true)->retval; //fill mail variables $interessentbez = $person->geschlecht == 'm' ? 'Ein Interessent' : 'Eine Interessentin'; @@ -823,6 +825,25 @@ class InfoCenter extends VileSci_Controller $orgform = $prestudentstatus->orgform != '' ? ' ('.$prestudentstatus->orgform.')' : ''; $geschlecht = $person->geschlecht == 'm' ? 'männlich' : 'weiblich'; $geburtsdatum = date('d.m.Y', strtotime($person->gebdatum)); + $zgvort = !empty($prestudent->zgvort) ? ' in '.$prestudent->zgvort : ''; + $zgvnation = !empty($prestudent->zgvnation_bez) ? ', '.$prestudent->zgvnation_bez : ''; + $zgvdatum = !empty($prestudent->zgvdatum) ? ', am '.date_format(date_create($prestudent->zgvdatum), 'd.m.Y') : ''; + + $dokumenteNachzureichenMail = $dokumenteMail = array(); + //convert documents to array so they can be parsed, and keeping only needed fields + $lastel = end($dokumente); + foreach ($dokumente as $dokument) + { + $postfix = $lastel === $dokument ? '' : ' |'; + $dokumenteMail[] = array('dokument_bezeichnung' => $dokument->dokument_bezeichnung.$postfix); + } + + foreach ($dokumenteNachzureichen as $dokument) + { + $anmerkung = !empty($dokument->anmerkung) ? ' | Anmerkung: '.$dokument->anmerkung : ''; + $nachgereichtam = !empty($dokument->nachgereicht_am) ? ' | wird nachgereicht bis '.date_format(date_create($dokument->nachgereicht_am), 'd.m.Y') : ''; + $dokumenteNachzureichenMail[] = array('dokument_bezeichnung' => $dokument->dokument_bezeichnung, 'anmerkung' => $anmerkung, 'nachgereicht_am' => $nachgereichtam); + } $notizenBewerbung = $this->NotizModel->getNotizByTitel($person_id, 'Anmerkung zur Bewerbung')->retval; @@ -859,7 +880,13 @@ class InfoCenter extends VileSci_Controller 'gebdatum' => $geburtsdatum, 'mailadresse' => $mailadresse, 'prestudentid' => $prestudent_id, - 'notizentext' => $notizentext + 'zgvbez' => $prestudent->zgv_bez, + 'zgvort' => $zgvort, + 'zgvdatum' => $zgvdatum, + 'zgvnation' => $zgvnation, + 'notizentext' => $notizentext, + 'dokumente' => $dokumenteMail, + 'dokumente_nachgereicht' => $dokumenteNachzureichenMail ); $this->load->library('parser'); diff --git a/application/views/templates/mailtemplates/interessentFreigabe.php b/application/views/templates/mailtemplates/interessentFreigabe.php index 91ca22f94..9c26a11d6 100644 --- a/application/views/templates/mailtemplates/interessentFreigabe.php +++ b/application/views/templates/mailtemplates/interessentFreigabe.php @@ -8,42 +8,63 @@

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Studiengang{studiengangbez} {studiengangtypbez} {orgform} {sprache}
    Studiensemester{studiensemester}
    Geschlecht{geschlecht}
    Vorname{vorname}
    Nachname{nachname}
    Geburtsdatum{gebdatum}
    E-Mail Adresse{mailadresse}
    Prestudent ID{prestudentid}
    Anmerkungen zur Bewerbung{notizentext}
    Studiengang{studiengangbez} {studiengangtypbez} {orgform} {sprache}
    Studiensemester{studiensemester}
    Geschlecht{geschlecht}
    Vorname{vorname}
    Nachname{nachname}
    Geburtsdatum{gebdatum}
    E-Mail Adresse{mailadresse}
    Prestudent ID{prestudentid}
    Zugangsvoraussetzung{zgvbez}{zgvort}{zgvnation}{zgvdatum}
    Erbrachte Dokumente + {dokumente} + {dokument_bezeichnung} + {/dokumente} +
    Nachzureichende Dokumente + {dokumente_nachgereicht} + {dokument_bezeichnung}{anmerkung}{nachgereicht_am} +
    + {/dokumente_nachgereicht} +
    Anmerkungen zur Bewerbung{notizentext}

    From 16631d7ad9b9490b9bb9da3cc512c4c4a7c5d6a9 Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 14 Mar 2018 11:28:57 +0100 Subject: [PATCH 06/12] quickfix for collapsing menu - add click events only after ajax call execution (asynchronity can be a bitch...) --- application/views/widgets/navigationMenu.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/application/views/widgets/navigationMenu.php b/application/views/widgets/navigationMenu.php index f231bc67e..1fdb4b6b3 100644 --- a/application/views/widgets/navigationMenu.php +++ b/application/views/widgets/navigationMenu.php @@ -114,7 +114,7 @@ { var strMenu = ''; - $("#side-menu").html('
  • '); + printCollapseIcon(); jQuery.each(data, function(i, e) { strMenu += printNavItem(e); @@ -134,12 +134,12 @@ }); } - $(document).ready(function() { - - renderSideMenu(); + function printCollapseIcon() + { // Hiding/showing navigation menu - works only with sb admin 2 template!! + $("#side-menu").prepend('
  • '); $("#collapseicon").click(function() { $("#page-wrapper").css('margin-left', '0px'); $("#side-menu").hide(); @@ -151,6 +151,11 @@ $("#side-menu").show(); $("#collapseinicon").hide(); }); + } + + $(document).ready(function() { + + renderSideMenu(); }); From 55c5f87832c4cbd992b2ef6f1c9f0f1c4f0b245e Mon Sep 17 00:00:00 2001 From: Paolo Date: Wed, 14 Mar 2018 12:24:01 +0100 Subject: [PATCH 07/12] Changed the server name in config/fhcomplete for addons_aufnahme_url --- application/config/fhcomplete.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/config/fhcomplete.php b/application/config/fhcomplete.php index b680d6f5d..15c5d8be0 100644 --- a/application/config/fhcomplete.php +++ b/application/config/fhcomplete.php @@ -243,4 +243,4 @@ $config['fhc_acl'] = array // $config['addons_aufnahme_url'] = array(); -$config['addons_aufnahme_url']['OE_ROOT'] = 'http://debian.dev/addons/aufnahme/OE_ROOT/cis/index.php'; +$config['addons_aufnahme_url']['OE_ROOT'] = 'https://SERVER-NAME/addons/aufnahme/OE_ROOT/cis/index.php'; From fb56a694cd80dd6c8436f91e3e352fe34d1ff298 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Wed, 14 Mar 2018 15:27:00 +0100 Subject: [PATCH 08/12] =?UTF-8?q?Fehler=20behoben=20wodurch=20der=20Excel?= =?UTF-8?q?=20Export=20f=C3=BCr=20Reihungstests=20nicht=20funktionierte=20?= =?UTF-8?q?wenn=20kein=20Studienplan=20zugeteilt=20ist?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vilesci/stammdaten/reihungstestverwaltung.php | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/vilesci/stammdaten/reihungstestverwaltung.php b/vilesci/stammdaten/reihungstestverwaltung.php index 7cb117f5a..1afcc0c3c 100644 --- a/vilesci/stammdaten/reihungstestverwaltung.php +++ b/vilesci/stammdaten/reihungstestverwaltung.php @@ -178,14 +178,22 @@ if(isset($_GET['excel'])) $reihungstest = new reihungstest(); if($reihungstest->load($_GET['reihungstest_id'])) { + $rt_studienplan_id = ''; $studienplaene_arr = array(); $studienplaene = new reihungstest(); $studienplaene->getStudienplaeneReihungstest($reihungstest->reihungstest_id); foreach ($studienplaene->result AS $row) { $studienplan = new studienplan(); - $studienplan->loadStudienplan($row->studienplan_id); - $studienplaene_arr[ $row->studienplan_id] = $studienplan->bezeichnung; + if($studienplan->loadStudienplan($row->studienplan_id)) + { + $studienplaene_arr[ $row->studienplan_id] = $studienplan->bezeichnung; + $rt_studienplan_id = $row->studienplan_id; + } + else + { + die('Fehler beim Laden:'.$studienplan->errormsg); + } } $studienplaene_list = implode(',', array_keys($studienplaene_arr)); @@ -249,12 +257,15 @@ if(isset($_GET['excel'])) "; $gebietbezeichnungen = array(); - $qry_gebiete = "SELECT gebiet_id, reihung, bezeichnung FROM testtool.tbl_ablauf JOIN testtool.tbl_gebiet USING (gebiet_id) WHERE studienplan_id = ".$db->db_add_param($row->studienplan_id)." ORDER BY reihung"; - if($result_gebiete = $db->db_query($qry_gebiete)) + if ($rt_studienplan_id != '') { - while($row_gebiete = $db->db_fetch_object($result_gebiete)) + $qry_gebiete = "SELECT gebiet_id, reihung, bezeichnung FROM testtool.tbl_ablauf JOIN testtool.tbl_gebiet USING (gebiet_id) WHERE studienplan_id = ".$db->db_add_param($rt_studienplan_id)." ORDER BY reihung"; + if($result_gebiete = $db->db_query($qry_gebiete)) { - $gebietbezeichnungen[$row_gebiete->gebiet_id] = $row_gebiete->bezeichnung; + while($row_gebiete = $db->db_fetch_object($result_gebiete)) + { + $gebietbezeichnungen[$row_gebiete->gebiet_id] = $row_gebiete->bezeichnung; + } } } From 68f934a5d012c8eb0122da332ba2249cdd95e606 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Thu, 15 Mar 2018 06:53:50 +0100 Subject: [PATCH 09/12] Removed Budget Tables from Core -> moved to Extension Fixed Problem during Extension installation --- application/core/DB_Model.php | 8 +- .../models/system/Extensions_model.php | 2 +- system/dbupdate_3.3.php | 138 +++--------------- 3 files changed, 24 insertions(+), 124 deletions(-) diff --git a/application/core/DB_Model.php b/application/core/DB_Model.php index be9e39082..bcc45ff17 100644 --- a/application/core/DB_Model.php +++ b/application/core/DB_Model.php @@ -29,18 +29,16 @@ class DB_Model extends FHC_Model /** * Constructor */ - public function __construct($dbTable = null, $pk = null, $hasSequence = true) + public function __construct($dbtype = 'default') { // Call parent constructor parent::__construct(); // Set properties - $this->pk = $pk; - $this->dbTable = $dbTable; - $this->hasSequence = $hasSequence; + $this->hasSequence = true; // Loads DB conns and confs - $this->load->database(); + $this->load->database($dbtype); // Loads the UDF library $this->load->library('UDFLib'); diff --git a/application/models/system/Extensions_model.php b/application/models/system/Extensions_model.php index c93817040..0792732d8 100644 --- a/application/models/system/Extensions_model.php +++ b/application/models/system/Extensions_model.php @@ -7,7 +7,7 @@ class Extensions_model extends DB_Model */ public function __construct() { - parent::__construct(); + parent::__construct('system'); $this->dbTable = 'system.tbl_extensions'; $this->pk = 'extension_id'; } diff --git a/system/dbupdate_3.3.php b/system/dbupdate_3.3.php index 07dd57b45..a9db58f41 100644 --- a/system/dbupdate_3.3.php +++ b/system/dbupdate_3.3.php @@ -1768,84 +1768,9 @@ if($result = @$db->db_query("SELECT * FROM system.tbl_filters WHERE filter_kurzb } } -/** Budget **/ -if (!$result = @$db->db_query("SELECT 1 FROM wawi.tbl_budgetantrag LIMIT 1")) +if (!$result = @$db->db_query("SELECT projekt_id FROM fue.tbl_projekt LIMIT 1")) { - $qry = "CREATE TABLE wawi.tbl_budgetantrag - ( - budgetantrag_id integer NOT NULL, - kostenstelle_id integer NOT NULL, - geschaeftsjahr_kurzbz varchar(32) NOT NULL, - bezeichnung varchar(256), - insertamum timestamp DEFAULT now(), - insertvon varchar(32), - updateamum timestamp, - updatevon varchar(32) - ); - COMMENT ON TABLE wawi.tbl_budgetantrag IS 'Budget Requests'; - - ALTER TABLE wawi.tbl_budgetantrag ADD CONSTRAINT pk_tbl_budgetantrag PRIMARY KEY (budgetantrag_id); - - CREATE SEQUENCE wawi.tbl_budgetantrag_budgetantrag_id_seq - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - ALTER TABLE wawi.tbl_budgetantrag ALTER COLUMN budgetantrag_id SET DEFAULT nextval(' wawi.tbl_budgetantrag_budgetantrag_id_seq'); - - GRANT SELECT, INSERT, UPDATE, DELETE ON wawi.tbl_budgetantrag TO vilesci; - GRANT SELECT, UPDATE ON wawi.tbl_budgetantrag_budgetantrag_id_seq TO vilesci; - - ALTER TABLE wawi.tbl_budgetantrag ADD CONSTRAINT fk_budgetantrag_kostenstelle_id FOREIGN KEY (kostenstelle_id) REFERENCES wawi.tbl_kostenstelle(kostenstelle_id) ON UPDATE CASCADE ON DELETE RESTRICT; - ALTER TABLE wawi.tbl_budgetantrag ADD CONSTRAINT fk_budgetantrag_geschaeftsjahr_kurzbz FOREIGN KEY (geschaeftsjahr_kurzbz) REFERENCES public.tbl_geschaeftsjahr(geschaeftsjahr_kurzbz) ON UPDATE CASCADE ON DELETE RESTRICT; - - CREATE TABLE wawi.tbl_budgetstatus - ( - budgetstatus_kurzbz varchar(32) NOT NULL, - bezeichnung varchar(128) - ); - COMMENT ON TABLE wawi.tbl_budgetstatus IS 'Key Table of Budget Request Statuses'; - - ALTER TABLE wawi.tbl_budgetstatus ADD CONSTRAINT pk_tbl_budgetstatus PRIMARY KEY (budgetstatus_kurzbz); - - INSERT INTO wawi.tbl_budgetstatus(budgetstatus_kurzbz, bezeichnung) VALUES('new','Neu'); - INSERT INTO wawi.tbl_budgetstatus(budgetstatus_kurzbz, bezeichnung) VALUES('sent','Abgeschickt'); - INSERT INTO wawi.tbl_budgetstatus(budgetstatus_kurzbz, bezeichnung) VALUES('approved','Freigegeben'); - INSERT INTO wawi.tbl_budgetstatus(budgetstatus_kurzbz, bezeichnung) VALUES('accepted','Akzeptiert'); - INSERT INTO wawi.tbl_budgetstatus(budgetstatus_kurzbz, bezeichnung) VALUES('rejected','Abgelehnt'); - - GRANT SELECT, INSERT, UPDATE, DELETE ON wawi.tbl_budgetantrag TO vilesci; - - CREATE TABLE wawi.tbl_budgetantrag_status - ( - budgetantrag_status_id integer NOT NULL, - budgetantrag_id integer NOT NULL, - budgetstatus_kurzbz varchar(32) NOT NULL, - datum timestamp NOT NULL, - uid varchar(32), - oe_kurzbz varchar(32), - insertamum timestamp DEFAULT now(), - insertvon varchar(32) - ); - COMMENT ON TABLE wawi.tbl_budgetantrag_status IS 'Statuses of Budget Requests'; - - ALTER TABLE wawi.tbl_budgetantrag_status ADD CONSTRAINT pk_tbl_budgetantrag_status PRIMARY KEY (budgetantrag_status_id); - - CREATE SEQUENCE wawi.tbl_budgetantrag_status_budgetantrag_status_id_seq - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - ALTER TABLE wawi.tbl_budgetantrag_status ALTER COLUMN budgetantrag_status_id SET DEFAULT nextval(' wawi.tbl_budgetantrag_status_budgetantrag_status_id_seq'); - - ALTER TABLE wawi.tbl_budgetantrag_status ADD CONSTRAINT fk_budgetantrag_status_budgetstatus_kurzbz FOREIGN KEY (budgetstatus_kurzbz) REFERENCES wawi.tbl_budgetstatus(budgetstatus_kurzbz) ON UPDATE CASCADE ON DELETE RESTRICT; - ALTER TABLE wawi.tbl_budgetantrag_status ADD CONSTRAINT fk_budgetantrag_status_uid FOREIGN KEY (uid) REFERENCES public.tbl_benutzer(uid) ON UPDATE CASCADE ON DELETE RESTRICT; - ALTER TABLE wawi.tbl_budgetantrag_status ADD CONSTRAINT fk_budgetantrag_status_oe_kurzbz FOREIGN KEY (oe_kurzbz) REFERENCES public.tbl_organisationseinheit(oe_kurzbz) ON UPDATE CASCADE ON DELETE RESTRICT; - - GRANT SELECT, INSERT, UPDATE, DELETE ON wawi.tbl_budgetantrag TO vilesci; - GRANT SELECT, UPDATE ON wawi.tbl_budgetantrag_status_budgetantrag_status_id_seq TO vilesci; - - CREATE SEQUENCE fue.tbl_projekt_projekt_id_seq + $qry = "CREATE SEQUENCE fue.tbl_projekt_projekt_id_seq INCREMENT BY 1 NO MAXVALUE NO MINVALUE @@ -1853,47 +1778,29 @@ if (!$result = @$db->db_query("SELECT 1 FROM wawi.tbl_budgetantrag LIMIT 1")) GRANT SELECT, UPDATE ON fue.tbl_projekt_projekt_id_seq TO vilesci; ALTER TABLE fue.tbl_projekt ADD COLUMN projekt_id integer NOT NULL DEFAULT nextval('fue.tbl_projekt_projekt_id_seq'); ALTER TABLE fue.tbl_projekt ADD CONSTRAINT uk_tbl_projekt_projekt_id UNIQUE (projekt_id); - - CREATE TABLE wawi.tbl_budgetposition - ( - budgetposition_id integer NOT NULL, - budgetantrag_id integer NOT NULL, - budgetposten varchar(512), - konto_id integer, - betrag numeric(12,4), - kommentar text, - projekt_id integer, - insertamum timestamp, - insertvon varchar(32), - updateamum timestamp, - updatevon varchar(32) - ); - - COMMENT ON TABLE wawi.tbl_budgetposition IS 'Budget position'; - - ALTER TABLE wawi.tbl_budgetposition ADD CONSTRAINT pk_tbl_budgetposition PRIMARY KEY (budgetposition_id); - - CREATE SEQUENCE wawi.tbl_budgetposition_budgetposition_id_seq - INCREMENT BY 1 - NO MAXVALUE - NO MINVALUE - CACHE 1; - ALTER TABLE wawi.tbl_budgetposition ALTER COLUMN budgetposition_id SET DEFAULT nextval(' wawi.tbl_budgetposition_budgetposition_id_seq'); - - ALTER TABLE wawi.tbl_budgetposition ADD CONSTRAINT fk_tbl_budgetposition_budgetantrag_id FOREIGN KEY (budgetantrag_id) REFERENCES wawi.tbl_budgetantrag(budgetantrag_id) ON UPDATE CASCADE ON DELETE RESTRICT; - ALTER TABLE wawi.tbl_budgetposition ADD CONSTRAINT fk_tbl_budgetposition_konto_id FOREIGN KEY (konto_id) REFERENCES wawi.tbl_konto(konto_id) ON UPDATE CASCADE ON DELETE RESTRICT; - ALTER TABLE wawi.tbl_budgetposition ADD CONSTRAINT fk_tbl_budgetposition_projekt_id FOREIGN KEY (projekt_id) REFERENCES fue.tbl_projekt(projekt_id) ON UPDATE CASCADE ON DELETE RESTRICT; - - GRANT SELECT, INSERT, UPDATE, DELETE ON wawi.tbl_budgetposition TO vilesci; - GRANT SELECT, UPDATE ON wawi.tbl_budgetposition_budgetposition_id_seq TO vilesci; "; - if(!$db->db_query($qry)) - echo 'Budget: '.$db->db_last_error().'
    '; + if (!$db->db_query($qry)) + echo 'Projekt: '.$db->db_last_error().'
    '; else - echo '
    Neue Tabellen fuer Budgetantrag in Schema wawi hinzugefuegt'; + echo '
    Neue Spalte projekt_id für fue.tbl_projekt hinzugefügt'; } +// Extension Schema +if ($result = $db->db_query("SELECT schema_name FROM information_schema.schemata WHERE schema_name='extension'")) +{ + if ($db->db_num_rows($result) == 0) + { + $qry = "CREATE SCHEMA extension; + COMMENT ON SCHEMA extension is 'Extension Tables';"; + + if (!$db->db_query($qry)) + echo 'Extension: '.$db->db_last_error().'
    '; + else + echo '
    Neues Schema extension hinzugefuegt'; + } +} + // *** Pruefung und hinzufuegen der neuen Attribute und Tabellen echo '

    Pruefe Tabellen und Attribute!

    '; @@ -2161,11 +2068,6 @@ $tabellen=array( "wawi.tbl_betriebsmittel_betriebsmittelstatus" => array("betriebsmittelbetriebsmittelstatus_id","betriebsmittel_id","betriebsmittelstatus_kurzbz", "datum", "updateamum", "updatevon", "insertamum", "insertvon","anmerkung"), "wawi.tbl_betriebsmittelstatus" => array("betriebsmittelstatus_kurzbz","beschreibung"), "wawi.tbl_betriebsmitteltyp" => array("betriebsmitteltyp","beschreibung","anzahl","kaution","typ_code","mastershapename"), - "wawi.tbl_budget" => array("geschaeftsjahr_kurzbz","kostenstelle_id","budget"), - "wawi.tbl_budgetantrag" => array("budgetantrag_id","kostenstelle_id","geschaeftsjahr_kurzbz","bezeichnung","insertamum","insertvon","updateamum","updatevon"), - "wawi.tbl_budgetantrag_status" => array("budgetantrag_status_id","budgetantrag_id","budgetstatus_kurzbz","datum","uid","oe_kurzbz","insertamum","insertvon"), - "wawi.tbl_budgetstatus" => array("budgetstatus_kurzbz","bezeichnung"), - "wawi.tbl_budgetposition" => array("budgetposition_id","budgetantrag_id","budgetposten","konto_id","betrag","kommentar","projekt_id","insertamum","insertvon","updateamum","updatevon"), "wawi.tbl_zahlungstyp" => array("zahlungstyp_kurzbz","bezeichnung"), "wawi.tbl_konto" => array("konto_id","kontonr","beschreibung","kurzbz","aktiv","person_id","insertamum","insertvon","updateamum","updatevon","ext_id","person_id"), "wawi.tbl_konto_kostenstelle" => array("konto_id","kostenstelle_id","insertamum","insertvon"), From 3eebd1f3edd39b4279886234c29ff16909062d6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Thu, 15 Mar 2018 07:00:30 +0100 Subject: [PATCH 10/12] Extension Permission is now needed to see installed Extensions --- .../controllers/system/extensions/Manager.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/application/controllers/system/extensions/Manager.php b/application/controllers/system/extensions/Manager.php index db56b0d8b..9e24f00f5 100644 --- a/application/controllers/system/extensions/Manager.php +++ b/application/controllers/system/extensions/Manager.php @@ -11,15 +11,19 @@ class Manager extends VileSci_Controller * */ public function __construct() - { - parent::__construct(); + { + parent::__construct(); // Load helpers to upload files $this->load->helper(array('form', 'url')); - // Loads the extensions library - $this->load->library('ExtensionsLib'); - } + // Loads the extensions library + $this->load->library('ExtensionsLib'); + + $this->load->library('PermissionLib'); + if(!$this->permissionlib->isBerechtigt('system/extensions')) + show_error('You have no Permission! You need Extensions Permission'); + } /** * From 65f1992d13552ea1d5dcf58a03362d9b8dda9f5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Thu, 15 Mar 2018 10:30:41 +0100 Subject: [PATCH 11/12] Fehler behoben wodurch Nationen nicht korrekt geladen wurden wenn die Sperre auf false gesetzt war --- include/nation.class.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/include/nation.class.php b/include/nation.class.php index 42956ec95..5eecb9fc7 100644 --- a/include/nation.class.php +++ b/include/nation.class.php @@ -49,7 +49,7 @@ class nation extends basis_db public function __construct($code=null) { parent::__construct(); - + if($code != null) $this->load($code); } @@ -64,7 +64,7 @@ class nation extends basis_db { //Lesen der Daten aus der Datenbank $qry = "SELECT * FROM bis.tbl_nation WHERE nation_code=".$this->db_add_param($code).';'; - + if(!$this->db_query($qry)) { $this->errormsg = 'Fehler bei einer Datenbankabfrage'; @@ -101,17 +101,17 @@ class nation extends basis_db { //Lesen der Daten aus der Datenbank $qry = "SELECT * FROM bis.tbl_nation"; - + if ($ohnesperre) - $qry .= " WHERE sperre is null"; - + $qry .= " WHERE sperre is null OR sperre is false"; + if ($orderEnglish == false) $qry .= " ORDER BY kurztext"; - else + else $qry .= " ORDER BY engltext"; - + $qry .= ';'; - + if (!$this->db_query($qry)) { $this->errormsg = 'Fehler bei einer Datenbankabfrage'; @@ -134,10 +134,10 @@ class nation extends basis_db $this->nation[] = $nation; } - + return true; } - + /** * Speichert die Personendaten in die Datenbank * @return true wenn erfolgreich, false im Fehlerfall @@ -169,4 +169,4 @@ class nation extends basis_db } } } -?> \ No newline at end of file +?> From 7060459e4420b261c6be5d1cd1340a7e40af16d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Thu, 15 Mar 2018 16:44:12 +0100 Subject: [PATCH 12/12] =?UTF-8?q?Men=C3=BCpunkt=20Wartung=20ist=20nur=20no?= =?UTF-8?q?ch=20sichtbar=20wenn=20Berechtigungen=20f=C3=BCr=20Unterpunkte?= =?UTF-8?q?=20vorhanden=20sind?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/tw/vilesci_menu_main.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/tw/vilesci_menu_main.inc.php b/include/tw/vilesci_menu_main.inc.php index 9247cd98d..76938c547 100644 --- a/include/tw/vilesci_menu_main.inc.php +++ b/include/tw/vilesci_menu_main.inc.php @@ -176,7 +176,7 @@ $menu=array 'Wartung'=> array ( 'name'=>'Wartung', 'opener'=>'true', 'hide'=>'true', 'image'=>'vilesci_wartung.png', 'link'=>'left.php?categorie=Wartung', 'target'=>'nav', - + 'permissions'=>array('basis/studiengang','lehre/vorrueckung','student/vorrueckung','admin','basis/firma','student/stammdaten','assistenz','lv-plan'), 'DokumenteZuteilung'=>array('name'=>'Dokumente Zuteilung', 'link'=>'stammdaten/studiengang_dokumente.php', 'target'=>'main', 'permissions'=>array('basis/studiengang')), 'Vorrueckung'=> array ( @@ -186,7 +186,7 @@ $menu=array ), 'Kreuzerllistekopieren'=>array('name'=>'Kreuzerllisten kopieren', 'link'=>CIS_ROOT.'cis/private/lehre/benotungstool/copy_uebung.php', 'target'=>'_blank','permissions'=>array('admin')), 'Firmenwartung'=>array('name'=>'Firmenwartung', 'link'=>'stammdaten/firma_zusammen_uebersicht.php', 'target'=>'main','permissions'=>array('basis/firma')), - 'checkStudenten'=>array('name'=>'CheckStudenten', 'link'=>'../system/checkStudenten.php', 'target'=>'main'), + 'checkStudenten'=>array('name'=>'CheckStudenten', 'link'=>'../system/checkStudenten.php', 'target'=>'main', 'permissions'=>array('student/stammdaten')), 'StudienplanZuteilung'=>array('name'=>'Studienplan Zuteilung', 'link'=>'lehre/studienplan_zuteilung.php', 'target'=>'main','permissions'=>array('assistenz')), 'lv_merge'=>array('name'=>'LVs zusammenlegen', 'link'=>'lehre/lv_merge.php', 'target'=>'main','permissions'=>array('admin','lv-plan')), 'akteupdate'=>array('name'=>'Akten überschreiben', 'link'=>'personen/akteupdate.php', 'target'=>'main','permissions'=>array('admin')),