From ddaa129bab09adec06e9e9715406811d34fb7343 Mon Sep 17 00:00:00 2001 From: Paolo Date: Thu, 4 Jul 2019 17:25:13 +0200 Subject: [PATCH 01/23] - Removed controllers api/v1/system/CallerLibrary.php and api/v1/system/CallerModel.php - Removed library libraries/CallerLib.php --- .../api/v1/system/CallerLibrary.php | 77 ---- .../controllers/api/v1/system/CallerModel.php | 77 ---- application/libraries/CallerLib.php | 361 ------------------ 3 files changed, 515 deletions(-) delete mode 100644 application/controllers/api/v1/system/CallerLibrary.php delete mode 100644 application/controllers/api/v1/system/CallerModel.php delete mode 100644 application/libraries/CallerLib.php diff --git a/application/controllers/api/v1/system/CallerLibrary.php b/application/controllers/api/v1/system/CallerLibrary.php deleted file mode 100644 index 594786384..000000000 --- a/application/controllers/api/v1/system/CallerLibrary.php +++ /dev/null @@ -1,77 +0,0 @@ - 'admin:rw')); - - // Loads the CallerLib - $this->load->library('CallerLib'); - } - - /** - * Manages a HTTP get call - */ - public function getCall() - { - // Start me up! - $result = $this->callerlib->callLibrary($this->get()); - - // Print the result - $this->response($result, REST_Controller::HTTP_OK); - } - - /** - * @return void - */ - public function postCall() - { - // Start me up! - $result = $this->callerlib->callLibrary($this->post()); - - // Print the result - $this->response($result, REST_Controller::HTTP_OK); - } - - /** - * @return void - */ - public function putCall() - { - // Start me up! - $result = $this->callerlib->callLibrary($this->put()); - - // Print the result - $this->response($result, REST_Controller::HTTP_OK); - } - - /** - * @return void - */ - public function deleteCall() - { - // Start me up! - $result = $this->callerlib->callLibrary($this->delete()); - - // Print the result - $this->response($result, REST_Controller::HTTP_OK); - } -} diff --git a/application/controllers/api/v1/system/CallerModel.php b/application/controllers/api/v1/system/CallerModel.php deleted file mode 100644 index 68296aff8..000000000 --- a/application/controllers/api/v1/system/CallerModel.php +++ /dev/null @@ -1,77 +0,0 @@ - 'admin:rw')); - - // Loads the CallerLib - $this->load->library('CallerLib'); - } - - /** - * Manages a HTTP get call - */ - public function getCall() - { - // Start me up! - $result = $this->callerlib->callModel($this->get()); - - // Print the result - $this->response($result, REST_Controller::HTTP_OK); - } - - /** - * @return void - */ - public function postCall() - { - // Start me up! - $result = $this->callerlib->callModel($this->post()); - - // Print the result - $this->response($result, REST_Controller::HTTP_OK); - } - - /** - * @return void - */ - public function putCall() - { - // Start me up! - $result = $this->callerlib->callModel($this->put()); - - // Print the result - $this->response($result, REST_Controller::HTTP_OK); - } - - /** - * @return void - */ - public function deleteCall() - { - // Start me up! - $result = $this->callerlib->callModel($this->delete()); - - // Print the result - $this->response($result, REST_Controller::HTTP_OK); - } -} diff --git a/application/libraries/CallerLib.php b/application/libraries/CallerLib.php deleted file mode 100644 index 0b46cf0c6..000000000 --- a/application/libraries/CallerLib.php +++ /dev/null @@ -1,361 +0,0 @@ -_ci =& get_instance(); // Gets CI instance - } - - /** - * Wrapper method for _call - */ - public function callLibrary($callParameters) - { - return $this->_call($callParameters); - } - - /** - * Wrapper method for _call - */ - public function callModel($callParameters) - { - return $this->_call($callParameters); - } - - /** - * Everything starts here... - */ - private function _call($callParameters) - { - $result = null; - $parameters = $this->_getParameters($callParameters); - $validation = $this->_validateCall($parameters); - - // If the validation was passed - if (isSuccess($validation)) - { - $loaded = null; - // If the given resource is a model - if (strpos($parameters->resourceName, CallerLib::MODEL_PREFIX) !== false) - { - // Try to load the model - $result = $this->_loadModel($parameters->resourcePath, $parameters->resourceName); - if (isSuccess($result)) - { - $loaded = $result->retval; - } - } - // If the given resource is a library - elseif (strpos($parameters->resourceName, CallerLib::LIB_PREFIX) !== false) - { - // Check if the resource is already loaded, it works only with libraries and drivers - $isLoaded = $this->_ci->load->is_loaded($parameters->resourceName); - // If not loaded then load it - if ($isLoaded === false) - { - // Try to load the library - $result = $this->_loadLibrary($parameters->resourcePath, $parameters->resourceName); - if (isSuccess($result)) - { - $loaded = $result->retval; - } - } - // If it is already loaded $isLoaded contains the instance of the library - else - { - $loaded = $isLoaded; - } - } - // Wrong selection! - else - { - $result = error('Neither a lib nor model: '.$parameters->resourcePath.$parameters->resourceName); - } - - // If the resource was found and loaded - if (!is_null($loaded)) - { - $result = $this->_callThis($parameters->resourceName, $parameters->function, $parameters->parameters); - } - else - { - // Resource not loaded - } - } - else - { - $result = $validation; - } - - return $result; - } - - /** - * Gets the parameters from the http call - * Search for parameters and - * is the name of the model or of the library - * is the name of the method present in the model/library - * All the others parameters will be given to the method in the same order that - * they are present in the HTTP call - * EX: - * URL: ../system/CallerLibrary/Call?resource=&function=&=&=&= - * will call .(par1, par2, par3) - */ - private function _getParameters($parametersArray) - { - $parameters = new stdClass(); - $parameters->parameters = array(); - $count = 0; - - foreach ($parametersArray as $parameterName => $parameterValue) - { - // The name of the resource, path included - if ($parameterName == CallerLib::RESOURCE_PARAMETER) - { - // Separates the resource path from the resource name - $splittedResource = preg_split(CallerLib::REG_SPLIT_EXPR, $parameterValue); - $parameters->resourceName = $splittedResource[count($splittedResource) - 1]; - $parameters->resourcePath = str_replace($parameters->resourceName, '', $parameterValue); - } - // The name of the function - elseif ($parameterName == CallerLib::FUNCTION_PARAMETER) - { - $parameters->function = $parameterValue; - } - // It is assumed that all other parameters are the parameters to be passed to the function - // They will be passed to the function in the same order in which they are passed to - // this controller - else - { - $parameters->parameters[$count++] = $parameterValue; - } - } - - return $parameters; - } - - /** - * Validate the given parameters - */ - private function _validateCall($parameters) - { - if (!is_object($parameters)) - { - return error('Parameter is not an object'); - } - if (!isset($parameters->resourcePath)) - { - return error('Resource path is not specified'); - } - if (!isset($parameters->resourceName)) - { - return error('Resource name is not specified'); - } - if (!isset($parameters->function)) - { - return error('Function is not specified'); - } - if (!is_array($parameters->parameters)) - { - return error('Parameters are not specified'); - } - if (in_array($parameters->resourceName, CallerLib::$RESOURCES_BLACK_LIST)) - { - return error('You are trying to access to unauthorized resources'); - } - - return success('Input data are valid'); - } - - /** - * Loads a model using the given path and name - * - * NOTE: the models automatically handle the permissions - */ - private function _loadModel($resourcePath, $resourceName) - { - $loaded = null; - $result = null; - - try - { - $loaded = $this->_ci->load->model($resourcePath.$resourceName); - } - catch (Exception $e) - { - // Errors while loading the model - $result = error('Errors while loading the model: '.$e->getMessage()); - } - - if (!is_null($loaded)) - { - $result = success($loaded); - } - - return $result; - } - - /** - * Loads a library using the given path and name - * - * The method 'library' of the class CI_Loader provided by CI has some limitations, - * so to be able to check errors was used a workaround. - * It consists in: - * - Checking if the file (identified by parameters $resourcePath and $resourceName) exists - * - If exists it will be loaded using the method 'file' from CI_Loader - * - Checks if the loaded file contains a class identified by parameter $resourceName - * - * If one of the previous tests fails, it will be returned a null value - */ - private function _loadLibrary($resourcePath, $resourceName) - { - $loaded = null; - - try - { - // Gets all the configured resources paths - $packagePaths = $this->_ci->load->get_package_paths(); - // Looking for a file in every paths with the same name of the resource - $found = null; - for ($i = 0; $i < count($packagePaths) && is_null($found); $i++) - { - $file = $packagePaths[$i].CallerLib::LIBS_PATH.DIRECTORY_SEPARATOR. - $resourcePath.$resourceName.CallerLib::LIB_FILE_EXTENSION; - if (file_exists($file)) - { - $found = $file; - } - } - - // If the file was found - if (!is_null($found)) - { - // Load the file - $loaded = $this->_ci->load->file($found); - // If the resource is not present inside the file - if (!class_exists($resourceName)) - { - $loaded = null; - // Same phrase error as load->model() provided by CI - $result = error($found.' exists, but doesn\'t declare class '.$resourceName); - } - } - else - { - $loaded = null; - // Same phrase error as load->model() provided by CI - $result = error('Unable to load the requested class: '.$resourceName); - } - } - catch (Exception $e) - { - // Errors while loading the library - $result = error('Errors while loading the library: '.$e->getMessage()); - } - - if (!is_null($loaded)) - { - $result = success($loaded); - } - - return $result; - } - - /** - * Calls a method of a class with the given parameters and returns its result - * - * @param string $resourceName identifies the class name - * @param string $function identifies the method name - * @param array $parameters contains the parameters to be passed to the method - */ - private function _callThis($resourceName, $function, $parameters) - { - $result = null; - - try - { - // Get informations about the function - $reflectionMethod = new ReflectionMethod($resourceName, $function); - // If the number of given parameters is greater or equal to the number of - // parameters required by the function - if (count($parameters) >= $reflectionMethod->getNumberOfRequiredParameters()) - { - // If the function is static - if ($reflectionMethod->isStatic() === true) - { - $classMethod = $resourceName.'::'.$function; - } - // If the function is not static - else - { - $classMethod = array(new $resourceName(), $function); - } - - // If the resource's function is callable - if (is_callable($classMethod)) - { - // Call resource->function() - // @ was applied to prevent really ugly and unmanageable errors - $resultCall = @call_user_func_array($classMethod, $parameters); - // If errors occurred while running it - // NOTE: if the called function via call_user_func_array returns a boolean set as false, - // it will be recognized like a running error. A little bit tricky ;) - if ($resultCall === false) - { - $result = error('Error running '.$resourceName.'->'.$function.'()'); - } - // Returns the result of resource->function() - else - { - $result = success($resultCall); - } - } - else - { - $result = error($resourceName.'->'.$function.'() is not callable!'); - } - } - else - { - $result = error( - 'Number of required parameters: '.$reflectionMethod->getNumberOfRequiredParameters().'. Given: '.count($parameters) - ); - } - } - catch (Exception $e) - { - $result = error($e->getMessage()); - } - - return $result; - } -} From ff858a495d97b8b8af29ac2a96e05d70044e81a0 Mon Sep 17 00:00:00 2001 From: Paolo Date: Wed, 28 Aug 2019 17:26:41 +0200 Subject: [PATCH 02/23] - Added new core controller JOB_Controller - Added new webservicetyp_kurzbz "job" to table system.tbl_webservicetyp in system/dbupdate_3.3.php - Added new filter "All jobs viewer" - Added new __construct to LogLib to set properties - Added new public methods logInfoDB, logDebugDB, logWarningDB and logErrorDB to LogLib - Added new private method _logDB to LogLib - Renamed LogLib private method _format to _getPrefix - Added new private method _getDatabaseDescription to LogLib - Changed method _getCaller to use different levels of debug_backtrace - Added new properties and constants to LogLib to log to the database --- application/core/APIv1_Controller.php | 4 +- application/core/Auth_Controller.php | 7 +- application/core/CLI_Controller.php | 5 +- application/core/DB_Model.php | 5 + application/core/FHC_Controller.php | 7 +- application/core/FS_Model.php | 7 +- application/core/JOB_Controller.php | 92 ++++++++ application/libraries/LogLib.php | 210 +++++++++++++++--- .../models/system/Webservicelog_model.php | 3 +- public/css/FilterWidget.css | 16 ++ system/dbupdate_3.3.php | 14 ++ system/filtersupdate.php | 24 +- 12 files changed, 355 insertions(+), 39 deletions(-) create mode 100644 application/core/JOB_Controller.php diff --git a/application/core/APIv1_Controller.php b/application/core/APIv1_Controller.php index 6432c87db..b0c98c6e5 100644 --- a/application/core/APIv1_Controller.php +++ b/application/core/APIv1_Controller.php @@ -1,9 +1,11 @@ load->library('LogLib', array( + 'classIndex' => 5, + 'functionIndex' => 5, + 'lineIndex' => 4, + 'dbLogType' => 'job', // required + 'dbExecuteUser' => 'Cronjob system' + )); + } + + //------------------------------------------------------------------------------------------------------------------ + // Protected methods + + /** + * Writes a cronjob info log + */ + protected function logInfo($response, $parameters = null) + { + $this->_log(LogLib::INFO, 'Cronjob info', $response, $parameters); + } + + /** + * Writes a cronjob debug log + */ + protected function logDebug($response, $parameters = null) + { + $this->_log(LogLib::DEBUG, 'Cronjob debug', $response, $parameters); + } + + /** + * Writes a cronjob warning log + */ + protected function logWarning($response, $parameters = null) + { + $this->_log(LogLib::WARNING, 'Cronjob warning', $response, $parameters); + } + + /** + * Writes a cronjob error log + */ + protected function logError($response, $parameters = null) + { + $this->_log(LogLib::ERROR, 'Cronjob error', $response, $parameters); + } + + //------------------------------------------------------------------------------------------------------------------ + // Private methods + + /** + * Writes a log to database + */ + private function _log($level, $requestId, $response, $parameters) + { + $data = new stdClass(); + + $data->response = $response; + if ($parameters != null) $data->parameters = $parameters; + + switch($level) + { + case LogLib::INFO: + $this->loglib->logInfoDB($requestId, json_encode(success($data, LogLib::INFO))); + break; + case LogLib::DEBUG: + $this->loglib->logDebugDB($requestId, json_encode(success($data, LogLib::DEBUG))); + break; + case LogLib::WARNING: + $this->loglib->logWarningDB($requestId, json_encode(error($data, LogLib::WARNING))); + break; + case LogLib::ERROR: + $this->loglib->logErrorDB($requestId, json_encode(error($data, LogLib::ERROR))); + break; + } + } +} diff --git a/application/libraries/LogLib.php b/application/libraries/LogLib.php index cb0541003..b98575150 100644 --- a/application/libraries/LogLib.php +++ b/application/libraries/LogLib.php @@ -1,102 +1,252 @@ '; const LINE_SEPARATOR = ':'; - // -------------------------------------------------------------------------------------------------------------- - // Public methods + // CodeIgniter configuration log entry name and log debug value + const CI_LOG_THRESHOLD_NAME = 'log_threshold'; + const CI_LOG_THRESHOLD_DEBUG = 2; + + // LogLib parameters names + const P_NAME_CLASS_INDEX = 'classIndex'; + const P_NAME_FUNCTION_INDEX = 'functionIndex'; + const P_NAME_LINE_INDEX = 'lineIndex'; + const P_NAME_DB_LOG_TYPE = 'dbLogType'; + const P_NAME_DB_EXECUTE_USER = 'dbExecuteUser'; + + // Properties used to retrieve caller data + private $_classIndex; + private $_functionIndex; + private $_lineIndex; + + // Properties used when logging to database + private $_dbLogType; + private $_dbExecuteUser; /** - * logDebug + * Set properties to a default value or overwrites them with the given parameters + */ + public function __construct($params = null) + { + // Properties default values + $this->_classIndex = self::CLASS_INDEX; + $this->_functionIndex = self::FUNCTION_INDEX; + $this->_lineIndex = self::LINE_INDEX; + $this->_dbLogType = null; + $this->_dbExecuteUser = self::DB_EXECUTE_USER; + + // If parameters are given then overwrite the default values + if (!isEmptyArray($params)) + { + if (isset($params[self::P_NAME_CLASS_INDEX])) $this->_classIndex = $params[self::P_NAME_CLASS_INDEX]; + if (isset($params[self::P_NAME_FUNCTION_INDEX])) $this->_functionIndex = $params[self::P_NAME_FUNCTION_INDEX]; + if (isset($params[self::P_NAME_LINE_INDEX])) $this->_lineIndex = $params[self::P_NAME_LINE_INDEX]; + if (isset($params[self::P_NAME_DB_LOG_TYPE])) $this->_dbLogType = $params[self::P_NAME_DB_LOG_TYPE]; + if (isset($params[self::P_NAME_DB_EXECUTE_USER])) $this->_dbExecuteUser = $params[self::P_NAME_DB_EXECUTE_USER]; + } + } + + // -------------------------------------------------------------------------------------------------------------- + // Public methods based on CodeIgniter log system + + /** + * Writes a debug log to CodeIgniter log */ public function logDebug($message) { - $this->_log(LogLib::DEBUG, $message); + $this->_log(self::DEBUG, $message); } /** - * logInfo + * Writes an info log to CodeIgniter log */ public function logInfo($message) { - $this->_log(LogLib::INFO, $message); + $this->_log(self::INFO, $message); } /** - * logError + * Writes an error log to CodeIgniter log */ public function logError($message) { - $this->_log(LogLib::ERROR, $message); + $this->_log(self::ERROR, $message); + } + + // -------------------------------------------------------------------------------------------------------------- + // Public methods based on database + + /** + * Writes an info log to database + */ + public function logInfoDB($requestId, $data) + { + $this->_logDB(self::INFO, $requestId, $data); + } + + /** + * Writes a debug log to database + */ + public function logDebugDB($requestId, $data) + { + $this->_logDB(self::DEBUG, $requestId, $data); + } + + /** + * Writes an warning log to database + */ + public function logWarningDB($requestId, $data) + { + $this->_logDB(self::WARNING, $requestId, $data); + } + + /** + * Writes an error log to database + */ + public function logErrorDB($requestId, $data) + { + $this->_logDB(self::ERROR, $requestId, $data); } // -------------------------------------------------------------------------------------------------------------- // Private methods /** - * log + * Writes using CodeIgniter log system (file system) */ private function _log($level, $message) { - log_message($level, $this->_getCaller().$message); + log_message($level, $this->_getPrefix($this->_getCaller()).$message); } /** - * _getCaller + * Writes logs to database + */ + private function _logDB($level, $requestId, $data) + { + // If the _dbLogType parameter was not given when this library was loaded + // NOTE: this message will be displayed only to the developer AND stops the execution + if ($this->_dbLogType == null) + { + show_error('To log to database you need to specify the "'.self::P_NAME_DB_LOG_TYPE.'" parameter when the LogLib is loaded'); + } + + $ci =& get_instance(); // get code igniter instance + + // If only debug log is enabed then is possible to write a debug log, otherwise... + if ($level == self::DEBUG && $ci->config->item(self::CI_LOG_THRESHOLD_NAME) != self::CI_LOG_THRESHOLD_DEBUG) + { + // ...do nothing + } + else + { + // Loads WebservicelogModel + $ci->load->model('system/Webservicelog_model', 'WebservicelogModel'); + + // Get caller data + $callerData = $this->_getCaller(); + + // Writes a log to database + $ci->WebservicelogModel->insert(array( + 'webservicetyp_kurzbz' => $this->_dbLogType, + 'request_id' => $requestId, + 'beschreibung' => $this->_getDatabaseDescription($callerData), + 'request_data' => $data, + 'execute_user' => $this->_dbExecuteUser, + 'execute_time' => 'NOW()' // current time + )); + } + } + + /** + * Retrieves caller's data */ private function _getCaller() { - $classIndex = 3; - $functionIndex = 3; - $lineIndex = 2; $class = ''; $function = ''; $line = ''; $backtrace_arr = debug_backtrace(); - if (isset($backtrace_arr[$classIndex]['class']) && $backtrace_arr[$classIndex]['class'] != '') + + if (isset($backtrace_arr[$this->_classIndex]['class']) && $backtrace_arr[$this->_classIndex]['class'] != '') { - $class = $backtrace_arr[$classIndex]['class']; + $class = $backtrace_arr[$this->_classIndex]['class']; } - if (isset($backtrace_arr[$functionIndex]['function']) && $backtrace_arr[$functionIndex]['function'] != '') + if (isset($backtrace_arr[$this->_functionIndex]['function']) && $backtrace_arr[$this->_functionIndex]['function'] != '') { - $function = $backtrace_arr[$functionIndex]['function']; + $function = $backtrace_arr[$this->_functionIndex]['function']; } - if (isset($backtrace_arr[$lineIndex]['line']) && $backtrace_arr[$lineIndex]['line'] != '') + if (isset($backtrace_arr[$this->_lineIndex]['line']) && $backtrace_arr[$this->_lineIndex]['line'] != '') { - $line = $backtrace_arr[$lineIndex]['line']; + $line = $backtrace_arr[$this->_lineIndex]['line']; } - return $this->_format($class, $function, $line); + return array( + self::CLASS_NAME => $class, + self::FUNCTION_NAME => $function, + self::CODE_LINE => $line + ); } /** - * format + * Formats the log message prefix (file system based) */ - private function _format($class, $function, $line) + private function _getPrefix($callerData) { - $formatted = LogLib::CALLER_PREFIX; + $formatted = self::CALLER_PREFIX; - if (!is_null($class) && $class != '') + if (!isEmptyString($callerData[self::CLASS_NAME])) { - $formatted .= $class.LogLib::CLASS_POSTFIX; + $formatted .= $callerData[self::CLASS_NAME].self::CLASS_POSTFIX; } - $formatted .= $function.LogLib::LINE_SEPARATOR.$line.LogLib::CALLER_POSTFIX.' '; + $formatted .= $callerData[self::FUNCTION_NAME].self::LINE_SEPARATOR.$callerData[self::CODE_LINE].self::CALLER_POSTFIX.' '; + + return $formatted; + } + + /** + * Formats the database description for a log + */ + private function _getDatabaseDescription($callerData) + { + $formatted = $callerData[self::FUNCTION_NAME].self::LINE_SEPARATOR.$callerData[self::CODE_LINE]; + + if (!isEmptyString($callerData[self::CLASS_NAME])) + { + $formatted = $callerData[self::CLASS_NAME].self::CLASS_POSTFIX.$formatted; + } return $formatted; } diff --git a/application/models/system/Webservicelog_model.php b/application/models/system/Webservicelog_model.php index dc45b13a7..a5b23a396 100644 --- a/application/models/system/Webservicelog_model.php +++ b/application/models/system/Webservicelog_model.php @@ -1,13 +1,14 @@ dbTable = 'system.tbl_webservicelog'; $this->pk = 'webservicelog_id'; } diff --git a/public/css/FilterWidget.css b/public/css/FilterWidget.css index 295dff8ec..5254268c7 100644 --- a/public/css/FilterWidget.css +++ b/public/css/FilterWidget.css @@ -113,3 +113,19 @@ #applyFilter, #saveCustomFilterButton { width: 100px; } + +.text-red { + color: red; +} + +.text-orange { + color: orange; +} + +.text-blue { + color: blue; +} + +.text-green { + color: green; +} diff --git a/system/dbupdate_3.3.php b/system/dbupdate_3.3.php index 4e720daef..1947debdb 100644 --- a/system/dbupdate_3.3.php +++ b/system/dbupdate_3.3.php @@ -3030,6 +3030,20 @@ if(!$result = @$db->db_query("SELECT stufe FROM public.tbl_dokumentstudiengang L echo '
public.tbl_dokumentstudiengang: Spalte stufe hinzugefuegt'; } +// Add new webservice type in system.tbl_webservicetyp +if ($result = @$db->db_query("SELECT 1 FROM system.tbl_webservicetyp WHERE webservicetyp_kurzbz = 'job';")) +{ + if ($db->db_num_rows($result) == 0) + { + $qry = "INSERT INTO system.tbl_webservicetyp(webservicetyp_kurzbz, beschreibung) VALUES('job', 'Cronjob');"; + + if (!$db->db_query($qry)) + echo 'system.tbl_webservicetyp '.$db->db_last_error().'
'; + else + echo ' system.tbl_webservicetyp: Added webservice type "job"
'; + } +} + // *** Pruefung und hinzufuegen der neuen Attribute und Tabellen echo '

