diff --git a/.gitignore b/.gitignore index bd98c9b59..96af3e5dc 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,7 @@ application/logs/ application/models/extensions/ application/views/extensions/ application/widgets/extensions/ +application/components/extensions/ public/extensions/ diff --git a/application/components/extensions/.placeholder b/application/components/extensions/.placeholder new file mode 100644 index 000000000..e69de29bb diff --git a/application/components/filters/LogsViewer.php b/application/components/filters/LogsViewer.php new file mode 100644 index 000000000..3a5390273 --- /dev/null +++ b/application/components/filters/LogsViewer.php @@ -0,0 +1,19 @@ + 'core', + 'datasetName' => 'logs', + //'filterKurzbz' => 'jobs48hours', // REMOVE ME + 'query' => ' + SELECT wsl.webservicelog_id AS "LogId", + wsl.request_id AS "RequestId", + wsl.execute_time AS "ExecutionTime", + wsl.execute_user AS "ExecutedBy", + wsl.beschreibung AS "Description", + wsl.request_data AS "Data", + wsl.webservicetyp_kurzbz AS "WebserviceType" + FROM system.tbl_webservicelog wsl + ORDER BY wsl.execute_time DESC + ', + 'requiredPermissions' => 'admin' + ); + diff --git a/application/config/anrechnung.php b/application/config/anrechnung.php index d1f4f0958..c2e38385c 100644 --- a/application/config/anrechnung.php +++ b/application/config/anrechnung.php @@ -7,8 +7,8 @@ if (! defined('BASEPATH')) exit('No direct script access allowed'); $config['interval_blocking_application'] = 'P1M'; // Application submission period given by start- and enddate. -$config['submit_application_start'] = '01.02.2021'; -$config['submit_application_end'] = '22.02.2021'; +$config['submit_application_start'] = '05.09.2022'; +$config['submit_application_end'] = '22.09.2022'; // Lehrveranstaltungen with these grades will be blocked for application $config['grades_blocking_application'] = array( diff --git a/application/config/navigation.php b/application/config/navigation.php index 033a65f86..5f3414759 100644 --- a/application/config/navigation.php +++ b/application/config/navigation.php @@ -15,7 +15,7 @@ $config['navigation_header'] = array( 'description' => 'Organisation', 'sort' => 20, 'requiredPermissions' => 'basis/vilesci:r', - 'children'=> array( + 'children' => array( 'vilesci' => array( 'link' => base_url('vilesci'), 'icon' => '', @@ -40,7 +40,7 @@ $config['navigation_header'] = array( 'description' => 'Lehre', 'sort' => 30, 'requiredPermissions' => 'basis/vilesci:r', - 'children'=> array( + 'children' => array( 'cis' => array( 'link' => CIS_ROOT, 'icon' => '', @@ -71,16 +71,16 @@ $config['navigation_header'] = array( 'lehre/lehrauftrag_erteilen:r' ) ), - 'zverfueg' => array( - 'link' => site_url('lehre/lvplanung/AdminZeitverfuegbarkeit'), - 'description' => 'Zeitverfügbarkeit', - 'expand' => true, - 'sort' => 45, - 'requiredPermissions' => array( - 'lehre/zeitverfuegbarkeit:rw', - 'lehre/zeitverfuegbarkeit:rw' - ) - ), + 'zverfueg' => array( + 'link' => site_url('lehre/lvplanung/AdminZeitverfuegbarkeit'), + 'description' => 'Zeitverfügbarkeit', + 'expand' => true, + 'sort' => 45, + 'requiredPermissions' => array( + 'lehre/zeitverfuegbarkeit:rw', + 'lehre/zeitverfuegbarkeit:rw' + ) + ), 'zgvueberpruefung' => array( 'link' => site_url('system/infocenter/ZGVUeberpruefung'), 'description' => 'ZGV Überprüfung', @@ -98,7 +98,7 @@ $config['navigation_header'] = array( 'description' => 'Personen', 'sort' => 40, 'requiredPermissions' => 'basis/vilesci:r', - 'children'=> array( + 'children' => array( 'messages' => array( 'link' => site_url('system/messages/MessageClient/read'), 'icon' => '', @@ -119,6 +119,13 @@ $config['navigation_header'] = array( 'expand' => true, 'sort' => 30, 'requiredPermissions' => 'system/issues_verwalten:r' + ), + 'gruppenmanagement' => array( + 'link' => site_url('person/Gruppenmanagement'), + 'description' => 'Gruppenmanagement', + 'expand' => true, + 'sort' => 40, + 'requiredPermissions' => 'lehre/gruppenmanager:r' ) ) ), @@ -129,7 +136,7 @@ $config['navigation_header'] = array( 'expand' => false, 'sort' => 50, 'requiredPermissions' => 'admin:r', - 'children'=> array( + 'children' => array( 'extensions' => array( 'link' => site_url('system/extensions/Manager'), 'description' => 'Extensions Manager', @@ -194,7 +201,8 @@ $config['navigation_menu']['lehre/lehrauftrag/Lehrauftrag/*'] = array( 'icon' => 'dashboard', 'sort' => 1, 'requiredPermissions' => array('lehre/lehrauftrag_bestellen:r','lehre/lehrauftrag_erteilen:r') - ),'lehrauftragBestellen' => array( + ), + 'lehrauftragBestellen' => array( 'link' => site_url('lehre/lehrauftrag/Lehrauftrag'), 'description' => 'Lehrauftrag bestellen', 'icon' => '', @@ -216,6 +224,7 @@ $config['navigation_menu']['lehre/lehrauftrag/Lehrauftrag/*'] = array( 'requiredPermissions' => array('lehre/lehrauftrag_erteilen:r') ) ); + $config['navigation_menu']['lehre/lehrauftrag/LehrauftragErteilen/*'] = array( 'lehrauftragDashboard' => array( 'link' => site_url('lehre/lehrauftrag/Lehrauftrag/Dashboard'), @@ -223,7 +232,8 @@ $config['navigation_menu']['lehre/lehrauftrag/LehrauftragErteilen/*'] = array( 'icon' => 'dashboard', 'sort' => 1, 'requiredPermissions' => array('lehre/lehrauftrag_bestellen:r','lehre/lehrauftrag_erteilen:r') - ),'lehrauftragBestellen' => array( + ), + 'lehrauftragBestellen' => array( 'link' => site_url('lehre/lehrauftrag/Lehrauftrag'), 'description' => 'Lehrauftrag bestellen', 'icon' => '', @@ -256,3 +266,4 @@ $config['navigation_menu']['system/issues/Issues/*'] = array( 'requiredPermissions' => array('admin:rw') ) ); + diff --git a/application/config/routes.php b/application/config/routes.php index 36bfdcb1e..15da5698f 100644 --- a/application/config/routes.php +++ b/application/config/routes.php @@ -60,3 +60,26 @@ $route['api/v1/organisation/[G|g]eschaeftsjahr/(:any)'] = 'api/v1/organisation/g $route['api/v1/organisation/[O|o]rganisationseinheit/(:any)'] = 'api/v1/organisation/organisationseinheit2/$1'; $route['api/v1/ressource/[B|b]etriebsmittelperson/(:any)'] = 'api/v1/ressource/betriebsmittelperson2/$1'; $route['api/v1/system/[S|s]prache/(:any)'] = 'api/v1/system/sprache2/$1'; + +// load routes from extensions +$subdir = 'application/config/extensions'; +$dirlist = scandir($subdir); + +if ($dirlist) +{ + $files = array_diff($dirlist, array('.','..')); + + foreach ($files as &$item) + { + if (is_dir($subdir . DIRECTORY_SEPARATOR . $item)) + { + $routes_file = $subdir . DIRECTORY_SEPARATOR . $item . DIRECTORY_SEPARATOR . 'routes.php'; + + if (file_exists($routes_file)) + { + require($routes_file); + } + } + } +} + diff --git a/application/controllers/components/Filter.php b/application/controllers/components/Filter.php new file mode 100644 index 000000000..ab7e1493e --- /dev/null +++ b/application/controllers/components/Filter.php @@ -0,0 +1,207 @@ +load->library('AuthLib'); + + // Loads the FilterCmptLib with HTTP GET/POST parameters + $this->_startFilterCmptLib(); + } + + //------------------------------------------------------------------------------------------------------------------ + // Public methods + + /** + * Retrieves data about the current filter from the session and will be written on the output in JSON format + */ + public function getFilter() + { + $this->outputJsonSuccess($this->filtercmptlib->getSession()); + } + + /** + * Remove an applied filter (SQL where condition) from the current filter + */ + public function removeFilterField() + { + $request = $this->getPostJSON(); + + if (property_exists($request, 'filterField') + && $this->filtercmptlib->removeFilterField($request->filterField) == true) + { + $this->outputJsonSuccess('Field removed'); + } + else + { + $this->outputJsonError('Error occurred'); + } + } + + /** + * Add a filter (SQL where clause) to be applied to the current filter + */ + public function addFilterField() + { + $request = $this->getPostJSON(); + + if (property_exists($request, 'filterField') + && $this->filtercmptlib->addFilterField($request->filterField) == true) + { + $this->outputJsonSuccess('Field added'); + } + else + { + $this->outputJsonError('Error occurred'); + } + } + + /** + * Apply the filter changes + */ + public function applyFilterFields() + { + $request = $this->getPostJSON(); + + if (property_exists($request, 'filterFields') + && $this->filtercmptlib->applyFilterFields($request->filterFields) == true) + { + $this->outputJsonSuccess('Applied'); + } + else + { + $this->outputJsonError('Error occurred'); + } + } + + /** + * Save the current filter as a custom filter for this user with the given description + */ + public function saveCustomFilter() + { + $request = $this->getPostJSON(); + + if (property_exists($request, 'customFilterName') + && $this->filtercmptlib->saveCustomFilter($request->customFilterName) == true) + { + $this->outputJsonSuccess('Saved'); + } + else + { + $this->outputJsonError('An error occurred while saving a custom filter'); + } + } + + /** + * Remove a custom filter by its filterId + */ + public function removeCustomFilter() + { + $request = $this->getPostJSON(); + + if (property_exists($request, 'filterId') + && $this->filtercmptlib->removeCustomFilter($request->filterId) == true) + { + $this->outputJsonSuccess('Removed'); + } + else + { + $this->outputJsonError('Wrong parameter'); + } + } + + /** + * Reloads the dataset + */ + public function reloadDataset() + { + $this->filtercmptlib->reloadDataset(); + + $this->outputJsonSuccess('Success'); + } + + //------------------------------------------------------------------------------------------------------------------ + // Private methods + + /** + * Loads the FilterCmptLib with the FILTER_UNIQUE_ID parameter + * If the parameter FILTER_UNIQUE_ID is not given then the execution of the controller is terminated and + * an error message is printed + */ + private function _startFilterCmptLib() + { + $filterUniqueId = null; + $filterType = null; + $filterId = null; + + // Try to get the POSTed JSON + $postJSON = $this->getPostJSON(); + + // POSTed JSON + if ($postJSON != null) + { + // If the mandatory parameters FILTER_UNIQUE_ID and FILTER_TYPE have been provided + if (property_exists($postJSON, self::FILTER_UNIQUE_ID) && property_exists($postJSON, self::FILTER_TYPE)) + { + // Retrives them from the POSTed JSON + $filterUniqueId = $postJSON->{self::FILTER_UNIQUE_ID}; + $filterType = $postJSON->{self::FILTER_TYPE}; + } + + // If the optional parameter FILTER_ID has been provided + if (property_exists($postJSON, self::FILTER_ID)) $filterId = $postJSON->{self::FILTER_ID}; + } + else // otherwise it is an HTTP GET call + { + // If the mandatory parameters FILTER_UNIQUE_ID and FILTER_TYPE have been provided + if (isset($_GET[self::FILTER_UNIQUE_ID]) && isset($_GET[self::FILTER_TYPE])) + { + // Retrives them from the HTTP GET + $filterUniqueId = $this->input->get(self::FILTER_UNIQUE_ID); + $filterType = $this->input->get(self::FILTER_TYPE); + } + + // If the optional parameter FILTER_ID has been provided + if (isset($_GET[self::FILTER_ID])) $filterId = $filterId = $this->input->get(self::FILTER_ID); + } + + // If the mandatory parameters have _not_ been provided, then terminate the execution and return an error + if ($filterUniqueId == null) $this->terminateWithJsonError('Parameter "'.self::FILTER_UNIQUE_ID.'" not provided!'); + if ($filterType == null) $this->terminateWithJsonError('Parameter "'.self::FILTER_TYPE.'" not provided!'); + + // Loads the FilterCmptLib that contains all the used logic + $this->load->library( + 'FilterCmptLib', + array( + 'filterUniqueId' => $filterUniqueId, + 'filterType' => $filterType, + 'filterId' => $filterId + ) + ); + + // Start the component + $this->filtercmptlib->start(); + } +} + diff --git a/application/controllers/components/SearchBar.php b/application/controllers/components/SearchBar.php new file mode 100644 index 000000000..09a49e163 --- /dev/null +++ b/application/controllers/components/SearchBar.php @@ -0,0 +1,51 @@ +load->library('SearchBarLib'); + } + + //------------------------------------------------------------------------------------------------------------------ + // Public methods + + /** + * Gets a JSON body via HTTP POST and provides the parameters + */ + public function search() + { + $json = json_decode($this->input->raw_input_stream); + + // Checks if the searchstr and the types parameters are in the POSTed JSON + if (isset($json->{self::SEARCHSTR_PARAM}) && isset($json->{self::TYPES_PARAM})) + { + // Convert to json the result from searchbarlib->search + $this->outputJson( + $this->searchbarlib->search( + $json->{self::SEARCHSTR_PARAM}, + $json->{self::TYPES_PARAM} + ) + ); + } + else // otherwise return an error in JSON format + { + $this->outputJsonError(SearchBarLib::ERROR_WRONG_JSON); + } + } +} + diff --git a/application/controllers/lehre/anrechnung/RequestAnrechnung.php b/application/controllers/lehre/anrechnung/RequestAnrechnung.php index bc8ab562e..fbaac9b3e 100644 --- a/application/controllers/lehre/anrechnung/RequestAnrechnung.php +++ b/application/controllers/lehre/anrechnung/RequestAnrechnung.php @@ -6,13 +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'; - + public function __construct() { // Set required permissions @@ -23,22 +23,22 @@ 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'); @@ -208,11 +208,11 @@ class requestAnrechnung extends Auth_Controller $this->_checkIfEntitledToReadDMSDoc($dms_id); // Get file to be downloaded from DMS - $download = $this->dmslib->download($dms_id, $filename); - if (isError($download)) return $download; + $download = $this->dmslib->download($dms_id); + if (isError($download)) return $download; - // Download file - $this->outputFile(getData($download)); + // Download file + $this->outputFile(getData($download)); } /** @@ -221,10 +221,10 @@ class requestAnrechnung extends Auth_Controller private function _setAuthUID() { $this->_uid = getAuthUID(); - + if (!$this->_uid) show_error('User authentification failed'); } - + /** * Check if application deadline is expired. * @@ -237,7 +237,7 @@ class requestAnrechnung extends Auth_Controller private function _isExpired($start, $ende, $studiensemester_kurzbz) { $this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel'); - + // If start is not given, set to Semesterstart. if (!isset($start) || isEmptyString($start)) { @@ -245,7 +245,7 @@ class requestAnrechnung extends Auth_Controller $result = $this->StudiensemesterModel->load($studiensemester_kurzbz); $start = getData($result)[0]->start; } - + // If ende is not given, set to Semesterende. if (!isset($ende) || isEmptyString($ende)) { @@ -253,15 +253,15 @@ class requestAnrechnung extends Auth_Controller $result = $this->StudiensemesterModel->load($studiensemester_kurzbz); $ende = getData($result)[0]->ende; } - + $today = new DateTime('today midnight'); $start = new DateTime($start); $ende = new DateTime($ende); - + // True if expired return ($today < $start || $today > $ende); } - + /** * Check if user is entitled to read dms doc. * @@ -273,9 +273,9 @@ class requestAnrechnung extends Auth_Controller { show_error('Failed loading Student'); } - + $result = $this->AnrechnungModel->loadWhere(array('dms_id' => $dms_id)); - + if($result = getData($result)[0]) { if ($result->prestudent_id == $student->prestudent_id) @@ -283,10 +283,10 @@ class requestAnrechnung extends Auth_Controller return; } } - + show_error('You are not entitled to read this document'); } - + /** * Check if application already exists. * @@ -302,15 +302,15 @@ class requestAnrechnung extends Auth_Controller 'studiensemester_kurzbz' => $studiensemester_kurzbz, 'prestudent_id' => $prestudent_id )); - + if (isError($result)) { show_error(getError($result)); } - + return hasData($result); } - + /** * Check if applications' study semester is actual study semester. * @@ -322,10 +322,10 @@ class requestAnrechnung extends Auth_Controller $this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel'); $result = $this->StudiensemesterModel->getNearest(); $actual_ss = getData($result)[0]->studiensemester_kurzbz; - + return $studiensemester_kurzbz == $actual_ss; } - + private function _LVhasBlockingGrades($studiensemester_kurzbz, $lehrveranstaltung_id) { // Get Note of Lehrveranstaltung @@ -336,12 +336,12 @@ class requestAnrechnung extends Auth_Controller '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'))) { @@ -350,7 +350,7 @@ class requestAnrechnung extends Auth_Controller } return false; } - + /** * Upload file via DMS library. * @@ -367,7 +367,7 @@ class requestAnrechnung extends Auth_Controller 'insertamum' => (new DateTime())->format('Y-m-d H:i:s'), 'insertvon' => $this->_uid ); - + // Upload document return $this->dmslib->upload($dms, 'uploadfile', array('pdf')); } diff --git a/application/controllers/lehre/anrechnung/ReviewAnrechnungDetail.php b/application/controllers/lehre/anrechnung/ReviewAnrechnungDetail.php index f574e7dfc..1bd92004d 100644 --- a/application/controllers/lehre/anrechnung/ReviewAnrechnungDetail.php +++ b/application/controllers/lehre/anrechnung/ReviewAnrechnungDetail.php @@ -322,20 +322,10 @@ class reviewAnrechnungDetail extends Auth_Controller // Send mail to STGL of each studiengang foreach ($studiengang_kz_arr as $studiengang_kz) { - // Get STGL mail address, if available, otherwise get assistance mail address - $stgmail = $this->_getSTGLMailAddress($studiengang_kz); - - if(isSuccess($stgmail) && hasData($stgmail)) - list ($to, $vorname) = getData($stgmail)[0]; - else - show_error ('Failed retrieving DegreeProgram Mail'); - // Get full name of lector $this->load->model('person/Person_model', 'PersonModel'); - if (!$lector_name = getData($this->PersonModel->getFullName($this->_uid))) - { - show_error ('Failed retrieving person'); - } + $result = $this->PersonModel->getFullName($this->_uid); + $lector_name = hasData($result) ? getData($result) : 'Ein Lektor'; // Link to Antrag genehmigen $url = @@ -343,22 +333,26 @@ class reviewAnrechnungDetail extends Auth_Controller CIS_ROOT. 'cis/menu.php?content_id=&content='. CIS_ROOT. index_page(). self::APPROVE_ANRECHNUNG_URI; - // Prepare mail content - $body_fields = array( - 'vorname' => $vorname, - 'lektor_name' => $lector_name, - 'empfehlung' => $empfehlung ? 'positive' : 'negative', - 'link' => anchor($url, 'Anrechnungsanträge Übersicht') - ); + // Get STGL mail address, if available, otherwise get assistance mail address + if( !$result = $this->_getSTGLMailAddress($studiengang_kz)) return false; + foreach ($result as $stgl) + { + // Prepare mail content + $body_fields = array( + 'vorname' => $stgl['vorname'], + 'lektor_name' => $lector_name, + 'empfehlung' => $empfehlung ? 'positive' : 'negative', + 'link' => anchor($url, 'Anrechnungsanträge Übersicht') + ); - sendSanchoMail( - 'AnrechnungEmpfehlungAbgeben', - $body_fields, - $to, - 'Anerkennung nachgewiesener Kenntnisse: Empfehlung wurde abgegeben' - ); + sendSanchoMail( + 'AnrechnungEmpfehlungAbgeben', + $body_fields, + $stgl['to'], + 'Anerkennung nachgewiesener Kenntnisse: Empfehlung wurde abgegeben' + ); + } } - return true; } @@ -369,28 +363,33 @@ class reviewAnrechnungDetail extends Auth_Controller $result = $this->StudiengangModel->getLeitung($stg_kz); // Get STGL mail address, if available - if (isSuccess($result) && hasData($result)) - { - return success(array( - $result->retval[0]->uid. '@'. DOMAIN, - $result->retval[0]->vorname - )); - } + if (hasData($result)) + { + foreach (getData($result) as $stgl) + { + $stglMailAdress_arr[]= array( + 'to' => $stgl->uid. '@'. DOMAIN, + 'vorname' => $stgl->vorname + ); + } + + return $stglMailAdress_arr; + } // ...otherwise get assistance mail address else { $result = $this->StudiengangModel->load($stg_kz); - if (isSuccess($result) && hasData($result)) + if (hasData($result)) { - return success(array( + return array( $result->retval[0]->email, '' - )); + ); } else { - return error('Keine E-Mail für diesen Stg gefunden'); + return false; } } } diff --git a/application/controllers/lehre/anrechnung/ReviewAnrechnungUebersicht.php b/application/controllers/lehre/anrechnung/ReviewAnrechnungUebersicht.php index 974b32393..c63d0af69 100644 --- a/application/controllers/lehre/anrechnung/ReviewAnrechnungUebersicht.php +++ b/application/controllers/lehre/anrechnung/ReviewAnrechnungUebersicht.php @@ -257,20 +257,10 @@ class reviewAnrechnungUebersicht extends Auth_Controller // Send mail to STGL of each studiengang foreach ($studiengang_kz_arr as $studiengang_kz) { - // Get STGL mail address, if available, otherwise get assistance mail address - $stgmail = $this->_getSTGLMailAddress($studiengang_kz); - - if(isSuccess($stgmail) && hasData($stgmail)) - list ($to, $vorname) = getData($stgmail)[0]; - else - show_error ('Failed retrieving DegreeProgram Mail'); - // Get full name of lector $this->load->model('person/Person_model', 'PersonModel'); - if (!$lector_name = getData($this->PersonModel->getFullName($this->_uid))) - { - show_error ('Failed retrieving person'); - } + $result = $this->PersonModel->getFullName($this->_uid); + $lector_name = hasData($result) ? getData($result) : 'Ein Lektor'; // Link to Antrag genehmigen $url = @@ -278,22 +268,26 @@ class reviewAnrechnungUebersicht extends Auth_Controller CIS_ROOT. 'cis/menu.php?content_id=&content='. CIS_ROOT. index_page(). self::APPROVE_ANRECHNUNG_URI; - // Prepare mail content - $body_fields = array( - 'vorname' => $vorname, - 'lektor_name' => $lector_name, - 'empfehlung' => $empfehlung ? 'positive' : 'negative', - 'link' => anchor($url, 'Anrechnungsanträge Übersicht') - ); + // Get STGL mail address, if available, otherwise get assistance mail address + if (!$result = $this->_getSTGLMailAddress($studiengang_kz)) return false; + foreach ($result as $stgl) + { + // Prepare mail content + $body_fields = array( + 'vorname' => $stgl['vorname'], + 'lektor_name' => $lector_name, + 'empfehlung' => $empfehlung ? 'positive' : 'negative', + 'link' => anchor($url, 'Anrechnungsanträge Übersicht') + ); - sendSanchoMail( - 'AnrechnungEmpfehlungAbgeben', - $body_fields, - $to, - 'Anerkennung nachgewiesener Kenntnisse: Empfehlung wurde abgegeben' - ); + sendSanchoMail( + 'AnrechnungEmpfehlungAbgeben', + $body_fields, + $stgl['to'], + 'Anerkennung nachgewiesener Kenntnisse: Empfehlung wurde abgegeben' + ); + } } - return true; } @@ -304,28 +298,33 @@ class reviewAnrechnungUebersicht extends Auth_Controller $result = $this->StudiengangModel->getLeitung($stg_kz); // Get STGL mail address, if available - if (isSuccess($result) && hasData($result)) - { - return success(array( - $result->retval[0]->uid. '@'. DOMAIN, - $result->retval[0]->vorname - )); - } + if (hasData($result)) + { + foreach (getData($result) as $stgl) + { + $stglMailAdress_arr[]= array( + 'to' => $stgl->uid. '@'. DOMAIN, + 'vorname' => $stgl->vorname + ); + } + + return $stglMailAdress_arr; + } // ...otherwise get assistance mail address else { $result = $this->StudiengangModel->load($stg_kz); - if (isSuccess($result) && hasData($result)) + if (hasData($result)) { - return success(array( + return array( $result->retval[0]->email, '' - )); + ); } else { - return error('Keine E-Mail für diesen Stg gefunden'); + return false; } } } diff --git a/application/controllers/organisation/Studiensemester.php b/application/controllers/organisation/Studiensemester.php index 10fa5b3ad..685c8cd7c 100644 --- a/application/controllers/organisation/Studiensemester.php +++ b/application/controllers/organisation/Studiensemester.php @@ -138,7 +138,7 @@ class Studiensemester extends Auth_Controller $start = $this->input->post("semstart"); $ende = $this->input->post("semende"); $studienjahr_kurzbz = $this->input->post("studienjahrkurzbz"); - $beschreibung = $this->input->post("beschreibung"); + $beschreibung = isEmptyString($this->input->post("beschreibung")) ? null : $this->input->post("beschreibung"); $onlinebewerbung = $this->input->post("onlinebewerbung"); $onlinebewerbung = isset($onlinebewerbung); diff --git a/application/controllers/person/BPKWartung.php b/application/controllers/person/BPKWartung.php index 52cb09c5c..0d96f8a12 100644 --- a/application/controllers/person/BPKWartung.php +++ b/application/controllers/person/BPKWartung.php @@ -7,8 +7,6 @@ if (! defined('BASEPATH')) exit('No direct script access allowed'); */ class BPKWartung extends Auth_Controller { - private $_uid; // contains the UID of the logged user - /** * Constructor */ @@ -46,7 +44,7 @@ class BPKWartung extends Auth_Controller // Public methods /** - * Main page of the InfoCenter tool + * Main page of the bPK Wartung. */ public function index() { @@ -56,9 +54,7 @@ class BPKWartung extends Auth_Controller } /** - * Personal details page of the InfoCenter tool - * Initialization function, gets person and prestudent data and loads the view with the data - * @param $person_id + * bPK Details initialization function, gets person data and loads the view with the data. */ public function showDetails() { @@ -85,8 +81,7 @@ class BPKWartung extends Auth_Controller } /** - * Saves a ZGV for a prestudent, includes Ort, Datum, Nation for bachelor and master - * @param $prestudent_id + * Saves a bPK for a person. */ public function saveBPK() { @@ -112,7 +107,7 @@ class BPKWartung extends Auth_Controller // Private methods /** - * Loads all necessary Person data: Stammdaten (name, svnr, contact, ...), Dokumente, Logs and Notizen + * Loads all necessary Person data. * @param $person_id * @return array */ diff --git a/application/controllers/person/Gruppenmanagement.php b/application/controllers/person/Gruppenmanagement.php new file mode 100644 index 000000000..1a4c341a4 --- /dev/null +++ b/application/controllers/person/Gruppenmanagement.php @@ -0,0 +1,254 @@ + 'lehre/gruppenmanager:r', + 'showBenutzergruppe' => 'lehre/gruppenmanager:r', + 'getBenutzer' => 'lehre/gruppenmanager:r', + 'getAllBenutzer' => 'lehre/gruppenmanager:r', + 'addBenutzer' => 'lehre/gruppenmanager:rw', + 'removeBenutzer' => 'lehre/gruppenmanager:rw' + ) + ); + + // Loads models + $this->load->model('person/benutzer_model', 'BenutzerModel'); + $this->load->model('ressource/mitarbeiter_model', 'MitarbeiterModel'); + $this->load->model('person/benutzergruppe_model', 'BenutzergruppeModel'); + $this->load->model('system/Log_model', 'LogModel'); + + $this->load->library('WidgetLib'); + $this->loadPhrases( + array( + 'global', + 'person', + 'lehre', + 'ui', + 'filter', + 'gruppenmanagement' + ) + ); + + $this->setControllerId(); // sets the controller id + $this->_setAuthUID(); // sets property uid + } + + // ----------------------------------------------------------------------------------------------------------------- + // Public methods + + /** + * Main page + */ + public function index() + { + $this->load->view( + 'person/gruppenmanagement/gruppenmanagement.php', + array('uid' => $this->_uid) + ); + } + + /** + * Shows Benutzergruppe overview page. + */ + public function showBenutzergruppe() + { + $this->_setNavigationMenuShowDetails(); + $gruppe_kurzbz = $this->input->get('gruppe_kurzbz'); + + $data[self::FHC_CONTROLLER_ID] = $this->getControllerId(); + + $this->load->view( + 'person/gruppenmanagement/benutzergruppe.php', + array('gruppe_kurzbz' => $gruppe_kurzbz) + ); + } + + /** + * Gets Benutzer assigned to a Gruppe + */ + public function getBenutzer() + { + $gruppe_kurzbz = $this->input->get('gruppe_kurzbz'); + + $this->BenutzergruppeModel->addSelect('uid, vorname, nachname, ben.aktiv'); + $this->BenutzergruppeModel->addJoin('public.tbl_benutzer ben', 'uid'); + $this->BenutzergruppeModel->addJoin('public.tbl_person', 'person_id'); + $benutzerRes = $this->BenutzergruppeModel->loadWhere(array('gruppe_kurzbz' => $gruppe_kurzbz)); + + $this->outputJson($benutzerRes); + } + + /** + * Gets all Benutzer for assignment to Gruppe + */ + public function getAllBenutzer() + { + $this->BenutzerModel->addSelect('uid, vorname, nachname'); + $this->BenutzerModel->addJoin('public.tbl_person', 'person_id'); + $benutzerRes = $this->BenutzerModel->loadWhere( + array('tbl_benutzer.aktiv' => true) + ); + $this->outputJson($benutzerRes); + } + + /** + * Adds a Benutzer to Gruppe + */ + public function addBenutzer() + { + $uid = $this->input->post('uid'); + $gruppe_kurzbz = $this->input->post('gruppe_kurzbz'); + + if (isEmptyString($uid)) + $result = error('Uid missing'); + else + { + $benutzerExistsRes = $this->BenutzergruppeModel->loadWhere( + array( + 'uid' => $uid, + 'gruppe_kurzbz' => $gruppe_kurzbz + ) + ); + + if (isError($benutzerExistsRes)) + { + $this->outputJsonError(getError($benutzerExistsRes)); + return; + } + + if (hasData($benutzerExistsRes)) + { + $this->outputJsonError($this->p->t('gruppenmanagement', 'benutzerSchonZugewiesen')); + return; + } + + $result = $this->BenutzergruppeModel->insert( + array( + 'uid' => $uid, + 'gruppe_kurzbz' => $gruppe_kurzbz, + 'insertamum' => date('Y-m-d H:i:s'), + 'insertvon' => $this->_uid + ) + ); + + // log the group add + $lastQry = $this->db->last_query(); + + if (isSuccess($result)) + { + $beschreibung = 'Gruppenmanagement: Nutzer zu Gruppe hinzugefügt'; + $this->_writeLog($this->_uid, $beschreibung, $lastQry); + } + } + + $this->outputJson($result); + } + + /** + * Removes Benutzer from Gruppe + */ + public function removeBenutzer() + { + $uid = $this->input->post('uid'); + $gruppe_kurzbz = $this->input->post('gruppe_kurzbz'); + + if (isEmptyString($uid)) + $result = error('Uid missing'); + else + { + $result = $this->BenutzergruppeModel->delete( + array( + 'uid' => $uid, + 'gruppe_kurzbz' => $gruppe_kurzbz + ) + ); + } + + // log the group remove + $lastQry = $this->db->last_query(); + + if (isSuccess($result)) + { + $beschreibung = 'Gruppenmanagement: Nutzer aus Gruppe entfernt'; + $this->_writeLog($this->_uid, $beschreibung, $lastQry); + } + + $this->outputJson($result); + } + + // ----------------------------------------------------------------------------------------------------------------- + // Private methods + + /** + * Define the navigation menu for the showDetails page + */ + private function _setNavigationMenuShowDetails() + { + $this->load->library('NavigationLib', array('navigation_page' => 'person/Gruppenmanagement/showBenutzergruppe')); + + $link = site_url('person/Gruppenmanagement'); + + $this->navigationlib->setSessionMenu( + array( + 'back' => $this->navigationlib->oneLevel( + 'Zurück', // description + $link, // link + array(), // children + 'angle-left', // icon + true, // expand + null, // subscriptDescription + null, // subscriptLinkClass + null, // subscriptLinkValue + '', // target + 1 // sort + ) + ) + ); + } + + /** + * Set uid of authentificated user + */ + private function _setAuthUID() + { + $this->_uid = getAuthUID(); + + if (!$this->_uid) show_error('User authentification failed'); + } + + /** + * Writes an entry in the log table + */ + private function _writeLog($uid, $beschreibung, $lastQry) + { + $mitarbeiterResult = $this->MitarbeiterModel->load(array('mitarbeiter_uid'=>$this->_uid)); + + if(!isSuccess($mitarbeiterResult) || !hasData($mitarbeiterResult)) + { + $uid = DUMMY_LEKTOR_UID; + $beschreibung .= ': '.$this->_uid; + $beschreibung = mb_substr($beschreibung, 0, 64); + } + + $this->LogModel->insert(array( + 'mitarbeiter_uid' => $uid, + 'beschreibung' => $beschreibung, + 'sql' => $lastQry + )); + } + +} diff --git a/application/controllers/system/Navigation.php b/application/controllers/system/Navigation.php index 190f84acd..c3764b612 100644 --- a/application/controllers/system/Navigation.php +++ b/application/controllers/system/Navigation.php @@ -1,4 +1,20 @@ . + */ if (! defined('BASEPATH')) exit('No direct script access allowed'); diff --git a/application/controllers/system/TestSearch.php b/application/controllers/system/TestSearch.php new file mode 100644 index 000000000..1f5c66a1d --- /dev/null +++ b/application/controllers/system/TestSearch.php @@ -0,0 +1,44 @@ + 'system/developer:r' + ) + ); + + // Loads WidgetLib + $this->load->library('WidgetLib'); + + // Loads phrases system + $this->loadPhrases( + array( + 'global', + 'ui', + 'filter' + ) + ); + } + + // ----------------------------------------------------------------------------------------------------------------- + // Public methods + + /** + * Everything has a beginning + */ + public function index() + { + $this->load->view('system/logs/testSearch.php'); + } +} diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 76011dc04..48c50bb4a 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -88,6 +88,12 @@ class InfoCenter extends Auth_Controller 'message' => 'Type of Document %s was updated, set to %s', 'success' => null ), + 'deletedoc' => array( + 'logtype' => 'Action', + 'name' => 'Document deleted', + 'message' => 'Document %s deleted', + 'success' => null + ), ); // Name of Interessentenstatus @@ -131,6 +137,7 @@ class InfoCenter extends Auth_Controller 'reloadZgvPruefungen' => 'infocenter:r', 'reloadMessages' => 'infocenter:r', 'reloadDoks' => 'infocenter:r', + 'reloadUebersichtDoks' => 'infocenter:r', 'reloadNotizen' => array('infocenter:r', 'lehre/zgvpruefung:r'), 'reloadLogs' => 'infocenter:r', 'outputAkteContent' => array('infocenter:r', 'lehre/zgvpruefung:r'), @@ -142,7 +149,9 @@ class InfoCenter extends Auth_Controller 'getStudienjahrEnd' => array('infocenter:r', 'lehre/zgvpruefung:r'), 'setNavigationMenuArrayJson' => 'infocenter:r', 'getAbsageData' => 'infocenter:r', - 'saveAbsageForAll' => 'infocenter:rw' + 'saveAbsageForAll' => 'infocenter:rw', + 'deleteDoc' => 'infocenter:rw', + 'getStudienartData' => 'infocenter:rw' ) ); @@ -159,6 +168,10 @@ class InfoCenter extends Auth_Controller $this->load->model('system/Message_model', 'MessageModel'); $this->load->model('system/Filters_model', 'FiltersModel'); $this->load->model('system/PersonLock_model', 'PersonLockModel'); + $this->load->model('organisation/Studiengang_model', 'StudiengangModel'); + $this->load->model('codex/Zgv_model', 'ZgvModel'); + $this->load->model('codex/Zgvmaster_model', 'ZgvmasterModel'); + $this->load->model('codex/Nation_model', 'NationModel'); // Loads libraries $this->load->library('PersonLogLib'); @@ -398,6 +411,35 @@ class InfoCenter extends Auth_Controller $this->outputJsonSuccess(array($json)); } + public function deleteDoc($person_id) + { + $akte_id = $this->input->post('akteid'); + + if (isset($akte_id) && isset($person_id)) + { + $this->load->library('AkteLib'); + $akte = $this->aktelib->get($akte_id); + + if (hasData($akte)) + { + $akte = getData($akte); + if ($akte->person_id === (int)$person_id) + { + $result = $this->aktelib->remove($akte_id); + + if (isError($result)) + { + $this->terminateWithJsonError('Error deleting document'); + } + + $this->_log($person_id, 'deletedoc', array($akte->bezeichnung)); + + $this->outputJsonSuccess('success'); + } + } + } + } + /** * Gets prestudent data for a person in json format * @param $person_id @@ -1074,6 +1116,17 @@ class InfoCenter extends Auth_Controller $this->load->view('system/infocenter/dokNachzureichend.php', array('dokumente_nachgereicht' => $dokumente_nachgereicht->retval)); } + public function reloadUebersichtDoks($person_id) + { + $dokumente = $this->AkteModel->getAktenWithDokInfo($person_id, null, false); + + $this->DokumentModel->addOrder('bezeichnung'); + $dokumentdata = array('dokumententypen' => (getData($this->DokumentModel->load()))); + $data = array_merge($dokumentdata, ['dokumente' => $dokumente->retval]); + + $this->load->view('system/infocenter/dokpruefung.php', $data); + } + /** * Outputs content of an Akte, sends appropriate headers (so the document can be downloaded) * @param $akte_id @@ -1932,10 +1985,25 @@ class InfoCenter extends Auth_Controller $abwstatusgruende = $this->StatusgrundModel->getStatus(self::ABGEWIESENERSTATUS, true)->retval; $intstatusgruende = $this->StatusgrundModel->getStatus(self::INTERESSENTSTATUS)->retval; + $studienArtBerechtigung = array_column($this->getStudienArtBerechtigung(), 'typ'); + + $this->ZgvModel->addOrder('zgv_bez'); + $allZGVs = getData($this->ZgvModel->load()); + + $this->ZgvModel->addOrder('zgvmas_bez'); + $allZGVsMaster = getData($this->ZgvmasterModel->load()); + + $this->NationModel->addOrder('langtext'); + $allNations = getData($this->NationModel->load()); + $data = array ( 'zgvpruefungen' => $zgvpruefungen, 'abwstatusgruende' => $abwstatusgruende, - 'intstatusgruende' => $intstatusgruende + 'intstatusgruende' => $intstatusgruende, + 'studienArtBerechtigung' => $studienArtBerechtigung, + 'all_zgvs' => $allZGVs, + 'all_zgvs_master' => $allZGVsMaster, + 'all_nations' => $allNations, ); return $data; @@ -2194,18 +2262,36 @@ class InfoCenter extends Auth_Controller public function getAbsageData() { - $this->load->model('organisation/Studiengang_model', 'StudiengangModel'); + $studiengang_kz_all = $this->permissionlib->getSTG_isEntitledFor('infocenter'); + $stg_typ = $this->StudiengangModel->getStudiengangTyp($studiengang_kz_all, ['b', 'm']); - $statusgruende = $this->StatusgrundModel->getStatus(self::ABGEWIESENERSTATUS, true)->retval; - $studienSemester = $this->variablelib->getVar('infocenter_studiensemester'); - $studiengaenge = $this->StudiengangModel->getStudiengaengeWithOrgForm(['b', 'm'], $studienSemester); + if (hasData($stg_typ)) + { + $stg_typ = getData($stg_typ); + $statusgruende = $this->StatusgrundModel->getStatus(self::ABGEWIESENERSTATUS, true)->retval; + $studienSemester = $this->variablelib->getVar('infocenter_studiensemester'); + $studiengaenge = $this->StudiengangModel->getStudiengaengeWithOrgForm(array_column($stg_typ, 'typ'), $studienSemester); - $data = array ( - 'statusgruende' => $statusgruende, - 'studiengaenge' => $studiengaenge->retval - ); + $data = array ( + 'statusgruende' => $statusgruende, + 'studiengaenge' => $studiengaenge->retval + ); - $this->outputJsonSuccess($data); + $this->outputJsonSuccess($data); + } + else + $this->outputJsonSuccess(null); + } + + public function getStudienArtBerechtigung() + { + $studiengang_kz_all = $this->permissionlib->getSTG_isEntitledFor('infocenter'); + $stg_typ = $this->StudiengangModel->getStudiengangTyp($studiengang_kz_all, ['b', 'm', 'l']); + return getData($stg_typ); + } + public function getStudienartData() + { + $this->outputJsonSuccess($this->getStudienArtBerechtigung()); } public function saveAbsageForAll() diff --git a/application/controllers/system/issues/Issues.php b/application/controllers/system/issues/Issues.php index da92c251c..6d959a024 100644 --- a/application/controllers/system/issues/Issues.php +++ b/application/controllers/system/issues/Issues.php @@ -81,7 +81,7 @@ class Issues extends Auth_Controller } if (isEmptyString($changeIssueMethod)) - $errors[] = error("Invalid issue status given"); + $errors[] = "Invalid issue status given"; else { $issueRes = $this->issueslib->{$changeIssueMethod}($issue_id, $user); diff --git a/application/core/FHC_Controller.php b/application/core/FHC_Controller.php index c71d5f6d0..dcd693cb1 100644 --- a/application/core/FHC_Controller.php +++ b/application/core/FHC_Controller.php @@ -169,6 +169,15 @@ abstract class FHC_Controller extends CI_Controller } } + /** + * Return the JSON decoded HTTP POST request + * If the request is not in JSON format then a null value is returned + */ + protected function getPostJSON() + { + return json_decode($this->input->raw_input_stream); + } + //------------------------------------------------------------------------------------------------------------------ // Private methods @@ -185,3 +194,4 @@ abstract class FHC_Controller extends CI_Controller } } } + diff --git a/application/helpers/hlp_common_helper.php b/application/helpers/hlp_common_helper.php index 7b937d73d..913d29b54 100644 --- a/application/helpers/hlp_common_helper.php +++ b/application/helpers/hlp_common_helper.php @@ -1,20 +1,19 @@ . */ if (! defined('BASEPATH')) exit('No direct script access allowed'); @@ -42,15 +41,19 @@ function generateToken($length = 64) { $firstGeneratedToken = random_bytes($length); // try to generates cryptographically secure pseudo-random bytes... } - catch (Exception $e) { $firstGeneratedToken = null; } // if fails $firstGeneratedToken is set to null + catch (Exception $e) + { + // If fails $firstGeneratedToken is set to null + $firstGeneratedToken = null; + } } // For PHP >= 5.3 and < 7 and openssl is available elseif (function_exists('openssl_random_pseudo_bytes')) { $firstGeneratedToken = openssl_random_pseudo_bytes($length, $strong); // If the token generation ended with errors OR the generated token is NOT strong enough - if ($firstGeneratedToken == false || $strong == false) $firstGeneratedToken = null; // $firstGeneratedToken is set to null - } + if ($firstGeneratedToken == false || $strong == false) $firstGeneratedToken = null; // $firstGeneratedToken is set to null + } if ($firstGeneratedToken != null) // If everything was fine { @@ -107,10 +110,7 @@ function var_dump_to_error_log($parameter) function loadResource($path, $resources = null, $subdir = false) { // Place a / character at the and of the string if not present - if (strrpos($path, '/') < strlen($path) - 1) - { - $path .= '/'; - } + if (strrpos($path, '/') < strlen($path) - 1) $path .= '/'; // Loads in $tmpResources all the given resources $tmpResources = $resources; @@ -125,28 +125,36 @@ function loadResource($path, $resources = null, $subdir = false) // Loads in $tmpPaths path and eventually the subdirectories $tmpPaths = array($path); - // NOTE: Used @ to prevent ugly error messages - if (is_dir($path) && ($dirHandler = @opendir($path)) !== false) + + // If path is a directory + if (is_dir($path)) { - // Reads all file system entries present in path - while (($entry = readdir($dirHandler)) !== false) + // NOTE: Used @ to prevent ugly error messages + $dirHandler = @opendir($path); + + // Successfully opened + if ($dirHandler !== false) { - // If entry is a directory but not the current and subdirectories should be loaded - if ($subdir === true && $entry != '.' && $entry != '..' && is_dir($entry)) + // Reads all file system entries present in path + while (($entry = readdir($dirHandler)) !== false) { - $tmpPaths[] = $entry; - } - // If no resources are specified and the current file system entry is a file - if ($resources == null && is_file($path.$entry)) - { - // If the current entry is a php file store the name without extension - if ($entry != ($tmpName = str_replace('.php', '', $entry))) + // If entry is a directory but not the current and subdirectories should be loaded + if ($subdir === true && $entry != '.' && $entry != '..' && is_dir($path.$entry)) { - $tmpResources[] = $tmpName; + $tmpPaths[] = $path.$entry.'/'; + } + // If no resources are specified and the current file system entry is a file + if ($resources == null && is_file($path.$entry)) + { + // Name without php extension + $tmpName = str_replace('.php', '', $entry); + + // If the current entry is a php file store the name without extension + if ($entry != $tmpName) $tmpResources[] = $tmpName; } } + closedir($dirHandler); } - closedir($dirHandler); } // Loops through the resources @@ -156,10 +164,7 @@ function loadResource($path, $resources = null, $subdir = false) foreach ($tmpPaths as $tmpPath) { $fileName = $tmpPath.$tmpResource.'.php'; // Php extension - if (file_exists($fileName)) - { - include_once($fileName); - } + if (file_exists($fileName)) include_once($fileName); } } } @@ -351,3 +356,52 @@ function sanitizeProblemChars($str) return preg_replace($acentos, array_keys($acentos), htmlentities($str, ENT_NOQUOTES | ENT_HTML5, $enc)); } + +/** + * + */ +function findResource($path, $resource, $subdir = false, $extraDir = null) +{ + // Place a / character at the and of the string if not present + if (strrpos($path, '/') < strlen($path) - 1) $path .= '/'; + + // Loads in $tmpPaths path and eventually the subdirectories + $tmpPaths = array($path); + if (is_dir($path)) + { + // NOTE: Used @ to prevent ugly error messages + $dirHandler = @opendir($path); + + // Successfully opened + if ($dirHandler !== false) + { + // Reads all file system entries present in path + while (($entry = readdir($dirHandler)) !== false) + { + // If entry is a directory but not the current and subdirectories should be loaded + if ($subdir === true && $entry != '.' && $entry != '..' && is_dir($path.$entry)) + { + if ($extraDir == null) + { + $tmpPaths[] = $path.$entry.'/'; + } + else + { + $tmpPaths[] = $path.$entry.'/'.$extraDir.'/'; + } + } + } + closedir($dirHandler); + } + } + + // Loops through the paths + foreach ($tmpPaths as $tmpPath) + { + $fileName = $tmpPath.$resource.'.php'; // Php extension + if (file_exists($fileName)) return $fileName; + } + + return null; +} + diff --git a/application/helpers/hlp_header_helper.php b/application/helpers/hlp_header_helper.php index 203834ebb..05bba48c4 100644 --- a/application/helpers/hlp_header_helper.php +++ b/application/helpers/hlp_header_helper.php @@ -149,6 +149,31 @@ function generateJSsInclude($JSs) } } +/** + * Generates tags for the javascript modules you want to include, the parameter could by a string or an array of strings + */ +function generateJSModulesInclude($JSModules) +{ + $jsInclude = ''; + + $ci =& get_instance(); + $cachetoken = '?'.$ci->config->item('fhcomplete_build_version'); + + if (isset($JSModules)) + { + $tmpJSs = is_array($JSModules) ? $JSModules : array($JSModules); + + for ($tmpJSsCounter = 0; $tmpJSsCounter < count($tmpJSs); $tmpJSsCounter++) + { + $toPrint = sprintf($jsInclude, base_url($tmpJSs[$tmpJSsCounter].$cachetoken)).PHP_EOL; + + if ($tmpJSsCounter > 0) $toPrint = "\t\t".$toPrint; + + echo $toPrint; + } + } +} + /** * Generates all the includes needed by the Addons */ @@ -156,16 +181,26 @@ function generateAddonsJSsInclude($calledFrom) { $aktive_addons = array_filter(explode(";", ACTIVE_ADDONS)); + // For each active addon foreach ($aktive_addons as $addon) { + // Build the path to the hook file $hookfile = DOC_ROOT.'addons/'.$addon.'/hooks.config.inc.php'; + + // If the hook file exists if (file_exists($hookfile)) { - include($hookfile); + $js_hooks = array(); // default value + + include($hookfile); // include the hook file where the array js_hooks should be setup + + // If it contains the provided key calledFrom if (key_exists($calledFrom, $js_hooks)) { foreach ($js_hooks[$calledFrom] as $js_file) + { generateJSsInclude('addons/'.$addon.'/'.$js_file); + } } } } @@ -180,3 +215,4 @@ function generateBackwardCompatibleJSMsIe($js) echo ' '."\n"; echo "\n"; } + diff --git a/application/libraries/DmsLib.php b/application/libraries/DmsLib.php index b2c53a7d9..fccfe503b 100644 --- a/application/libraries/DmsLib.php +++ b/application/libraries/DmsLib.php @@ -50,62 +50,57 @@ class DmsLib $kategorie_kurzbz = null, $dokument_kurzbz = null, $beschreibung = null, $cis_suche = false, $schlagworte = null ) { - // write file with content of fileHandle - $writeFileResult = $this->_writeNewFile($name, $fileHandle); + // create unique filename, using original document name to detect file extension + $filename = $this->_getUniqueFilename($name); - if (isError($writeFileResult)) return $writeFileResult; + // copy file from fileHandle to dms folder + $copyFileResult = $this->_copyFile($fileHandle, $filename); - if (hasData($writeFileResult)) + if (isError($copyFileResult)) return $copyFileResult; + + // if file written successful, insert dms + $dmsResult = $this->_ci->DmsModel->insert( + array( + 'kategorie_kurzbz' => $kategorie_kurzbz, + 'dokument_kurzbz' => $dokument_kurzbz + ) + ); + + if (isError($dmsResult)) return $dmsResult; + + if (hasData($dmsResult)) { - $writeFileData = getData($writeFileResult); - $filename = $writeFileData->filename; + $dms_id = getData($dmsResult); + $version = 0; - // if file written successful, insert dms - $dmsResult = $this->_ci->DmsModel->insert( - array( - 'kategorie_kurzbz' => $kategorie_kurzbz, - 'dokument_kurzbz' => $dokument_kurzbz - ) + // insert dms version + $dmsVersion = array( + 'dms_id' => $dms_id, + 'version' => $version, + 'filename' => $filename, + 'mimetype' => $mimetype, + 'name' => $name, + 'beschreibung' => $beschreibung, + 'cis_suche' => $cis_suche, + 'schlagworte' => $schlagworte, + 'insertvon' => $this->_who, + 'insertamum' => date('Y-m-d H:i:s') ); - if (isError($dmsResult)) return $dmsResult; + $dmsVersionResult = $this->_ci->DmsVersionModel->insert($dmsVersion); - if (hasData($dmsResult)) - { - $dms_id = getData($dmsResult); - $version = 0; + if (isError($dmsVersionResult)) return $dmsVersionResult; - // insert dms version - $dmsVersion = array( - 'dms_id' => $dms_id, - 'version' => $version, - 'filename' => $filename, - 'mimetype' => $mimetype, - 'name' => $name, - 'beschreibung' => $beschreibung, - 'cis_suche' => $cis_suche, - 'schlagworte' => $schlagworte, - 'insertvon' => $this->_who, - 'insertamum' => date('Y-m-d H:i:s') - ); + // return dms info + $resObj = new stdClass(); + $resObj->dms_id = $dms_id; + $resObj->version = $version; + $resObj->filename = $filename; - $dmsVersionResult = $this->_ci->DmsVersionModel->insert($dmsVersion); - - if (isError($dmsVersionResult)) return $dmsVersionResult; - - // return dms info - $resObj = new stdClass(); - $resObj->dms_id = $dms_id; - $resObj->version = $version; - $resObj->filename = $filename; - - return success($resObj); - } - else - return error("error when inserting DMS"); + return success($resObj); } else - return error("file could not be written"); + return error("error when inserting DMS"); } /** @@ -125,46 +120,41 @@ class DmsLib $originalName = isset($name) ? $name : $lastVersion->name; - // write new file with content of fileHandle - $writeFileResult = $this->_writeNewFile($originalName, $fileHandle); + // create unique filename, using original document name to detect file extension + $filename = $this->_getUniqueFilename($originalName); - if (isError($writeFileResult)) return $writeFileResult; + // copy file from fileHandle to dms folder + $copyFileResult = $this->_copyFile($fileHandle, $filename); - if (hasData($writeFileResult)) - { - $writeFileData = getData($writeFileResult); - $filename = $writeFileData->filename; + if (isError($copyFileResult)) return $copyFileResult; - // insert new version - $newVersionNumber = $lastVersion->version + 1; + // insert new version + $newVersionNumber = $lastVersion->version + 1; - // if new parameters given, use them, otherwise use parameters from last version - $newVersion = array( - 'dms_id' => $dms_id, - 'name' => $originalName, - 'filename' => $filename, - 'version' => $newVersionNumber, - 'mimetype' => isset($mimetype) ? $mimetype : $lastVersion->mimetype, - 'beschreibung' => isset($beschreibung) ? $beschreibung : $lastVersion->beschreibung, - 'cis_suche' => isset($cis_suche) ? $cis_suche : $lastVersion->cis_suche, - 'schlagworte' => isset($schlagworte) ? $schlagworte : $lastVersion->schlagworte, - 'insertvon' => $this->_who, - 'insertamum' => date('Y-m-d H:i:s') - ); + // if new parameters given, use them, otherwise use parameters from last version + $newVersion = array( + 'dms_id' => $dms_id, + 'name' => $originalName, + 'filename' => $filename, + 'version' => $newVersionNumber, + 'mimetype' => isset($mimetype) ? $mimetype : $lastVersion->mimetype, + 'beschreibung' => isset($beschreibung) ? $beschreibung : $lastVersion->beschreibung, + 'cis_suche' => isset($cis_suche) ? $cis_suche : $lastVersion->cis_suche, + 'schlagworte' => isset($schlagworte) ? $schlagworte : $lastVersion->schlagworte, + 'insertvon' => $this->_who, + 'insertamum' => date('Y-m-d H:i:s') + ); - $addVersionResult = $this->_ci->DmsVersionModel->insert($newVersion); + $addVersionResult = $this->_ci->DmsVersionModel->insert($newVersion); - if (isError($addVersionResult)) return $addVersionResult; + if (isError($addVersionResult)) return $addVersionResult; - // return dms info - $resObj = new stdClass(); - $resObj->version = $newVersionNumber; - $resObj->filename = $filename; + // return dms info + $resObj = new stdClass(); + $resObj->version = $newVersionNumber; + $resObj->filename = $filename; - return success($resObj); - } - else - return error("file could not be written"); + return success($resObj); } else return error("last version not found"); @@ -185,44 +175,37 @@ class DmsLib if (hasData($lastVersionResult)) { $lastVersion = getData($lastVersionResult); + $filename = $lastVersion->filename; // update file in filesystem - $writeFileResult = $this->_writeFile($lastVersion->filename, $fileHandle); + $copyFileResult = $this->_copyFile($fileHandle, $filename); - if (isError($writeFileResult)) return $writeFileResult; + if (isError($copyFileResult)) return $copyFileResult; - if (hasData($writeFileResult)) - { - $writeFileData = getData($writeFileResult); - $filename = $writeFileData->filename; + // if new parameters given, use them, otherwise use parameters from last version + $newVersion = array( + 'name' => isset($name) ? $name : $lastVersion->name, + 'filename' => $filename, + 'mimetype' => isset($mimetype) ? $mimetype : $lastVersion->mimetype, + 'beschreibung' => isset($beschreibung) ? $beschreibung : $lastVersion->beschreibung, + 'cis_suche' => isset($cis_suche) ? $cis_suche : $lastVersion->cis_suche, + 'schlagworte' => isset($schlagworte) ? $schlagworte : $lastVersion->schlagworte, + ); - // if new parameters given, use them, otherwise use parameters from last version - $newVersion = array( - 'name' => isset($name) ? $name : $lastVersion->name, - 'filename' => $filename, - 'mimetype' => isset($mimetype) ? $mimetype : $lastVersion->mimetype, - 'beschreibung' => isset($beschreibung) ? $beschreibung : $lastVersion->beschreibung, - 'cis_suche' => isset($cis_suche) ? $cis_suche : $lastVersion->cis_suche, - 'schlagworte' => isset($schlagworte) ? $schlagworte : $lastVersion->schlagworte, - ); + // update last dms version + $addVersionResult = $this->_ci->DmsVersionModel->update( + array($dms_id, $lastVersion->version), + $newVersion + ); - // update last dms version - $addVersionResult = $this->_ci->DmsVersionModel->update( - array($dms_id, $lastVersion->version), - $newVersion - ); + if (isError($addVersionResult)) return $addVersionResult; - if (isError($addVersionResult)) return $addVersionResult; + // return dms info + $resObj = new stdClass(); + $resObj->version = $lastVersion->version; + $resObj->filename = $filename; - // return dms info - $resObj = new stdClass(); - $resObj->version = $lastVersion->version; - $resObj->filename = $filename; - - return success($resObj); - } - else - return error("file could not be written"); + return success($resObj); } else return error("last version not found"); @@ -441,68 +424,35 @@ class DmsLib // Private methods /** - * Writes file with content of fileHandle using original document name for file extension + * Copies file from sourceFileHandle to destinationFilename in DMS folder + * Returns success or error on fail */ - private function _writeNewFile($originalName, $fileHandle) + private function _copyFile($sourceFileHandle, $destinationFilename) { - // create unique filename, using original document name to detect file extension - $filename = $this->_getUniqueFilename($originalName); + // get file location from file handle + $metaData = stream_get_meta_data($sourceFileHandle); - // write the file - return $this->_writeFile($filename, $fileHandle); - } - - /** - * Writes file with content of fileHandle - * Returns number of bytes written and filename - */ - private function _writeFile($filename, $fileHandle) - { - // file content provided by fileHandle - $fileContent = ''; - - $readBlockResult = success(); - - // While the end of the file is not reached and the read does not fail - while (!feof($fileHandle) && isSuccess($readBlockResult = $this->_ci->DmsFSModel->readBlock($fileHandle))) + if (isset($metaData['uri']) && !isEmptyString($metaData['uri'])) { - // Concatenate the content of the file - $fileContent .= getData($readBlockResult); + // if file location determined, copy file + $source = $metaData['uri']; + + if (copy($source, DMS_PATH.$destinationFilename)) + { + return success(); + } + else + { + // error if copy returned false + return error('error occured while copying file'); + } } - - // If an error occurred while reading then return it - if (isError($readBlockResult)) return $readBlockResult; - - // open file for writing - $openFileResult = $this->_ci->DmsFSModel->openReadWrite($filename); - - if (isError($openFileResult)) return $openFileResult; - - if (!hasData($openFileResult)) return error("File could not be opened"); - - $newFileHandle = getData($openFileResult); - - // write file - $writeFileResult = $this->_ci->DmsFSModel->write($newFileHandle, $fileContent); - - if (isError($writeFileResult)) return $writeFileResult; - - // return number of bytes written and filename - $resObj = new stdClass(); - $resObj->bytesWritten = 0; - $resObj->filename = ''; - - if (hasData($writeFileResult)) + else { - $resObj->bytesWritten = getData($writeFileResult); - $resObj->filename = $filename; + // error when source location could not be determined + return error('error occured while getting source file name'); } - // close handle - $closeResult = $this->_ci->DmsFSModel->close($newFileHandle, $fileContent); - - if (isError($closeResult)) return $closeResult; - return success($resObj); } @@ -527,7 +477,7 @@ class DmsLib // ----------------------------------------------------------------------------------------------------------- // Deprecated methods, not to be used - + /** * Load a DMS Document. * If no version is particularly given, the latest version is loaded. @@ -543,7 +493,7 @@ class DmsLib $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); @@ -620,7 +570,7 @@ class DmsLib return $result; } - + /** * Uploads a document and saves it to DMS * @param $dms DMS assoc array @@ -659,7 +609,7 @@ class DmsLib // Return result of uploaded data return success($upload_data); } - + /** * Download a document. * @@ -678,7 +628,7 @@ class DmsLib if (hasData($fileInfoResult)) { $fileObj = getData($fileInfoResult); - + // Change filename, if filename is provided if (!isEmptyString($filename)) $fileObj->name = $filename; @@ -694,7 +644,7 @@ class DmsLib // If no data have been found then return an empty success return success(); } - + /** * Get file information. * @@ -706,7 +656,7 @@ class DmsLib { // Checks the dms_id parameter if (!is_numeric($dms_id)) return error('Wrong parameter'); - + // Load DMS from database $result = $this->load($dms_id, $version); if (isError($result)) return error(getError($result)); @@ -951,4 +901,3 @@ class DmsLib $this->_ci->upload->initialize($config); } } - diff --git a/application/libraries/ExtensionsLib.php b/application/libraries/ExtensionsLib.php index cec40a753..9fe5d9e87 100644 --- a/application/libraries/ExtensionsLib.php +++ b/application/libraries/ExtensionsLib.php @@ -1,7 +1,25 @@ . + */ if (! defined('BASEPATH')) exit('No direct script access allowed'); +use \stdClass as stdClass; + /** * Library to manage core extensions */ @@ -23,7 +41,7 @@ class ExtensionsLib // Directories that are part of the extension archive private $SOFTLINK_TARGET_DIRECTORIES = array( - APPPATH => array('config', 'controllers', 'helpers', 'hooks', 'libraries', 'models', 'views', 'widgets'), + APPPATH => array('config', 'components', 'controllers', 'helpers', 'hooks', 'libraries', 'models', 'views', 'widgets'), DOC_ROOT => array('public') ); @@ -181,17 +199,15 @@ class ExtensionsLib // Select all the version of this extension $this->_ci->ExtensionsModel->addSelect('extension_id'); $result = $this->_ci->ExtensionsModel->loadWhere(array('name' => $extensionName)); - if (hasData($result)) // if something was found + // If something was found + if (hasData($result)) { - $extsArray = array(); - foreach ($result->retval as $key => $extension) // loops on them + // Loops on them + foreach ($result->retval as $extension) { // Remove them all $result = $this->_ci->ExtensionsModel->delete($extension->extension_id); - if (isSuccess($result)) - { - $delExtension = true; - } + if (isSuccess($result)) $delExtension = true; } } } @@ -432,9 +448,13 @@ class ExtensionsLib // If no errors occurred if ($extensionJson != null) { + // Default value + $fhcomplete_version = 0; + require_once('version.php'); // get the core version + // Checks if the required core version of the extension is the same of this system - if (isset($extensionJson->core_version) && $extensionJson->core_version == $fhcomplete_version) + if (isset($extensionJson->core_version) && version_compare($extensionJson->core_version, $fhcomplete_version,'<=')) { $this->_printMessage('Required core version: '.$extensionJson->core_version); $this->_printMessage('Current core version: '.$fhcomplete_version); @@ -587,18 +607,22 @@ class ExtensionsLib for ($sqlDir = $startVersion; $sqlDir <= $extensionJson->version; $sqlDir++) { // If a directory with the same value of the version is present in the sql scripts directory - if (($files = glob($pkgSQLsPath.'/'.$sqlDir.'/*'.ExtensionsLib::SQL_FILE_EXTENSION)) != false) - { + $files = glob($pkgSQLsPath.'/'.$sqlDir.'/*'.ExtensionsLib::SQL_FILE_EXTENSION); + if ($files != false) + { // Loads every sql files - foreach ($files as $file) - { - $sql = file_get_contents($file); // gets the entire content of the file + foreach ($files as $file) + { + $sql = file_get_contents($file); // gets the entire content of the file $this->_printMessage('Executing query:'); $this->_printMessage($sql); // Try to execute that - if (!isSuccess($result = @$this->_ci->ExtensionsModel->executeQuery($sql))) + $resultQuery = @$this->_ci->ExtensionsModel->executeQuery($sql); + + // If _not_ a success + if (!isSuccess($resultQuery)) { $this->_errorOccurred = true; $this->_printFailure(' error occurred while executing the query'); @@ -608,11 +632,11 @@ class ExtensionsLib else { $this->_printMessage('Query result:'); - var_dump($result->retval); // KEEP IT!!! + var_dump(getData($resultQuery)); // KEEP IT!!! $this->_ci->eprintflib->printEOL(); } - } - } + } + } } $this->_printSuccess(!$this->_errorOccurred); @@ -673,7 +697,7 @@ class ExtensionsLib foreach ($this->SOFTLINK_TARGET_DIRECTORIES as $rootPath => $targetDirectories) { - foreach ($targetDirectories as $key => $targetDirectory) + foreach ($targetDirectories as $targetDirectory) { if (file_exists($rootPath.$targetDirectory.'/'.ExtensionsLib::EXTENSIONS_DIR_NAME.'/'.$extensionName)) { @@ -727,7 +751,7 @@ class ExtensionsLib // For every target directory foreach ($this->SOFTLINK_TARGET_DIRECTORIES as $rootPath => $targetDirectories) { - foreach ($targetDirectories as $key => $targetDirectory) + foreach ($targetDirectories as $targetDirectory) { // If destination of the symlink does not exist if (!file_exists($rootPath.$targetDirectory.'/'.ExtensionsLib::EXTENSIONS_DIR_NAME.'/'.$extensionName)) diff --git a/application/libraries/FilterCmptLib.php b/application/libraries/FilterCmptLib.php new file mode 100644 index 000000000..9d6dfa681 --- /dev/null +++ b/application/libraries/FilterCmptLib.php @@ -0,0 +1,1163 @@ +. + */ + +if (! defined('BASEPATH')) exit('No direct script access allowed'); + +use \stdClass as stdClass; + +/** + * Filter component logic + */ +class FilterCmptLib +{ + // FilterCmpt session name + const SESSION_NAME = 'FHC_FILTER_COMPONENT'; + + // Session elements + const SESSION_FILTER_NAME = 'filterName'; + const SESSION_FIELDS = 'fields'; + const SESSION_SELECTED_FIELDS = 'selectedFields'; + const SESSION_FILTERS = 'filters'; + const SESSION_METADATA = 'datasetMetadata'; + const SESSION_ROW_NUMBER = 'rowNumber'; + const SESSION_TIMEOUT = 'sessionTimeout'; + + // Session dataset elements + const SESSION_DATASET = 'dataset'; + const SESSION_DATASET_RELOAD = 'reloadDataset'; + + const SESSION_SIDE_MENU = 'sideMenu'; + + // Default session timeout + const SESSION_DEFAULT_TIMEOUT = 30; + + // Alias for the dynamic table used to retrieve the dataset + const DATASET_TABLE_ALIAS = 'datasetFilterTable'; + + // Parameters names... + // ...to identify a single filter component in the session + const FHC_CONTROLLER_ID = 'fhc_controller_id'; + + // ...to identify a single filter component in the DB + const FILTER_ID = 'filter_id'; + const APP = 'app'; + const DATASET_NAME = 'datasetName'; + const FILTER_KURZBZ = 'filterKurzbz'; + const DATASET_RELOAD = 'reloadDataset'; + + // ...to specify permissions that are needed to use this FilterCmpt + const REQUIRED_PERMISSIONS = 'requiredPermissions'; + + // ...stament to retrieve the dataset + const QUERY = 'query'; + + // Filter operations values + const OP_EQUAL = 'equal'; + const OP_NOT_EQUAL = 'nequal'; + const OP_GREATER_THAN = 'gt'; + const OP_LESS_THAN = 'lt'; + const OP_IS_TRUE = 'true'; + const OP_IS_FALSE = 'false'; + const OP_CONTAINS = 'contains'; + const OP_NOT_CONTAINS = 'ncontains'; + const OP_SET = 'set'; + const OP_NOT_SET = 'nset'; + + // Filter options values + const OPT_MINUTES = 'minutes'; + const OPT_HOURS = 'hours'; + const OPT_DAYS = 'days'; + const OPT_MONTHS = 'months'; + + const FILTER_PHRASES_CATEGORY = 'FilterWidget'; // The category used to store phrases for the FilterCmpt + + const FILTER_UNIQUE_ID = 'filterUniqueId'; // Filter page parameter name + + const PERMISSION_FILTER_METHOD = 'FilterCmpt'; // Name for fake method to be checked by the PermissionLib + const PERMISSION_TYPE = 'r'; + + private $_ci; // Code igniter instance + + private $_filterUniqueId; // Unique id for this filter component + private $_filterType; // + private $_filterId; // + + private $_app; + private $_datasetName; + private $_filterKurzbz; + private $_query; + private $_requiredPermissions; + private $_reloadDataset; + private $_sessionTimeout; + + /** + * Gets the CI instance and loads message helper + */ + public function __construct($params) + { + $this->_ci =& get_instance(); // get code igniter instance + + // Set parameters + $this->_setParameters($params); + } + + //------------------------------------------------------------------------------------------------------------------ + // Public methods + + /** + * Wrapper method to the session helper funtions to retrieve the whole session for this filter + */ + public function getSession() + { + return getSessionElement(self::SESSION_NAME, $this->_filterUniqueId); + } + + /** + * Contains all the logic used to load all the data needed to the FilterCmpt + */ + public function start() + { + // + if (!$this->_checkJSParameters()) return; + + $filterCmptArray = array(); // default value + + // + $filePath = findResource(APPPATH.'components/filters/', $this->_filterType, true); + if (!isEmptyString($filePath)) + { + // Gets the filter configuration from the file system + require_once($filePath); + } + else + { + $filePath = findResource(APPPATH.'components/extensions/', $this->_filterType, true, 'filters'); + if (!isEmptyString($filePath)) require_once($filePath); + } + + // + if (!isset($filterCmptArray) && isEmptyArray($filterCmptArray)) + { + $this->_setSession(error('Component definition file '.$this->_filterType.' not found')); + return; + } + + // + if (!$this->_checkPHPParameters($filterCmptArray)) return; + + // + $this->_initFilterCmpt($filterCmptArray); + + // + if (!$this->_isAllowed()) return; + + // Looks for expired filter components in session and drops them + $this->_dropExpiredFilterCmpts(); + + // Read the all session for this filter component + $session = $this->getSession(); + + // If session is NOT empty -> a filter was already loaded + if ($session != null) + { + // Retrieve the filterId stored in the session + $sessionFilterId = $this->_getSessionElement(FilterCmptLib::FILTER_ID); + + // If the filter loaded in session is NOT the same that is being requested then empty the session + if ($this->_filterId != $sessionFilterId) + { + $this->_setSession(null); + $session = null; + } + else // else if the filter loaded in session is the same that is being requested + { + // Get SESSION_DATASET_RELOAD from the session + $sessionReloadDataset = $this->_getSessionElement(FilterCmptLib::SESSION_DATASET_RELOAD); + + // if Filter changed or reload is forced by parameter then reload the Dataset + if ($this->_reloadDataset === true || $sessionReloadDataset === true) + { + // Set as false to stop changing the dataset + $this->_setSessionElement(FilterCmptLib::SESSION_DATASET_RELOAD, false); + + // Generate dataset query using filters from the session + $datasetQuery = $this->_generateDatasetQuery( + $this->_query, + $this->_getSessionElement(FilterCmptLib::SESSION_FILTERS) + ); + + // Then retrieve dataset from DB + $dataset = $this->_getDataset($datasetQuery); + + // Save changes into session if data are valid + if (!isError($dataset)) + { + // Set the new dataset and its attributes in the session + $this->_setSessionElement(FilterCmptLib::SESSION_METADATA, $this->_ci->FiltersModel->getExecutedQueryMetaData()); + $this->_setSessionElement(FilterCmptLib::SESSION_ROW_NUMBER, count($dataset->retval)); + $this->_setSessionElement(FilterCmptLib::SESSION_DATASET, $dataset->retval); + } + } + } + } + + // If the session is empty -> first time that this filter is loaded + if ($session == null) + { + // Load filter definition data from DB + $definition = $this->_loadDefinition( + $this->_filterId, + $this->_app, + $this->_datasetName, + $this->_filterKurzbz + ); + + // Checks and parse json present into the definition + $parsedFilterJson = $this->_parseFilterJson($definition); + if ($parsedFilterJson != null) // if the json is valid + { + // Generate dataset query + $datasetQuery = $this->_generateDatasetQuery($this->_query, $parsedFilterJson->filters); + + // Then retrieve dataset from DB + $dataset = $this->_getDataset($datasetQuery); + + // Try to load the name of the filter using the PhrasesLib + $filterName = $this->_getFilterName($parsedFilterJson); + + // Save changes into session if data are valid + if (!isError($dataset)) + { + // Stores an array that contains all the data useful for + $this->_setSession( + array( + FilterCmptLib::FILTER_ID => $this->_filterId, // the current filter id + FilterCmptLib::APP => $this->_app, // the current app parameter + FilterCmptLib::DATASET_NAME => $this->_datasetName, // the carrent dataset name + FilterCmptLib::SESSION_FILTER_NAME => $filterName, // the current filter name + FilterCmptLib::SESSION_FIELDS => $this->_ci->FiltersModel->getExecutedQueryListFields(), // all the fields of the dataset + FilterCmptLib::SESSION_SELECTED_FIELDS => $this->_getColumnsNames($parsedFilterJson->columns), // all the selected fields + FilterCmptLib::SESSION_FILTERS => $parsedFilterJson->filters, // all the filters used to filter the dataset + FilterCmptLib::SESSION_METADATA => $this->_ci->FiltersModel->getExecutedQueryMetaData(), // the metadata of the dataset + FilterCmptLib::SESSION_ROW_NUMBER => count($dataset->retval), // the number of loaded rows by this filter + FilterCmptLib::SESSION_DATASET => $dataset->retval, // the entire dataset + FilterCmptLib::SESSION_DATASET_RELOAD => false, // if the dataset must be reloaded, not needed the first time + FilterCmptLib::SESSION_SIDE_MENU => $this->_generateFilterMenu($this->_app, $this->_datasetName) + ) + ); + } + } + } + + // NOTE: latest operations to be performed in the session to be shure that they are always present + // To be always stored in the session, otherwise is not possible to load data from Filters controller + $this->_setSessionElement(FilterCmptLib::REQUIRED_PERMISSIONS, $this->_requiredPermissions); + // Renew or set the session expiring time + $this->_setSessionElement(FilterCmptLib::SESSION_TIMEOUT, strtotime('+'.$this->_sessionTimeout.' minutes', time())); + } + + /** + * Add a filter (SQL where clause) to be applied to the current filter + */ + public function addFilterField($filterField) + { + $addFilterField = false; + + // Checks the parameter filter + if (!isEmptyString($filterField)) + { + // Retrieves all the used fields by the current filter + $fields = $this->_getSessionElement(self::SESSION_FIELDS); + // Retrieves the applied filters by the current filter + $filters = $this->_getSessionElement(self::SESSION_FILTERS); + + // Checks that the given applied filter is present in the list of all the used fields by the current filter + if (in_array($filterField, $fields)) + { + // Search in what position the given applied filter is + $pos = $this->_searchFilterByName($filters, $filterField); + if ($pos === false) // If NOT found then add it + { + // New filter definition + $filterDefinition = new stdClass(); + // Sets filter definition required properties + $filterDefinition->name = $filterField; + // Sets filter definition optional properties + $filterDefinition->operation = null; + $filterDefinition->condition = null; + $filterDefinition->option = null; + // Place the new applied filter at the end of the applied filters list + array_push($filters, $filterDefinition); + } + + $this->_setSessionElement(self::SESSION_FILTERS, $filters); // write changes into the session + + $addFilterField = true; + } + } + + return $addFilterField; + } + + /** + * Remove an applied filter (SQL where condition) from the current filter + */ + public function removeFilterField($filterField) + { + $removeFilterField = false; + + // Checks the parameter filterField + if (!isEmptyString($filterField)) + { + // Retrieves all the used fields by the current filter + $fields = $this->_getSessionElement(self::SESSION_FIELDS); + // Retrieves the applied filters by the current filter + $filters = $this->_getSessionElement(self::SESSION_FILTERS); + + // Checks that the given applied filter is present in the list of all the used fields by the current filter + if (in_array($filterField, $fields)) + { + // Search in what position the given applied filter is + $pos = $this->_searchFilterByName($filters, $filterField); + if ($pos !== false) // If found + { + array_splice($filters, $pos, 1); // Then remove it and shift the rest of elements by one if needed + } + + // Write changes into the session + $this->_setSessionElement(self::SESSION_FILTERS, $filters); + $this->_setSessionElement(self::SESSION_DATASET_RELOAD, true); // the dataset must be reloaded + + $removeFilterField = true; + } + } + + return $removeFilterField; + } + + /** + * Apply all the applied filters (SQL where conditions) to the current filter + */ + public function applyFilterFields($filterFields) + { + $applyFilters = false; + + // Check if the parameter is an array and it is not empty + if (!isEmptyArray($filterFields)) + { + $filters = array(); + + // Check if the parameter is fine + $fine = true; + foreach ($filterFields as $filterField) + { + // If not an empty array + if ($filterField != null) + { + // + if (isset($filterField->name) && isset($filterField->operation) && isset($filterField->condition) + && !isEmptyString($filterField->name) && !isEmptyString($filterField->operation) + && !isEmptyString($filterField->condition)) + { + // Fine + $filter = new stdClass(); + $filter->name = $filterField->name; + $filter->operation = $filterField->operation; + $filter->condition = $filterField->condition; + if (isset($filterField->option) && !isEmptyString($filterField->option)) + { + $filter->option = $filterField->option; + } + else + { + $filter->option = null; + } + $filters[] = $filter; + } + else // otherwise is not fine and stop checking + { + $fine = false; + break; + } + } + else // + { + $fine = false; + break; + } + } + + // + if ($fine) + { + // Write changes into the session + $this->_setSessionElement(self::SESSION_FILTERS, $filters); + $this->_setSessionElement(self::SESSION_DATASET_RELOAD, true); // the dataset must be reloaded + + $applyFilters = true; + } + } + + return $applyFilters; + } + + /** + * Reloads dataset by setting session variable to true + */ + public function reloadDataset() + { + $this->_setSessionElement(self::SESSION_DATASET_RELOAD, true); + } + + /** + * Save the current filter as a custom filter for this user with the given description + */ + public function saveCustomFilter($customFilterDescription) + { + $saveCustomFilter = false; // by default returns a failure + + // Checks parameter customFilterDescription if not valid stop the execution + if (isEmptyString($customFilterDescription)) return $saveCustomFilter; + + $this->_ci->load->model('system/Filters_model', 'FiltersModel'); // to load the filter definitions + $this->_ci->FiltersModel->resetQuery(); // reset any previous built query + + // person_id of the authenticated user + $authPersonId = getAuthPersonId(); + // Postgres array for the description + $descPGArray = str_replace('%desc%', $customFilterDescription, '{"%desc%", "%desc%", "%desc%", "%desc%"}'); + + // Loads the definition to check if is already present in the DB + $definition = $this->_ci->FiltersModel->loadWhere(array( + 'app' => $this->_getSessionElement(self::APP), + 'dataset_name' => $this->_getSessionElement(self::DATASET_NAME), + 'description' => $descPGArray, + 'person_id' => $authPersonId + )); + + // New definition to be json encoded + $jsonDeifinition = new stdClass(); + $jsonDeifinition->name = $customFilterDescription; // name of the filter + + // Generates the "column" property + $jsonDeifinition->columns = array(); + $selectedFields = $this->_getSessionElement(self::SESSION_SELECTED_FIELDS); // retrieved the selected fields + for ($i = 0; $i < count($selectedFields); $i++) + { + // Each element is an object with a property called "name" + $jsonDeifinition->columns[$i] = new stdClass(); + $jsonDeifinition->columns[$i]->name = $selectedFields[$i]; + } + + // List of applied filters + $jsonDeifinition->filters = $this->_getSessionElement(self::SESSION_FILTERS); + + // If it is already present + if (hasData($definition)) + { + // update it + $this->_ci->FiltersModel->update( + array( + 'app' => $this->_getSessionElement(self::APP), + 'dataset_name' => $this->_getSessionElement(self::DATASET_NAME), + 'description' => $descPGArray, + 'person_id' => $authPersonId + ), + array( + 'filter' => json_encode($jsonDeifinition) + ) + ); + + $saveCustomFilter = true; + } + else // otherwise insert a new one + { + $this->_ci->FiltersModel->insert( + array( + 'app' => $this->_getSessionElement(self::APP), + 'dataset_name' => $this->_getSessionElement(self::DATASET_NAME), + 'filter_kurzbz' => uniqid($authPersonId, true), + 'description' => $descPGArray, + 'person_id' => $authPersonId, + 'sort' => null, + 'default_filter' => false, + 'filter' => json_encode($jsonDeifinition), + 'oe_kurzbz' => null + ) + ); + + $saveCustomFilter = true; + } + + if ($saveCustomFilter === true) + { + $this->_setSessionElement(FilterCmptLib::SESSION_SIDE_MENU, + $this->_generateFilterMenu($this->_app, $this->_datasetName)); + } + + return $saveCustomFilter; + } + + /** + * Remove a custom filter by its filter_id + */ + public function removeCustomFilter($filterId) + { + $removeCustomFilter = false; + + // Checks the parameter filterId + if (isset($filterId) && is_numeric($filterId) && $filterId > 0) + { + $this->_ci->load->model('system/Filters_model', 'FiltersModel'); // to remove the filter definitions from DB + + // Delete it from database + $this->_ci->FiltersModel->delete(array(self::FILTER_ID => $filterId)); + + // Delete it from session + $this->_dropFromSessionFilterCmptById($filterId); + + $removeCustomFilter = true; + } + + return $removeCustomFilter; + } + + //------------------------------------------------------------------------------------------------------------------ + // Private methods + + /** + * Generates the filters menu structure array and stores it into the session + */ + private function _generateFilterMenu($app, $datasetName) + { + $filterMenu = new stdClass(); + $filterMenu->filters = array(); + $filterMenu->personalFilters = array(); + + // Loads the Filters model + $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->getFiltersByAppDatasetNamePersonId( + $app, + $datasetName, + getAuthPersonId() + ); + + // If filters were loaded + if (hasData($filters)) + { + // Loops through loaded filters + foreach (getData($filters) as $filter) + { + $menuEntry = new stdClass(); + $menuEntry->desc = $filter->description[0]; + $menuEntry->filter_id = $filter->filter_id; + + // If it is NOT a personal filter + if ($filter->person_id == null) + { + $filterMenu->filters[] = $menuEntry; + } + else // otherwise + { + $menuEntry->subscriptDescription = '(Remove)'; + $menuEntry->subscriptLinkClass = 'remove-custom-filter'; + $menuEntry->subscriptLinkValue = $filter->{self::FILTER_ID}; + + $filterMenu->personalFilters[] = $menuEntry; // adds to personal filters menu array + } + } + } + + return $filterMenu; + } + + /** + * Wrapper method to the session helper funtions to retrieve one element from the session of this filter + */ + private function _getSessionElement($name) + { + $session = getSessionElement(self::SESSION_NAME, $this->_filterUniqueId); + + if (isset($session[$name])) + { + return $session[$name]; + } + + return null; + } + + /** + * 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 FilterCmpt. + * If the parameter requiredPermissions is NOT given or is not present in the session, + * then NO one is allow to use this FilterCmpt + * Wrapper method to permissionlib->hasAtLeastOne + */ + private function _isAllowed() + { + $this->_ci->load->library('PermissionLib'); // Load permission library + + if (!$this->_ci->permissionlib->hasAtLeastOne($this->_requiredPermissions, self::PERMISSION_FILTER_METHOD, self::PERMISSION_TYPE)) + { + $this->_setSession(error('The required permission is not help by the logged user')); + return false; + } + + return true; + } + + /** + * + */ + private function _setParameters($params) + { + if (isset($params['filterUniqueId'])) $this->_filterUniqueId = $params['filterUniqueId']; + if (isset($params['filterType'])) $this->_filterType = $params['filterType']; + if (isset($params['filterId'])) $this->_filterId = $params['filterId']; + } + + /** + * Checks the required parameters used to call this FilterCmpt + */ + private function _checkJSParameters() + { + // + if (isEmptyString($this->_filterUniqueId)) + { + $this->_setSession(error('Parameter "filterUniqueId" not provided')); + return false; + } + + // + if (isEmptyString($this->_filterType)) + { + $this->_setSession(error('Parameter "filterType" not provided')); + return false; + } + + return true; + } + + /** + * Checks the required parameters used to call this FilterCmpt + */ + private function _checkPHPParameters($filterCmptArray) + { + // If no options are given to this component... + if (!is_array($filterCmptArray) || (is_array($filterCmptArray) && count($filterCmptArray) == 0)) + { + $this->_setSession(error('No parameters provided')); + return false; + } + else // ...otherwise + { + // Parameters app AND dataset name + if (!isset($filterCmptArray[FilterCmptLib::APP]) && !isset($filterCmptArray[FilterCmptLib::DATASET_NAME])) + { + $this->_setSession( + error( + 'The parameters "'.FilterCmptLib::APP.'" AND "'.FilterCmptLib::DATASET_NAME.' must be specified' + ) + ); + return false; + } + + // The query parameter is mandatory + if (!isset($filterCmptArray[FilterCmptLib::QUERY])) + { + $this->_setSession(error('The parameter "'.FilterCmptLib::QUERY.'" must be specified')); + return false; + } + + // + if (!isset($filterCmptArray[FilterCmptLib::DATASET_NAME])) + { + $this->_setSession(error('The parameter "'.FilterCmptLib::DATESET_NAME.'" must be specified')); + return false; + } + + // + if (!isset($filterCmptArray[FilterCmptLib::REQUIRED_PERMISSIONS])) + { + $this->_setSession(error('The parameter "'.FilterCmptLib::REQUIRED_PERMISSIONS.'" must be specified')); + return false; + } + } + + return true; + } + + /** + * Checks parameters and initialize all the properties of this FilterCmpt + */ + private function _initFilterCmpt($filterCmptArray) + { + // If here then everything is ok + + // Initialize class properties + $this->_app = null; + $this->_datasetName = null; + $this->_filterKurzbz = null; + $this->_query = null; + $this->_requiredPermissions = null; + + $this->_reloadDataset = true; // by default the dataset is NOT cached in session + $this->_sessionTimeout = FilterCmptLib::SESSION_DEFAULT_TIMEOUT; + + // Retrieved the required permissions parameter if present + if (isset($filterCmptArray[FilterCmptLib::REQUIRED_PERMISSIONS])) + { + $this->_requiredPermissions = $filterCmptArray[FilterCmptLib::REQUIRED_PERMISSIONS]; + } + + // Parameters needed to retrieve univocally a filter from DB + if (isset($filterCmptArray[FilterCmptLib::APP])) + { + $this->_app = $filterCmptArray[FilterCmptLib::APP]; + } + + if (isset($filterCmptArray[FilterCmptLib::DATASET_NAME])) + { + $this->_datasetName = $filterCmptArray[FilterCmptLib::DATASET_NAME]; + } + + if (isset($filterCmptArray[FilterCmptLib::FILTER_KURZBZ])) + { + $this->_filterKurzbz = $filterCmptArray[FilterCmptLib::FILTER_KURZBZ]; + } + + // How to retrieve data for the filter: SQL statement or a result from DB + if (isset($filterCmptArray[FilterCmptLib::QUERY])) + { + $this->_query = $filterCmptArray[FilterCmptLib::QUERY]; + } + } + + /** + * Generates a condition for a SQL where clause using the given applied filter definition. + * By default an empty string is returned. + */ + private function _getDatasetQueryCondition($filterDefinition) + { + $condition = ''; // starts building the condition + + $this->_ci->load->model('system/Filters_model', 'FiltersModel'); + + // "operation" is a required property for the applied filter definition + if (!isEmptyString($filterDefinition->operation)) + { + // Checks what operation is required + switch ($filterDefinition->operation) + { + // comparison (==) + case self::OP_EQUAL: + // Numeric + if (is_numeric($filterDefinition->condition)) + { + $condition = '= '.$filterDefinition->condition; + } + else // string type + { + $condition = '= \''.$this->_ci->FiltersModel->escapeLike($filterDefinition->condition).'\''; + } + break; + // not equal (!=) + case self::OP_NOT_EQUAL: + // Numeric + if (is_numeric($filterDefinition->condition)) + { + $condition = '!= '.$filterDefinition->condition; + } + else // string type + { + $condition = '!= \''.$this->_ci->FiltersModel->escapeLike($filterDefinition->condition).'\''; + } + break; + // greater than (>) + case self::OP_GREATER_THAN: + // If it's a date type + if (is_numeric($filterDefinition->condition) + && isset($filterDefinition->option) + && ($filterDefinition->option == self::OPT_HOURS + || $filterDefinition->option == self::OPT_DAYS + || $filterDefinition->option == self::OPT_MONTHS + || $filterDefinition->option == self::OPT_MINUTES)) + { + $condition = '< (NOW() - \''.$filterDefinition->condition.' '.$filterDefinition->option.'\'::interval)'; + } + else // otherwise is a number + { + $condition = '> '.$filterDefinition->condition; + } + break; + // less than (<) + case self::OP_LESS_THAN: + // If it's a date type + if (is_numeric($filterDefinition->condition) + && isset($filterDefinition->option) + && ($filterDefinition->option == self::OPT_HOURS + || $filterDefinition->option == self::OPT_DAYS + || $filterDefinition->option == self::OPT_MONTHS + || $filterDefinition->option == self::OPT_MINUTES)) + { + $condition = '> (NOW() - \''.$filterDefinition->condition.' '.$filterDefinition->option.'\'::interval)'; + } + else // otherwise is a number + { + $condition = '< '.$filterDefinition->condition; + } + break; + // contains (ILIKE) + case self::OP_CONTAINS: + $condition = 'ILIKE \'%'.$this->_ci->FiltersModel->escapeLike($filterDefinition->condition).'%\''; + break; + // not contains (NOT ILIKE) + case self::OP_NOT_CONTAINS: + $condition = 'NOT ILIKE \'%'.$this->_ci->FiltersModel->escapeLike($filterDefinition->condition).'%\''; + break; + // is true (=== true) + case self::OP_IS_TRUE: + $condition = 'IS TRUE'; + break; + // is false (=== false) + case self::OP_IS_FALSE: + $condition = 'IS FALSE'; + break; + // is set + case self::OP_SET: + $condition = 'IS NOT NULL'; + break; + // is NOT set + case self::OP_NOT_SET: + $condition = 'IS NULL'; + break; + // by default must not be null (!= null) + default: + $condition = 'IS NOT NULL'; + break; + } + } + + // if the condition is valid + if (!isEmptyString($condition)) $condition = ' '.$condition; // add a white space before + + return $condition; + } + + /** + * Search for a filter inside a list of filters by the given filter name + * Returns false if NOT found, otherwise the position inside the list + */ + private function _searchFilterByName($filters, $filterName) + { + $pos = false; + + for($i = 0; $i < count($filters); $i++) + { + if ($filters[$i]->name == $filterName) + { + $pos = $i; + break; + } + } + + return $pos; + } + + /** + * Remove from the session the given filter component + */ + private function _dropFromSessionFilterCmptById($filterId) + { + // Loads the session for all the filter components + $filterCmptsSession = getSession(self::SESSION_NAME); + + // If something is present in session + if ($filterCmptsSession != null) + { + // Loops in the session for all the filter components + foreach ($filterCmptsSession as $filterCmpt => $filterCmptData) + { + // If this filter component is not the one that we are looking for + if ($filterCmptData[self::FILTER_ID] == $filterId) + { + cleanSessionElement(self::SESSION_NAME, $filterCmpt); // ...remove it + break; // stop to search + } + } + } + } + + /** + * Utility method that retrieves the name of the columns present in a filter JSON definition + */ + private function _getColumnsNames($columns) + { + $columnsNames = array(); + + // For each column + foreach ($columns as $obj) + { + // If it is set the property name of the column + if (isset($obj->name)) $columnsNames[] = $obj->name; + } + + return $columnsNames; + } + + /** + * Wrapper method to the session helper funtions to set the whole session for this filter + */ + private function _setSession($data) + { + setSessionElement(self::SESSION_NAME, $this->_filterUniqueId, $data); + } + + /** + * Wrapper method to the session helper funtions to set one element in the session for this filter + */ + private function _setSessionElement($name, $value) + { + $session = getSessionElement(self::SESSION_NAME, $this->_filterUniqueId); + + $session[$name] = $value; + + setSessionElement(self::SESSION_NAME, $this->_filterUniqueId, $session); // stores the single value + } + + /** + * + */ + private function _dropExpiredFilterCmpts() + { + // Loads the session for all the filter components + $filterCmptsSession = getSession(self::SESSION_NAME); + + // If something is present in session + if ($filterCmptsSession != null) + { + // Loops in the session for all the filter components + foreach ($filterCmptsSession as $filterCmpt => $filterCmptData) + { + // If this filter component is not the current used filter component and the it is expired... + if ($this->_filterUniqueId != $filterCmpt && $filterCmptData[self::SESSION_TIMEOUT] <= time()) + { + cleanSessionElement(self::SESSION_NAME, $filterCmpt); // ...remove it + } + } + } + } + + /** + * Loads the definition data from DB for a filter component + */ + private function _loadDefinition($filterId, $app, $datasetName, $filterKurzbz) + { + // Loads the needed models + $this->_ci->load->model('system/Filters_model', 'FiltersModel'); + $this->_ci->FiltersModel->resetQuery(); // reset any previous built query + + $this->_ci->FiltersModel->addSelect('system.tbl_filters.*'); // select only from table filters + $this->_ci->FiltersModel->addOrder('sort', 'ASC'); // sort on column sort + $this->_ci->FiltersModel->addLimit(1); // if more than one filter is set as default only one will be retrieved + + $definition = null; + $whereParameters = null; // where clause parameters + + // If we have a good filterId then use it! + if ($filterId != null && is_numeric($filterId) && $filterId > 0) + { + $whereParameters = array( + self::FILTER_ID => $filterId + ); + } + else + { + // If we can univocally retrieve a filter + if ($app != null && $datasetName != null && $filterKurzbz != null) + { + $whereParameters = array( + 'app' => $app, + 'dataset_name' => $datasetName, + 'filter_kurzbz' => $filterKurzbz + ); + } + // Else if we have only app and datasetName + elseif ($app != null && $datasetName != null && $filterKurzbz == null) + { + // Try to load the custom filter (person_id = logged user person_id) with the given "app" and "dataset_name" + // that is set as default filter (default_filter = true) + $whereParameters = array( + 'app' => $app, + 'dataset_name' => $datasetName, + 'person_id' => getAuthPersonId(), + 'default_filter' => true + ); + + $definition = $this->_ci->FiltersModel->loadWhere($whereParameters); + if (!hasData($definition)) // If a custom filter is NOT found + { + // Try to load the global filter (person_id = null) with the given "app" and "dataset_name" that is set as + // default filter (default_filter = true) + $whereParameters = array( + 'app' => $app, + 'dataset_name' => $datasetName, + 'person_id' => null, + 'default_filter' => true + ); + + $definition = $this->_ci->FiltersModel->loadWhere($whereParameters); + } + } + } + + // If no definition where loaded and where parameters were set + if ($definition == null && $whereParameters != null) + { + $definition = $this->_ci->FiltersModel->loadWhere($whereParameters); + + // Last chance!!! + if (!hasData($definition)) // If no data have been found until now the tries the most desperate query + { + $this->_ci->FiltersModel->addOrder('filter_id', 'ASC'); // sort on column filter_id to get the oldest + $whereParameters = array( + 'app' => $app, + 'dataset_name' => $datasetName + ); + + $definition = $this->_ci->FiltersModel->loadWhere($whereParameters); + } + } + + return $definition; + } + + /** + * Checks if the json definition of this filter is valid + */ + private function _parseFilterJson($definition) + { + $jsonEncodedFilter = null; + + // If the definition contains data and they are valid + if (hasData($definition) && isset(getData($definition)[0]->filter) && trim(getData($definition)[0]->filter) != '') + { + // Get the json definition of the filter + $tmpJsonEncodedFilter = json_decode(getData($definition)[0]->filter); + + // Checks required filter's properies + if (isset($tmpJsonEncodedFilter->name) + && isset($tmpJsonEncodedFilter->columns) + && is_array($tmpJsonEncodedFilter->columns) + && isset($tmpJsonEncodedFilter->filters) + && is_array($tmpJsonEncodedFilter->filters)) + { + $jsonEncodedFilter = $tmpJsonEncodedFilter; + } + } + + return $jsonEncodedFilter; + } + + /** + * Generate the query to retrieve the dataset for a filter + */ + private function _generateDatasetQuery($query, $filters) + { + $datasetQuery = 'SELECT * FROM ('.$query.') '.self::DATASET_TABLE_ALIAS; + + // If the given query is valid and the parameter filters is an array + if (!isEmptyString($query) && $filters != null && is_array($filters)) + { + $where = ''; // starts building the SQL where clause + + // Loops through the given applied filters + for ($filtersCounter = 0; $filtersCounter < count($filters); $filtersCounter++) + { + $filterDefinition = $filters[$filtersCounter]; // definition of one filter + + // If the name of the applied filter is valid + if (!isEmptyString($filterDefinition->name)) + { + // Build the query conditions + $datasetQueryCondition = $this->_getDatasetQueryCondition($filterDefinition); + + // If the built condition is valid then add it to the query clause + if (!isEmptyString($datasetQueryCondition)) + { + // If this is NOT the first one + if ($filtersCounter > 0) $where .= ' AND '; + + $where .= '"'.$filterDefinition->name.'"'.$datasetQueryCondition; + } + } + } + + // If the SQL where clause was built + if ($where != '') $datasetQuery .= ' WHERE '.$where; + } + + return $datasetQuery; + } + + /** + * Retrieves the dataset from the DB + */ + private function _getDataset($datasetQuery) + { + $dataset = null; + + if ($datasetQuery != null) + { + $this->_ci->load->model('system/Filters_model', 'FiltersModel'); + + // Execute the given SQL statement suppressing error messages + $dataset = @$this->_ci->FiltersModel->execReadOnlyQuery($datasetQuery); + } + + return $dataset; + } + + /** + * Get the filter name, the default is the "name" property of the JSON definition + * If the property namePhrase is present into the JSON definition, then try to load that from the phrases system + * NOTE: filterJson should be already checked using the method _parseFilterJson + */ + private function _getFilterName($filterJson) + { + $filterName = $filterJson->name; // always present, used as default + + // Filter name from phrases system + if (isset($filterJson->namePhrase) && !isEmptyString($filterJson->namePhrase)) + { + // Loads the library to use the phrases system + $this->_ci->load->library('PhrasesLib', array(self::FILTER_PHRASES_CATEGORY)); + + $tmpFilterNamePhrase = $this->_ci->phraseslib->t(self::FILTER_PHRASES_CATEGORY, $filterJson->namePhrase); + if (!isEmptyString($tmpFilterNamePhrase)) // if is not null or an empty string + { + $filterName = $tmpFilterNamePhrase; + } + } + + return $filterName; + } +} + diff --git a/application/libraries/FilterWidgetLib.php b/application/libraries/FilterWidgetLib.php index d9a3428a0..19cdec848 100644 --- a/application/libraries/FilterWidgetLib.php +++ b/application/libraries/FilterWidgetLib.php @@ -340,20 +340,25 @@ class FilterWidgetLib { $filterDefinition = $filters[$filtersCounter]; // definition of one filter - if ($filtersCounter > 0) - $where .= ' AND '; // if it's NOT the last one - - if (!isEmptyString($filterDefinition->name)) // if the name of the applied filter is valid + // If the name of the applied filter is valid + if (!isEmptyString($filterDefinition->name)) { - // ...build the condition - $where .= '"'.$filterDefinition->name.'"'.$this->_getDatasetQueryCondition($filterDefinition); + // Build the query conditions + $datasetQueryCondition = $this->_getDatasetQueryCondition($filterDefinition); + + // If the built condition is valid then add it to the query clause + if (!isEmptyString($datasetQueryCondition)) + { + // // If this is NOT the first one + if ($filtersCounter > 0) $where .= ' AND '; + + $where .= '"'.$filterDefinition->name.'"'.$datasetQueryCondition; + } } } - if ($where != '') // if the SQL where clause was built - { - $datasetQuery .= ' WHERE '.$where; - } + // If the SQL where clause was built + if ($where != '') $datasetQuery .= ' WHERE '.$where; } return $datasetQuery; diff --git a/application/libraries/NavigationLib.php b/application/libraries/NavigationLib.php index e2492cef4..95ce67610 100644 --- a/application/libraries/NavigationLib.php +++ b/application/libraries/NavigationLib.php @@ -1,4 +1,20 @@ . + */ if (! defined('BASEPATH')) exit('No direct script access allowed'); @@ -37,7 +53,7 @@ class NavigationLib // Loads library ExtensionsLib $this->_ci->load->library('ExtensionsLib'); - $this->_navigationPage = $this->_getNavigationtPage($params); // sets the id for the related navigation widget + $this->_navigationPage = $this->_getNavigationPage($params); // sets the id for the related navigation widget } //------------------------------------------------------------------------------------------------------------------ @@ -67,9 +83,19 @@ class NavigationLib * Returns the structure for one level of the menu */ public function oneLevel( - $description, $link = '#', $children = null, $icon = '', $expand = false, - $subscriptDescription = null, $subscriptLinkClass = null, $subscriptLinkValue = null, $target = '', - $sort = null, $requiredPermissions = null, $subscriptLinkHref = '#') + $description, + $link = '#', + $children = null, + $icon = '', + $expand = false, + $subscriptDescription = null, + $subscriptLinkClass = null, + $subscriptLinkValue = null, + $target = '', + $sort = null, + $requiredPermissions = null, + $subscriptLinkHref = '#' + ) { return array( 'description' => $description, @@ -223,7 +249,8 @@ class NavigationLib $filename = APPPATH.'config/'.ExtensionsLib::EXTENSIONS_DIR_NAME.'/'.$ext->name.'/'.self::CONFIG_NAVIGATION_FILENAME; if (file_exists($filename)) { - unset($config); + $config = array(); // default value + include($filename); if (isset($config[$configName]) && is_array($config[$configName])) @@ -278,7 +305,7 @@ class NavigationLib } else { - foreach ($navigationArray as $key=>$row) + foreach ($navigationArray as $key => $row) { // Search for * Entries if (mb_strpos($key, '*') === 0 || mb_strpos($key, '*') === mb_strlen($key) - 1) @@ -300,7 +327,7 @@ class NavigationLib * Return an unique string that identify this navigation widget * NOTE: The default value is the URI where the NavigationWidget is called */ - private function _getNavigationtPage($params) + private function _getNavigationPage($params) { if ($params != null && is_array($params) diff --git a/application/libraries/SearchBarLib.php b/application/libraries/SearchBarLib.php new file mode 100644 index 000000000..3a9d06d13 --- /dev/null +++ b/application/libraries/SearchBarLib.php @@ -0,0 +1,298 @@ +. + */ + +if (! defined('BASEPATH')) exit('No direct script access allowed'); + +use \stdClass as stdClass; + +/** + * + */ +class SearchBarLib +{ + // Error constats + const ERROR_WRONG_JSON = 'ERR001'; + const ERROR_WRONG_SEARCHSTR = 'ERR002'; + const ERROR_NO_TYPES = 'ERR003'; + const ERROR_WRONG_TYPES = 'ERR004'; + + // List of allowed types of search + const ALLOWED_TYPES = ['mitarbeiter', 'organisationunit', 'raum', 'person', 'student', 'prestudent', 'document', 'cms']; + + const PHOTO_IMG_URL = '/cis/public/bild.php?src=person&person_id='; + + private $_ci; // Code igniter instance + + /** + * Gets the CI instance and loads model + */ + public function __construct() + { + $this->_ci =& get_instance(); // get code igniter instance + + // It is loaded only to have the DB_Model available + $this->_ci->load->model('person/Benutzer_model', 'BenutzerModel'); + } + + //------------------------------------------------------------------------------------------------------------------ + // Public methods + + /** + * It performes the search of the given search string using the specified search types + */ + public function search($searchstr, $types) + { + // Checks if the given parameters are fine + $search = $this->_checkParameters($searchstr, $types); + + // If the check was successful then perform the search + if (isSuccess($search)) $search = $this->_search($searchstr, $types); + + return $search; // return the result + } + + //------------------------------------------------------------------------------------------------------------------ + // Private methods + + /** + * Checks: + * - The given searchstr is a not empty string + * - The given types is a not empty array and contains allowed search types + */ + private function _checkParameters($searchstr, $types) + { + // If searchstr is empty + if (isEmptyString($searchstr)) return error(self::ERROR_WRONG_SEARCHSTR); + + // If types is not an array or it is empty + if (isEmptyArray($types)) return error(self::ERROR_NO_TYPES); + + // If all the elements in types are allowed search types + if (!isEmptyArray(array_diff($types, self::ALLOWED_TYPES))) return error(self::ERROR_WRONG_TYPES); + + return success(); // The check is fine! + } + + /** + * Loops on types and perform the search of that type using searchstr + * Then it collects all the returned data into an array as property of an object + */ + private function _search($searchstr, $types) + { + // Object to be returned + $result = new stdClass(); + $result->data = array(); + + // For each search type + foreach ($types as $type) + { + // Perform the search and then add the result to data + $result->data = array_merge($result->data, $this->{'_'.$type}($searchstr, $type)); + } + + return $result; + } + + /** + * Search for employees + */ + private function _mitarbeiter($searchstr, $type) + { + $dbModel = new DB_Model(); + + $employees = $dbModel->execReadOnlyQuery(' + SELECT + \''.$type.'\' AS type, + b.uid AS uid, + p.person_id AS person_id, + p.vorname || \' \' || p.nachname AS name, + ARRAY_AGG(DISTINCT(org.bezeichnung)) AS organisationunit_name, + COALESCE(b.alias, b.uid) || \''.'@'.DOMAIN.'\' AS email, + TRIM(COALESCE(k.kontakt, \'\') || \' \' || COALESCE(m.telefonklappe, \'\')) AS phone, + \''.base_url(self::PHOTO_IMG_URL).'\' || p.person_id AS photo_url, + ARRAY_AGG(DISTINCT(stdkst.bezeichnung)) AS standardkostenstelle + FROM public.tbl_mitarbeiter m + JOIN public.tbl_benutzer b ON(b.uid = m.mitarbeiter_uid) + JOIN ( + SELECT o.bezeichnung, bf.uid + FROM public.tbl_benutzerfunktion bf + JOIN public.tbl_organisationseinheit o USING(oe_kurzbz) + WHERE bf.funktion_kurzbz = \'kstzuordnung\' + AND (bf.datum_von IS NULL OR bf.datum_von <= NOW()) + AND (bf.datum_bis IS NULL OR bf.datum_bis >= NOW()) + GROUP BY o.bezeichnung, bf.uid + ) stdkst ON stdkst.uid = b.uid + JOIN public.tbl_person p USING(person_id) + JOIN ( + SELECT o.bezeichnung, bf.uid + FROM public.tbl_benutzerfunktion bf + JOIN public.tbl_organisationseinheit o USING(oe_kurzbz) + WHERE bf.funktion_kurzbz = \'oezuordnung\' + AND (bf.datum_von IS NULL OR bf.datum_von <= NOW()) + AND (bf.datum_bis IS NULL OR bf.datum_bis >= NOW()) + GROUP BY o.bezeichnung, bf.uid + ) org ON org.uid = b.uid + LEFT JOIN ( + SELECT kontakt, standort_id + FROM public.tbl_kontakt + WHERE kontakttyp = \'telefon\' + ) k ON(k.standort_id = m.standort_id) + WHERE b.uid ILIKE \'%'.$dbModel->escapeLike($searchstr).'%\' + OR p.vorname ILIKE \'%'.$dbModel->escapeLike($searchstr).'%\' + OR p.nachname ILIKE \'%'.$dbModel->escapeLike($searchstr).'%\' + OR org.bezeichnung ILIKE \'%'.$dbModel->escapeLike($searchstr).'%\' + OR stdkst.bezeichnung ILIKE \'%'.$dbModel->escapeLike($searchstr).'%\' + GROUP BY type, b.uid, p.person_id, name, email, m.telefonklappe, phone + '); + + // If something has been found then return it + if (hasData($employees)) return getData($employees); + + // Otherwise return an empty array + return array(); + } + + /** + * Seach for organisation units + */ + private function _organisationunit($searchstr, $type) + { + $dbModel = new DB_Model(); + + $ous = $dbModel->execReadOnlyQuery(' + SELECT + \''.$type.'\' AS type, + o.oe_kurzbz AS oe_kurzbz, + o.bezeichnung AS name, + oParent.oe_kurzbz AS parentoe_kurzbz, + oParent.bezeichnung AS parentoe_name, + ARRAY_AGG(DISTINCT(bfLeader.uid)) AS leader_uid, + ARRAY_AGG(DISTINCT(bfLeader.vorname || \' \' || bfLeader.nachname)) AS leader_name, + COUNT(bfCount.benutzerfunktion_id) AS number_of_people, + (CASE WHEN o.mailverteiler = TRUE THEN o.oe_kurzbz || \''.'@'.DOMAIN.'\' END) AS mailgroup + FROM public.tbl_organisationseinheit o + LEFT JOIN public.tbl_organisationseinheit oParent ON(oParent.oe_kurzbz = o.oe_parent_kurzbz) + LEFT JOIN ( + SELECT benutzerfunktion_id, oe_kurzbz + FROM public.tbl_benutzerfunktion + WHERE funktion_kurzbz = \'oezuordnung\' + AND (datum_von IS NULL OR datum_von <= NOW()) + AND (datum_bis IS NULL OR datum_bis >= NOW()) + ) bfCount ON(bfCount.oe_kurzbz = o.oe_kurzbz) + LEFT JOIN ( + SELECT bf.oe_kurzbz, bf.uid, p.vorname, p.nachname + FROM public.tbl_benutzerfunktion bf + JOIN public.tbl_benutzer b USING(uid) + JOIN public.tbl_person p USING(person_id) + WHERE funktion_kurzbz = \'Leitung\' + AND (datum_von IS NULL OR datum_von <= NOW()) + AND (datum_bis IS NULL OR datum_bis >= NOW()) + AND b.aktiv = TRUE + ) bfLeader ON(bfLeader.oe_kurzbz = o.oe_kurzbz) + WHERE o.oe_kurzbz ILIKE \'%'.$dbModel->escapeLike($searchstr).'%\' + OR o.bezeichnung ILIKE \'%'.$dbModel->escapeLike($searchstr).'%\' + GROUP BY type, o.oe_kurzbz, o.bezeichnung, oParent.oe_kurzbz, oParent.bezeichnung + '); + + // If something has been found + if (hasData($ous)) + { + // Loop through the returned dataset + foreach (getData($ous) as $ou) + { + // Create the new property leaders as an empty array + $ou->leaders = array(); + + // Loop through the found leaders for this organisation unit + for ($i = 0; $i < count($ou->leader_uid); $i++) + { + // If a leader exists for this organisationunit and has a name :D + if (!isEmptyString($ou->leader_uid[$i]) && !isEmptyString($ou->leader_name[$i])) + { + // Empty object that will contains the leader uid and name + $leader = new stdClass(); + // Set the properties name and uid + $leader->uid = $ou->leader_uid[$i]; + $leader->name = $ou->leader_name[$i]; + // Add the leader object to the leaders array + $ou->leaders[] = $leader; + } + } + + // Remove the not needed properties leader_uid and leader_name + unset($ou->leader_uid); + unset($ou->leader_name); + } + + // Returns the changed dataset + return getData($ous); + } + + // Otherwise return an empty array + return array(); + } + + /** + * Search for persons + */ + private function _person($searchstr, $type) + { + return array(); + } + + /** + * Search for students + */ + private function _student($searchstr, $type) + { + return array(); + } + + /** + * Search for prestudents + */ + private function _prestudent($searchstr, $type) + { + return array(); + } + + /** + * Search for documents + */ + private function _document($searchstr, $type) + { + return array(); + } + + /** + * Search for CMSs + */ + private function _cms($searchstr, $type) + { + return array(); + } + + /** + * Search for rooms + */ + private function _raum($searchstr, $type) + { + return array(); + } +} + diff --git a/application/models/CL/Messages_model.php b/application/models/CL/Messages_model.php index 4975af382..b987102dd 100644 --- a/application/models/CL/Messages_model.php +++ b/application/models/CL/Messages_model.php @@ -528,6 +528,13 @@ class Messages_model extends CI_Model */ public function sendReply($receiver_id, $subject, $body, $relationmessage_id, $token) { + // Checks that the receiver_id, relationmessage_id and token belongs to the same message + $crossedDataResult = $this->MessageTokenModel->crossClientData($token, $relationmessage_id, $receiver_id); + if (isError($crossedDataResult)) show_error(getError($crossedDataResult)); + if (!hasData($crossedDataResult)) show_error( + 'The parameters token, relationmessage_id and receiver_id do not belong to the same message' + ); + // Retrieves message sender information $senderResult = $this->MessageTokenModel->getSenderData($receiver_id); if (isError($senderResult)) show_error(getError($senderResult)); diff --git a/application/models/codex/Gsprogramm_model.php b/application/models/codex/Gsprogramm_model.php new file mode 100644 index 000000000..4fd0694dd --- /dev/null +++ b/application/models/codex/Gsprogramm_model.php @@ -0,0 +1,15 @@ +dbTable = 'bis.tbl_gsprogramm'; + $this->pk = 'gsprogramm_id'; + } + +} diff --git a/application/models/codex/Mobilitaet_model.php b/application/models/codex/Mobilitaet_model.php new file mode 100644 index 000000000..13f966d50 --- /dev/null +++ b/application/models/codex/Mobilitaet_model.php @@ -0,0 +1,14 @@ +dbTable = 'bis.tbl_mobilitaet'; + $this->pk = 'mobilitaet_id'; + } +} diff --git a/application/models/codex/Nation_model.php b/application/models/codex/Nation_model.php index 239639795..ee38c9051 100644 --- a/application/models/codex/Nation_model.php +++ b/application/models/codex/Nation_model.php @@ -3,7 +3,7 @@ class Nation_model extends DB_Model { /** - * + * */ public function __construct() { @@ -11,4 +11,4 @@ class Nation_model extends DB_Model $this->dbTable = 'bis.tbl_nation'; $this->pk = 'nation_code'; } -} \ No newline at end of file +} diff --git a/application/models/crm/Dokumentprestudent_model.php b/application/models/crm/Dokumentprestudent_model.php index ab4764479..0a6669359 100644 --- a/application/models/crm/Dokumentprestudent_model.php +++ b/application/models/crm/Dokumentprestudent_model.php @@ -10,6 +10,7 @@ class Dokumentprestudent_model extends DB_Model parent::__construct(); $this->dbTable = 'public.tbl_dokumentprestudent'; $this->pk = array('prestudent_id', 'dokument_kurzbz'); + $this->hasSequence = false; } /** diff --git a/application/models/crm/Prestudent_model.php b/application/models/crm/Prestudent_model.php index b7804952e..f37b715f4 100644 --- a/application/models/crm/Prestudent_model.php +++ b/application/models/crm/Prestudent_model.php @@ -556,7 +556,7 @@ class Prestudent_model extends DB_Model */ public function getOrganisationunitsByPersonId($person_id) { - $query = 'SELECT o.oe_kurzbz, + $query = 'SELECT DISTINCT o.oe_kurzbz, o.bezeichnung, (CASE WHEN sg.typ = \'b\' THEN ps.prestudent_id diff --git a/application/models/organisation/Studiengang_model.php b/application/models/organisation/Studiengang_model.php index 0d0c248a6..e848cb4c2 100644 --- a/application/models/organisation/Studiengang_model.php +++ b/application/models/organisation/Studiengang_model.php @@ -507,4 +507,14 @@ class Studiengang_model extends DB_Model return $this->execQuery($query, array($typ, $semester)); } + + public function getStudiengangTyp($studiengang_kz, $typ) + { + $query = "SELECT DISTINCT(sgt.*) + FROM tbl_studiengangstyp sgt JOIN tbl_studiengang sg on sgt.typ = sg.typ + WHERE studiengang_kz IN ? and sgt.typ IN ?"; + + return $this->execQuery($query, array($studiengang_kz, $typ)); + + } } diff --git a/application/models/person/Adressentyp_model.php b/application/models/person/Adressentyp_model.php new file mode 100644 index 000000000..94a8c6048 --- /dev/null +++ b/application/models/person/Adressentyp_model.php @@ -0,0 +1,14 @@ +dbTable = 'public.tbl_adressentyp'; + $this->pk = 'adressentyp_kurzbz'; + } +} diff --git a/application/models/system/MessageToken_model.php b/application/models/system/MessageToken_model.php index cd3d8f7d9..af7794fdb 100644 --- a/application/models/system/MessageToken_model.php +++ b/application/models/system/MessageToken_model.php @@ -176,4 +176,20 @@ class MessageToken_model extends DB_Model return $this->execQuery($sql, array($oe_kurzbz)); } + + /** + * + */ + public function crossClientData($token, $relationmessage_id, $receiver_id) + { + $sql = 'SELECT mm.message_id + FROM public.tbl_msg_message mm + JOIN public.tbl_msg_recipient mr USING(message_id) + WHERE mr.token = ? + AND mm.message_id = ? + AND mm.person_id = ?'; + + return $this->execQuery($sql, array($token, $relationmessage_id, $receiver_id)); + } } + diff --git a/application/views/codex/oehbeitrag.php b/application/views/codex/oehbeitrag.php index 8a697129e..feebeddef 100644 --- a/application/views/codex/oehbeitrag.php +++ b/application/views/codex/oehbeitrag.php @@ -3,12 +3,12 @@ $this->load->view( 'templates/FHC-Header', array( 'title' => 'ÖH-Beitragsverwaltung', - 'jquery' => true, - 'jqueryui' => true, - 'bootstrap' => true, - 'fontawesome' => true, - 'sbadmintemplate' => true, - 'tablesorter' => true, + 'jquery3' => true, + 'jqueryui1' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, + 'sbadmintemplate3' => true, + 'tablesorter2' => true, 'dialoglib' => true, 'ajaxlib' => true, 'navigationwidget' => true, diff --git a/application/views/home.php b/application/views/home.php index 79669dd88..eb7ef0406 100644 --- a/application/views/home.php +++ b/application/views/home.php @@ -1,42 +1,36 @@ load->view('templates/FHC-Header', - array( + $includesArray = array( 'title' => 'FH-Complete', - 'jquery' => true, - 'jqueryui' => true, - 'bootstrap' => true, - 'fontawesome' => true, - 'sbadmintemplate' => true, + 'jquery3' => true, + 'jqueryui1' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, + 'sbadmintemplate3' => true, 'ajaxlib' => true, + 'bootstrapper' => true, // to be used only if you know what you are doing! 'addons' => true, 'navigationwidget' => true - ) -); + ); + + $this->load->view('templates/FHC-Header', $includesArray); ?> - -
- - widgetlib->widget('NavigationWidget'); ?> - -
-
-
-
- +
+ + widgetlib->widget('NavigationWidget'); ?> + +
+
+
+
+ +
+ +
+
- -
-
-
- - -load->view('templates/FHC-Footer'); ?> + +load->view('templates/FHC-Footer', $includesArray); ?> + diff --git a/application/views/lehre/anrechnung/approveAnrechnungDetail.php b/application/views/lehre/anrechnung/approveAnrechnungDetail.php index 248dd33ca..bc3b6215a 100644 --- a/application/views/lehre/anrechnung/approveAnrechnungDetail.php +++ b/application/views/lehre/anrechnung/approveAnrechnungDetail.php @@ -3,10 +3,10 @@ $this->load->view( 'templates/FHC-Header', array( 'title' => $this->p->t('anrechnung', 'anrechnungenGenehmigen'), - 'jquery' => true, - 'jqueryui' => true, - 'bootstrap' => true, - 'fontawesome' => true, + 'jquery3' => true, + 'jqueryui1' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, 'ajaxlib' => true, 'dialoglib' => true, 'phrases' => array( diff --git a/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php b/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php index e2452fb13..f5d1e8214 100644 --- a/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php +++ b/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php @@ -3,11 +3,11 @@ $this->load->view( 'templates/FHC-Header', array( 'title' => $this->p->t('anrechnung', 'anrechnungenGenehmigen'), - 'jquery' => true, - 'jqueryui' => true, - 'bootstrap' => true, - 'fontawesome' => true, - 'tabulator' => true, + 'jquery3' => true, + 'jqueryui1' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, + 'tabulator4' => true, 'ajaxlib' => true, 'dialoglib' => true, 'tablewidget' => true, diff --git a/application/views/lehre/anrechnung/createAnrechnung.php b/application/views/lehre/anrechnung/createAnrechnung.php index 2d2193b80..e3cc9cad1 100644 --- a/application/views/lehre/anrechnung/createAnrechnung.php +++ b/application/views/lehre/anrechnung/createAnrechnung.php @@ -3,13 +3,13 @@ $this->load->view( 'templates/FHC-Header', array( 'title' => $this->p->t('anrechnung', 'neueAnrechnung'), - 'jquery' => true, - 'jqueryui' => true, - 'bootstrap' => true, - 'fontawesome' => true, + 'jquery3' => true, + 'jqueryui1' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, 'ajaxlib' => true, 'dialoglib' => true, - 'tabulator' => true, + 'tabulator4' => true, 'tablewidget' => true, 'phrases' => array( 'global' => array( @@ -101,7 +101,7 @@ $this->load->view( p->t('lehre', 'lehrveranstaltung'); ?> * @@ -112,7 +112,7 @@ $this->load->view( p->t('global', 'begruendung'); ?> * - + diff --git a/application/views/person/bpk/bpkwartung.php b/application/views/person/bpk/bpkwartung.php index 53450a9d8..f6283ee3b 100644 --- a/application/views/person/bpk/bpkwartung.php +++ b/application/views/person/bpk/bpkwartung.php @@ -3,12 +3,12 @@ 'templates/FHC-Header', array( 'title' => 'bPK Wartung', - 'jquery' => true, - 'jqueryui' => true, - 'bootstrap' => true, - 'fontawesome' => true, - 'sbadmintemplate' => true, - 'tablesorter' => true, + 'jquery3' => true, + 'jqueryui1' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, + 'sbadmintemplate3' => true, + 'tablesorter2' => true, 'ajaxlib' => true, 'filterwidget' => true, 'navigationwidget' => true, diff --git a/application/views/person/gradelist/gradelist.php b/application/views/person/gradelist/gradelist.php index 9ae485c02..06d499ded 100644 --- a/application/views/person/gradelist/gradelist.php +++ b/application/views/person/gradelist/gradelist.php @@ -3,10 +3,10 @@ 'templates/FHC-Header', array( 'title' => 'Gradelist', - 'jquery' => true, - 'jqueryui' => true, - 'bootstrap' => true, - 'fontawesome' => true, + 'jquery3' => true, + 'jqueryui1' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, 'ajaxlib' => true, 'customCSSs' => array( 'public/css/tools/gradelist.css', @@ -31,14 +31,26 @@
- p->t('lehre', 'notendurchschnitt'); ?> - : + + p->t('lehre', 'notendurchschnitt'); ?> + : +
- p->t('lehre', 'gewichteternotendurchschnitt'); ?> - : + + p->t('lehre', 'gewichteternotendurchschnitt'); ?> + : +
- p->t('lehre', 'ects'); ?> - : + + p->t('lehre', 'ects'); ?> + : +

load->view('templates/FHC-Footer'); ?> + diff --git a/application/views/person/gruppenmanagement/benutzergruppe.php b/application/views/person/gruppenmanagement/benutzergruppe.php new file mode 100644 index 000000000..c076f6dd0 --- /dev/null +++ b/application/views/person/gruppenmanagement/benutzergruppe.php @@ -0,0 +1,75 @@ +load->view( + 'templates/FHC-Header', + array( + 'title' => 'Benutzer in Gruppe', + 'jquery3' => true, + 'jqueryui1' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, + 'sbadmintemplate3' => true, + 'tablesorter2' => true, + 'ajaxlib' => true, + 'dialoglib' => true, + 'navigationwidget' => true, + 'phrases' => array( + 'gruppenmanagement', + 'ui' + ), + 'customCSSs' => 'public/css/sbadmin2/tablesort_bootstrap.css', + 'customJSs' => array('public/js/bootstrapper.js', 'public/js/tablesort/tablesort.js', 'public/js/person/benutzergruppe.js') + ) + ); +?> + + +
+ + widgetlib->widget('NavigationWidget'); ?> + +
+
+
+
+ +
+
+
+
+
+
+ + + + + + +
+
+
+
+
+
+ + + + + + + + + + +
Uidp->t('person', 'vorname')); ?>p->t('person', 'nachname')); ?>p->t('gruppenmanagement', 'aktiv')); ?>p->t('ui', 'entfernen')); ?>
+
+
+
+
+
+ + +load->view('templates/FHC-Footer'); ?> diff --git a/application/views/person/gruppenmanagement/gruppenmanagement.php b/application/views/person/gruppenmanagement/gruppenmanagement.php new file mode 100644 index 000000000..87c44c1b9 --- /dev/null +++ b/application/views/person/gruppenmanagement/gruppenmanagement.php @@ -0,0 +1,46 @@ +load->view( + 'templates/FHC-Header', + array( + 'title' => 'Gruppenmanagement', + 'jquery3' => true, + 'jqueryui1' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, + 'sbadmintemplate3' => true, + 'tablesorter2' => true, + 'ajaxlib' => true, + 'filterwidget' => true, + 'navigationwidget' => true, + 'phrases' => array( + 'ui' + ), + 'customCSSs' => 'public/css/sbadmin2/tablesort_bootstrap.css', + 'customJSs' => array('public/js/bootstrapper.js') + ) + ); +?> + + +
+ + widgetlib->widget('NavigationWidget'); ?> + +
+
+
+
+ +
+
+
+ load->view('person/gruppenmanagement/gruppenmanagementData.php'); ?> +
+
+
+
+ + +load->view('templates/FHC-Footer'); ?> diff --git a/application/views/person/gruppenmanagement/gruppenmanagementData.php b/application/views/person/gruppenmanagement/gruppenmanagementData.php new file mode 100644 index 000000000..ddbaea350 --- /dev/null +++ b/application/views/person/gruppenmanagement/gruppenmanagementData.php @@ -0,0 +1,66 @@ + ' + SELECT gruppe_kurzbz, grp.bezeichnung AS gruppe_bezeichnung, grp.beschreibung AS gruppe_beschreibung, + studiengang_kz, UPPER(stg.typ||stg.kurzbz) AS studiengang_kurzbz, semester, sichtbar, lehre, grp.aktiv, mailgrp, generiert + FROM public.tbl_gruppe grp + JOIN public.tbl_studiengang stg USING (studiengang_kz) + JOIN public.tbl_gruppe_manager grpmgr USING (gruppe_kurzbz) + WHERE grp.aktiv = TRUE + AND grpmgr.uid = \''.$uid.'\'', + 'requiredPermissions' => 'lehre/gruppenmanager', + 'datasetRepresentation' => 'tablesorter', + 'additionalColumns' => array('Teilnehmer'), + 'columnsAliases' => array( + ucfirst($this->p->t('gruppenmanagement', 'kurzbezeichnung')), + ucfirst($this->p->t('gruppenmanagement', 'bezeichnung')), + ucfirst($this->p->t('gruppenmanagement', 'beschreibung')), + ucfirst($this->p->t('lehre', 'studiengangskennzahlLehre')), + ucfirst($this->p->t('lehre', 'studiengang')), + ucfirst($this->p->t('lehre', 'semester')), + 'Sichtbar', + 'Lehre', + 'Aktiv', + 'Mailgrp', + 'Generiert' + ), + 'formatRow' => function($datasetRaw) { + + /* NOTE: Dont use $this here for PHP Version compatibility */ + $datasetRaw->{'Teilnehmer'} = sprintf( + ''.$this->p->t('gruppenmanagement', 'zuweisenloeschen').'', + site_url('person/Gruppenmanagement/showBenutzergruppe'), + $datasetRaw->{'gruppe_kurzbz'}, + 'index', + (isset($_GET['fhc_controller_id'])?$_GET['fhc_controller_id']:'') + ); + + if ($datasetRaw->{'gruppe_bezeichnung'} == null) + { + $datasetRaw->{'gruppe_bezeichnung'} = '-'; + } + if ($datasetRaw->{'gruppe_beschreibung'} == null) + { + $datasetRaw->{'gruppe_beschreibung'} = '-'; + } + if ($datasetRaw->{'semester'} == null) + { + $datasetRaw->{'semester'} = '-'; + } + $datasetRaw->{'sichtbar'} = $datasetRaw->{'sichtbar'} == 'true' ? 'ja' : 'nein'; + $datasetRaw->{'lehre'} = $datasetRaw->{'lehre'} == 'true' ? 'ja' : 'nein'; + $datasetRaw->{'aktiv'} = $datasetRaw->{'aktiv'} == 'true' ? 'ja' : 'nein'; + $datasetRaw->{'mailgrp'} = $datasetRaw->{'mailgrp'} == 'true' ? 'ja' : 'nein'; + $datasetRaw->{'generiert'} = $datasetRaw->{'generiert'} == 'true' ? 'ja' : 'nein'; + + return $datasetRaw; + } + ); + + $filterWidgetArray['app'] = 'core'; + $filterWidgetArray['datasetName'] = 'gruppenmanagement'; + $filterWidgetArray['filterKurzbz'] = 'gruppenmanagement'; + $filterWidgetArray['filter_id'] = $this->input->get('filter_id'); + + echo $this->widgetlib->widget('FilterWidget', $filterWidgetArray); + diff --git a/application/views/system/fas_udf.php b/application/views/system/fas_udf.php index e6fa396cf..6d3c710ca 100644 --- a/application/views/system/fas_udf.php +++ b/application/views/system/fas_udf.php @@ -1,110 +1,109 @@ -load->view( - 'templates/FHC-Header', - array( - 'title' => 'InfocenterDetails', - 'jquery' => true, - 'bootstrap' => true, - 'fontawesome' => true, - 'jqueryui' => true, - 'dialoglib' => true, - 'ajaxlib' => true, - 'udfs' => true, - 'widgets' => true, - 'sbadmintemplate' => true, - 'customCSSs' => array( - 'public/css/sbadmin2/admintemplate.css' - ), - 'customJSs' => array( - 'public/js/bootstrapper.js' - ) - ) - ); -?> - - - -
-
-
- Zusatzfelder -
-
-
-
-   -
-
-
- -
- udflib->UDFWidget( - array( - UDFLib::UDF_UNIQUE_ID => 'fasPersonUDFs', - UDFLib::SCHEMA_ARG_NAME => 'public', - UDFLib::TABLE_ARG_NAME => 'tbl_person', - UDFLib::PRIMARY_KEY_NAME => 'person_id', - UDFLib::PRIMARY_KEY_VALUE => $person_id, - UDFLib::UDFS_ARG_NAME => $personUdfs - ) - ); - ?> -
-
-   -
- - -
- udflib->UDFWidget( - array( - UDFLib::UDF_UNIQUE_ID => 'fasPrestudentUDFs', - UDFLib::SCHEMA_ARG_NAME => 'public', - UDFLib::TABLE_ARG_NAME => 'tbl_prestudent', - UDFLib::PRIMARY_KEY_NAME => 'prestudent_id', - UDFLib::PRIMARY_KEY_VALUE => $prestudent_id, - UDFLib::UDFS_ARG_NAME => $prestudentUdfs - ) - ); - ?> -
- -
-
-
-   -
-
-
- -
-   -
-
-   -
- -
-
- - - -load->view("templates/footer"); ?> - + 'InfocenterDetails', + 'jquery3' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, + 'jqueryui1' => true, + 'dialoglib' => true, + 'ajaxlib' => true, + 'udfs' => true, + 'widgets' => true, + 'sbadmintemplate3' => true, + 'customCSSs' => array( + 'public/css/sbadmin2/admintemplate.css' + ), + 'customJSs' => array( + 'public/js/bootstrapper.js' + ) +); + +$this->load->view( + 'templates/FHC-Header', + $sitesettings +); +?> + + + +
+
+
+ Zusatzfelder +
+
+
+
+   +
+
+
+ +
+ udflib->UDFWidget( + array( + UDFLib::UDF_UNIQUE_ID => 'fasPersonUDFs', + UDFLib::SCHEMA_ARG_NAME => 'public', + UDFLib::TABLE_ARG_NAME => 'tbl_person', + UDFLib::PRIMARY_KEY_NAME => 'person_id', + UDFLib::PRIMARY_KEY_VALUE => $person_id, + UDFLib::UDFS_ARG_NAME => $personUdfs + ) + ); + ?> +
+
+   +
+ + +
+ udflib->UDFWidget( + array( + UDFLib::UDF_UNIQUE_ID => 'fasPrestudentUDFs', + UDFLib::SCHEMA_ARG_NAME => 'public', + UDFLib::TABLE_ARG_NAME => 'tbl_prestudent', + UDFLib::PRIMARY_KEY_NAME => 'prestudent_id', + UDFLib::PRIMARY_KEY_VALUE => $prestudent_id, + UDFLib::UDFS_ARG_NAME => $prestudentUdfs + ) + ); + ?> +
+ +
+
+
+   +
+
+
+ +
+   +
+
+   +
+ +
+
+ +load->view("templates/FHC-Footer", $sitesettings); ?> diff --git a/application/views/system/infocenter/dokpruefung.php b/application/views/system/infocenter/dokpruefung.php index b184b9a0b..633f3ec02 100644 --- a/application/views/system/infocenter/dokpruefung.php +++ b/application/views/system/infocenter/dokpruefung.php @@ -1,10 +1,11 @@ -
- +
+
+ akte_id ?>">titel) ? $dokument->bezeichnung : $dokument->titel ?> + load->view( - 'templates/FHC-Header', - array( - 'title' => 'Info Center', - 'jquery' => true, - 'jqueryui' => true, - 'jquerycheckboxes' => true, - 'bootstrap' => true, - 'fontawesome' => true, - 'sbadmintemplate' => true, - 'tablesorter' => true, - 'ajaxlib' => true, - 'filterwidget' => true, - 'navigationwidget' => true, - 'dialoglib' => true, - 'phrases' => array( - 'person' => array('vorname', 'nachname'), - 'global' => array('mailAnXversandt'), - 'ui' => array('bitteEintragWaehlen') - ), - 'customCSSs' => array('public/css/sbadmin2/tablesort_bootstrap.css', 'public/css/infocenter/infocenterPersonDataset.css'), - 'customJSs' => array('public/js/bootstrapper.js', 'public/js/infocenter/infocenterPersonDataset.js') - ) + $includesArray = array( + 'title' => 'Info Center', + 'jquery3' => true, + 'jqueryui1' => true, + 'jquerycheckboxes1' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, + 'sbadmintemplate3' => true, + 'tablesorter2' => true, + 'ajaxlib' => true, + 'bootstrapper' => true, + 'filterwidget' => true, + 'navigationwidget' => true, + 'dialoglib' => true, + 'phrases' => array( + 'person' => array('vorname', 'nachname'), + 'global' => array('mailAnXversandt'), + 'ui' => array('bitteEintragWaehlen') + ), + 'customCSSs' => array('public/css/sbadmin2/tablesort_bootstrap.css', 'public/css/infocenter/infocenterPersonDataset.css'), + 'customJSs' => array('public/js/bootstrapper.js', 'public/js/infocenter/infocenterPersonDataset.js') ); + + $this->load->view('templates/FHC-Header', $includesArray); ?> -
widgetlib->widget('NavigationWidget'); ?> @@ -46,6 +45,6 @@
- -load->view('templates/FHC-Footer'); ?> +load->view('templates/FHC-Footer', $includesArray); ?> + diff --git a/application/views/system/infocenter/infocenterAbgewiesen.php b/application/views/system/infocenter/infocenterAbgewiesen.php index 8e946e573..55987a3bd 100644 --- a/application/views/system/infocenter/infocenterAbgewiesen.php +++ b/application/views/system/infocenter/infocenterAbgewiesen.php @@ -3,13 +3,13 @@ 'templates/FHC-Header', array( 'title' => 'Info Center', - 'jquery' => true, - 'jqueryui' => true, - 'jquerycheckboxes' => true, - 'bootstrap' => true, - 'fontawesome' => true, - 'sbadmintemplate' => true, - 'tablesorter' => true, + 'jquery3' => true, + 'jqueryui1' => true, + 'jquerycheckboxes1' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, + 'sbadmintemplate3' => true, + 'tablesorter2' => true, 'ajaxlib' => true, 'filterwidget' => true, 'navigationwidget' => true, diff --git a/application/views/system/infocenter/infocenterData.php b/application/views/system/infocenter/infocenterData.php index acf8944d6..de2bd1bca 100644 --- a/application/views/system/infocenter/infocenterData.php +++ b/application/views/system/infocenter/infocenterData.php @@ -15,6 +15,7 @@ $AKTE_TYP = '\'identity\', \'zgv_bakk\''; $STUDIENSEMESTER = '\''.$this->variablelib->getVar('infocenter_studiensemester').'\''; $ORG_NAME = '\'InfoCenter\''; + $ONLINE = '\'online\''; $query = ' SELECT @@ -55,10 +56,13 @@ a.dokument_kurzbz in ('.$AKTE_TYP.') ) AS "AnzahlAkte", ( - SELECT CASE WHEN sp.nachname IS NULL THEN l.insertvon ELSE sp.nachname END + SELECT CASE WHEN student.student_uid IS NULL THEN + (CASE WHEN sp.nachname IS NULL THEN l.insertvon ELSE sp.nachname END) + ELSE '. $ONLINE .' END FROM system.tbl_log l LEFT JOIN public.tbl_benutzer on l.insertvon = tbl_benutzer.uid LEFT JOIN public.tbl_person sp on tbl_benutzer.person_id = sp.person_id + LEFT JOIN public.tbl_student student ON tbl_benutzer.uid = student.student_uid WHERE l.taetigkeit_kurzbz IN ('.$TAETIGKEIT_KURZBZ.') AND l.logdata->>\'name\' NOT IN ('.$LOGDATA_NAME.') AND l.person_id = p.person_id diff --git a/application/views/system/infocenter/infocenterDetails.php b/application/views/system/infocenter/infocenterDetails.php index 76a371c11..158feeb2c 100644 --- a/application/views/system/infocenter/infocenterDetails.php +++ b/application/views/system/infocenter/infocenterDetails.php @@ -1,232 +1,230 @@ load->view( - 'templates/FHC-Header', - array( - 'title' => 'InfocenterDetails', - 'jquery' => true, - 'bootstrap' => true, - 'fontawesome' => true, - 'jqueryui' => true, - 'dialoglib' => true, - 'ajaxlib' => true, - 'tablesorter' => true, - 'tinymce' => true, - 'sbadmintemplate' => true, - 'addons' => true, - 'navigationwidget' => true, - 'udfs' => true, - 'widgets' => true, - 'customCSSs' => array( - 'public/css/sbadmin2/admintemplate.css', - 'public/css/sbadmin2/tablesort_bootstrap.css', - 'public/css/infocenter/infocenterDetails.css' + $includesArray = array( + 'title' => 'InfocenterDetails', + 'jquery3' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, + 'jqueryui1' => true, + 'dialoglib' => true, + 'ajaxlib' => true, + 'tablesorter2' => true, + 'tinymce4' => true, + 'sbadmintemplate3' => true, + 'addons' => true, + 'navigationwidget' => true, + 'udfs' => true, + 'widgets' => true, + 'customCSSs' => array( + 'public/css/sbadmin2/admintemplate.css', + 'public/css/sbadmin2/tablesort_bootstrap.css', + 'public/css/infocenter/infocenterDetails.css' + ), + 'customJSs' => array( + 'public/js/bootstrapper.js', + 'public/js/tablesort/tablesort.js', + 'public/js/infocenter/messageList.js', + 'public/js/infocenter/infocenterDetails.js', + 'public/js/infocenter/zgvUeberpruefung.js', + 'public/js/infocenter/docUeberpruefung.js' + ), + 'phrases' => array( + 'infocenter' => array( + 'notizHinzufuegen', + 'notizAendern', + 'bewerberParken', + 'bewerberAusparken', + 'nichtsZumAusparken', + 'fehlerBeimAusparken', + 'fehlerBeimParken', + 'bewerberGeparktBis', + 'bewerberOnHold', + 'bewerberOnHoldEntfernen', + 'bewerberOnHoldBis', + 'nichtsZumEntfernen', + 'fehlerBeimEntfernen', + 'rueckstelldatumUeberschritten', + 'parkenZurueckstellenInfo', + 'zgvInPruefung', + 'zgvErfuellt', + 'zgvNichtErfuellt', + 'zgvErfuelltPruefung', + 'datumUngueltig', + 'nachreichDatumNichtVergangenheit' ), - 'customJSs' => array( - 'public/js/bootstrapper.js', - 'public/js/tablesort/tablesort.js', - 'public/js/infocenter/messageList.js', - 'public/js/infocenter/infocenterDetails.js', - 'public/js/infocenter/zgvUeberpruefung.js', - 'public/js/infocenter/docUeberpruefung.js' + 'ui' => array( + 'gespeichert', + 'fehlerBeimSpeichern' ), - 'phrases' => array( - 'infocenter' => array( - 'notizHinzufuegen', - 'notizAendern', - 'bewerberParken', - 'bewerberAusparken', - 'nichtsZumAusparken', - 'fehlerBeimAusparken', - 'fehlerBeimParken', - 'bewerberGeparktBis', - 'bewerberOnHold', - 'bewerberOnHoldEntfernen', - 'bewerberOnHoldBis', - 'nichtsZumEntfernen', - 'fehlerBeimEntfernen', - 'rueckstelldatumUeberschritten', - 'parkenZurueckstellenInfo', - 'zgvInPruefung', - 'zgvErfuellt', - 'zgvNichtErfuellt', - 'zgvErfuelltPruefung', - 'datumUngueltig', - 'nachreichDatumNichtVergangenheit' - ), - 'ui' => array( - 'gespeichert', - 'fehlerBeimSpeichern' - ), - 'global' => array( - 'bis', - 'zeilen' - ) + 'global' => array( + 'bis', + 'zeilen' ) ) ); + + $this->load->view('templates/FHC-Header', $includesArray); ?> - -
- - widgetlib->widget('NavigationWidget'); ?> - -
-
- -
-
- -
-
-
- p->t('global', 'wirdBearbeitetVon').': '; - echo $lockedby; - if ($origin_page == 'index'): - $unlockpath = 'unlockPerson/'.$stammdaten->person_id; - $unlockpath .= '?fhc_controller_id='.$fhc_controller_id; - $unlockpath .= '&filter_id='.$prev_filter_id; - ?> -    - -  p->t('ui', 'freigeben')) ?> - +
+ + widgetlib->widget('NavigationWidget'); ?> + +
+
+ +
+
+ +
+
+
+ p->t('global', 'wirdBearbeitetVon').': '; + echo $lockedby; + if ($origin_page == 'index'): + $unlockpath = 'unlockPerson/'.$stammdaten->person_id; + $unlockpath .= '?fhc_controller_id='.$fhc_controller_id; + $unlockpath .= '&filter_id='.$prev_filter_id; + ?> +    + +  p->t('ui', 'freigeben')) ?> + + + +   - -   - +
-
- -
-

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

-
- person_id . '
'; - } - ?> + +
+

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

+
+ person_id . '
'; + } + ?> +
+
- -
- -
-
-
-
-
-
-

p->t('global', 'stammdaten')) ?>

-
-
- load->view('system/infocenter/stammdaten.php'); ?> - load->view('system/infocenter/anmerkungenZurBewerbung.php'); ?> -
-
-
-
-
-
-
-
-
- -
-

- p->t('infocenter', 'dokumentenpruefung')) ?> -

-
-
- load->view('system/infocenter/dokpruefung.php'); ?> -
- load->view('system/infocenter/dokNachzureichend.php'); ?> + +
+
+
+
+
+
+

p->t('global', 'stammdaten')) ?>

-
-
-
-
-
-
-
-
-
-
- -

- p->t('infocenter', 'zgv').' - '.ucfirst($this->p->t('lehre', 'pruefung'))?> -

-
-
- load->view('system/infocenter/zgvpruefungen.php'); ?> -
-
-
-
-
-
-
-
-
-
- -

- p->t('global', 'nachrichten')) ?> -

-
-
-
- load->view('system/infocenter/messageList.php', $messages); - ?> +
+ load->view('system/infocenter/stammdaten.php'); ?> + load->view('system/infocenter/anmerkungenZurBewerbung.php'); ?> +
+
+
+
+
+
+
+
+
+ +
+

+ p->t('infocenter', 'dokumentenpruefung')) ?> +

+
+
+ load->view('system/infocenter/dokpruefung.php'); ?> +
+ load->view('system/infocenter/dokNachzureichend.php'); ?> +
+
+
+
+
+
+
+
+
+
+
+ +

+ p->t('infocenter', 'zgv').' - '.ucfirst($this->p->t('lehre', 'pruefung'))?> +

+
+
+ load->view('system/infocenter/zgvpruefungen.php'); ?> +
+
+
+
+
+
+
+
+
+
+ +

+ p->t('global', 'nachrichten')) ?> +

+
+
+
+ load->view('system/infocenter/messageList.php', $messages); + ?> +
-
- -
-
-
-
-
- -

- p->t('global', 'notizen')).' & '.ucfirst($this->p->t('global', 'aktivitaeten')) ?> -