Pruefe Tabellen und Attribute!

'; diff --git a/system/filtersupdate.php b/system/filtersupdate.php index 413b821af..2d1789774 100644 --- a/system/filtersupdate.php +++ b/system/filtersupdate.php @@ -353,7 +353,7 @@ $filters = array( {"name": "fakultaet"}, {"name": "datum"}, {"name": "uhrzeit"}, - {"name": "anmeldefrist"}, + {"name": "anmeldefrist"}, {"name": "oeffentlich"}, {"name": "studiengaenge"}, {"name": "freie_plaetze"}, @@ -460,6 +460,28 @@ $filters = array( } ', 'oe_kurzbz' => null, + ), + array( + 'app' => 'core', + 'dataset_name' => 'jobslogs', + 'filter_kurzbz' => 'all', + 'description' => '{All logs produced by jobs}', + 'sort' => 1, + 'default_filter' => true, + 'filter' => ' + { + "name": "All jobs viewer", + "columns": [ + {"name": "RequestId"}, + {"name": "ExecutionTime"}, + {"name": "ExecutedBy"}, + {"name": "Description"}, + {"name": "Data"} + ], + "filters": [] + } + ', + 'oe_kurzbz' => null, ) ); From 562e509875131e55843b3bebe34540fd60e08447 Mon Sep 17 00:00:00 2001 From: alex Date: Fri, 6 Sep 2019 16:31:01 +0200 Subject: [PATCH 03/23] - added tbl_variablenname table, which is referenced by tbl_variable for storing available Variables and their defaults --- system/dbupdate_3.3.php | 54 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/system/dbupdate_3.3.php b/system/dbupdate_3.3.php index 4e720daef..66504cd5a 100644 --- a/system/dbupdate_3.3.php +++ b/system/dbupdate_3.3.php @@ -3030,6 +3030,59 @@ if(!$result = @$db->db_query("SELECT stufe FROM public.tbl_dokumentstudiengang L echo '
public.tbl_dokumentstudiengang: Spalte stufe hinzugefuegt'; } +// Create TABLE public.tbl_variablenname +if(!@$db->db_query("SELECT 0 FROM public.tbl_variablenname WHERE 0 = 1")) { + $qry = ' + CREATE TABLE public.tbl_variablenname + ( + name varchar(64) NOT NULL constraint pk_tbl_variablenname primary key, + defaultwert varchar(64) + ); + COMMENT ON TABLE public.tbl_variablenname IS \'Namen aller benutzerdefinierten Variablen\'; + + INSERT INTO public.tbl_variablenname (name, defaultwert) VALUES (\'termin_export_db_stpl_table\', null); + INSERT INTO public.tbl_variablenname (name, defaultwert) VALUES (\'sleep_time\', null); + INSERT INTO public.tbl_variablenname (name, defaultwert) VALUES (\'semester_aktuell\', null); + INSERT INTO public.tbl_variablenname (name, defaultwert) VALUES (\'reihungstestverwaltung_punkteberechnung\', null); + INSERT INTO public.tbl_variablenname (name, defaultwert) VALUES (\'number_displayed_past_studiensemester\', null); + INSERT INTO public.tbl_variablenname (name, defaultwert) VALUES (\'max_kollision\', \'0\'); + INSERT INTO public.tbl_variablenname (name, defaultwert) VALUES (\'locale\', \'de-AT\'); + INSERT INTO public.tbl_variablenname (name, defaultwert) VALUES (\'kontofilterstg\', \'false\'); + INSERT INTO public.tbl_variablenname (name, defaultwert) VALUES (\'kollision_student\', \'false\'); + INSERT INTO public.tbl_variablenname (name, defaultwert) VALUES (\'infocenter_studiensemester\', null); + INSERT INTO public.tbl_variablenname (name, defaultwert) VALUES (\'ignore_zeitsperre\', \'false\'); + INSERT INTO public.tbl_variablenname (name, defaultwert) VALUES (\'ignore_reservierung\', \'false\'); + INSERT INTO public.tbl_variablenname (name, defaultwert) VALUES (\'ignore_kollision\', \'false\'); + INSERT INTO public.tbl_variablenname (name, defaultwert) VALUES (\'fas_id\', null); + INSERT INTO public.tbl_variablenname (name, defaultwert) VALUES (\'fasfunktionfilter\', \'alle\'); + INSERT INTO public.tbl_variablenname (name, defaultwert) VALUES (\'emailadressentrennzeichen\', null); + INSERT INTO public.tbl_variablenname (name, defaultwert) VALUES (\'db_stpl_table\', \'stundenplan\'); + INSERT INTO public.tbl_variablenname (name, defaultwert) VALUES (\'allow_lehrstunde_drop\', \'false\'); + INSERT INTO public.tbl_variablenname (name, defaultwert) VALUES (\'alle_unr_mitladen\', \'false\'); + + ALTER TABLE public.tbl_variable ADD CONSTRAINT variablenname_variable FOREIGN KEY (name) REFERENCES public.tbl_variablenname(name) ON UPDATE CASCADE ON DELETE RESTRICT; + '; + + if (!$db->db_query($qry)) + echo 'public.tbl_variablenname ' . $db->db_last_error() . '
'; + else + echo '
Created public.tbl_variablenname'; + + // GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE public.tbl_variablenname TO web; + $qry = 'GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE public.tbl_variablenname TO web;'; + if (!$db->db_query($qry)) + echo 'public.tbl_variablenname ' . $db->db_last_error() . '
'; + else + echo '
Granted privileges to web on public.tbl_variablenname'; + + // GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE public.tbl_variablenname TO vilesci; + $qry = 'GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE public.tbl_variablenname TO vilesci;'; + if (!$db->db_query($qry)) + echo 'public.tbl_variablenname ' . $db->db_last_error() . '
'; + else + echo '
Granted privileges to vilesci on public.tbl_variablenname'; +} + // *** Pruefung und hinzufuegen der neuen Attribute und Tabellen echo '

Pruefe Tabellen und Attribute!

'; @@ -3258,6 +3311,7 @@ $tabellen=array( "public.tbl_studiensemester" => array("studiensemester_kurzbz","bezeichnung","start","ende","studienjahr_kurzbz","ext_id","beschreibung","onlinebewerbung"), "public.tbl_tag" => array("tag"), "public.tbl_variable" => array("name","uid","wert"), + "public.tbl_variablenname" => array("name","defaultwert"), "public.tbl_vorlage" => array("vorlage_kurzbz","bezeichnung","anmerkung","mimetype","attribute","archivierbar","signierbar","stud_selfservice","dokument_kurzbz"), "public.tbl_vorlagedokument" => array("vorlagedokument_id","sort","vorlagestudiengang_id","dokument_kurzbz"), "public.tbl_vorlagestudiengang" => array("vorlagestudiengang_id","vorlage_kurzbz","studiengang_kz","version","text","oe_kurzbz","style","berechtigung","anmerkung_vorlagestudiengang","aktiv","sprache","subject","orgform_kurzbz"), From 36ff38b0eec4888b7e4d5904528a4470c19cf9ef Mon Sep 17 00:00:00 2001 From: alex Date: Fri, 6 Sep 2019 17:29:22 +0200 Subject: [PATCH 04/23] - FilterWidget: added method reloadDataset() for reload of dataset only --- application/controllers/system/Filters.php | 10 ++++++++++ application/libraries/FiltersLib.php | 8 ++++++++ public/js/FilterWidget.js | 23 +++++++++++++++++++--- 3 files changed, 38 insertions(+), 3 deletions(-) diff --git a/application/controllers/system/Filters.php b/application/controllers/system/Filters.php index 3bdb6dde2..b29bd2bb0 100644 --- a/application/controllers/system/Filters.php +++ b/application/controllers/system/Filters.php @@ -216,6 +216,16 @@ class Filters extends FHC_Controller $this->outputJsonSuccess('Success'); } + /** + * Reloads the dataset + */ + public function reloadDataset() + { + $this->filterslib->reloadDataset(); + + $this->outputJsonSuccess('Success'); + } + //------------------------------------------------------------------------------------------------------------------ // Private methods diff --git a/application/libraries/FiltersLib.php b/application/libraries/FiltersLib.php index 6346150d8..6875d16ec 100644 --- a/application/libraries/FiltersLib.php +++ b/application/libraries/FiltersLib.php @@ -528,6 +528,14 @@ class FiltersLib return $applyFilters; } + /** + * Reloads dataset by setting session variable to true + */ + public function reloadDataset() + { + $this->setSessionElement(self::SESSION_RELOAD_DATASET, true); + } + /** * Add a filter (SQL where clause) to be applied to the current filter */ diff --git a/public/js/FilterWidget.js b/public/js/FilterWidget.js index 767cd228a..6aad74562 100644 --- a/public/js/FilterWidget.js +++ b/public/js/FilterWidget.js @@ -92,7 +92,7 @@ var FHC_FilterWidget = { }, /** - * Alias call to method display only to inprove the readability of the code + * Alias call to method display only to improve the readability of the code */ refresh: function() { @@ -100,13 +100,30 @@ var FHC_FilterWidget = { }, /** - * To retrive the page where the FilterWidget is used, using the FHC_JS_DATA_STORAGE_OBJECT + * To retrieve the page where the FilterWidget is used, using the FHC_JS_DATA_STORAGE_OBJECT */ getFilterPage: function() { return FHC_JS_DATA_STORAGE_OBJECT.called_path + "/" + FHC_JS_DATA_STORAGE_OBJECT.called_method; }, + /** + * Reload of dataset, also reloads page to show changes + */ + reloadDataset: function() { + FHC_AjaxClient.ajaxCallPost( + "system/Filters/reloadDataset", + { + filter_page: FHC_FilterWidget.getFilterPage() + }, + { + successCallback: function(data, textStatus, jqXHR) { + FHC_FilterWidget._failOrReload(data); + } + } + ); + }, + //------------------------------------------------------------------------------------------------------------------ // Private methods @@ -197,7 +214,7 @@ var FHC_FilterWidget = { }, /** - * This method calls all the other methods needed to rendere the GUI for a FilterWidget + * This method calls all the other methods needed to render the GUI for a FilterWidget * The parameter data contains all the data about the FilterWidget and it is given as parameter * to all the methods that here are called * NOTE: think very carefully before changing the order of the calls From 67415a47077ce997967793cdb54e451c6392555c Mon Sep 17 00:00:00 2001 From: alex Date: Fri, 6 Sep 2019 17:33:56 +0200 Subject: [PATCH 05/23] =?UTF-8?q?-=20possible=20to=20read=20and=20write=20?= =?UTF-8?q?user=20Variables=20in=20Codeigniter=20-=20added=20Variablenname?= =?UTF-8?q?=5Fmodel,=20VariableLib,=20Variables=20controller=20-=20Infocen?= =?UTF-8?q?ter=20=C3=9Cbersicht=20-=20infocenterData,=20infocenterFreigege?= =?UTF-8?q?benData,=20infocenterReihungstestAbsolviertData:=20added=20poss?= =?UTF-8?q?ibility=20of=20toggle=20of=20infocenter=5Fstudiensemester=20var?= =?UTF-8?q?iable,=20only=20prestudents=20of=20selected=20Studiensemester?= =?UTF-8?q?=20are=20shown?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/system/Variables.php | 78 +++++++++++ .../system/infocenter/InfoCenter.php | 2 + application/libraries/VariableLib.php | 131 ++++++++++++++++++ application/models/system/Variable_model.php | 87 ++++++++++++ .../models/system/Variablenname_model.php | 78 +++++++++++ .../views/system/infocenter/infocenter.php | 2 +- .../system/infocenter/infocenterData.php | 20 +-- .../infocenter/infocenterFreigegeben.php | 2 +- .../infocenter/infocenterFreigegebenData.php | 5 +- .../infocenterReihungstestAbsolviert.php | 2 +- .../infocenterReihungstestAbsolviertData.php | 3 +- .../infocenter/infocenterPersonDataset.css | 7 + .../js/infocenter/infocenterPersonDataset.js | 94 ++++++++++++- 13 files changed, 485 insertions(+), 26 deletions(-) create mode 100644 application/controllers/system/Variables.php create mode 100644 application/libraries/VariableLib.php create mode 100644 application/models/system/Variablenname_model.php create mode 100644 public/css/infocenter/infocenterPersonDataset.css diff --git a/application/controllers/system/Variables.php b/application/controllers/system/Variables.php new file mode 100644 index 000000000..20303118b --- /dev/null +++ b/application/controllers/system/Variables.php @@ -0,0 +1,78 @@ + 'basis/variable:rw', + 'getVar' => 'basis/variable:rw', + 'changeStudiensemesterVar' => 'basis/variable:rw' + ) + ); + + $this->load->model('system/variable_model', 'VariableModel'); + + $this->_setAuthUID(); + + $this->load->library('VariableLib', array('uid' => $this->_uid)); + } + + /** + * Sets a user variable based on received post parameters, outputs JSON response. + */ + public function setVar() + { + $name = $this->input->post('name'); + $wert = $this->input->post('wert'); + + $result = $this->VariableModel->setVariable($this->_uid, $name, $wert); + + $this->outputJson($result); + } + + /** + * gets a user variable based on received post parameter, outputs JSON response. + */ + public function getVar() + { + $name = $this->input->get('name'); + $this->outputJson($this->VariableModel->getVariables($this->_uid, array($name))); + } + + /** + * Changes a user variable containing a Studiensemester based on received post parameters, outputs JSON response. + */ + public function changeStudiensemesterVar() + { + $name = $this->input->post('name'); + $change = $this->input->post('change'); + + $result = $this->variablelib->changeStudiensemesterVar($this->_uid, $name, $change); + + $this->outputJson($result); + } + + /** + * Retrieve the UID of the logged user and checks if it is valid + */ + private function _setAuthUID() + { + $this->_uid = getAuthUID(); + + if (!$this->_uid) show_error('User authentification failed'); + } +} diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index d59c058cf..c803520ed 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -136,6 +136,8 @@ class InfoCenter extends Auth_Controller $this->_setAuthUID(); // sets property uid + $this->load->library('VariableLib', array('uid' => $this->_uid)); + $this->setControllerId(); // sets the controller id } diff --git a/application/libraries/VariableLib.php b/application/libraries/VariableLib.php new file mode 100644 index 000000000..3d732984f --- /dev/null +++ b/application/libraries/VariableLib.php @@ -0,0 +1,131 @@ +_ci =& get_instance(); + + $this->_variables = null; + + $this->_ci->load->model('system/Variable_model', 'VariableModel'); + $this->_ci->load->model('organisation/studiensemester_model', 'StudiensemesterModel'); + + if (isset($loggeduid['uid']) && !isEmptyString($loggeduid['uid'])) + $this->_setVariables($loggeduid['uid']); + else + { + show_error('uid of logged user not passed!'); + } + } + + /** + * Gets an already loaded user variable by variable name. + * @param $name + * @return mixed|null + */ + public function getVar($name) + { + return isset($this->_variables[$name]) ? $this->_variables[$name] : null; + } + + /** + * Changes variables having Studiensemester as value. Sets variable value to next or previous Semester. + * @param $uid variable is set for this user + * @param $name variable name + * @param $change if positive, variable value is set to next semester, negative - previous semester + * @return array if change was successfull, uid and variable name. Infotext otherwise. + */ + public function changeStudiensemesterVar($uid, $name, $change) + { + $result = error('error when setting variable!'); + $notchangedtext = "Studiensemester variable not changed."; + + if (!isEmptyString($uid) && !isEmptyString($name) && is_numeric($change)) + { + $change = (int) $change; + $varres = $this->_ci->VariableModel->getVariables($uid, array($name)); + + if (isSuccess($varres)) + { + if (hasData($varres)) + { + $currStudiensemester = getData($varres); + + if ($change === 0) + { + $result = success($notchangedtext); + } + else + { + if ($change > 0) + { + $changedsem = $this->_ci->StudiensemesterModel->getNextFrom($currStudiensemester[$name]); + } + elseif ($change < 0) + { + $changedsem = $this->_ci->StudiensemesterModel->getPreviousFrom($currStudiensemester[$name]); + } + + if (hasData($changedsem)) + { + $changedsem = getData($changedsem); + + $result = $this->_ci->VariableModel->setVariable($uid, $name, $changedsem[0]->studiensemester_kurzbz); + //update property + $this->_setVariable($uid, $name); + } + else + { + $result = success($notchangedtext); + } + } + } + } + } + return $result; + } + + /** + * "Refreshes" variable value with given name by retrieving current value from db and saving it. + * @param $uid + * @param $name + */ + private function _setVariable($uid, $name) + { + $variable = $this->_ci->VariableModel->getVariables($uid, array($name)); + + if (hasData($variable)) + { + $variable = getData($variable); + $this->_variables[$name] = $variable[$name]; + } + } + + /** + * "Refreshes" all variable values by retrieving current values from db and saving them. + * @param $uid + */ + private function _setVariables($uid) + { + $variables = $this->_ci->VariableModel->getVariables($uid); + if (hasData($variables)) + { + $this->_variables = getData($variables); + } + } +} diff --git a/application/models/system/Variable_model.php b/application/models/system/Variable_model.php index 9800999fe..1fcb5b274 100644 --- a/application/models/system/Variable_model.php +++ b/application/models/system/Variable_model.php @@ -10,5 +10,92 @@ class Variable_model extends DB_Model parent::__construct(); $this->dbTable = 'public.tbl_variable'; $this->pk = array('uid', 'name'); + $this->hasSequence = false; + + $this->load->model('system/Variablenname_model', 'VariablennameModel'); + } + + /** + * Gets user variables and values for a uid. + * If no value found in tbl_variable, default as defined in variablename_model is retrieved. + * @param $uid + * @param null $names optionally get only certain variables + * @return array + */ + public function getVariables($uid, $names = null) + { + if (isEmptyString($uid) || (isset($names) && !is_array($names))) + $result = error('wrong parameters passed'); + else + { + $vardata = array(); + + $qry = "SELECT name, wert FROM public.tbl_variable WHERE uid = ?"; + + if (isset($names)) + { + $qry .= " AND name IN ('".implode(',', $names)."')"; + } + $qry .= ";"; + + $varresults = $this->execQuery($qry, array($uid)); + + if (hasData($varresults)) + { + $varresults = getData($varresults); + foreach ($varresults as $varresult) + { + if (isset($varresult->wert)) + $vardata[$varresult->name] = $varresult->wert; + } + } + + $vardefaults = $this->VariablennameModel->getDefaults($names); + + if (hasData($vardefaults)) + { + $vardefaults = getData($vardefaults); + + + foreach ($vardefaults as $vardefault) + { + if (!isset($vardata[$vardefault->name]) && isset($vardefault->defaultwert)) + { + $vardata[$vardefault->name] = $vardefault->defaultwert; + } + } + } + $result = success($vardata); + } + + return $result; + } + + /** + * Sets a variable value for a uid. Adds new entry if not present, updates entry otherwise. + * @param $uid + * @param $name + * @param $wert + * @return array + */ + public function setVariable($uid, $name, $wert) + { + $result = error('error when setting variable!'); + if (!isEmptyString($uid) && !isEmptyString($name) && !isEmptyString($wert)) + { + $varres = $this->loadWhere(array('uid' => $uid, 'name' => $name)); + + if (isSuccess($varres)) + { + if (hasData($varres)) + { + $result = $this->VariableModel->update(array('uid' => $uid, 'name' => $name), array('wert' => $wert)); + } + else + $result = $this->VariableModel->insert(array('uid' => $uid, 'name' => $name, 'wert' => $wert)); + } + } + + return $result; } } diff --git a/application/models/system/Variablenname_model.php b/application/models/system/Variablenname_model.php new file mode 100644 index 000000000..ada1d330c --- /dev/null +++ b/application/models/system/Variablenname_model.php @@ -0,0 +1,78 @@ + 'SELECT studiensemester_kurzbz FROM public.tbl_studiensemester WHERE ende>now() ORDER BY start LIMIT 1', + 'infocenter_studiensemester' => 'SELECT studiensemester_kurzbz FROM ( + SELECT DISTINCT ON (studienjahr_kurzbz) start, studiensemester_kurzbz + FROM public.tbl_studiensemester + ORDER BY studienjahr_kurzbz, start + ) sem + WHERE start > now() + LIMIT 1;' + ); + + /** + * Constructor + */ + public function __construct() + { + parent::__construct(); + $this->dbTable = 'public.tbl_variablenname'; + $this->pk ='name'; + } + + /** + * Gets defaults for user variables. + * If no default value present in table, SQL can be executed for retrieving the value. + * @param null $names optionally get only defaults for certain variables + * @return array + */ + public function getDefaults($names = null) + { + $defaults = array(); + + $qry = "SELECT name, defaultwert FROM public.tbl_variablenname"; + + if (isset($names) && is_array($names)) + { + $qry .= " WHERE name IN ('".implode(',', $names)."')"; + } + $qry .= ";"; + + $defaultsres = $this->execQuery($qry); + + if (hasData($defaultsres)) + { + $defaults = getData($defaultsres); + + foreach ($defaults as $default) + { + if (!isset($default->defaultwert)) + { + if (isset($this->_dynamic_defaults[$default->name])) + { + $dyndefault = $this->execQuery($this->_dynamic_defaults[$default->name]); + if (hasData($dyndefault)) + { + $dyndefault = getData($dyndefault); + + if (count($dyndefault) === 1) + { + foreach ($dyndefault[0] as $value) + { + $default->defaultwert = $value; + break; + } + } + } + } + } + } + } + + return success($defaults); + } +} diff --git a/application/views/system/infocenter/infocenter.php b/application/views/system/infocenter/infocenter.php index ebc99ba93..4005518a1 100644 --- a/application/views/system/infocenter/infocenter.php +++ b/application/views/system/infocenter/infocenter.php @@ -18,7 +18,7 @@ 'global' => array('mailAnXversandt'), 'ui' => array('bitteEintragWaehlen') ), - 'customCSSs' => 'public/css/sbadmin2/tablesort_bootstrap.css', + 'customCSSs' => array('public/css/sbadmin2/tablesort_bootstrap.css', 'public/css/infocenter/infocenterPersonDataset.css'), 'customJSs' => array('public/js/bootstrapper.js', 'public/js/infocenter/infocenterPersonDataset.js') ) ); diff --git a/application/views/system/infocenter/infocenterData.php b/application/views/system/infocenter/infocenterData.php index d888f6cd7..6dd0ee957 100644 --- a/application/views/system/infocenter/infocenterData.php +++ b/application/views/system/infocenter/infocenterData.php @@ -11,16 +11,9 @@ $STATUS_KURZBZ = '\'Wartender\', \'Bewerber\', \'Aufgenommener\', \'Student\''; $ADDITIONAL_STG = '10021,10027'; $AKTE_TYP = '\'identity\', \'zgv_bakk\''; + $STUDIENSEMESTER = '\''.$this->variablelib->getVar('infocenter_studiensemester').'\''; $query = ' - WITH currentOrNextStudiensemester AS ( - SELECT ss.studiensemester_kurzbz - FROM public.tbl_studiensemester ss - WHERE ss.ende > NOW() - ORDER BY ss.ende - LIMIT 3 - ) - SELECT p.person_id AS "PersonId", p.vorname AS "Vorname", @@ -100,7 +93,7 @@ OR sg.studiengang_kz in('.$ADDITIONAL_STG.') ) - AND pss.studiensemester_kurzbz IN (SELECT cnss.studiensemester_kurzbz FROM currentOrNextStudiensemester cnss) + AND pss.studiensemester_kurzbz = '.$STUDIENSEMESTER.' AND NOT EXISTS ( SELECT 1 FROM tbl_prestudentstatus spss @@ -125,7 +118,7 @@ OR sg.studiengang_kz in('.$ADDITIONAL_STG.') ) - AND pss.studiensemester_kurzbz IN (SELECT cnss.studiensemester_kurzbz FROM currentOrNextStudiensemester cnss) + AND pss.studiensemester_kurzbz = '.$STUDIENSEMESTER.' AND NOT EXISTS ( SELECT 1 FROM tbl_prestudentstatus spss @@ -149,7 +142,7 @@ OR sg.studiengang_kz in('.$ADDITIONAL_STG.') ) - AND pss.studiensemester_kurzbz IN (SELECT cnss.studiensemester_kurzbz FROM currentOrNextStudiensemester cnss) + AND pss.studiensemester_kurzbz = '.$STUDIENSEMESTER.' AND NOT EXISTS ( SELECT 1 FROM tbl_prestudentstatus spss @@ -173,7 +166,8 @@ OR sg.studiengang_kz in('.$ADDITIONAL_STG.') ) - AND pss.studiensemester_kurzbz IN (SELECT cnss.studiensemester_kurzbz FROM currentOrNextStudiensemester cnss) + AND pss.studiensemester_kurzbz = '.$STUDIENSEMESTER.' + AND NOT EXISTS ( SELECT 1 FROM tbl_prestudentstatus spss @@ -252,7 +246,7 @@ WHERE spss.prestudent_id = sps.prestudent_id AND spss.status_kurzbz = '.$INTERESSENT_STATUS.' AND spss.bestaetigtam IS NULL - AND spss.studiensemester_kurzbz IN (SELECT ss.studiensemester_kurzbz FROM public.tbl_studiensemester ss WHERE ss.ende > NOW()) + AND spss.studiensemester_kurzbz = '.$STUDIENSEMESTER.' ) ) ORDER BY "LastAction" ASC'; diff --git a/application/views/system/infocenter/infocenterFreigegeben.php b/application/views/system/infocenter/infocenterFreigegeben.php index 40f69528d..15e73f1b6 100644 --- a/application/views/system/infocenter/infocenterFreigegeben.php +++ b/application/views/system/infocenter/infocenterFreigegeben.php @@ -18,7 +18,7 @@ 'global' => array('mailAnXversandt'), 'ui' => array('bitteEintragWaehlen') ), - 'customCSSs' => 'public/css/sbadmin2/tablesort_bootstrap.css', + 'customCSSs' => array('public/css/sbadmin2/tablesort_bootstrap.css', 'public/css/infocenter/infocenterPersonDataset.css'), 'customJSs' => array('public/js/bootstrapper.js', 'public/js/infocenter/infocenterPersonDataset.js') ) ); diff --git a/application/views/system/infocenter/infocenterFreigegebenData.php b/application/views/system/infocenter/infocenterFreigegebenData.php index 059e30a80..20548d3f4 100644 --- a/application/views/system/infocenter/infocenterFreigegebenData.php +++ b/application/views/system/infocenter/infocenterFreigegebenData.php @@ -8,6 +8,7 @@ $REJECTED_STATUS = '\'Abgewiesener\''; $ADDITIONAL_STG = '10021,10027,10002'; $STATUS_KURZBZ = '\'Wartender\', \'Bewerber\', \'Aufgenommener\', \'Student\''; + $STUDIENSEMESTER = '\''.$this->variablelib->getVar('infocenter_studiensemester').'\''; $query = ' SELECT @@ -179,7 +180,7 @@ ) rtp ON(rtp.person_id = ps.person_id AND rtp.studiensemester_kurzbz = pss.studiensemester_kurzbz) WHERE pss.status_kurzbz = '.$INTERESSENT_STATUS.' AND ps.person_id = p.person_id - AND pss.studiensemester_kurzbz IN (SELECT ss.studiensemester_kurzbz FROM public.tbl_studiensemester ss WHERE ss.studiensemester_kurzbz = \'WS2019\') + AND pss.studiensemester_kurzbz IN (SELECT ss.studiensemester_kurzbz FROM public.tbl_studiensemester ss WHERE ss.studiensemester_kurzbz = '.$STUDIENSEMESTER.') ORDER BY pss.datum DESC, pss.insertamum DESC, pss.ext_id DESC LIMIT 1 ) AS "ReihungstestApplied", @@ -215,7 +216,7 @@ AND pss.status_kurzbz = '.$INTERESSENT_STATUS.' AND pss.bestaetigtam IS NOT NULL AND pss.bewerbung_abgeschicktamum IS NOT NULL - AND pss.studiensemester_kurzbz IN (SELECT ss.studiensemester_kurzbz FROM public.tbl_studiensemester ss WHERE ss.ende >= NOW()) + AND pss.studiensemester_kurzbz = '.$STUDIENSEMESTER.' AND NOT EXISTS ( SELECT 1 FROM tbl_prestudentstatus spss diff --git a/application/views/system/infocenter/infocenterReihungstestAbsolviert.php b/application/views/system/infocenter/infocenterReihungstestAbsolviert.php index d40b7a572..79f75885b 100644 --- a/application/views/system/infocenter/infocenterReihungstestAbsolviert.php +++ b/application/views/system/infocenter/infocenterReihungstestAbsolviert.php @@ -18,7 +18,7 @@ 'global' => array('mailAnXversandt'), 'ui' => array('bitteEintragWaehlen') ), - 'customCSSs' => 'public/css/sbadmin2/tablesort_bootstrap.css', + 'customCSSs' => array('public/css/sbadmin2/tablesort_bootstrap.css', 'public/css/infocenter/infocenterPersonDataset.css'), 'customJSs' => array('public/js/bootstrapper.js', 'public/js/infocenter/infocenterPersonDataset.js') ) ); diff --git a/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php b/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php index ff488b6dc..46f952ec3 100644 --- a/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php +++ b/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php @@ -6,6 +6,7 @@ $TAETIGKEIT_KURZBZ = '\'bewerbung\', \'kommunikation\''; $LOGDATA_NAME = '\'Login with code\', \'Login with user\', \'New application\''; $ADDITIONAL_STG = '10021,10027'; + $STUDIENSEMESTER = '\''.$this->variablelib->getVar('infocenter_studiensemester').'\''; $query = ' SELECT @@ -191,7 +192,7 @@ AND pss.status_kurzbz = '.$INTERESSENT_STATUS.' AND pss.bestaetigtam IS NOT NULL AND pss.bewerbung_abgeschicktamum IS NOT NULL - AND pss.studiensemester_kurzbz IN (SELECT ss.studiensemester_kurzbz FROM public.tbl_studiensemester ss WHERE ss.ende >= NOW()) + AND pss.studiensemester_kurzbz = '.$STUDIENSEMESTER.' ) ) ORDER BY "LastAction" DESC'; diff --git a/public/css/infocenter/infocenterPersonDataset.css b/public/css/infocenter/infocenterPersonDataset.css new file mode 100644 index 000000000..2e0edf07f --- /dev/null +++ b/public/css/infocenter/infocenterPersonDataset.css @@ -0,0 +1,7 @@ +/* styles for infocenter overview page */ + +/* horizontal line after Studiensemester in dataset table header */ +hr.studiensemesterline +{ + margin: 6px 6px; +} \ No newline at end of file diff --git a/public/js/infocenter/infocenterPersonDataset.js b/public/js/infocenter/infocenterPersonDataset.js index dc6af2284..54933165d 100644 --- a/public/js/infocenter/infocenterPersonDataset.js +++ b/public/js/infocenter/infocenterPersonDataset.js @@ -19,18 +19,26 @@ if (FHC_JS_DATA_STORAGE_OBJECT.called_method == 'index') * */ var InfocenterPersonDataset = { + infocenter_studiensemester_variablename: 'infocenter_studiensemester', /** * adds person table additional actions html (above and beneath it) */ - appendTableActionsHtml: function() + appendTableActionsHtml: function(infocenter_studiensemester) { - var currurl = window.location.href; var url = FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + "/system/Messages/write"; var formHtml = '
'; $("#datasetActionsTop").before(formHtml); + var studienSemesterHtml = ' ' + + infocenter_studiensemester + + ' '; + var selectAllHtml = '' + ' Alle  ' + @@ -44,6 +52,21 @@ var InfocenterPersonDataset = { var legendHtml = ' Gesperrt    ' + ' Geparkt'; + // userdefined Semestervariable shown independently of personcount, + // it is possible to change the semester + $("#datasetActionsTop, #datasetActionsBottom").append( + "
"+ + "
"+studienSemesterHtml+"
"+ + "

"); + + $("button.incStudiensemester").click(function() { + InfocenterPersonDataset.changeStudiensemesterUservar(1); + }); + + $("button.decStudiensemester").click(function() { + InfocenterPersonDataset.changeStudiensemesterUservar(-1); + }); + var personcount = 0; FHC_AjaxClient.ajaxCallGet( @@ -70,9 +93,9 @@ var InfocenterPersonDataset = { $("#datasetActionsTop, #datasetActionsBottom").append( "
"+ - "
" + selectAllHtml + "  " + actionHtml + "
"+ - "
" + legendHtml + "
"+ - "
" + + "
" + selectAllHtml + "  " + actionHtml + "
"+ + "
" + legendHtml + "
"+ + "
" + "" + countHtml + "
"+ "
"+ @@ -125,8 +148,65 @@ var InfocenterPersonDataset = { trs.find("input[name=PersonId\\[\\]]").prop("checked", false); } ); - } + }, + /** + * initializes change of the uservariable infocenter_studiensemesster, either + * to next semester (change > 0) or previous semester (change < 0) + */ + changeStudiensemesterUservar: function(change) + { + FHC_AjaxClient.showVeil(); + + FHC_AjaxClient.ajaxCallPost( + 'system/Variables/changeStudiensemesterVar', + { + 'name': InfocenterPersonDataset.infocenter_studiensemester_variablename, + 'change': change + }, + { + successCallback: function(data, textStatus, jqXHR) { + if (FHC_AjaxClient.hasData(data)) + { + // refresh filterwidget with page reload + FHC_FilterWidget.reloadDataset(); + } + }, + errorCallback: function(jqXHR, textStatus, errorThrown) { + FHC_AjaxClient.hideVeil(); + alert(textStatus);//TODO dialoglib + } + } + ); + }, + + /** + * initializes call to get the Studiensemester user variable + */ + getStudiensemesterUservar: function(callback) + { + FHC_AjaxClient.ajaxCallGet( + 'system/Variables/getVar', + { + 'name': InfocenterPersonDataset.infocenter_studiensemester_variablename + }, + { + successCallback: function(data, textStatus, jqXHR) { + if (FHC_AjaxClient.hasData(data)) + { + if (typeof callback === "function") + { + var infocenter_studiensemester = FHC_AjaxClient.getData(data); + callback(infocenter_studiensemester[InfocenterPersonDataset.infocenter_studiensemester_variablename]); + } + } + }, + errorCallback: function(jqXHR, textStatus, errorThrown) { + alert(textStatus); + } + } + ); + } }; /** @@ -134,6 +214,6 @@ var InfocenterPersonDataset = { */ $(document).ready(function() { - InfocenterPersonDataset.appendTableActionsHtml(); + InfocenterPersonDataset.getStudiensemesterUservar(InfocenterPersonDataset.appendTableActionsHtml); }); From bf8b7e0ccd972f83118fc73c065c39d8456dbf0d Mon Sep 17 00:00:00 2001 From: Paolo Date: Mon, 16 Sep 2019 14:00:51 +0200 Subject: [PATCH 06/23] Added JobsViewer --- application/controllers/system/JobsViewer.php | 44 +++++++++++++ application/views/system/jobs/jobsViewer.php | 47 +++++++++++++ .../views/system/jobs/jobsViewerData.php | 66 +++++++++++++++++++ 3 files changed, 157 insertions(+) create mode 100644 application/controllers/system/JobsViewer.php create mode 100644 application/views/system/jobs/jobsViewer.php create mode 100644 application/views/system/jobs/jobsViewerData.php diff --git a/application/controllers/system/JobsViewer.php b/application/controllers/system/JobsViewer.php new file mode 100644 index 000000000..2fdfa7181 --- /dev/null +++ b/application/controllers/system/JobsViewer.php @@ -0,0 +1,44 @@ + 'admin:r' + ) + ); + + // Loads WidgetLib + $this->load->library('WidgetLib'); + + // Loads phrases system + $this->loadPhrases( + array( + 'global', + 'ui', + 'filter' + ) + ); + } + + // ----------------------------------------------------------------------------------------------------------------- + // Public methods + + /** + * Main page of the InfoCenter tool + */ + public function index() + { + $this->load->view('system/jobs/jobsViewer.php'); + } +} diff --git a/application/views/system/jobs/jobsViewer.php b/application/views/system/jobs/jobsViewer.php new file mode 100644 index 000000000..f7018a272 --- /dev/null +++ b/application/views/system/jobs/jobsViewer.php @@ -0,0 +1,47 @@ +load->view( + 'templates/FHC-Header', + array( + 'title' => 'JobsViewer', + 'jquery' => true, + 'jqueryui' => true, + 'bootstrap' => true, + 'fontawesome' => true, + 'sbadmintemplate' => true, + 'tablesorter' => true, + 'ajaxlib' => true, + 'filterwidget' => true, + 'navigationwidget' => true, + 'phrases' => array( + 'global' => array('mailAnXversandt'), + 'ui' => array('bitteEintragWaehlen') + ), + 'customCSSs' => 'public/css/sbadmin2/tablesort_bootstrap.css', + 'customJSs' => array('public/js/bootstrapper.js') + ) + ); +?> + + +
+ + widgetlib->widget('NavigationWidget'); ?> + +
+
+
+
+ +
+
+
+ load->view('system/jobs/jobsViewerData.php'); ?> +
+
+
+
+ + +load->view('templates/FHC-Footer'); ?> diff --git a/application/views/system/jobs/jobsViewerData.php b/application/views/system/jobs/jobsViewerData.php new file mode 100644 index 000000000..07815c2f3 --- /dev/null +++ b/application/views/system/jobs/jobsViewerData.php @@ -0,0 +1,66 @@ + ' + 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" + FROM system.tbl_webservicelog wsl + WHERE wsl.webservicetyp_kurzbz = \'job\' + ORDER BY wsl.execute_time DESC + ', + 'requiredPermissions' => 'admin', + 'datasetRepresentation' => 'tablesorter', + 'reloadDataset' => ($this->input->get('reloadDataset') == 'true' ? true : false), + 'columnsAliases' => array( + 'Log id', + 'Request id', + 'Execution time', + 'Executed by', + 'Producer', + 'Data' + ), + 'formatRow' => function($datasetRaw) { + + $datasetRaw->ExecutionTime = date_format(date_create($datasetRaw->ExecutionTime), 'd.m.Y H:i:s'); + + return $datasetRaw; + }, + 'markRow' => function($datasetRaw) { + + $mark = ''; + + if ($datasetRaw->RequestId == 'Cronjob error') + { + $mark = 'text-red'; + } + + if ($datasetRaw->RequestId == 'Cronjob info') + { + $mark = 'text-green'; + } + + if ($datasetRaw->RequestId == 'Cronjob warning') + { + $mark = 'text-orange'; + } + + if ($datasetRaw->RequestId == 'Cronjob debug') + { + $mark = 'text-info'; + } + + return $mark; + } + ); + + $filterWidgetArray['app'] = 'core'; + $filterWidgetArray['datasetName'] = 'jobslogs'; + $filterWidgetArray['filterKurzbz'] = 'all'; + $filterWidgetArray['filter_id'] = $this->input->get('filter_id'); + + echo $this->widgetlib->widget('FilterWidget', $filterWidgetArray); +?> From 131d031caea7692af5f520ce9a72b6aa448c8bd7 Mon Sep 17 00:00:00 2001 From: alex Date: Tue, 17 Sep 2019 10:29:24 +0200 Subject: [PATCH 07/23] - added column projektphase_id to tbl_zeitaufzeichnung --- system/dbupdate_3.3.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/system/dbupdate_3.3.php b/system/dbupdate_3.3.php index 4e720daef..9df2f6eff 100644 --- a/system/dbupdate_3.3.php +++ b/system/dbupdate_3.3.php @@ -3030,6 +3030,18 @@ if(!$result = @$db->db_query("SELECT stufe FROM public.tbl_dokumentstudiengang L echo '
public.tbl_dokumentstudiengang: Spalte stufe hinzugefuegt'; } +// Add column projektphase_id to tbl_zeitaufzeichnung +if(!$result = @$db->db_query("SELECT projektphase_id FROM campus.tbl_zeitaufzeichnung LIMIT 1")) +{ + $qry = "ALTER TABLE campus.tbl_zeitaufzeichnung ADD COLUMN projektphase_id bigint; + ALTER TABLE campus.tbl_zeitaufzeichnung ADD CONSTRAINT fk_zeitaufzeichnung_projektphase FOREIGN KEY (projektphase_id) REFERENCES fue.tbl_projektphase (projektphase_id) ON DELETE RESTRICT ON UPDATE CASCADE;"; + + if(!$db->db_query($qry)) + echo 'campus.tbl_zeitaufzeichnung: '.$db->db_last_error().'
'; + else + echo '
campus.tbl_zeitaufzeichnung: Spalte projektphase_id hinzugefuegt'; +} + // *** Pruefung und hinzufuegen der neuen Attribute und Tabellen echo '

Pruefe Tabellen und Attribute!

'; From 31cb13ec14179233c3cf226fe9f44eb86e7b9e8b Mon Sep 17 00:00:00 2001 From: alex Date: Tue, 17 Sep 2019 10:36:53 +0200 Subject: [PATCH 08/23] - Zeitaufzeichnung: Projektphase can be selected and saved for a project --- cis/private/tools/zeitaufzeichnung.php | 78 + .../tools/zeitaufzeichnung_projektphasen.php | 28 + include/zeitaufzeichnung.class.php | 1605 +++++++++-------- locale/de-AT/zeitaufzeichnung.php | 121 +- locale/en-US/zeitaufzeichnung.php | 121 +- locale/it-IT/zeitaufzeichnung.php | 1 + 6 files changed, 1034 insertions(+), 920 deletions(-) create mode 100644 cis/private/tools/zeitaufzeichnung_projektphasen.php diff --git a/cis/private/tools/zeitaufzeichnung.php b/cis/private/tools/zeitaufzeichnung.php index 7461f2421..df7a2bd34 100644 --- a/cis/private/tools/zeitaufzeichnung.php +++ b/cis/private/tools/zeitaufzeichnung.php @@ -33,6 +33,7 @@ require_once('../../../include/zeitaufzeichnung.class.php'); require_once('../../../include/zeitsperre.class.php'); require_once('../../../include/datum.class.php'); require_once('../../../include/projekt.class.php'); +require_once('../../../include/projektphase.class.php'); require_once('../../../include/phrasen.class.php'); require_once('../../../include/organisationseinheit.class.php'); require_once('../../../include/service.class.php'); @@ -117,6 +118,7 @@ $sperrdatum = date('c', strtotime($gesperrt_bis)); // Uses urlencode to avoid XSS issues $zeitaufzeichnung_id = urlencode(isset($_GET['zeitaufzeichnung_id'])?$_GET['zeitaufzeichnung_id']:''); $projekt_kurzbz = (isset($_POST['projekt'])?$_POST['projekt']:''); +$projektphase_id = (isset($_POST['projektphase'])?$_POST['projektphase']:''); $oe_kurzbz_1 = (isset($_POST['oe_kurzbz_1'])?$_POST['oe_kurzbz_1']:''); $oe_kurzbz_2 = (isset($_POST['oe_kurzbz_2'])?$_POST['oe_kurzbz_2']:''); $aktivitaet_kurzbz = (isset($_POST['aktivitaet'])?$_POST['aktivitaet']:''); @@ -251,6 +253,13 @@ echo ' $("#kunde_uid").val(ui.item.uid); } }); + + $("#projekt").change( + function() + { + getProjektphasen($(this).val()); + } + ) }); @@ -489,6 +498,40 @@ echo ' } return true; } + + function getProjektphasen(projekt_kurzbz) + { + $.ajax + ( + { + type: "GET", + url: "zeitaufzeichnung_projektphasen.php", + dataType: "json", + data: + { + "projekt_kurzbz":projekt_kurzbz + }, + success: function(json) + { + $("#projektphase").children("option").each( + function() + { + if ($(this).prop("id") !== "projektphasekeineausw") + $(this).remove(); + } + ); + + var projphasenhtml = ""; + for (var i = 0; i < json.length; i++) + { + projphasenhtml += "
- load->view('system/jobs/jobsViewerData.php'); ?> + load->view('system/logs/logsViewerData.php'); ?>
diff --git a/application/views/system/jobs/jobsViewerData.php b/application/views/system/logs/logsViewerData.php similarity index 88% rename from application/views/system/jobs/jobsViewerData.php rename to application/views/system/logs/logsViewerData.php index 07815c2f3..2dfcfc9d0 100644 --- a/application/views/system/jobs/jobsViewerData.php +++ b/application/views/system/logs/logsViewerData.php @@ -7,9 +7,9 @@ wsl.execute_time AS "ExecutionTime", wsl.execute_user AS "ExecutedBy", wsl.beschreibung AS "Description", - wsl.request_data AS "Data" + wsl.request_data AS "Data", + wsl.webservicetyp_kurzbz AS "WebserviceType" FROM system.tbl_webservicelog wsl - WHERE wsl.webservicetyp_kurzbz = \'job\' ORDER BY wsl.execute_time DESC ', 'requiredPermissions' => 'admin', @@ -21,7 +21,8 @@ 'Execution time', 'Executed by', 'Producer', - 'Data' + 'Data', + 'Webservice type' ), 'formatRow' => function($datasetRaw) { @@ -58,8 +59,7 @@ ); $filterWidgetArray['app'] = 'core'; - $filterWidgetArray['datasetName'] = 'jobslogs'; - $filterWidgetArray['filterKurzbz'] = 'all'; + $filterWidgetArray['datasetName'] = 'logs'; $filterWidgetArray['filter_id'] = $this->input->get('filter_id'); echo $this->widgetlib->widget('FilterWidget', $filterWidgetArray); diff --git a/system/filtersupdate.php b/system/filtersupdate.php index 2d1789774..415b8d442 100644 --- a/system/filtersupdate.php +++ b/system/filtersupdate.php @@ -463,14 +463,14 @@ $filters = array( ), array( 'app' => 'core', - 'dataset_name' => 'jobslogs', - 'filter_kurzbz' => 'all', - 'description' => '{All logs produced by jobs}', + 'dataset_name' => 'logs', + 'filter_kurzbz' => 'last7days', + 'description' => '{Last 7 days logs}', 'sort' => 1, 'default_filter' => true, 'filter' => ' { - "name": "All jobs viewer", + "name": "All logs from the last 7 days", "columns": [ {"name": "RequestId"}, {"name": "ExecutionTime"}, @@ -478,7 +478,150 @@ $filters = array( {"name": "Description"}, {"name": "Data"} ], - "filters": [] + "filters": [ + { + "name": "ExecutionTime", + "operation": "lt", + "condition": "7", + "option": "days" + } + ] + } + ', + 'oe_kurzbz' => null, + ), + array( + 'app' => 'core', + 'dataset_name' => 'logs', + 'filter_kurzbz' => 'jobs14days', + 'description' => '{Last 14 days jobs logs}', + 'sort' => 2, + 'default_filter' => false, + 'filter' => ' + { + "name": "All jobs logs from the last 14 days", + "columns": [ + {"name": "RequestId"}, + {"name": "ExecutionTime"}, + {"name": "ExecutedBy"}, + {"name": "Description"}, + {"name": "Data"} + ], + "filters": [ + { + "name": "WebserviceType", + "operation": "contains", + "condition": "job" + }, + { + "name": "ExecutionTime", + "operation": "lt", + "condition": "14", + "option": "days" + } + ] + } + ', + 'oe_kurzbz' => null, + ), + array( + 'app' => 'core', + 'dataset_name' => 'logs', + 'filter_kurzbz' => 'repots14days', + 'description' => '{Last 14 days reports logs}', + 'sort' => 3, + 'default_filter' => false, + 'filter' => ' + { + "name": "All reports logs from the last 14 days", + "columns": [ + {"name": "RequestId"}, + {"name": "ExecutionTime"}, + {"name": "ExecutedBy"}, + {"name": "Description"}, + {"name": "Data"} + ], + "filters": [ + { + "name": "WebserviceType", + "operation": "contains", + "condition": "reports" + }, + { + "name": "ExecutionTime", + "operation": "lt", + "condition": "14", + "option": "days" + } + ] + } + ', + 'oe_kurzbz' => null, + ), + array( + 'app' => 'core', + 'dataset_name' => 'logs', + 'filter_kurzbz' => 'content3days', + 'description' => '{Last 3 days content logs}', + 'sort' => 4, + 'default_filter' => false, + 'filter' => ' + { + "name": "All content logs from the last 3 days", + "columns": [ + {"name": "RequestId"}, + {"name": "ExecutionTime"}, + {"name": "ExecutedBy"}, + {"name": "Description"}, + {"name": "Data"} + ], + "filters": [ + { + "name": "WebserviceType", + "operation": "contains", + "condition": "content" + }, + { + "name": "ExecutionTime", + "operation": "lt", + "condition": "3", + "option": "days" + } + ] + } + ', + 'oe_kurzbz' => null, + ), + array( + 'app' => 'core', + 'dataset_name' => 'logs', + 'filter_kurzbz' => 'wienerlinien7days', + 'description' => '{Last 7 days wiener linien logs}', + 'sort' => 5, + 'default_filter' => false, + 'filter' => ' + { + "name": "All wiener linien logs from the last 7 days", + "columns": [ + {"name": "RequestId"}, + {"name": "ExecutionTime"}, + {"name": "ExecutedBy"}, + {"name": "Description"}, + {"name": "Data"} + ], + "filters": [ + { + "name": "WebserviceType", + "operation": "contains", + "condition": "wienerlinien" + }, + { + "name": "ExecutionTime", + "operation": "lt", + "condition": "7", + "option": "days" + } + ] } ', 'oe_kurzbz' => null, From 05898bdde59e3bec01643bcac7407e0ffdd10cb2 Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 26 Sep 2019 17:46:40 +0200 Subject: [PATCH 14/23] system/dbupdate_3.3.: removed UPDATE, INSERT, DELETE permissions from user web for public.tbl_variablename --- system/dbupdate_3.3.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/dbupdate_3.3.php b/system/dbupdate_3.3.php index 66504cd5a..1c95190fb 100644 --- a/system/dbupdate_3.3.php +++ b/system/dbupdate_3.3.php @@ -3069,7 +3069,7 @@ if(!@$db->db_query("SELECT 0 FROM public.tbl_variablenname WHERE 0 = 1")) { echo '
Created public.tbl_variablenname'; // GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE public.tbl_variablenname TO web; - $qry = 'GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE public.tbl_variablenname TO web;'; + $qry = 'GRANT SELECT ON TABLE public.tbl_variablenname TO web;'; if (!$db->db_query($qry)) echo 'public.tbl_variablenname ' . $db->db_last_error() . '
'; else From 4a00395d08f19538f85c745b15729fc4031941cc Mon Sep 17 00:00:00 2001 From: Andreas Oesterreicher Date: Fri, 27 Sep 2019 09:49:47 +0200 Subject: [PATCH 15/23] Moved directory creation to correct position to avoid problems if the entry is not displayed --- include/tw/cis_menu_lv.inc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/tw/cis_menu_lv.inc.php b/include/tw/cis_menu_lv.inc.php index 3a4a8f13b..68ae8a1cb 100644 --- a/include/tw/cis_menu_lv.inc.php +++ b/include/tw/cis_menu_lv.inc.php @@ -217,12 +217,12 @@ function checkZeilenUmbruch() $link= "anwesenheitsliste.php?stg_kz=$studiengang_kz&sem=$semester&lvid=$lvid&stsem=$angezeigtes_stsem"; } - ensureDirectoryExists($DOC_ROOT, $kurzbz, $semester, $short_short_name, 'leistung','teacher'); - $dir_empty = isDirectoryEmpty($DOC_ROOT, $kurzbz, $semester, $short_short_name, 'leistung'); - $text=''; if(CIS_LEHRVERANSTALTUNG_LEISTUNGSUEBERSICHT_ANZEIGEN && ($angemeldet || $is_lector)) { + ensureDirectoryExists($DOC_ROOT, $kurzbz, $semester, $short_short_name, 'leistung','teacher'); + $dir_empty = isDirectoryEmpty($DOC_ROOT, $kurzbz, $semester, $short_short_name, 'leistung'); + if($dir_empty == false) { $dir_name=$DOC_ROOT.'/documents/'.mb_strtolower($kurzbz).'/'.$semester.'/'.mb_strtolower($short_short_name).'/leistung'; From 471c1ab9ef043502598bc017ba56014542d5e96b Mon Sep 17 00:00:00 2001 From: alex Date: Fri, 27 Sep 2019 11:43:55 +0200 Subject: [PATCH 16/23] top border of projekt name row is shown also in excel --- .../tools/zeitaufzeichnung_projektliste.php | 14 +++++++++----- locale/de-AT/zeitaufzeichnung.php | 2 +- locale/en-US/zeitaufzeichnung.php | 2 +- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/cis/private/tools/zeitaufzeichnung_projektliste.php b/cis/private/tools/zeitaufzeichnung_projektliste.php index 64cf0ae9b..b8b19a0a9 100644 --- a/cis/private/tools/zeitaufzeichnung_projektliste.php +++ b/cis/private/tools/zeitaufzeichnung_projektliste.php @@ -528,7 +528,7 @@ $nrProjects = count($projektnames); $totalwidth = 150; $daywidth = 4; $totalworktimewidth = 13; -$worktimewidth = 8; +$worktimewidth = 14; $timecolumnswidth = 2 * $daywidth + $totalworktimewidth + $worktimewidth; if ($nrProjects < 1)//no projekts - merge all cells and write notice @@ -660,14 +660,18 @@ foreach ($projektnames as $projektname) $phasenames = array(); $phasenameslength = 0; } - $worksheet->write($zeile, $spalte, $projektname, $format_bold_centered_toprightline); $worksheet->write($zeile, $spalte + $phasenameslength + 1, '', $format_bold_centered_toprightline); - $worksheet->write($zeile + 1, $spalte, $p->t('zeitaufzeichnung/stunden'), $format_bold_centered_bottomline); + $worksheet->write($zeile + 1, $spalte, $p->t('zeitaufzeichnung/projektstunden'), $format_bold_centered_bottomline); + + for($i = 0; $i < $phasenameslength; $i++) + $worksheet->write($zeile, $spalte + 1 + $i, '', $format_bold_centered_toprightline); + $worksheet->setMerge($zeile, $spalte, $zeile, $spalte + 1 + $phasenameslength); + $worksheet->write($zeile, $spalte, $projektname, $format_bold_centered_toprightline); + for ($i = 0; $i < $phasenameslength; $i++) - { $worksheet->write($zeile + 1, $spalte + 1 + $i, $phasenames[$i], $format_bold_centered_bottomline); - } + $worksheet->setColumn($spalte + $phasenameslength + 1, $spalte + $phasenameslength + 1, $taetigkeitenwidth); $worksheet->write($zeile + 1, $spalte + $phasenameslength + 1, $p->t('zeitaufzeichnung/taetigkeit'), $format_bold_centered_bottomrightline); $spalte = $spalte + 2 + $phasenameslength; diff --git a/locale/de-AT/zeitaufzeichnung.php b/locale/de-AT/zeitaufzeichnung.php index 2901ac4a7..0692a5f8b 100644 --- a/locale/de-AT/zeitaufzeichnung.php +++ b/locale/de-AT/zeitaufzeichnung.php @@ -54,7 +54,7 @@ $this->phrasen['zeitaufzeichnung/monat']='Monat:'; $this->phrasen['zeitaufzeichnung/tag']='Tag'; $this->phrasen['zeitaufzeichnung/startdatum']='Startdatum:'; $this->phrasen['zeitaufzeichnung/enddatum']='Enddatum:'; -$this->phrasen['zeitaufzeichnung/stunden']='Stunden'; +$this->phrasen['zeitaufzeichnung/projektstunden']='Projektstunden'; $this->phrasen['zeitaufzeichnung/taetigkeit']='Tätigkeit'; $this->phrasen['zeitaufzeichnung/keineprojekte']='keine Projekte vorhanden'; $this->phrasen['zeitaufzeichnung/summe']='Summe:'; diff --git a/locale/en-US/zeitaufzeichnung.php b/locale/en-US/zeitaufzeichnung.php index 936e65653..cd460dc97 100644 --- a/locale/en-US/zeitaufzeichnung.php +++ b/locale/en-US/zeitaufzeichnung.php @@ -54,7 +54,7 @@ $this->phrasen['zeitaufzeichnung/monat']='Month:'; $this->phrasen['zeitaufzeichnung/tag']='Day'; $this->phrasen['zeitaufzeichnung/startdatum']='Startdate:'; $this->phrasen['zeitaufzeichnung/enddatum']='Enddate:'; -$this->phrasen['zeitaufzeichnung/stunden']='Hours'; +$this->phrasen['zeitaufzeichnung/projektstunden']='Project hours'; $this->phrasen['zeitaufzeichnung/taetigkeit']='Activity'; $this->phrasen['zeitaufzeichnung/keineprojekte']='no projects exist'; $this->phrasen['zeitaufzeichnung/summe']='Sum:'; From 10e1539b22e1afa43fa43c42b97459f1b4b5ef40 Mon Sep 17 00:00:00 2001 From: alex Date: Fri, 27 Sep 2019 14:36:18 +0200 Subject: [PATCH 17/23] infocenterData.php, infocenterFreigegebenData.php, infocenterReihungstestAbsolviertData.php: column data is retrieved from selected Studiensemester variable, and not from future Semesters --- .../system/infocenter/infocenterData.php | 17 +++++++++++------ .../infocenter/infocenterFreigegebenData.php | 19 ++++++++++--------- .../infocenterReihungstestAbsolviertData.php | 16 ++++++++-------- 3 files changed, 29 insertions(+), 23 deletions(-) diff --git a/application/views/system/infocenter/infocenterData.php b/application/views/system/infocenter/infocenterData.php index 6dd0ee957..04b99b057 100644 --- a/application/views/system/infocenter/infocenterData.php +++ b/application/views/system/infocenter/infocenterData.php @@ -99,7 +99,8 @@ FROM tbl_prestudentstatus spss WHERE spss.prestudent_id = pss.prestudent_id AND spss.status_kurzbz = '.$REJECTED_STATUS.' - AND spss.studiensemester_kurzbz IN (SELECT ss.studiensemester_kurzbz FROM public.tbl_studiensemester ss WHERE ss.ende > NOW()) + AND spss.studiensemester_kurzbz IN (SELECT ss.studiensemester_kurzbz FROM public.tbl_studiensemester ss WHERE ss.ende > + (SELECT start FROM public.tbl_studiensemester sss WHERE studiensemester_kurzbz = '.$STUDIENSEMESTER.')) ) ORDER BY pss.datum DESC, pss.insertamum DESC, pss.ext_id DESC LIMIT 1 @@ -124,7 +125,8 @@ FROM tbl_prestudentstatus spss WHERE spss.prestudent_id = pss.prestudent_id AND spss.status_kurzbz = '.$REJECTED_STATUS.' - AND spss.studiensemester_kurzbz IN (SELECT ss.studiensemester_kurzbz FROM public.tbl_studiensemester ss WHERE ss.ende > NOW()) + AND spss.studiensemester_kurzbz IN (SELECT ss.studiensemester_kurzbz FROM public.tbl_studiensemester ss WHERE ss.ende > + (SELECT start FROM public.tbl_studiensemester sss WHERE studiensemester_kurzbz = '.$STUDIENSEMESTER.')) ) LIMIT 1 ) AS "AnzahlAbgeschickt", @@ -148,7 +150,8 @@ FROM tbl_prestudentstatus spss WHERE spss.prestudent_id = pss.prestudent_id AND spss.status_kurzbz = '.$REJECTED_STATUS.' - AND spss.studiensemester_kurzbz IN (SELECT ss.studiensemester_kurzbz FROM public.tbl_studiensemester ss WHERE ss.ende > NOW()) + AND spss.studiensemester_kurzbz IN (SELECT ss.studiensemester_kurzbz FROM public.tbl_studiensemester ss WHERE ss.ende > + (SELECT start FROM public.tbl_studiensemester sss WHERE studiensemester_kurzbz = '.$STUDIENSEMESTER.')) ) LIMIT 1 ) AS "StgAbgeschickt", @@ -173,7 +176,8 @@ FROM tbl_prestudentstatus spss WHERE spss.prestudent_id = pss.prestudent_id AND spss.status_kurzbz = '.$REJECTED_STATUS.' - AND spss.studiensemester_kurzbz IN (SELECT ss.studiensemester_kurzbz FROM public.tbl_studiensemester ss WHERE ss.ende > NOW()) + AND spss.studiensemester_kurzbz IN (SELECT ss.studiensemester_kurzbz FROM public.tbl_studiensemester ss WHERE ss.ende > + (SELECT start FROM public.tbl_studiensemester sss WHERE studiensemester_kurzbz = '.$STUDIENSEMESTER.')) ) LIMIT 1 ) AS "StgNichtAbgeschickt", @@ -190,13 +194,14 @@ OR sg.studiengang_kz in('.$ADDITIONAL_STG.') ) - AND pss.studiensemester_kurzbz IN (SELECT ss.studiensemester_kurzbz FROM public.tbl_studiensemester ss WHERE ss.start >= NOW()) + AND pss.studiensemester_kurzbz = '.$STUDIENSEMESTER.' AND NOT EXISTS ( SELECT 1 FROM tbl_prestudentstatus spss WHERE spss.prestudent_id = pss.prestudent_id AND spss.status_kurzbz = '.$REJECTED_STATUS.' - AND spss.studiensemester_kurzbz IN (SELECT ss.studiensemester_kurzbz FROM public.tbl_studiensemester ss WHERE ss.ende > NOW()) + AND spss.studiensemester_kurzbz IN (SELECT ss.studiensemester_kurzbz FROM public.tbl_studiensemester ss WHERE ss.ende > + (SELECT start FROM public.tbl_studiensemester sss WHERE studiensemester_kurzbz = '.$STUDIENSEMESTER.')) ) LIMIT 1 ) AS "StgAktiv", diff --git a/application/views/system/infocenter/infocenterFreigegebenData.php b/application/views/system/infocenter/infocenterFreigegebenData.php index 20548d3f4..89ba2ec38 100644 --- a/application/views/system/infocenter/infocenterFreigegebenData.php +++ b/application/views/system/infocenter/infocenterFreigegebenData.php @@ -59,7 +59,7 @@ sg.studiengang_kz in('.$ADDITIONAL_STG.') ) AND pss.bestaetigtam is not null - AND pss.studiensemester_kurzbz IN (SELECT ss.studiensemester_kurzbz FROM public.tbl_studiensemester ss WHERE ss.ende >= NOW()) + AND pss.studiensemester_kurzbz = '.$STUDIENSEMESTER.' ORDER BY pss.datum DESC, pss.insertamum DESC, pss.ext_id DESC LIMIT 1 ) AS "Studiensemester", @@ -75,7 +75,7 @@ OR sg.studiengang_kz in('.$ADDITIONAL_STG.') ) - AND pss.studiensemester_kurzbz IN (SELECT ss.studiensemester_kurzbz FROM public.tbl_studiensemester ss WHERE ss.ende >= NOW()) + AND pss.studiensemester_kurzbz = '.$STUDIENSEMESTER.' ORDER BY pss.datum DESC, pss.insertamum DESC, pss.ext_id DESC LIMIT 1 ) AS "SendDate", @@ -91,7 +91,7 @@ OR sg.studiengang_kz in('.$ADDITIONAL_STG.') ) - AND pss.studiensemester_kurzbz IN (SELECT ss.studiensemester_kurzbz FROM public.tbl_studiensemester ss WHERE ss.ende >= NOW()) + AND pss.studiensemester_kurzbz = '.$STUDIENSEMESTER.' AND NOT EXISTS ( SELECT 1 FROM tbl_prestudentstatus spss @@ -113,7 +113,7 @@ OR sg.studiengang_kz in('.$ADDITIONAL_STG.') ) - AND pss.studiensemester_kurzbz IN (SELECT ss.studiensemester_kurzbz FROM public.tbl_studiensemester ss WHERE ss.ende >= NOW()) + AND pss.studiensemester_kurzbz = '.$STUDIENSEMESTER.' LIMIT 1 ) AS "StgAbgeschickt", ( @@ -129,13 +129,14 @@ OR sg.studiengang_kz in('.$ADDITIONAL_STG.') ) - AND pss.studiensemester_kurzbz IN (SELECT ss.studiensemester_kurzbz FROM public.tbl_studiensemester ss WHERE ss.ende >= NOW()) + AND pss.studiensemester_kurzbz = '.$STUDIENSEMESTER.' AND NOT EXISTS ( SELECT 1 FROM tbl_prestudentstatus spss WHERE spss.prestudent_id = pss.prestudent_id AND spss.status_kurzbz = '.$REJECTED_STATUS.' - AND spss.studiensemester_kurzbz IN (SELECT ss.studiensemester_kurzbz FROM public.tbl_studiensemester ss WHERE ss.ende > NOW()) + AND spss.studiensemester_kurzbz IN (SELECT ss.studiensemester_kurzbz FROM public.tbl_studiensemester ss WHERE ss.ende > + (SELECT start FROM public.tbl_studiensemester sss WHERE studiensemester_kurzbz = '.$STUDIENSEMESTER.')) ) LIMIT 1 ) AS "StgAktiv", @@ -146,7 +147,7 @@ LEFT JOIN public.tbl_status_grund sg USING(statusgrund_id) WHERE pss.status_kurzbz = '.$INTERESSENT_STATUS.' AND ps.person_id = p.person_id - AND pss.studiensemester_kurzbz IN (SELECT ss.studiensemester_kurzbz FROM public.tbl_studiensemester ss WHERE ss.ende >= NOW()) + AND pss.studiensemester_kurzbz = '.$STUDIENSEMESTER.' LIMIT 1 ) AS "Statusgrund", ( @@ -163,7 +164,7 @@ ) rtp ON(rtp.person_id = ps.person_id AND rtp.studiensemester_kurzbz = pss.studiensemester_kurzbz) WHERE pss.status_kurzbz = '.$INTERESSENT_STATUS.' AND ps.person_id = p.person_id - AND pss.studiensemester_kurzbz IN (SELECT ss.studiensemester_kurzbz FROM public.tbl_studiensemester ss WHERE ss.ende >= NOW()) + AND pss.studiensemester_kurzbz = '.$STUDIENSEMESTER.' ORDER BY pss.datum DESC, pss.insertamum DESC, pss.ext_id DESC LIMIT 1 ) AS "ReihungstestAngetreten", @@ -180,7 +181,7 @@ ) rtp ON(rtp.person_id = ps.person_id AND rtp.studiensemester_kurzbz = pss.studiensemester_kurzbz) WHERE pss.status_kurzbz = '.$INTERESSENT_STATUS.' AND ps.person_id = p.person_id - AND pss.studiensemester_kurzbz IN (SELECT ss.studiensemester_kurzbz FROM public.tbl_studiensemester ss WHERE ss.studiensemester_kurzbz = '.$STUDIENSEMESTER.') + AND pss.studiensemester_kurzbz = '.$STUDIENSEMESTER.' ORDER BY pss.datum DESC, pss.insertamum DESC, pss.ext_id DESC LIMIT 1 ) AS "ReihungstestApplied", diff --git a/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php b/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php index 46f952ec3..22b122bb0 100644 --- a/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php +++ b/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php @@ -47,7 +47,7 @@ OR sg.studiengang_kz in('.$ADDITIONAL_STG.') ) - AND pss.studiensemester_kurzbz IN (SELECT ss.studiensemester_kurzbz FROM public.tbl_studiensemester ss WHERE ss.ende >= NOW()) + AND pss.studiensemester_kurzbz = '.$STUDIENSEMESTER.' ORDER BY pss.datum DESC, pss.insertamum DESC, pss.ext_id DESC LIMIT 1 ) AS "Studiensemester", @@ -63,7 +63,7 @@ OR sg.studiengang_kz in('.$ADDITIONAL_STG.') ) - AND pss.studiensemester_kurzbz IN (SELECT ss.studiensemester_kurzbz FROM public.tbl_studiensemester ss WHERE ss.ende >= NOW()) + AND pss.studiensemester_kurzbz = '.$STUDIENSEMESTER.' ORDER BY pss.datum DESC, pss.insertamum DESC, pss.ext_id DESC LIMIT 1 ) AS "SendDate", @@ -79,7 +79,7 @@ OR sg.studiengang_kz in('.$ADDITIONAL_STG.') ) - AND pss.studiensemester_kurzbz IN (SELECT ss.studiensemester_kurzbz FROM public.tbl_studiensemester ss WHERE ss.ende >= NOW()) + AND pss.studiensemester_kurzbz = '.$STUDIENSEMESTER.' LIMIT 1 ) AS "AnzahlAbgeschickt", ( @@ -94,7 +94,7 @@ OR sg.studiengang_kz in('.$ADDITIONAL_STG.') ) - AND pss.studiensemester_kurzbz IN (SELECT ss.studiensemester_kurzbz FROM public.tbl_studiensemester ss WHERE ss.ende >= NOW()) + AND pss.studiensemester_kurzbz = '.$STUDIENSEMESTER.' LIMIT 1 ) AS "StgAbgeschickt", ( @@ -104,7 +104,7 @@ LEFT JOIN public.tbl_status_grund sg USING(statusgrund_id) WHERE pss.status_kurzbz = '.$INTERESSENT_STATUS.' AND ps.person_id = p.person_id - AND pss.studiensemester_kurzbz IN (SELECT ss.studiensemester_kurzbz FROM public.tbl_studiensemester ss WHERE ss.ende >= NOW()) + AND pss.studiensemester_kurzbz = '.$STUDIENSEMESTER.' LIMIT 1 ) AS "Statusgrund", ( @@ -121,7 +121,7 @@ ) rtp ON(rtp.person_id = ps.person_id AND rtp.studiensemester_kurzbz = pss.studiensemester_kurzbz) WHERE pss.status_kurzbz = '.$INTERESSENT_STATUS.' AND ps.person_id = p.person_id - AND pss.studiensemester_kurzbz IN (SELECT ss.studiensemester_kurzbz FROM public.tbl_studiensemester ss WHERE ss.ende >= NOW()) + AND pss.studiensemester_kurzbz = '.$STUDIENSEMESTER.' ORDER BY pss.datum DESC, pss.insertamum DESC, pss.ext_id DESC LIMIT 1 ) AS "ReihungstestAngetreten", @@ -138,7 +138,7 @@ ) rtp ON(rtp.person_id = ps.person_id AND rtp.studiensemester_kurzbz = pss.studiensemester_kurzbz) WHERE pss.status_kurzbz = '.$INTERESSENT_STATUS.' AND ps.person_id = p.person_id - AND pss.studiensemester_kurzbz IN (SELECT ss.studiensemester_kurzbz FROM public.tbl_studiensemester ss WHERE ss.ende >= NOW()) + AND pss.studiensemester_kurzbz = '.$STUDIENSEMESTER.' ORDER BY pss.datum DESC, pss.insertamum DESC, pss.ext_id DESC LIMIT 1 ) AS "ReihungstestApplied", @@ -156,7 +156,7 @@ ) rtp ON(rtp.person_id = ps.person_id AND rtp.studiensemester_kurzbz = pss.studiensemester_kurzbz) WHERE pss.status_kurzbz = '.$INTERESSENT_STATUS.' AND ps.person_id = p.person_id - AND pss.studiensemester_kurzbz IN (SELECT ss.studiensemester_kurzbz FROM public.tbl_studiensemester ss WHERE ss.ende >= NOW()) + AND pss.studiensemester_kurzbz = '.$STUDIENSEMESTER.' ORDER BY pss.datum DESC, pss.insertamum DESC, pss.ext_id DESC LIMIT 1 ) AS "ReihungstestDatum", From 484cc844edd7b6096df71c6e3eafffdb9fc4e1e1 Mon Sep 17 00:00:00 2001 From: alex Date: Fri, 27 Sep 2019 16:44:01 +0200 Subject: [PATCH 18/23] - Zeitaufzeichnung Projektphasen dropdown is shown right from Projektdropdown - Projektphasen Dropdown is shown only if selected Projekt has Projektphasen --- cis/private/tools/zeitaufzeichnung.php | 46 +++++++++++++++++--------- 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/cis/private/tools/zeitaufzeichnung.php b/cis/private/tools/zeitaufzeichnung.php index df7a2bd34..94251ce12 100644 --- a/cis/private/tools/zeitaufzeichnung.php +++ b/cis/private/tools/zeitaufzeichnung.php @@ -111,8 +111,6 @@ else if (defined('CIS_ZEITAUFZEICHNUNG_GESPERRT_BIS') && CIS_ZEITAUFZEICHNUNG_GE else $gesperrt_bis = '2015-08-31'; -//var_dump($gesperrt_bis); - $sperrdatum = date('c', strtotime($gesperrt_bis)); // Uses urlencode to avoid XSS issues @@ -513,6 +511,7 @@ echo ' }, success: function(json) { + //remove Projektphasen from html if any $("#projektphase").children("option").each( function() { @@ -520,14 +519,22 @@ echo ' $(this).remove(); } ); - - var projphasenhtml = ""; - for (var i = 0; i < json.length; i++) + //append Projektphasen if any + if (json.length > 0) { - projphasenhtml += "'; sort($projekt->result); + $projektfound = false; foreach ($projekt->result as $row_projekt) { if ($projekt_kurzbz == $row_projekt->projekt_kurzbz || $filter == $row_projekt->projekt_kurzbz) + { + $projektfound = true; $selected = 'selected'; + } else $selected = ''; echo ''; } - echo ''; - echo ''; + echo ''; //Projektphase - echo ' - '.$p->t("zeitaufzeichnung/projektphase").' - '; - if (isset($projektphasen) && is_array($projektphasen)) + if ($showprojphases) { foreach ($projektphasen as $projektphase) { @@ -1018,9 +1032,9 @@ if($projekt->getProjekteMitarbeiter($user, true)) echo ''; } + echo ''; } - echo ''; - echo ''; + echo ''; } if ($za_simple == 0) From cdf3295e0162fdb2e36cd8418b8db502447c9f80 Mon Sep 17 00:00:00 2001 From: Nikolaus Krondraf Date: Wed, 2 Oct 2019 07:18:12 +0200 Subject: [PATCH 19/23] =?UTF-8?q?Auswahl=20f=C3=BCr=20Pr=C3=BCfungsinterva?= =?UTF-8?q?ll=20erg=C3=A4nzt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cis/private/lehre/pruefung/pruefungstermin_festlegen.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cis/private/lehre/pruefung/pruefungstermin_festlegen.php b/cis/private/lehre/pruefung/pruefungstermin_festlegen.php index e6f708d97..fdbce10d6 100644 --- a/cis/private/lehre/pruefung/pruefungstermin_festlegen.php +++ b/cis/private/lehre/pruefung/pruefungstermin_festlegen.php @@ -224,7 +224,8 @@ if (empty($lehrveranstaltung->lehrveranstaltungen) && !$rechte->isBerechtigt('le t('pruefung/pruefungIntervall'); ?>: From 96385e978d62dec3f8df35a59d21803e2045f9ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Wed, 2 Oct 2019 18:28:00 +0200 Subject: [PATCH 20/23] =?UTF-8?q?Anmerkung=20bei=20Abschlusspr=C3=BCfungen?= =?UTF-8?q?=20ist=20jetzt=20wieder=20sichtbar=20auch=20wenn=20die=20Uhrzei?= =?UTF-8?q?t=20ausgeblendet=20ist?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- content/student/studentabschlusspruefungoverlay.xul.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/student/studentabschlusspruefungoverlay.xul.php b/content/student/studentabschlusspruefungoverlay.xul.php index dccfff1b3..3c915e270 100644 --- a/content/student/studentabschlusspruefungoverlay.xul.php +++ b/content/student/studentabschlusspruefungoverlay.xul.php @@ -292,6 +292,8 @@ echo ''; +