-
-
-
-
-
- load->view('system/infocenter/addNotiz.php'); ?> +
+
+
+
+
+
+ +

+ p->t('global', 'notizen')).' & '.ucfirst($this->p->t('global', 'aktivitaeten')) ?> +

+
+
+
+
+
+ load->view('system/infocenter/addNotiz.php'); ?> +
+
+ load->view('system/infocenter/notizen.php'); ?> +
-
- load->view('system/infocenter/notizen.php'); ?> -
-
-
-
-
- load->view('system/infocenter/logs.php'); ?> -
-
-
-
-
-
-
- -
-
-
- - +
+
+
+ load->view('system/infocenter/logs.php'); ?> +
+
+
+
+
+
+ + + + + + + +load->view('templates/FHC-Footer', $includesArray); ?> -load->view('templates/FHC-Footer'); ?> diff --git a/application/views/system/infocenter/infocenterFreigegeben.php b/application/views/system/infocenter/infocenterFreigegeben.php index 4855e5cd6..d3e44ea95 100644 --- a/application/views/system/infocenter/infocenterFreigegeben.php +++ b/application/views/system/infocenter/infocenterFreigegeben.php @@ -3,13 +3,13 @@ 'templates/FHC-Header', array( 'title' => 'Info Center', - 'jquery' => true, - 'jqueryui' => true, - 'jquerycheckboxes' => true, - 'bootstrap' => true, - 'fontawesome' => true, - 'sbadmintemplate' => true, - 'tablesorter' => true, + 'jquery3' => true, + 'jqueryui1' => true, + 'jquerycheckboxes1' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, + 'sbadmintemplate3' => true, + 'tablesorter2' => true, 'ajaxlib' => true, 'filterwidget' => true, 'navigationwidget' => true, diff --git a/application/views/system/infocenter/infocenterFreigegebenData.php b/application/views/system/infocenter/infocenterFreigegebenData.php index 75d60a179..13e1d5549 100644 --- a/application/views/system/infocenter/infocenterFreigegebenData.php +++ b/application/views/system/infocenter/infocenterFreigegebenData.php @@ -12,6 +12,7 @@ $STUDIENSEMESTER = '\''.$this->variablelib->getVar('infocenter_studiensemester').'\''; $ORG_NAME = '\'InfoCenter\''; $IDENTITY = '\'identity\''; + $ONLINE = '\'online\''; $query = ' SELECT @@ -42,10 +43,13 @@ $query = ' LIMIT 1 ) AS "LastActionType", ( - SELECT CASE WHEN sp.nachname IS NULL THEN l.insertvon ELSE sp.nachname END + SELECT CASE WHEN student.student_uid IS NULL THEN + (CASE WHEN sp.nachname IS NULL THEN l.insertvon ELSE sp.nachname END) + ELSE '. $ONLINE .' END FROM system.tbl_log l LEFT JOIN public.tbl_benutzer on l.insertvon = tbl_benutzer.uid LEFT JOIN public.tbl_person sp on tbl_benutzer.person_id = sp.person_id + LEFT JOIN public.tbl_student student ON tbl_benutzer.uid = student.student_uid WHERE l.taetigkeit_kurzbz IN('.$TAETIGKEIT_KURZBZ.') AND l.logdata->>\'name\' NOT IN ('.$LOGDATA_NAME.') AND l.person_id = p.person_id @@ -178,7 +182,7 @@ $query = ' WHERE pss.status_kurzbz = '.$INTERESSENT_STATUS.' AND ps.person_id = p.person_id AND pss.studiensemester_kurzbz = '.$STUDIENSEMESTER.' - ORDER BY pss.datum DESC, pss.insertamum DESC, pss.ext_id DESC + ORDER BY rtp.teilgenommen NULLS FIRST, pss.datum DESC, pss.insertamum DESC, pss.ext_id DESC LIMIT 1 ) AS "ReihungstestAngetreten", ( @@ -199,7 +203,7 @@ $query = ' LIMIT 1 ) AS "ReihungstestApplied", ( - SELECT CONCAT(rtp.datum, rtp.uhrzeit) + SELECT (ARRAY_TO_STRING(array_agg(DISTINCT(CONCAT(rtp.datum, \' \', to_char(rtp.uhrzeit, \'HH24:MI\'), \' \', studiengang.kurzbzlang))), \', \')) FROM public.tbl_prestudentstatus pss JOIN public.tbl_prestudent ps USING(prestudent_id) LEFT JOIN ( @@ -207,14 +211,17 @@ $query = ' rt.studiensemester_kurzbz, rtp.teilgenommen, rt.datum, - rt.uhrzeit + rt.uhrzeit, + rt.studiengang_kz FROM public.tbl_rt_person rtp JOIN tbl_reihungstest rt ON(rtp.rt_id = rt.reihungstest_id) WHERE rt.stufe = 1 ) rtp ON(rtp.person_id = ps.person_id AND rtp.studiensemester_kurzbz = pss.studiensemester_kurzbz) + JOIN tbl_studiengang studiengang ON rtp.studiengang_kz = studiengang.studiengang_kz WHERE pss.status_kurzbz = '.$INTERESSENT_STATUS.' AND ps.person_id = p.person_id AND pss.studiensemester_kurzbz = '.$STUDIENSEMESTER.' + GROUP BY pss.datum, pss.insertamum, pss.ext_id ORDER BY pss.datum DESC, pss.insertamum DESC, pss.ext_id DESC LIMIT 1 ) AS "ReihungstestDate", @@ -414,10 +421,6 @@ $query = ' { $datasetRaw->{'ReihungstestDate'} = '-'; } - else - { - $datasetRaw->{'ReihungstestDate'} = date_format(date_create($datasetRaw->{'ReihungstestDate'}),'Y-m-d H:i'); - } if ($datasetRaw->{'ZGVNation'} == null) { diff --git a/application/views/system/infocenter/infocenterReihungstestAbsolviert.php b/application/views/system/infocenter/infocenterReihungstestAbsolviert.php index f2d838fac..71a7a1d5e 100644 --- a/application/views/system/infocenter/infocenterReihungstestAbsolviert.php +++ b/application/views/system/infocenter/infocenterReihungstestAbsolviert.php @@ -3,13 +3,13 @@ 'templates/FHC-Header', array( 'title' => 'Info Center', - 'jquery' => true, - 'jqueryui' => true, - 'jquerycheckboxes' => true, - 'bootstrap' => true, - 'fontawesome' => true, - 'sbadmintemplate' => true, - 'tablesorter' => true, + 'jquery3' => true, + 'jqueryui1' => true, + 'jquerycheckboxes1' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, + 'sbadmintemplate3' => true, + 'tablesorter2' => true, 'ajaxlib' => true, 'filterwidget' => true, 'navigationwidget' => true, diff --git a/application/views/system/infocenter/infocenterZgvDetails.php b/application/views/system/infocenter/infocenterZgvDetails.php index 62fefbec8..cf3ffad8b 100644 --- a/application/views/system/infocenter/infocenterZgvDetails.php +++ b/application/views/system/infocenter/infocenterZgvDetails.php @@ -3,15 +3,15 @@ 'templates/FHC-Header', array( 'title' => 'InfocenterZgvDetails', - 'jquery' => true, - 'bootstrap' => true, - 'fontawesome' => true, - 'jqueryui' => true, + 'jquery3' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, + 'jqueryui1' => true, 'dialoglib' => true, 'ajaxlib' => true, - 'tablesorter' => true, - 'tinymce' => true, - 'sbadmintemplate' => true, + 'tablesorter2' => true, + 'tinymce4' => true, + 'sbadmintemplate3' => true, 'addons' => true, 'navigationwidget' => true, 'udfs' => true, @@ -129,15 +129,11 @@ - + - + diff --git a/application/views/system/infocenter/infocenterZgvUeberpruefung.php b/application/views/system/infocenter/infocenterZgvUeberpruefung.php index e0b8f9eae..7b285edb2 100644 --- a/application/views/system/infocenter/infocenterZgvUeberpruefung.php +++ b/application/views/system/infocenter/infocenterZgvUeberpruefung.php @@ -3,13 +3,13 @@ $this->load->view( 'templates/FHC-Header', array( 'title' => 'Info Center', - 'jquery' => true, - 'jqueryui' => true, - 'jquerycheckboxes' => true, - 'bootstrap' => true, - 'fontawesome' => true, - 'sbadmintemplate' => true, - 'tablesorter' => true, + 'jquery3' => true, + 'jqueryui1' => true, + 'jquerycheckboxes1' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, + 'sbadmintemplate3' => true, + 'tablesorter2' => true, 'ajaxlib' => true, 'filterwidget' => true, 'navigationwidget' => true, diff --git a/application/views/system/infocenter/studiengangZgvInfo.php b/application/views/system/infocenter/studiengangZgvInfo.php index 1b699d634..8b6d1a636 100644 --- a/application/views/system/infocenter/studiengangZgvInfo.php +++ b/application/views/system/infocenter/studiengangZgvInfo.php @@ -3,10 +3,10 @@ $this->load->view( 'templates/FHC-Header', array( 'title' => 'ZGV Info', - 'jquery' => true, - 'bootstrap' => true, - 'fontawesome' => true, - 'sbadmintemplate' => true, + 'jquery3' => true, + 'bootstrap3' => true, + 'fontawesome4' => true, + 'sbadmintemplate3' => true, 'customCSSs' => 'public/css/sbadmin2/admintemplate_contentonly.css' ) ); @@ -17,7 +17,11 @@ $this->load->view(
- +
@@ -35,3 +39,4 @@ $this->load->view( load->view('templates/FHC-Footer'); ?> + diff --git a/application/views/system/infocenter/zgvpruefungen.php b/application/views/system/infocenter/zgvpruefungen.php index 253145557..2e6ea90d2 100644 --- a/application/views/system/infocenter/zgvpruefungen.php +++ b/application/views/system/infocenter/zgvpruefungen.php @@ -124,6 +124,32 @@
+ prestudentstatus->bewerbung_abgeschicktamum)) + { + $disabled = $disabledStg = 'disabled'; + $disabledTxt = $disabledStgTxt = $this->p->t('infocenter', 'bewerbungMussAbgeschickt'); + } + + if ($studiengangtyp !== 'b' && $studiengangtyp !== 'm') + { + $disabled = 'disabled'; + $disabledTxt = $this->p->t('infocenter', 'nurBachelorMasterFreigeben'); + + // FIT-Lehrgänge: exceptions, can be freigegeben in Infocenter + if (!in_array($studiengang_kz, $fit_programme_studiengaenge)) + { + $disabledStg = 'disabled'; + $disabledStgTxt = $this->p->t('infocenter', 'nurBachelorMasterFreigeben'); + } + } + + if (!in_array($studiengangtyp, $studienArtBerechtigung)) + $disabledPer = 'disabled'; + else + $disabledPer = ''; + ?>
@@ -196,12 +222,25 @@ p->t('infocenter', 'zgv') ?>
- widgetlib->widget( - 'Zgv_widget', - array(DropdownWidget::SELECTED_ELEMENT => $zgvpruefung->zgv_code), - array('name' => 'zgv', 'id' => 'zgv_'.$zgvpruefung->prestudent_id) - ); ?> + prestudent_id . "' name='zgv' class='form-control'>"; + $selectedDefault = (is_null($zgvpruefung->zgv_code) ? 'selected' : ''); + echo ""; + foreach ($all_zgvs as $zgv) + { + $selected = ($zgvpruefung->zgv_code === $zgv->zgv_code) ? 'selected' : ''; + $aktiv = ''; + $class = ''; + if (!$zgv->aktiv) + { + $aktiv = '(inaktiv)'; + $class = 'gesperrtoption'; + } + + echo ""; + } + echo ""; + endif;?>
@@ -239,11 +278,26 @@ zgvnation_bez; else - echo $this->widgetlib->widget( - 'Nation_widget', - array(DropdownWidget::SELECTED_ELEMENT => $zgvpruefung->zgvnation_code), - array('name' => 'zgvnation', 'id' => 'zgvnation_'.$zgvpruefung->prestudent_id) - ); ?> + { + echo ""; + } + ?>
@@ -256,11 +310,25 @@ if ($infoonly) echo $zgvpruefung->zgvmas_bez; else - echo $this->widgetlib->widget( - 'Zgvmaster_widget', - array(DropdownWidget::SELECTED_ELEMENT => $zgvpruefung->zgvmas_code), - array('name' => 'zgvmas', 'id' => 'zgvmas_'.$zgvpruefung->prestudent_id) - ); ?> + { + echo ""; + } + ?>
@@ -300,11 +368,28 @@ if ($infoonly) echo $zgvpruefung->zgvmanation_bez; else - echo $this->widgetlib->widget( - 'Nation_widget', - array(DropdownWidget::SELECTED_ELEMENT => $zgvpruefung->zgvmanation_code), - array('name' => 'zgvmanation', 'id' => 'zgvmanation_'.$zgvpruefung->prestudent_id) - ); ?> + { + echo ""; + } + ?>
@@ -318,17 +403,17 @@
- - statusZGV))) ?: print_r('data-info="need"')?>>
-
@@ -336,7 +421,7 @@
prestudentUdfs)) + if (isset($zgvpruefung->prestudentUdfs) && $studiengangtyp !== 'l') { echo $this->udflib->UDFWidget( array( @@ -362,6 +447,8 @@
+ required>
- @@ -489,6 +558,8 @@
p->t('global','name')) ?> p->t('global','typ')) ?> p->t('global','uploaddatum')) ?>p->t('ui','loeschen')) ?> p->t('infocenter','ausstellungsnation')) ?> - autocomplete="off"> bezeichnung === $dokument->dokument_bezeichnung ? 'selected' : '') . " value = " . $dokumenttyp->dokument_kurzbz . ">" . $dokumenttyp->bezeichnung . "" @@ -30,7 +31,7 @@
- +
erstelltam), 'd.m.Y') ?>> langtext ?>
- \ No newline at end of file + diff --git a/cis/private/info/index.html b/cis/private/info/index.html new file mode 100644 index 000000000..e69de29bb diff --git a/cis/private/info/partnerhochschulen.php b/cis/private/info/partnerhochschulen.php index 1bcaa9520..2a448ee61 100644 --- a/cis/private/info/partnerhochschulen.php +++ b/cis/private/info/partnerhochschulen.php @@ -46,7 +46,7 @@ echo ' - + diff --git a/cis/private/info/service_uebersicht.php b/cis/private/info/service_uebersicht.php index 60a751927..27759e6c6 100644 --- a/cis/private/info/service_uebersicht.php +++ b/cis/private/info/service_uebersicht.php @@ -46,7 +46,7 @@ echo ' - + diff --git a/cis/private/info/telefonverzeichnis.php b/cis/private/info/telefonverzeichnis.php index fe276b85b..02db1575a 100644 --- a/cis/private/info/telefonverzeichnis.php +++ b/cis/private/info/telefonverzeichnis.php @@ -64,7 +64,7 @@ if(check_lektor($user)) - + diff --git a/cis/private/lehre/abgabe_lektor.php b/cis/private/lehre/abgabe_lektor.php index 414c5e423..70f80f7ba 100644 --- a/cis/private/lehre/abgabe_lektor.php +++ b/cis/private/lehre/abgabe_lektor.php @@ -128,7 +128,7 @@ echo ' - + diff --git a/cis/private/lehre/abgabe_lektor_terminuebersicht.php b/cis/private/lehre/abgabe_lektor_terminuebersicht.php index 0cc558e4a..00ed8e5c6 100644 --- a/cis/private/lehre/abgabe_lektor_terminuebersicht.php +++ b/cis/private/lehre/abgabe_lektor_terminuebersicht.php @@ -41,7 +41,7 @@ echo ' - + diff --git a/cis/private/lehre/abgabe_student.php b/cis/private/lehre/abgabe_student.php index 2a328dd35..5a2e41f4b 100644 --- a/cis/private/lehre/abgabe_student.php +++ b/cis/private/lehre/abgabe_student.php @@ -217,7 +217,7 @@ echo ' - + diff --git a/cis/private/lehre/benotungstool/lvgesamtnoteeintragen.php b/cis/private/lehre/benotungstool/lvgesamtnoteeintragen.php index 3c9985a8b..73d0e6fca 100644 --- a/cis/private/lehre/benotungstool/lvgesamtnoteeintragen.php +++ b/cis/private/lehre/benotungstool/lvgesamtnoteeintragen.php @@ -233,12 +233,21 @@ if (isset($_REQUEST["submit"])) continue; } $punkte=str_replace(',','.', $punkte); - //UID ermitteln + + //check ob statt Matrikelnummer nicht bereits student_uid (Moodle Grade Import) vorliegt.. $student = new student(); - if(!$student_uid = $student->getUidFromMatrikelnummer($matrikelnummer)) + if (!$student->checkIfValidStudentUID($matrikelnummer)) { - $response.="\n".$p->t('benotungstool/studentMitMatrikelnummerExistiertNicht',array($matrikelnummer)); - continue; + //UID ermitteln + if(!$student_uid = $student->getUidFromMatrikelnummer($matrikelnummer)) + { + $response.="\n".$p->t('benotungstool/studentMitMatrikelnummerExistiertNicht',array($matrikelnummer)); + continue; + } + } + else + { + $student_uid = $matrikelnummer; } // Hole Zeugnisnote wenn schon eine eingetragen ist diff --git a/cis/private/lehre/benotungstool/lvgesamtnoteverwalten.php b/cis/private/lehre/benotungstool/lvgesamtnoteverwalten.php index 3ff1f4695..1cfa4a4e2 100644 --- a/cis/private/lehre/benotungstool/lvgesamtnoteverwalten.php +++ b/cis/private/lehre/benotungstool/lvgesamtnoteverwalten.php @@ -112,7 +112,7 @@ echo ' - + @@ -803,6 +803,7 @@ if (defined('CIS_ANWESENHEITSLISTE_NOTENLISTE_ANZEIGEN') && CIS_ANWESENHEITSLIST { $hrefpath = "../notenliste.xls.php?stg=$stg_obj->studiengang_kz&lvid=$lvid&stsem=$stsem"; echo "
" . $p->t('benotungstool/notenlisteImport') . ""; + } // eingetragene lv-gesamtnoten freigeben diff --git a/cis/private/lehre/benotungstool/notenschluessel.php b/cis/private/lehre/benotungstool/notenschluessel.php index 93de334e2..a7185f2ce 100644 --- a/cis/private/lehre/benotungstool/notenschluessel.php +++ b/cis/private/lehre/benotungstool/notenschluessel.php @@ -47,7 +47,7 @@ echo ' - + diff --git a/cis/private/lehre/covidstatusliste.php b/cis/private/lehre/covidstatusliste.php index affe2b929..a5b2694bc 100644 --- a/cis/private/lehre/covidstatusliste.php +++ b/cis/private/lehre/covidstatusliste.php @@ -81,8 +81,8 @@ header('Content-Type: text/html; charset=utf-8'); FHC - Nachweisliste - - + + @@ -163,4 +163,4 @@ print_r($covidstatus);
- \ No newline at end of file + diff --git a/cis/private/lehre/fotoliste.pdf.php b/cis/private/lehre/fotoliste.pdf.php index 018ef6d7e..353f3a2ad 100644 --- a/cis/private/lehre/fotoliste.pdf.php +++ b/cis/private/lehre/fotoliste.pdf.php @@ -103,6 +103,7 @@ $gruppen_string = ''; $gruppen_string_arr = array(); $stg_typ = $stg->typ; $stg_bezeichnung = $stg->bezeichnung; +$lv_bezeichnung = ''; //structure overall lehrveranstaltungs data if ($result = $db->db_query($qry)) { @@ -154,6 +155,7 @@ $qry = 'SELECT DISTINCT ON (nachname, vorname, person_id) vorname, nachname, + wahlname, matrikelnr, tbl_studentlehrverband.semester, tbl_studentlehrverband.verband, @@ -238,6 +240,16 @@ if ($result = $db->db_query($qry)) { if ($row->stg_kz_student == $a_o_kz) //Außerordentliche Studierende $zusatz .= '(a.o.)'; + //wenn Wahlname vorhanden, wird dieser anstelle des Vornamens angezeigt + if ($row->wahlname != '') + { + $vorname = $row->wahlname; + } + else + { + $vorname = $row->vorname; + } + //allow admin and assistenz to see ALL fotos (even if locked by user) if ($show_all_fotos) $row->foto_sperre = 'f'; @@ -272,7 +284,7 @@ if ($result = $db->db_query($qry)) { //add studierenden data for XML $data[] = array('studierende' => array( - 'vorname' => $row->vorname, + 'vorname' => $vorname, 'nachname' => mb_strtoupper($row->nachname, 'UTF-8'), 'personenkennzeichen' => trim($row->matrikelnr), 'geschlecht' => $row->geschlecht, diff --git a/cis/private/lehre/lesson.php b/cis/private/lehre/lesson.php index 4d8c872a1..756572ae7 100644 --- a/cis/private/lehre/lesson.php +++ b/cis/private/lehre/lesson.php @@ -102,7 +102,8 @@ if (isset($_GET["handbuch"])){ - + + diff --git a/cis/private/lehre/notenliste.php b/cis/private/lehre/notenliste.php index 842d4b603..59eafde95 100644 --- a/cis/private/lehre/notenliste.php +++ b/cis/private/lehre/notenliste.php @@ -52,7 +52,7 @@ echo ' - + @@ -136,7 +136,7 @@ if (! check_student($user)) } else { - $qry = "SELECT vw_student.vorname, vw_student.nachname, vw_student.prestudent_id, tbl_studiengang.studiengang_kz + $qry = "SELECT vw_student.vorname, vw_student.nachname, vw_student.wahlname, vw_student.prestudent_id, tbl_studiengang.studiengang_kz FROM public.tbl_studiengang JOIN campus.vw_student USING (studiengang_kz) WHERE campus.vw_student.uid = " . $db->db_add_param($user) . ";"; @@ -148,6 +148,7 @@ else $vorname = $row->vorname; $nachname = $row->nachname; + $wahlname = $row->wahlname; $prestudent_id = $row->prestudent_id; $stg_obj = new studiengang(); $stg_obj->load($row->studiengang_kz); @@ -313,7 +314,7 @@ else // Noten ohne Wert werden entfernen if(isset($notenarr[$row->note]['notenwert'])) { - $notenSummenArray[$row->lehrveranstaltung_id]['notenwert'] = $notenarr[$row->note]['notenwert']; + $notenSummenArray[$row->lehrveranstaltung_id]['notenwert'] = $notenarr[$row->note]['notenwert']; $notenSummenArray[$row->lehrveranstaltung_id]['ects'] = $row->ects; } } diff --git a/cis/private/lehre/notenliste.xls.php b/cis/private/lehre/notenliste.xls.php index ad25a6bc2..74cb7e7c1 100644 --- a/cis/private/lehre/notenliste.xls.php +++ b/cis/private/lehre/notenliste.xls.php @@ -167,7 +167,7 @@ else //Lektoren ermitteln $qry = "SELECT - distinct vorname, nachname + distinct vorname, nachname, wahlname FROM campus.vw_benutzer, lehre.tbl_lehreinheit, lehre.tbl_lehreinheitmitarbeiter WHERE @@ -211,7 +211,7 @@ else $qry = " SELECT distinct on(nachname, vorname, person_id) - vorname, nachname, matrikelnr, person_id, tbl_student.student_uid as uid, + vorname, nachname, wahlname, matrikelnr, person_id, tbl_student.student_uid as uid, tbl_studentlehrverband.semester, tbl_studentlehrverband.verband, tbl_studentlehrverband.gruppe, (SELECT status_kurzbz FROM public.tbl_prestudentstatus @@ -277,6 +277,8 @@ else $worksheet->write($lines,1,$elem->uid); $worksheet->write($lines,2,$elem->nachname.$inc); $worksheet->write($lines,3,$elem->vorname); + //wenn Wahlname vorhanden überschreibt dieser den Vornamen + $worksheet->write($lines,3,$elem->wahlname); $worksheet->write($lines,4,'="'.$elem->semester.$elem->verband.$elem->gruppe.'"'); $worksheet->write($lines,5,'="'.trim($elem->matrikelnr).'"',$format_highlight); $worksheet->write($lines,6, $note, $format_highlightright); diff --git a/cis/private/lvplan/index.php b/cis/private/lvplan/index.php index 260ee8066..7e7e8e28e 100644 --- a/cis/private/lvplan/index.php +++ b/cis/private/lvplan/index.php @@ -114,7 +114,7 @@ $num_rows_lektor=$db->db_num_rows($result_lektor);*/ Lehrveranstaltungsplan - + diff --git a/cis/private/lvplan/raumsuche.php b/cis/private/lvplan/raumsuche.php index 0edbcbb8e..0cb9677d4 100644 --- a/cis/private/lvplan/raumsuche.php +++ b/cis/private/lvplan/raumsuche.php @@ -48,7 +48,7 @@ echo ' - + diff --git a/cis/private/lvplan/stpl_week_anzahl_studenten.php b/cis/private/lvplan/stpl_week_anzahl_studenten.php index eeec45145..cd69c7dbf 100644 --- a/cis/private/lvplan/stpl_week_anzahl_studenten.php +++ b/cis/private/lvplan/stpl_week_anzahl_studenten.php @@ -50,7 +50,7 @@ Anzahl Studenten Lehrveranstaltungsplan FH Technikum-Wien - + diff --git a/cis/private/mailverteiler.php b/cis/private/mailverteiler.php index 7a0736b05..a46193e72 100644 --- a/cis/private/mailverteiler.php +++ b/cis/private/mailverteiler.php @@ -60,7 +60,7 @@ if(!$is_lector) <?php echo $p->t('mailverteiler/mailverteiler');?> - + diff --git a/cis/private/outgoing/outgoing.php b/cis/private/outgoing/outgoing.php index 6be03532d..62cff05bb 100644 --- a/cis/private/outgoing/outgoing.php +++ b/cis/private/outgoing/outgoing.php @@ -262,7 +262,7 @@ if($method =="deleteFirma") - + diff --git a/cis/private/profile/anwesenheit.php b/cis/private/profile/anwesenheit.php index b75f59cd7..4eb0f6940 100644 --- a/cis/private/profile/anwesenheit.php +++ b/cis/private/profile/anwesenheit.php @@ -81,7 +81,7 @@ if(!$semester || !array_key_exists($semester, $alle_semester)) - + - + diff --git a/cis/private/profile/freebusy.php b/cis/private/profile/freebusy.php index d2e4f9bba..3d84307bb 100644 --- a/cis/private/profile/freebusy.php +++ b/cis/private/profile/freebusy.php @@ -19,7 +19,7 @@ */ /* * GUI fuer die FreeBusy Verwaltung - * + * * Mit diesem Tool koennen FreeBusy URLs aus verschiedenen Quellen zu einer * FreeBusy URL zusammengefasst werden */ @@ -32,7 +32,7 @@ require_once('../../../include/benutzerberechtigung.class.php'); if (!$db = new basis_db()) die('Fehler beim Oeffnen der Datenbankverbindung'); - + $user = get_uid(); $sprache = getSprache(); $p = new phrasen($sprache); @@ -60,23 +60,23 @@ echo ' '.$p->t('freebusy/titel').' - + - + - + + diff --git a/cis/private/profile/lva_liste.php b/cis/private/profile/lva_liste.php index 6f78cf8c8..9806b8cc1 100644 --- a/cis/private/profile/lva_liste.php +++ b/cis/private/profile/lva_liste.php @@ -128,7 +128,7 @@ echo ' '.$p->t('lvaliste/titel').' - + + diff --git a/cis/private/profile/studienplan.php b/cis/private/profile/studienplan.php index 6097ed136..70d234c38 100644 --- a/cis/private/profile/studienplan.php +++ b/cis/private/profile/studienplan.php @@ -133,7 +133,7 @@ echo ' - + diff --git a/cis/private/profile/urlaubsfreigabe.php b/cis/private/profile/urlaubsfreigabe.php index f71d7adda..39c7529d1 100644 --- a/cis/private/profile/urlaubsfreigabe.php +++ b/cis/private/profile/urlaubsfreigabe.php @@ -69,7 +69,7 @@ echo ' Urlaubsfreigabe - + diff --git a/cis/private/profile/urlaubstool.php b/cis/private/profile/urlaubstool.php index ce9150dd8..fc77a01d0 100644 --- a/cis/private/profile/urlaubstool.php +++ b/cis/private/profile/urlaubstool.php @@ -536,7 +536,7 @@ $datum_obj = new datum(); - + diff --git a/cis/private/profile/zeitsperre_resturlaub.php b/cis/private/profile/zeitsperre_resturlaub.php index 20b48c0db..6722aaa48 100644 --- a/cis/private/profile/zeitsperre_resturlaub.php +++ b/cis/private/profile/zeitsperre_resturlaub.php @@ -91,7 +91,7 @@ $num_rows_stunde=$db->db_num_rows($result_stunde); <?php echo $p->t('zeitsperre/zeitsperre');?> - + diff --git a/cis/private/profile/zeitwunsch.php b/cis/private/profile/zeitwunsch.php index a448125f6..807caf25a 100644 --- a/cis/private/profile/zeitwunsch.php +++ b/cis/private/profile/zeitwunsch.php @@ -424,9 +424,9 @@ function getStgMail($stgKz_arr) <?php echo $p->t('zeitwunsch/zeitwunsch');?> - - - + + + - + <?php echo $p->t('tools/ampelsystem') ?> diff --git a/cis/private/tools/index.html b/cis/private/tools/index.html new file mode 100644 index 000000000..e69de29bb diff --git a/cis/private/tools/suche.php b/cis/private/tools/suche.php index 15d75c546..52dbc2385 100644 --- a/cis/private/tools/suche.php +++ b/cis/private/tools/suche.php @@ -108,7 +108,7 @@ if (defined('LOG_CONTENT') && LOG_CONTENT==true) //Easter Egg $easteregg = array ('antwort','leben','universum','rest','answer','universe','life','everything'); $easteregg_intersect = array_intersect(array_map('strtolower',$searchItems), $easteregg); -if (count($easteregg_intersect)==4) +if (count($easteregg_intersect)==3) { echo '



42

'; exit; @@ -178,20 +178,25 @@ function searchPerson($searchItems) echo ''; //echo '',$row->titelpre,''; echo '',$row->anrede,''; - echo '',$row->vorname,''; + + if ($row->wahlname) + echo '',$row->wahlname, ' ' ,$row->vorname, ''; + else + echo '',$row->vorname, ''; + echo ''; if(!defined('CIS_SUCHE_PROFIL_ANZEIGEN')) - echo '',$row->nachname,''; + echo '',$row->nachname,''; else if(!CIS_SUCHE_PROFIL_ANZEIGEN) { $mitarbeiter = new Mitarbeiter($uid); if($mitarbeiter->errormsg === NULL) - echo '',$row->nachname,''; + echo '',$row->nachname,''; else echo $row->nachname; } else - echo '',$row->nachname,''; + echo '',$row->nachname,''; if($row->aktiv==false) echo ' (ausgeschieden)'; elseif($bisverwendung->beschausmasscode=='5') diff --git a/cis/private/tools/zeitaufzeichnung.php b/cis/private/tools/zeitaufzeichnung.php index ba57b442f..ff8e863e2 100644 --- a/cis/private/tools/zeitaufzeichnung.php +++ b/cis/private/tools/zeitaufzeichnung.php @@ -158,7 +158,7 @@ $angezeigte_tage = '50'; $zs = new zeitsperre(); if ($alle) - $zs->getZeitsperrenForZeitaufzeichnung($user,'180'); + $zs->getZeitsperrenForZeitaufzeichnung($user,'360'); else $zs->getZeitsperrenForZeitaufzeichnung($user,$angezeigte_tage); @@ -197,7 +197,7 @@ echo ' - + @@ -1440,7 +1440,7 @@ if ($projekt->getProjekteMitarbeiter($user, true)) else { if ($alle==true) - $za->getListeUserFull($user, ''); + $za->getListeUserFull($user, '360'); else $za->getListeUserFull($user, $angezeigte_tage); } diff --git a/cis/public/coodle.php b/cis/public/coodle.php index 48c585d6b..7447ac5c2 100644 --- a/cis/public/coodle.php +++ b/cis/public/coodle.php @@ -254,11 +254,11 @@ if (isset($_GET['resend'])) - + - + <?php echo $p->t('coodle/terminauswahl'); ?> - + diff --git a/cis/public/testtool_test/testseite.php b/cis/public/testtool_test/testseite.php index 470fec2c2..da6fee355 100644 --- a/cis/public/testtool_test/testseite.php +++ b/cis/public/testtool_test/testseite.php @@ -24,13 +24,13 @@ echo ''; Testsite MathML - + - + @@ -158,8 +301,10 @@ else if (isset($_GET['type']) && $_GET['type']=='delete') if($rechte->isBerechtigt('lehre/gruppe', $oe_studiengang, 'suid')) { + $grp_kurzbz = $_GET['einheit_id']; + $e=new gruppe(); - if(!$e->delete($_GET['einheit_id'])) + if(!$e->delete($grp_kurzbz)) echo $e->errormsg; } else @@ -214,6 +359,7 @@ function printDropDown() echo ''; echo ''; } + function doSave() { global $rechte; @@ -241,8 +387,10 @@ function doSave() $e->new = false; } + $user = get_uid(); + $e->updateamum = date('Y-m-d H:i:s'); - $e->updatevon = get_uid(); + $e->updatevon = $user; $e->bezeichnung = $_POST['bezeichnung']; $e->beschreibung = $_POST['beschreibung']; $e->studiengang_kz = $_POST['studiengang_kz']; @@ -258,13 +406,66 @@ function doSave() $e->sort = $_POST['sort']; $e->content_visible = isset($_POST['content_visible']); + + // gruppemanager immer array, leer wenn keine angegeben + $gruppemanager_uids = isset($_POST['gruppemanager']) && is_array($_POST['gruppemanager']) ? $_POST['gruppemanager'] : array(); + + // Prüfung: generierte Gruppen haben keine Manager + if (count($gruppemanager_uids) > 0 && $e->generiert === true) + { + echo "Generierte Gruppen dürfen keine Administratoren haben!"; + return; + } + if(!$e->save()) - echo $e->errormsg; + echo "".$e->errormsg.""; + else // wenn Gruppe erfolgreich gespeichert, Gruppenmanager speichern + { + // Gruppe gemäss Konvention in Großbuchstaben + $gruppe_kurzbz = mb_strtoupper($_POST['kurzbz']); + + // bestehende Gruppenmanager laden + $bestehende_gruppemanager_uids = array(); + $gruppemanager_hlp = new gruppemanager(); + if ($gruppemanager_hlp->load_uids($gruppe_kurzbz)) + { + foreach ($gruppemanager_hlp->uids as $uid_obj) + { + $bestehende_gruppemanager_uids[] = $uid_obj->uid; + } + } + + foreach ($gruppemanager_uids as $gruppemanager_uid) + { + // wenn Gruppenmanager noch nicht zugewiesen + if (!in_array($gruppemanager_uid, $bestehende_gruppemanager_uids)) + { + // Gruppemanager speichern + $gruppemgr = new gruppemanager(); + $gruppemgr->uid = $gruppemanager_uid; + $gruppemgr->gruppe_kurzbz = $gruppe_kurzbz; + $gruppemgr->insertamum = date('Y-m-d H:i:s'); + $gruppemgr->insertvon = $user; + + if(!$gruppemgr->save()) + echo $gruppemgr->errormsg; + } + } + + // zu löschende Gruppemanager ermitteln + $geloeschte_gruppemanager_uids = array_diff($bestehende_gruppemanager_uids, $gruppemanager_uids); + + // Nicht mehr vorhandene Gruppenmanager löschen + $gruppemanager_hlp = new gruppemanager(); + foreach ($geloeschte_gruppemanager_uids as $geloeschte_uid) + { + if (!$gruppemanager_hlp->delete($geloeschte_uid, $gruppe_kurzbz)) + echo $gruppemanager_hlp->errormsg; + } + } } } - - function doEdit($kurzbz,$new=false) { global $db, $rechte, $studiengang, $searchItems; @@ -282,6 +483,9 @@ function doEdit($kurzbz,$new=false)

Gruppe
+ + + @@ -341,6 +545,44 @@ function doEdit($kurzbz,$new=false) + + + load_uids($e->gruppe_kurzbz); + + // richtige Tabellenzeige Grösse wenn Administratoren vorhanden + if ($gruppemanager_uids_result === true) + { + $gruppemanagerCellClass = ' class="gruppenmanager-cell"'; + } + ?> + id="gruppenmanager-cell"> + + + Generierte Gruppen dürfen keine Administratoren haben. + + "; + // alle Manager der Gruppe anzeigen + if ($gruppemanager_uids_result === true) + { + $count = 1; + foreach ($gruppemanager_hlp->uids as $uid_obj) + { + $ben = new benutzer($uid_obj->uid); + // Vorlagestring durch Werte ersetzen und ausgeben + echo sprintf(MANAGER_HTML, $uid_obj->uid, $ben->vorname, $ben->nachname, $uid_obj->uid); + if ($count % 5 == 0) // neue Zeile nach 5 Elementen + echo "

"; + $count++; + } + } + ?> + +
+ diff --git a/vilesci/lehre/ferienverwaltung.php b/vilesci/lehre/ferienverwaltung.php index 632e20617..5583ac2aa 100644 --- a/vilesci/lehre/ferienverwaltung.php +++ b/vilesci/lehre/ferienverwaltung.php @@ -65,7 +65,7 @@ - + diff --git a/vilesci/lehre/freifach_lektoren.php b/vilesci/lehre/freifach_lektoren.php index bbce9393a..601069bbf 100644 --- a/vilesci/lehre/freifach_lektoren.php +++ b/vilesci/lehre/freifach_lektoren.php @@ -58,7 +58,7 @@ else - + diff --git a/vilesci/lehre/lehrveranstaltung.php b/vilesci/lehre/lehrveranstaltung.php index 757861d96..ab7abd9cd 100644 --- a/vilesci/lehre/lehrveranstaltung.php +++ b/vilesci/lehre/lehrveranstaltung.php @@ -124,6 +124,13 @@ if (isset($_REQUEST['lehrveranstaltung_name'])) else $lehrveranstaltung_name = ''; +if (isset($_REQUEST['lehrveranstaltung_kurzbz'])) +{ + $lehrveranstaltung_kurzbz = trim($_REQUEST['lehrveranstaltung_kurzbz']); +} +else + $lehrveranstaltung_kurzbz = ''; + //Wenn kein Fachbereich und kein Studiengang gewaehlt wurde //dann wird der Studiengang auf 0 gesetzt da sonst die zu ladende liste zu lang wird @@ -549,6 +556,11 @@ if($lehrveranstaltung_name != '') $sql_query.= " OR UPPER(tbl_lehrveranstaltung.bezeichnung_english) LIKE UPPER(".$db->db_add_param('%'.$lehrveranstaltung_name.'%', FHC_STRING).")) "; } +if($lehrveranstaltung_kurzbz != '') +{ + $sql_query.= " AND (UPPER(tbl_lehrveranstaltung.kurzbz) LIKE UPPER(".$db->db_add_param('%'.$lehrveranstaltung_kurzbz.'%', FHC_STRING).")) "; +} + //Wenn nicht admin, werden erst nur die aktiven angezeigt, es koennen aber auch die inaktiven eingeblendet werden $aktiv = ''; @@ -611,7 +623,7 @@ for ($i=0;$i<=$s[$stg_kz]->max_sem;$i++) $outp.=''; //Orgform DropDown -$outp.= ' Orgform '; $outp.= ''; $orgform = new organisationsform(); $orgform->getOrgformLV(); @@ -660,7 +672,11 @@ $outp .= '
'; + $outp.= ' ID '; + + //Lehrveranstaltung Suche Kurzbezeichnung + $outp.= ' Kurzbz '; //Lehrveranstaltung Suche Bezeichnung $outp.= ' Name
- - '; + + $htmlstr .= ''; echo ''; echo ''; +echo ''; echo ''; echo ''; echo '
Kurzbezeichnung
GruppenadministratorOptional, Administratoren, die Benutzer zur Gruppe entfernen/hinzufügen können
Semester Lehrmodus*Lehrmodus*
AnredeTitel(Pre)
Vorname
Weitere Vornamen
Wahlname
Nachname *
Titel(Post)
Geschlecht *'; + echo '
NachnameVornameWeitere
Vornamen
GebDatumSVNRGeschlechtAdresseStatusDetails
'; echo ''; while($row = $db->db_fetch_object($result)) { @@ -1161,7 +1167,7 @@ if ($where != '') } $status = mb_substr($status, 0, mb_strlen($status)-2); - echo ''; //echo ''; -echo ''; +//echo ''; +echo ''; + echo ''; +} + +// echo ''; echo ''; echo '
NachnameVornameWahlnameWeitere
Vornamen
GebDatumSVNRGeschlechtAdresseStatusDetails
Neue Person anlegen
'."$row->nachname$row->vorname$row->vornamen$row->gebdatum$row->svnr".($row->geschlecht=='m'?'männlich':'weiblich').""; + echo '
'."$row->nachname$row->vorname$row->wahlname$row->vornamen$row->gebdatum$row->svnr".($row->geschlecht=='m'?'männlich':'weiblich').""; $qry_adr = "SELECT * FROM public.tbl_adresse WHERE person_id=".$db->db_add_param($row->person_id, FHC_INTEGER); if ($result_adr = $db->db_query($qry_adr)) while ($row_adr = $db->db_fetch_object($result_adr)) diff --git a/vilesci/personen/import/mitarbeiterimport.php b/vilesci/personen/import/mitarbeiterimport.php index 91d78d385..8f19cce88 100644 --- a/vilesci/personen/import/mitarbeiterimport.php +++ b/vilesci/personen/import/mitarbeiterimport.php @@ -149,7 +149,7 @@ if(isset($_POST['checkUID'])) - + @@ -204,6 +204,7 @@ function disablefields(obj) document.getElementById('titelpost').disabled=val; document.getElementById('nachname').disabled=val; document.getElementById('vorname').disabled=val; + document.getElementById('wahlname').disabled=val; document.getElementById('vornamen').disabled=val; document.getElementById('geschlecht').disabled=val; document.getElementById('geburtsdatum').disabled=val; @@ -502,6 +503,7 @@ $titel = (isset($_POST['titel'])?$_POST['titel']:''); $titelpost = (isset($_POST['titelpost'])?$_POST['titelpost']:''); $nachname = (isset($_POST['nachname'])?$_POST['nachname']:''); $vorname = (isset($_POST['vorname'])?$_POST['vorname']:''); +$wahlname = (isset($_POST['wahlname'])?$_POST['wahlname']:''); $vornamen = (isset($_POST['vornamen'])?$_POST['vornamen']:''); $geschlecht = (isset($_POST['geschlecht'])?$_POST['geschlecht']:''); $geburtsdatum = (isset($_POST['geburtsdatum'])?$_POST['geburtsdatum']:''); @@ -574,6 +576,7 @@ if(isset($_POST['save'])) { $geburtsdatum = $person->gebdatum; $vorname = $person->vorname; + $wahlname = $person->wahlname; $vornamen = $person->vornamen; $nachname = $person->nachname; $svnr = $person->svnr; @@ -592,6 +595,7 @@ if(isset($_POST['save'])) $person->titelpre = $titel; $person->nachname = $nachname; $person->vorname = $vorname; + $person->wahlname = $wahlname; $person->vornamen = $vornamen; $person->titelpost = $titelpost; $person->geschlecht = $geschlecht; @@ -951,7 +955,26 @@ else echo ' '; echo '
Nachname *
Nachname *
Nachname *'; + +if ($showagain) +{ + //echo '
Wahlname1'; + // echo '
Wahlname1'; +// echo '
Wahlnahme'; +} +else +{ + echo '  '; + echo 'Wahlname              '; + //echo 'Wahlname4'; + echo '
Wahlname'; +// echo '
Titel(Post)
Geschlecht *'; + echo '
NachnameVornameWeitere
Vornamen
GebDatumSVNRGeschlechtAdresseStatusDetails
'; echo ''; while($row = $db->db_fetch_object($result)) { @@ -1100,7 +1123,7 @@ if($where!='') } } $status = mb_substr($status, 0, mb_strlen($status)-2); - echo ' + '; @@ -143,6 +145,7 @@ echo ' + '; } @@ -195,6 +198,13 @@ echo ' + + + + diff --git a/vilesci/stammdaten/infoscreen_details.php b/vilesci/stammdaten/infoscreen_details.php index 178f61e33..4ffdd5a69 100644 --- a/vilesci/stammdaten/infoscreen_details.php +++ b/vilesci/stammdaten/infoscreen_details.php @@ -55,7 +55,7 @@ $datum_obj = new datum(); - + diff --git a/vilesci/stammdaten/infoscreen_uebersicht.php b/vilesci/stammdaten/infoscreen_uebersicht.php index e766b2bc1..28e482601 100644 --- a/vilesci/stammdaten/infoscreen_uebersicht.php +++ b/vilesci/stammdaten/infoscreen_uebersicht.php @@ -45,7 +45,7 @@ echo ' - + diff --git a/vilesci/stammdaten/personen_wartung.php b/vilesci/stammdaten/personen_wartung.php index 7d8f62650..ee95854ed 100644 --- a/vilesci/stammdaten/personen_wartung.php +++ b/vilesci/stammdaten/personen_wartung.php @@ -1189,7 +1189,7 @@ function resize($base64, $width, $height) // 828 x 1104 -> 240 x 320 + src="../../vendor/jquery/jquery1/jquery-1.12.4.min.js"> + diff --git a/vilesci/stammdaten/reihungstest_zusammenlegung.php b/vilesci/stammdaten/reihungstest_zusammenlegung.php index f3be74dd3..d783a7598 100644 --- a/vilesci/stammdaten/reihungstest_zusammenlegung.php +++ b/vilesci/stammdaten/reihungstest_zusammenlegung.php @@ -151,7 +151,7 @@ if(isset($_POST['zusammenlegen'])) - + diff --git a/vilesci/stammdaten/service_details.php b/vilesci/stammdaten/service_details.php index 686ed52f4..cbd91755a 100644 --- a/vilesci/stammdaten/service_details.php +++ b/vilesci/stammdaten/service_details.php @@ -47,7 +47,7 @@ $datum_obj = new datum(); - + diff --git a/vilesci/stammdaten/studiengang_details.php b/vilesci/stammdaten/studiengang_details.php index d7f1a61d6..0d08accd9 100644 --- a/vilesci/stammdaten/studiengang_details.php +++ b/vilesci/stammdaten/studiengang_details.php @@ -312,7 +312,7 @@ if (!$erh->getAll('kurzbz')) - + diff --git a/vilesci/stammdaten/studiensemester.php b/vilesci/stammdaten/studiensemester.php index c8c57cc97..9eba96492 100644 --- a/vilesci/stammdaten/studiensemester.php +++ b/vilesci/stammdaten/studiensemester.php @@ -59,7 +59,7 @@ - + diff --git a/vilesci/stammdaten/variablen_details.php b/vilesci/stammdaten/variablen_details.php index 1a9cd6056..b367dee1b 100644 --- a/vilesci/stammdaten/variablen_details.php +++ b/vilesci/stammdaten/variablen_details.php @@ -117,7 +117,7 @@ if(isset($_POST["schick"])) $variable=new variable(); if($variable->load($uid, $name)) - $varialbe->new = false; + $variable->new = false; else $variable->new = true; diff --git a/vilesci/stammdaten/vertrag_typ.php b/vilesci/stammdaten/vertrag_typ.php index 5eac026c4..34cb3f788 100644 --- a/vilesci/stammdaten/vertrag_typ.php +++ b/vilesci/stammdaten/vertrag_typ.php @@ -71,7 +71,7 @@ echo ' - + diff --git a/vilesci/statistik/filter_overview.php b/vilesci/statistik/filter_overview.php index faa0ecee3..90807d6bb 100644 --- a/vilesci/statistik/filter_overview.php +++ b/vilesci/statistik/filter_overview.php @@ -49,7 +49,7 @@ if (!$filter->loadAll()) Filter Übersicht - + diff --git a/vilesci/statistik/incoming.php b/vilesci/statistik/incoming.php index 64a313a61..4f546edcf 100644 --- a/vilesci/statistik/incoming.php +++ b/vilesci/statistik/incoming.php @@ -37,7 +37,7 @@ echo ' - + diff --git a/vilesci/statistik/outgoing.php b/vilesci/statistik/outgoing.php index 276b697f2..0d8ca809d 100644 --- a/vilesci/statistik/outgoing.php +++ b/vilesci/statistik/outgoing.php @@ -37,7 +37,7 @@ echo ' - + diff --git a/vilesci/statistik/statistik.php b/vilesci/statistik/statistik.php index aa641f091..b7f992502 100644 --- a/vilesci/statistik/statistik.php +++ b/vilesci/statistik/statistik.php @@ -48,7 +48,7 @@ if(!$statistik->load($statistik_kurzbz)) - + + diff --git a/wawi/auswertungen/konto.php b/wawi/auswertungen/konto.php index 07d768975..6dc2c028c 100644 --- a/wawi/auswertungen/konto.php +++ b/wawi/auswertungen/konto.php @@ -60,7 +60,7 @@ if(count($kst_array)==0) - + diff --git a/wawi/auswertungen/kostenstelle.php b/wawi/auswertungen/kostenstelle.php index 4092140aa..7e3a80a6e 100644 --- a/wawi/auswertungen/kostenstelle.php +++ b/wawi/auswertungen/kostenstelle.php @@ -62,7 +62,7 @@ $datum_obj = new datum(); - + diff --git a/wawi/auswertungen/wawi_tags.php b/wawi/auswertungen/wawi_tags.php index 20af3382c..be4256dbd 100644 --- a/wawi/auswertungen/wawi_tags.php +++ b/wawi/auswertungen/wawi_tags.php @@ -58,7 +58,7 @@ if(count($kst_array)==0) - + diff --git a/wawi/berechtigung.php b/wawi/berechtigung.php index 7d6873052..8c52680a9 100644 --- a/wawi/berechtigung.php +++ b/wawi/berechtigung.php @@ -36,7 +36,7 @@ require_once('../include/benutzer.class.php'); - + diff --git a/wawi/bestellung.php b/wawi/bestellung.php index c7c22fb75..864a95367 100644 --- a/wawi/bestellung.php +++ b/wawi/bestellung.php @@ -352,12 +352,12 @@ if(isset($_POST['deleteBtnStorno']) && isset($_POST['id'])) - + + diff --git a/wawi/check_bestellung.php b/wawi/check_bestellung.php index f7022991c..e69485051 100644 --- a/wawi/check_bestellung.php +++ b/wawi/check_bestellung.php @@ -43,7 +43,7 @@ require_once '../include/firma.class.php'; - + diff --git a/wawi/firma.php b/wawi/firma.php index d2f7cc186..d5e5869aa 100644 --- a/wawi/firma.php +++ b/wawi/firma.php @@ -45,7 +45,7 @@ require_once('../include/nation.class.php'); - + diff --git a/wawi/kontouebersicht.php b/wawi/kontouebersicht.php index f86eaddc0..541c0630f 100644 --- a/wawi/kontouebersicht.php +++ b/wawi/kontouebersicht.php @@ -37,7 +37,7 @@ require_once('../include/sprache.class.php'); - + diff --git a/wawi/kostenstellenuebersicht.php b/wawi/kostenstellenuebersicht.php index b31f6f7d9..16d82b8af 100644 --- a/wawi/kostenstellenuebersicht.php +++ b/wawi/kostenstellenuebersicht.php @@ -40,7 +40,7 @@ require_once('../include/benutzerberechtigung.class.php'); - + diff --git a/wawi/rechnung.php b/wawi/rechnung.php index f37caae69..921505b13 100644 --- a/wawi/rechnung.php +++ b/wawi/rechnung.php @@ -63,13 +63,13 @@ if(isset($_POST['getBetragRow']) && isset($_POST['id'])) - +
NachnameVornameWeitere
Vornamen
WahlnameGebDatumSVNRGeschlechtAdresseStatusDetails
Neue Person anlegen
'."$row->nachname$row->vorname$row->vornamen$row->gebdatum$row->svnr".($row->geschlecht=='m'?'männlich':'weiblich').""; + echo '
'."$row->nachname$row->vorname$row->vornamen$row->wahlname$row->gebdatum$row->svnr".($row->geschlecht=='m'?'männlich':'weiblich').""; $qry_adr = "SELECT * FROM public.tbl_adresse WHERE person_id=".$db->db_add_param($row->person_id); if($result_adr = $db->db_query($qry_adr)) while($row_adr=$db->db_fetch_object($result_adr)) diff --git a/vilesci/personen/incoming_detail.php b/vilesci/personen/incoming_detail.php index 58368e52a..dd3cdf5ec 100644 --- a/vilesci/personen/incoming_detail.php +++ b/vilesci/personen/incoming_detail.php @@ -63,7 +63,7 @@ echo ' - + diff --git a/vilesci/personen/incoming_lehrveranstaltungen.php b/vilesci/personen/incoming_lehrveranstaltungen.php index 18e396a25..2fb7c64ec 100644 --- a/vilesci/personen/incoming_lehrveranstaltungen.php +++ b/vilesci/personen/incoming_lehrveranstaltungen.php @@ -66,7 +66,7 @@ if (isset($_GET['filter']) || isset($_GET['unterrichtssprache']) || isset($_GET[ - + diff --git a/vilesci/personen/incoming_uebersicht.php b/vilesci/personen/incoming_uebersicht.php index 4c46976a0..956b3098f 100644 --- a/vilesci/personen/incoming_uebersicht.php +++ b/vilesci/personen/incoming_uebersicht.php @@ -43,7 +43,7 @@ echo ' - + diff --git a/vilesci/personen/institutsliste.php b/vilesci/personen/institutsliste.php index 326b6ab48..0b3e85ebd 100644 --- a/vilesci/personen/institutsliste.php +++ b/vilesci/personen/institutsliste.php @@ -55,7 +55,7 @@ echo ' - + diff --git a/vilesci/personen/kontaktdaten_edit.php b/vilesci/personen/kontaktdaten_edit.php index a882b1350..b90d328db 100644 --- a/vilesci/personen/kontaktdaten_edit.php +++ b/vilesci/personen/kontaktdaten_edit.php @@ -72,7 +72,7 @@ if(isset($_GET['getstandort'])) - + diff --git a/vilesci/personen/outgoing_detail.php b/vilesci/personen/outgoing_detail.php index 72253685a..287bde809 100644 --- a/vilesci/personen/outgoing_detail.php +++ b/vilesci/personen/outgoing_detail.php @@ -199,7 +199,7 @@ if(isset($_POST['submit_anmerkung'])) - + diff --git a/vilesci/personen/outgoing_uebersicht.php b/vilesci/personen/outgoing_uebersicht.php index 0a06a3db7..5d585f933 100644 --- a/vilesci/personen/outgoing_uebersicht.php +++ b/vilesci/personen/outgoing_uebersicht.php @@ -63,7 +63,7 @@ echo ' - + diff --git a/vilesci/personen/preinteressent_uebersicht.php b/vilesci/personen/preinteressent_uebersicht.php index 8766e93d5..800969f14 100644 --- a/vilesci/personen/preinteressent_uebersicht.php +++ b/vilesci/personen/preinteressent_uebersicht.php @@ -113,7 +113,7 @@ echo ' - + diff --git a/vilesci/personen/zeitwunsch.php b/vilesci/personen/zeitwunsch.php index 726218302..8e365fb68 100644 --- a/vilesci/personen/zeitwunsch.php +++ b/vilesci/personen/zeitwunsch.php @@ -333,7 +333,7 @@ $selected_zwg_id = !is_null($selected_zwg) ? $selected_zwg->zeitwunsch_gueltigke Profil - + - - - - - + + + + + + diff --git a/vilesci/stammdaten/auswertung_fhtw.php b/vilesci/stammdaten/auswertung_fhtw.php index 9e8160808..d4e73c239 100644 --- a/vilesci/stammdaten/auswertung_fhtw.php +++ b/vilesci/stammdaten/auswertung_fhtw.php @@ -2109,7 +2109,7 @@ else - + @@ -2117,7 +2117,7 @@ else - + '; diff --git a/vilesci/stammdaten/benutzerberechtigung_details.php b/vilesci/stammdaten/benutzerberechtigung_details.php index 83a9c34bb..5db140a81 100644 --- a/vilesci/stammdaten/benutzerberechtigung_details.php +++ b/vilesci/stammdaten/benutzerberechtigung_details.php @@ -635,7 +635,7 @@ $htmlstr .= "
".$errorstr."
\n"; - + diff --git a/vilesci/stammdaten/berechtigungrolle.php b/vilesci/stammdaten/berechtigungrolle.php index ecd7920e7..56bb6935b 100644 --- a/vilesci/stammdaten/berechtigungrolle.php +++ b/vilesci/stammdaten/berechtigungrolle.php @@ -42,7 +42,7 @@ $delete = filter_input(INPUT_GET, 'delete', FILTER_VALIDATE_BOOLEAN); - + diff --git a/vilesci/stammdaten/betriebsmittel_uebersicht.php b/vilesci/stammdaten/betriebsmittel_uebersicht.php index 65244c6f5..a2129c2b1 100644 --- a/vilesci/stammdaten/betriebsmittel_uebersicht.php +++ b/vilesci/stammdaten/betriebsmittel_uebersicht.php @@ -184,7 +184,7 @@ if(isset($_GET['searchstr']) || isset($_POST['bmsuche'])) - + diff --git a/vilesci/stammdaten/buchung_typ.php b/vilesci/stammdaten/buchung_typ.php index 33f02326e..dd699186c 100644 --- a/vilesci/stammdaten/buchung_typ.php +++ b/vilesci/stammdaten/buchung_typ.php @@ -72,7 +72,7 @@ echo ' - + diff --git a/vilesci/stammdaten/dokumentvorlagen_verwaltung.php b/vilesci/stammdaten/dokumentvorlagen_verwaltung.php index 678f4b630..7559fa43d 100644 --- a/vilesci/stammdaten/dokumentvorlagen_verwaltung.php +++ b/vilesci/stammdaten/dokumentvorlagen_verwaltung.php @@ -70,7 +70,7 @@ echo ' - + diff --git a/vilesci/stammdaten/firma_details.php b/vilesci/stammdaten/firma_details.php index e5b7f2946..b3f6981cd 100644 --- a/vilesci/stammdaten/firma_details.php +++ b/vilesci/stammdaten/firma_details.php @@ -152,7 +152,7 @@ if(isset($_GET['deletetag'])) - + diff --git a/vilesci/stammdaten/firma_detailwork.php b/vilesci/stammdaten/firma_detailwork.php index 97c57dea2..53f9a7192 100644 --- a/vilesci/stammdaten/firma_detailwork.php +++ b/vilesci/stammdaten/firma_detailwork.php @@ -230,7 +230,7 @@ if(isset($_GET['type']) && $_GET['type']=='getortcontent' && isset($_GET['plz']) - + diff --git a/vilesci/stammdaten/firma_zusammen_details.php b/vilesci/stammdaten/firma_zusammen_details.php index 41a6d0e3d..3b43e55b4 100644 --- a/vilesci/stammdaten/firma_zusammen_details.php +++ b/vilesci/stammdaten/firma_zusammen_details.php @@ -75,7 +75,7 @@ if (empty($work) ) - + diff --git a/vilesci/stammdaten/firma_zusammen_uebersicht.php b/vilesci/stammdaten/firma_zusammen_uebersicht.php index fc641ac83..3282bd35f 100644 --- a/vilesci/stammdaten/firma_zusammen_uebersicht.php +++ b/vilesci/stammdaten/firma_zusammen_uebersicht.php @@ -71,7 +71,7 @@ if ($firma->getFirmenTypen()) - + diff --git a/vilesci/stammdaten/gsprogramm.php b/vilesci/stammdaten/gsprogramm.php index 116bf5427..adbe06d5d 100644 --- a/vilesci/stammdaten/gsprogramm.php +++ b/vilesci/stammdaten/gsprogramm.php @@ -52,6 +52,7 @@ if($action=='save') $gsprogramm->bezeichnung = $_POST['bezeichnung']; $gsprogramm->gsprogrammtyp_kurzbz = $_POST['gsprogrammtyp_kurzbz']; $gsprogramm->programm_code = $_POST['programm_code']; + $gsprogramm->studienkennung_uni = $_POST['studienkennung_uni']; if($gsprogramm->save()) echo 'Daten erfolgreich gespeichert'; else @@ -82,7 +83,7 @@ echo ' - + @@ -124,6 +125,7 @@ echo '
Bezeichnung Programmcode TypStudienkennung Uni
'.$row->bezeichnung.' '.$row->programm_code.' '.(isset($typ_arr[$row->gsprogrammtyp_kurzbz])?$typ_arr[$row->gsprogrammtyp_kurzbz]:$row->gsprogrammtyp_kurzbz).''.$row->studienkennung_uni.'
StudienkennungUni + +