Merge remote-tracking branch 'origin/master'

This commit is contained in:
Manfred Kindl
2019-10-07 18:59:36 +02:00
52 changed files with 2808 additions and 1818 deletions
@@ -1,77 +0,0 @@
<?php
/**
* FH-Complete
*
* @package FHC-API
* @author FHC-Team
* @copyright Copyright (c) 2016, fhcomplete.org
* @license GPLv3
* @link http://fhcomplete.org
* @since Version 1.0
* @filesource
*/
// ------------------------------------------------------------------------
if (!defined('BASEPATH')) exit('No direct script access allowed');
class CallerLibrary extends APIv1_Controller
{
/**
* API constructor
*/
public function __construct()
{
parent::__construct(array('Call' => '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);
}
}
@@ -1,77 +0,0 @@
<?php
/**
* FH-Complete
*
* @package FHC-API
* @author FHC-Team
* @copyright Copyright (c) 2016, fhcomplete.org
* @license GPLv3
* @link http://fhcomplete.org
* @since Version 1.0
* @filesource
*/
// ------------------------------------------------------------------------
if (!defined('BASEPATH')) exit('No direct script access allowed');
class CallerModel extends APIv1_Controller
{
/**
* API constructor
*/
public function __construct()
{
parent::__construct(array('Call' => '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);
}
}
@@ -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
@@ -0,0 +1,44 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Overview on cronjob logs
*/
class LogsViewer extends Auth_Controller
{
/**
* Constructor
*/
public function __construct()
{
parent::__construct(
array(
'index' => '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/logs/logsViewer.php');
}
}
@@ -0,0 +1,78 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Class Variables
* Provides interface for managing user variables.
*/
class Variables extends Auth_Controller
{
private $_uid;
/**
* Variables constructor.
* Sets logged in user, loads models and libraries.
*/
public function __construct()
{
parent::__construct(
array(
'setVar' => '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');
}
}
@@ -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
}
+3 -1
View File
@@ -1,9 +1,11 @@
<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
* REST_Controller takes care about authentication and it loads the AuthLib
*/
class APIv1_Controller extends REST_Controller
abstract class APIv1_Controller extends REST_Controller
{
private $_requiredPermissions;
+5 -2
View File
@@ -1,8 +1,11 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
if (!defined('BASEPATH')) exit('No direct script access allowed');
class Auth_Controller extends FHC_Controller
/**
*
*/
abstract class Auth_Controller extends FHC_Controller
{
/**
* Extends this controller if authentication is required
+4 -1
View File
@@ -2,7 +2,10 @@
if (!defined('BASEPATH')) exit('No direct script access allowed');
class CLI_Controller extends FHC_Controller
/**
*
*/
abstract class CLI_Controller extends FHC_Controller
{
const INFO_FORMAT = '%s %s %s %s'; // Info message format
const REQUIRED_PARAM_FORMAT = ' %s'; // Info message required method parameter format
+5
View File
@@ -1,5 +1,10 @@
<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
*
*/
class DB_Model extends CI_Model
{
// Default schema used by the models
+5 -2
View File
@@ -1,8 +1,11 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
if (!defined('BASEPATH')) exit('No direct script access allowed');
class FHC_Controller extends CI_Controller
/**
*
*/
abstract class FHC_Controller extends CI_Controller
{
const FHC_CONTROLLER_ID = 'fhc_controller_id'; // name of the parameter used to identify uniquely a call to a controller
+6 -1
View File
@@ -1,6 +1,11 @@
<?php
class FS_Model extends CI_Model
if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
*
*/
abstract class FS_Model extends CI_Model
{
protected $filepath; // Path of the file
+92
View File
@@ -0,0 +1,92 @@
<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
*
*/
abstract class JOB_Controller extends CLI_Controller
{
/**
* Constructor
*/
public function __construct()
{
parent::__construct();
// Loads LogLib with different debug trace levels to get data of the job that extends this class
// It also specify parameters to set database fields
$this->load->library('LogLib', array(
'classIndex' => 5,
'functionIndex' => 5,
'lineIndex' => 4,
'dbLogType' => '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;
}
}
}
-360
View File
@@ -1,360 +0,0 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Library used to call a method of a model or a library
*/
class CallerLib
{
const RESOURCE_PARAMETER = 'resource';
const FUNCTION_PARAMETER = 'function';
const REG_SPLIT_EXPR = '/\//';
const LIB_PREFIX = 'Lib';
const LIB_FILE_EXTENSION = '.php';
const LIBS_PATH = 'libraries';
const MODEL_PREFIX = '_model';
// Black list of resources that are no allowed to be used
private static $RESOURCES_BLACK_LIST = array(
'CallerLib', // disabled self loading
'LogLib', // hardly usefull and virtually dangerous
'FilesystemLib', // virtually dangerous, direct access to file system
'PermissionLib', // usefull?
'PersonLogLib'
);
private $_ci; // CI instance
/**
* Library initialization
*/
public function __construct()
{
$this->_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 <RESOURCE_PARAMETER> and <FUNCTION_PARAMETER>
* <RESOURCE_PARAMETER> is the name of the model or of the library
* <FUNCTION_PARAMETER> 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=<resource>&function=<method>&<par1>=<val1>&<par2>=<val2>&<par3>=<val3>
* will call <resource>.<method>(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;
}
}
+8
View File
@@ -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
*/
+180 -30
View File
@@ -1,102 +1,252 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
* Library usefull for logging!
* This library can log using CodeIgniter log system (file system) or to database
*/
class LogLib
{
const DEBUG = 'debug';
const ERROR = 'error';
// Log levels
const INFO = 'info';
const DEBUG = 'debug';
const WARNING = 'warning';
const ERROR = 'error';
// Default debug trace levels
const CLASS_INDEX = 3;
const FUNCTION_INDEX = 3;
const LINE_INDEX = 2;
const DB_EXECUTE_USER = 'LogLib'; // Default execute user
// Caller data names
const CLASS_NAME = 'className';
const FUNCTION_NAME = 'functionName';
const CODE_LINE = 'codeLine';
// To format the log message prefix when logging to file system
const CALLER_PREFIX = '[';
const CALLER_POSTFIX = ']';
const CLASS_POSTFIX = '->';
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;
}
+131
View File
@@ -0,0 +1,131 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Class VariableLib
* Provides functionality for managing uservariables for currently logged in user.
* Preloads variables for a user, so variables can be retrieved from views without getting uid again.
*/
class VariableLib
{
private $_variables; // Contains the retrieved variables
/**
* VariableLib constructor.
* Loads variable of logged in user.
* @param $loggeduid
*/
public function __construct($loggeduid)
{
$this->_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);
}
}
}
@@ -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;
}
}
@@ -0,0 +1,78 @@
<?php
class Variablenname_model extends DB_Model
{
// Contains SQL queries retrieving default variable values if no default is set.
private $_dynamic_defaults = array(
'semester_aktuell' => '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);
}
}
@@ -1,13 +1,14 @@
<?php
class Webservicelog_model extends DB_Model
{
/**
* Constructor
*/
public function __construct()
{
parent::__construct();
$this->dbTable = 'system.tbl_webservicelog';
$this->pk = 'webservicelog_id';
}
@@ -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')
)
);
@@ -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,13 +93,14 @@
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
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
@@ -125,13 +119,14 @@
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
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",
@@ -149,13 +144,14 @@
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
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,13 +169,15 @@
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
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",
@@ -196,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",
@@ -252,7 +251,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';
@@ -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')
)
);
@@ -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
@@ -58,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",
@@ -74,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",
@@ -90,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
@@ -112,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",
(
@@ -128,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",
@@ -145,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",
(
@@ -162,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",
@@ -179,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 = \'WS2019\')
AND pss.studiensemester_kurzbz = '.$STUDIENSEMESTER.'
ORDER BY pss.datum DESC, pss.insertamum DESC, pss.ext_id DESC
LIMIT 1
) AS "ReihungstestApplied",
@@ -215,7 +217,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
@@ -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')
)
);
@@ -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
@@ -46,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",
@@ -62,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",
@@ -78,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",
(
@@ -93,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",
(
@@ -103,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",
(
@@ -120,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",
@@ -137,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",
@@ -155,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",
@@ -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';
@@ -0,0 +1,47 @@
<?php
$this->load->view(
'templates/FHC-Header',
array(
'title' => 'Logs viewer',
'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')
)
);
?>
<body>
<div id="wrapper">
<?php echo $this->widgetlib->widget('NavigationWidget'); ?>
<div id="page-wrapper">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<h3 class="page-header">
JobsViewer
</h3>
</div>
</div>
<div>
<?php $this->load->view('system/logs/logsViewerData.php'); ?>
</div>
</div>
</div>
</div>
</body>
<?php $this->load->view('templates/FHC-Footer'); ?>
@@ -0,0 +1,66 @@
<?php
$filterWidgetArray = array(
'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',
'datasetRepresentation' => 'tablesorter',
'reloadDataset' => ($this->input->get('reloadDataset') == 'true' ? true : false),
'columnsAliases' => array(
'Log id',
'Request id',
'Execution time',
'Executed by',
'Producer',
'Data',
'Webservice type'
),
'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'] = 'logs';
$filterWidgetArray['filter_id'] = $this->input->get('filter_id');
echo $this->widgetlib->widget('FilterWidget', $filterWidgetArray);
?>
@@ -224,7 +224,8 @@ if (empty($lehrveranstaltung->lehrveranstaltungen) && !$rechte->isBerechtigt('le
<td><?php echo $p->t('pruefung/pruefungIntervall'); ?>:</td>
<td>
<select id="pruefungsintervall">
<option value="15">15</option>
<option value="10">10</option>
<option value="15">15</option>
<option value="20">20</option>
<option value="30">30</option>
</select>
+12 -6
View File
@@ -67,7 +67,13 @@ function ip_increment($ip = "")
<tr>
<td class="cmscontent" rowspan="3" valign="top">
<?php
if($is_lector || check_lektor($txtUID))
{
echo 'Die Notebook registrierung steht nur für Studierende zur Verfügung.<br>
Wollen Sie als Mitarbeiter ein Notebook registrieren wenden Sie sich bitte an den <a href="mailto:support@technikum-wien.at">Support</a> ';
echo '</td></tr></table></div></body></html>';
exit;
}
if (!$txtUID)
$txtUID = $user;
// wenn die übergebene UID nicht gleich dem
@@ -240,21 +246,21 @@ function ip_increment($ip = "")
else if ($error == 3)
echo '<h3>'.$p->t("notebookregister/MACadresseBereitsVerwendet").'.</h3>';
if(isset($mac_result) && $mac_result!='')
if(isset($mac_result) && $mac_result!=='')
{
if($mac_result == 0)
if($mac_result === 0)
{
echo '<h3>'.$p->t("notebookregister/MACadresseErfolgreichEingetragen").'.</h3>';
}
else if($mac_result == 1)
else if($mac_result === 1)
{
echo '<h3>'.$p->t("notebookregister/MACadresseErfolgreichGeaendert").'.</h3>';
}
else if($mac_result == 2)
else if($mac_result === 2)
{
echo '<h3>'.$p->t("notebookregister/MACadresseFehlerhaft").'.</h3>';
}
else if($mac_result == 3)
else if($mac_result === 3)
{
echo '<h3>'.$p->t("notebookregister/MACadresseNichtFreigeschalten").'.</h3>';
}
+96 -4
View File
@@ -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');
@@ -110,13 +111,12 @@ 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
$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 +251,13 @@ echo '
$("#kunde_uid").val(ui.item.uid);
}
});
$("#projekt").change(
function()
{
getProjektphasen($(this).val());
}
)
});
@@ -489,6 +496,49 @@ echo '
}
return true;
}
function getProjektphasen(projekt_kurzbz)
{
$.ajax
(
{
type: "GET",
url: "zeitaufzeichnung_projektphasen.php",
dataType: "json",
data:
{
"projekt_kurzbz":projekt_kurzbz
},
success: function(json)
{
//remove Projektphasen from html if any
$("#projektphase").children("option").each(
function()
{
if ($(this).prop("id") !== "projektphasekeineausw")
$(this).remove();
}
);
//append Projektphasen if any
if (json.length > 0)
{
var projphasenhtml = "";
for (var i = 0; i < json.length; i++)
{
projphasenhtml += "<option value = \'" + json[i].projektphase_id + "\'>" + json[i].bezeichnung + "<\/option>";
}
$("#projektphase").append(projphasenhtml);
$("#projektphaseformgroup").show();
}
else
{
$("#projektphaseformgroup").hide();
}
}
}
);
}
</script>
</head>
<body>
@@ -645,6 +695,7 @@ if(isset($_POST['save']) || isset($_POST['edit']) || isset($_POST['import']))
$zeit->updateamum = date('Y-m-d H:i:s');
$zeit->updatevon = $user;
$zeit->projekt_kurzbz = $projekt_kurzbz;
$zeit->projektphase_id = $projektphase_id;
$zeit->service_id = $service_id;
$zeit->kunde_uid = $kunde_uid;
@@ -667,6 +718,7 @@ if(isset($_POST['save']) || isset($_POST['edit']) || isset($_POST['import']))
$oe_kurzbz_1 = '';
$oe_kurzbz_2 = '';
$projekt_kurzbz = '';
$projektphase_id = '';
$service_id = '';
$kunde_uid = '';
}
@@ -719,8 +771,20 @@ if(isset($_GET['type']) && $_GET['type']=='edit')
$oe_kurzbz_1 = $zeit->oe_kurzbz_1;
$oe_kurzbz_2 = $zeit->oe_kurzbz_2;
$projekt_kurzbz = $zeit->projekt_kurzbz;
$projektphase_id = $zeit->projektphase_id;
$service_id = $zeit->service_id;
$kunde_uid = $zeit->kunde_uid;
$projektphase = new projektphase();
$projektphasen = array();
if($projektphase->getProjektphasen($projekt_kurzbz))
{
foreach ($projektphase->result as $row)
{
$projektphasen[] = $row;
}
}
}
else
{
@@ -932,17 +996,45 @@ if($projekt->getProjekteMitarbeiter($user, true))
<OPTION value="">-- '.$p->t('zeitaufzeichnung/keineAuswahl').' --</OPTION>';
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 '<option value="'.$db->convert_html_chars($row_projekt->projekt_kurzbz).'" '.$selected.'>'.$db->convert_html_chars($row_projekt->titel).'</option>';
}
echo '</SELECT><!--<input type="button" value="'.$p->t("zeitaufzeichnung/uebersicht").'" onclick="loaduebersicht();">--></td>';
echo '</tr>';
echo '</SELECT><!--<input type="button" value="'.$p->t("zeitaufzeichnung/uebersicht").'" onclick="loaduebersicht();">-->';
//Projektphase
$showprojphases = isset($projektphasen) && is_array($projektphasen) && count($projektphasen) > 0 && $projektfound;
$hiddentext = $showprojphases ? "" : " style='display:none'";
echo
'<span id="projektphaseformgroup"'.$hiddentext.'>&nbsp;&nbsp;&nbsp;&nbsp;'.
$p->t("zeitaufzeichnung/projektphase").'
<SELECT name="projektphase" id="projektphase">
<OPTION value="" id="projektphasekeineausw">-- '.$p->t('zeitaufzeichnung/keineAuswahl').' --</OPTION>';
if ($showprojphases)
{
foreach ($projektphasen as $projektphase)
{
if ($projektphase_id == $projektphase->projektphase_id/* || $filter == $row_projekt->projekt_kurzbz*/)
$selected = 'selected';
else
$selected = '';
echo '<option value="'.$db->convert_html_chars($projektphase->projektphase_id).'" '.$selected.'>'.$db->convert_html_chars($projektphase->bezeichnung).'</option>';
}
echo '</SELECT></span>';
}
echo '</td></tr>';
}
if ($za_simple == 0)
@@ -32,6 +32,7 @@ require_once('../../../include/benutzer.class.php');
require_once('../../../include/mitarbeiter.class.php');
require_once('../../../include/zeitaufzeichnung.class.php');
require_once('../../../include/projekt.class.php');
require_once('../../../include/projektphase.class.php');
if (!isset($_GET['projexpmonat']))
die("Parameter monat fehlt");
@@ -61,17 +62,19 @@ $daysinmonth = cal_days_in_month(CAL_GREGORIAN, $month, $year);
$date = new datum();
$ztauf = new zeitaufzeichnung();
$projektphaseclass = new projektphase();
$activitiesToIgnore = array('DienstreiseMT', 'Ersatzruhe');//aktivitaetstypen which shouldn't be added to worktime
$ztauf->getListeUserFromTo($uid, $year.'-'.$month.'-01', $year.'-'.$month.'-'.$daysinmonth, $activitiesToIgnore);
//objects for one projectline of list (corresponds to one day)
$projectlines = [];
$projektlines = array();
$dayStart = $dayEnd = '';
$projectnames = $tosubtract = $allpauseranges = [];
$projektnames = $projektphasenames = $tosubtract = $allpauseranges = array();
$activitiesToSubtract = ['Pause', 'LehreExtern', 'Arztbesuch', 'Behoerde'];//aktivitaetstypen which should be subtracted fromworktime
$ztaufdata = $ztauf->result;
$monthsums = [0 => 0.00];
$totalmonthsum = 0.00;
$projektmonthsums = array();
//sort list by startdate ascending (if not already done in zeitaufzeichnung class)
usort($ztaufdata, function ($ztaufa, $ztaufb)
@@ -85,12 +88,13 @@ usort($ztaufdata, function ($ztaufa, $ztaufb)
for ($i = 0; $i < count($ztaufdata); $i++)
{
$ztaufrow = $ztaufdata[$i];
//make sure dates are in correct format
$ztaufrow->start = $date->formatDatum($ztaufrow->start, $format = 'Y-m-d H:i:s');
$ztaufrow->ende = $date->formatDatum($ztaufrow->ende, $format = 'Y-m-d H:i:s');
$day = intval($date->formatDatum($ztaufrow->ende, 'd'));
//first entry for a day
$isFirstEntry = !isset($projectlines[$day]);
$isFirstEntry = !isset($projektlines[$day]);
//last entry for a day (next entry is different day)
$isLastEntry = !array_key_exists($i + 1, $ztaufdata) || intval($date->formatDatum($ztaufdata[$i + 1]->ende, 'd')) != $day;
@@ -137,18 +141,19 @@ for ($i = 0; $i < count($ztaufdata); $i++)
if ($isFirstEntry)
{
$projectlines[$day] = new stdClass();
$projectlines[$day]->arbeitszeit = '';
$projectlines[$day]->projekte = [];
$projektlines[$day] = new stdClass();
$projektlines[$day]->arbeitszeit = '';
$projektlines[$day]->projekte = [];
}
if (isset($ztaufrow->projekt_kurzbz))
{
//Project already in projectline - add to worktime and description
if (array_key_exists($ztaufrow->projekt_kurzbz, $projectlines[$day]->projekte))
if (array_key_exists($ztaufrow->projekt_kurzbz, $projektlines[$day]->projekte))
{
$laststart =& $projectlines[$day]->projekte[$ztaufrow->projekt_kurzbz]->laststart;
$lastende =& $projectlines[$day]->projekte[$ztaufrow->projekt_kurzbz]->lastende;
$currproj =& $projektlines[$day]->projekte[$ztaufrow->projekt_kurzbz];
$laststart =& $currproj->laststart;
$lastende =& $currproj->lastende;
$toadd = 0.00;
//case 1: there is no overlap, just add project time difference
@@ -157,56 +162,107 @@ for ($i = 0; $i < count($ztaufdata); $i++)
$toadd = $date->convertTimeStringToHours($ztaufrow->diff);
$laststart = $ztaufrow->start;
$lastende = $ztaufrow->ende;
$newprojecttime = new stdClass();
$newprojecttime->start = $ztaufrow->start;
$newprojecttime->ende = $ztaufrow->ende;
$projectlines[$day]->projekte[$ztaufrow->projekt_kurzbz]->alleZeiten[] = $newprojecttime;
$newprojekttime = new stdClass();
$newprojekttime->start = $ztaufrow->start;
$newprojekttime->ende = $ztaufrow->ende;
$currproj->alleZeiten[] = $newprojekttime;
if (isset($ztaufrow->projektphase_id))
$currproj->projektphasen[$ztaufrow->projektphase_id]->alleZeiten[] = $newprojekttime;
}
//case 2: overlap - add only part of the time
elseif ($ztaufrow->start < $lastende && $ztaufrow->ende > $lastende)
{
$toadd = ($date->mktime_fromtimestamp($ztaufrow->ende) - $date->mktime_fromtimestamp($lastende)) / 3600;
$lastende = $ztaufrow->ende;
$alleZeiten =& $projectlines[$day]->projekte[$ztaufrow->projekt_kurzbz]->alleZeiten;
$alleZeiten =& $currproj->alleZeiten;
$index = count($alleZeiten);
$alleZeiten[$index - 1]->ende = $ztaufrow->ende;
//check if overlap in projektphase, change ende accordingly
if (isset($ztaufrow->projektphase_id))
{
$projektphaseAlleZeiten =& $currproj->projektphasen[$ztaufrow->projektphase_id]->alleZeiten;
$projektphaselastendeidx = count($projektphaseAlleZeiten);
$projektphaselastende =& $projektphaseAlleZeiten[$projektphaselastendeidx - 1];
if ($ztaufrow->start < $projektphaselastende && $ztaufrow->ende > $projektphaselastende)
$projektphaselastende->ende = $ztaufrow->ende;
}
}
$currproj->stunden +=$toadd;
//add to projektphase
if (isset($ztaufrow->projektphase_id))
{
$currproj->projektphasen[$ztaufrow->projektphase_id]->stunden += $toadd;
}
$projectlines[$day]->projekte[$ztaufrow->projekt_kurzbz]->stunden += $toadd;
//concatenate descriptions "working packages" for each project
if (!empty($ztaufrow->beschreibung))
{
$packagecounter = ++$projectlines[$day]->projekte[$ztaufrow->projekt_kurzbz]->arbeitspakete;
$packagecounter = ++$currproj->arbeitspakete;
if ($packagecounter == 1)
$projectlines[$day]->projekte[$ztaufrow->projekt_kurzbz]->beschreibung = $ztaufrow->beschreibung;
$currproj->beschreibung = $ztaufrow->beschreibung;
else
$projectlines[$day]->projekte[$ztaufrow->projekt_kurzbz]->beschreibung .= " | ".str_replace(array("\r\n", "\r", "\n"), " ", $ztaufrow->beschreibung);
$currproj->beschreibung .= " | ".str_replace(array("\r\n", "\r", "\n"), " ", $ztaufrow->beschreibung);
}
}
else
{
//add new project to projectline
$newproject = new stdClass();
$newproject->laststart = $ztaufrow->start;
$newproject->lastende = $ztaufrow->ende;
$newprojecttime = new stdClass();
$newprojecttime->start = $ztaufrow->start;
$newprojecttime->ende = $ztaufrow->ende;
$newproject->alleZeiten = [];
$newproject->alleZeiten[] = $newprojecttime;
$newproject->stunden = $date->convertTimeStringToHours($ztaufrow->diff);
$newproject->arbeitspakete = 0;//counter for tracking number of descriptions (work packages)
$newproject->beschreibung = '';
$stunden = $date->convertTimeStringToHours($ztaufrow->diff);
$newprojekt = new stdClass();
$newprojekt->laststart = $ztaufrow->start;
$newprojekt->lastende = $ztaufrow->ende;
$newprojekttime = new stdClass();
$newprojekttime->start = $ztaufrow->start;
$newprojekttime->ende = $ztaufrow->ende;
$newprojekt->alleZeiten = [];
$newprojekt->alleZeiten[] = $newprojekttime;
$newprojekt->stunden = $stunden;
$newprojekt->arbeitspakete = 0;//counter for tracking number of descriptions (work packages)
$newprojekt->beschreibung = '';
if (!empty($ztaufrow->beschreibung))
{
$newproject->beschreibung = str_replace(array("\r\n", "\r", "\n"), " ", $ztaufrow->beschreibung);
$newproject->arbeitspakete++;
$newprojekt->beschreibung = str_replace(array("\r\n", "\r", "\n"), " ", $ztaufrow->beschreibung);
$newprojekt->arbeitspakete++;
}
$projectlines[$day]->projekte[$ztaufrow->projekt_kurzbz] = $newproject;
//add new project to array with unique project names
if (!in_array($ztaufrow->projekt_kurzbz, $projectnames))
$projectnames[] = $ztaufrow->projekt_kurzbz;
//add projektphasen of project
$projektphasen = array();
if ($projektphaseclass->getProjektphasen($ztaufrow->projekt_kurzbz))
{
$projektphasenames[$ztaufrow->projekt_kurzbz] = array();
foreach ($projektphaseclass->result as $ppitem)
{
$phasetoadd = new stdClass();
$phasetoadd->bezeichnung = $ppitem->bezeichnung;
$phasetoadd->stunden = 0;
$phasetoadd->alleZeiten = array();
if ($ppitem->projektphase_id == $ztaufrow->projektphase_id)
{
$phasetoadd->stunden += $stunden;
$phasetoadd->alleZeiten[] = $newprojekttime;
}
$projektphasen[$ppitem->projektphase_id] = $phasetoadd;
//add new projektphase to array with unique projekt phase names
if (!in_array($ppitem->bezeichnung, $projektphasenames[$ztaufrow->projekt_kurzbz]))
$projektphasenames[$ztaufrow->projekt_kurzbz][] = $ppitem->bezeichnung;
}
}
$newprojekt->projektphasen = $projektphasen;
$projektlines[$day]->projekte[$ztaufrow->projekt_kurzbz] = $newprojekt;
//add new projekt to array with unique projekt names
if (!in_array($ztaufrow->projekt_kurzbz, $projektnames))
$projektnames[] = $ztaufrow->projekt_kurzbz;
}
}
@@ -215,7 +271,7 @@ for ($i = 0; $i < count($ztaufdata); $i++)
$worktime_unix = $date->mktime_fromtimestamp($dayEnd) - $date->mktime_fromtimestamp($dayStart);
$worktimehours = $worktime_unix / 3600;
$projectlines[$day]->arbeitszeit = $worktimehours;
$projektlines[$day]->arbeitszeit = $worktimehours;
$pauseSubtracted = 0.00;
$lehreExternExists = false;
@@ -224,42 +280,71 @@ for ($i = 0; $i < count($ztaufdata); $i++)
{
if ($subtraction->typ == $activitiesToSubtract[0])
{
$projectlines[$day]->arbeitszeit -= $subtraction->diff;
$projektlines[$day]->arbeitszeit -= $subtraction->diff;
$pauseSubtracted += $subtraction->diff;
}
elseif ($subtraction->typ == $activitiesToSubtract[1] && $subtraction->start >= $dayStart && $subtraction->ende <= $dayEnd)
{
$projectlines[$day]->arbeitszeit -= $subtraction->diff;
$projektlines[$day]->arbeitszeit -= $subtraction->diff;
$lehreExternExists = true;
}
elseif ($subtraction->typ == $activitiesToSubtract[2] || $subtraction->typ == $activitiesToSubtract[3])
{
$projectlines[$day]->arbeitszeit -= $subtraction->diff;
$projektlines[$day]->arbeitszeit -= $subtraction->diff;
}
}
//subtract pauses from project worktimes
//subtract pauses from projekt worktimes
foreach ($allpauseranges as $pauserange)
{
foreach ($projectlines[$day]->projekte as $name => $project)
foreach ($projektlines[$day]->projekte as $name => $projekt)
{
foreach ($projectlines[$day]->projekte[$name]->alleZeiten as $zeit)
$proj =& $projektlines[$day]->projekte[$name];
foreach ($proj->alleZeiten as $zeit)
{
//pause between project start and end
$subtraction = 0.00;
//pause between projekt start and end
if ($pauserange->start >= $zeit->start && $pauserange->ende <= $zeit->ende)
{
$projectlines[$day]->projekte[$name]->stunden -= ($date->mktime_fromtimestamp($pauserange->ende) - $date->mktime_fromtimestamp($pauserange->start)) / 3600;
break;
$subtraction = $date->mktime_fromtimestamp($pauserange->ende) - $date->mktime_fromtimestamp($pauserange->start);
}
//pause and project time overlap at project time end
//pause and projekt time overlap at projekt time end
elseif ($pauserange->start < $zeit->ende && $pauserange->start > $zeit->start)
{
$projectlines[$day]->projekte[$name]->stunden -= ($date->mktime_fromtimestamp($zeit->ende) - $date->mktime_fromtimestamp($pauserange->start)) / 3600;
$subtraction = $date->mktime_fromtimestamp($zeit->ende) - $date->mktime_fromtimestamp($pauserange->start);
//$proj->stunden -= ($date->mktime_fromtimestamp($zeit->ende) - $date->mktime_fromtimestamp($pauserange->start)) / 3600;
}
//pause and project time overlap at project time start
//pause and projekt time overlap at projekt time start
elseif ($pauserange->ende > $zeit->start && $pauserange->ende < $zeit->ende)
{
$projectlines[$day]->projekte[$name]->stunden -= ($date->mktime_fromtimestamp($pauserange->ende) - $date->mktime_fromtimestamp($zeit->start)) / 3600;
$subtraction = $date->mktime_fromtimestamp($pauserange->ende) - $date->mktime_fromtimestamp($zeit->start);
}
$proj->stunden -= $subtraction / 3600;
}
//subtract from projektphasen
foreach ($proj->projektphasen as $phase_id => $phase)
{
foreach ($phase->alleZeiten as $zeit)
{
$subtraction = 0.00;
//pause between projektphase start and end
if ($pauserange->start >= $zeit->start && $pauserange->ende <= $zeit->ende)
{
$subtraction = ($date->mktime_fromtimestamp($pauserange->ende) - $date->mktime_fromtimestamp($pauserange->start));
}
//pause and projekt time overlap at projektphase time end
elseif ($pauserange->start < $zeit->ende && $pauserange->start > $zeit->start)
{
$subtraction = $date->mktime_fromtimestamp($zeit->ende) - $date->mktime_fromtimestamp($pauserange->start);
}
//pause and projekt time overlap at projektphase time start
elseif ($pauserange->ende > $zeit->start && $pauserange->ende < $zeit->ende)
{
$subtraction = $date->mktime_fromtimestamp($pauserange->ende) - $date->mktime_fromtimestamp($zeit->start);
}
$proj->projektphasen[$phase_id]->stunden -= $subtraction / 3600;
}
}
}
@@ -268,29 +353,47 @@ for ($i = 0; $i < count($ztaufdata); $i++)
//worktime with no break greater 6 -> compulsory break of half an hour
if ($pauseSubtracted < 0.5 && !$lehreExternExists)
{
if ($projectlines[$day]->arbeitszeit >= 6.5)
$projectlines[$day]->arbeitszeit -= 0.5;
if ($projektlines[$day]->arbeitszeit >= 6.5)
$projektlines[$day]->arbeitszeit -= 0.5;
//ensure that no worktime gets smaller than 6 hours because of compulsory break
elseif ($projectlines[$day]->arbeitszeit > 6)
$projectlines[$day]->arbeitszeit -= $projectlines[$day]->arbeitszeit - 6;
elseif ($projektlines[$day]->arbeitszeit > 6)
$projektlines[$day]->arbeitszeit -= $projektlines[$day]->arbeitszeit - 6;
}
$projectlines[$day]->arbeitszeit = round($projectlines[$day]->arbeitszeit, 2);
$projektlines[$day]->arbeitszeit = round($projektlines[$day]->arbeitszeit, 2);
foreach ($projectlines[$day]->projekte as $name => $project)
//calculate sums
foreach ($projektlines[$day]->projekte as $name => $projekt)
{
$projecthours =& $projectlines[$day]->projekte[$name]->stunden;
$projecthours = round($projecthours, 2);
if (array_key_exists($name, $monthsums))
$monthsums[$name] += $projecthours;
$projekthours =& $projektlines[$day]->projekte[$name]->stunden;
$projekthours = round($projekthours, 2);
if (isset($projektmonthsums[$name]->sum))
{
$projektmonthsums[$name]->sum += $projekthours;
foreach ($projekt->projektphasen as $projektphase)
{
$projektmonthsums[$name]->projektphasen[$projektphase->bezeichnung] += round($projektphase->stunden, 2, 0);
}
}
else
$monthsums[$name] = $projecthours;
{
$monthsum = new stdClass();
$monthsum->sum = $projekthours;
$monthsum->projektphasen = array();
foreach ($projekt->projektphasen as $projektphase)
{
$monthsum->projektphasen[$projektphase->bezeichnung] = round($projektphase->stunden, 2, 0);
}
$projektmonthsums[$name] = $monthsum;
}
}
$dayStart = $dayEnd = '';
$tosubtract = $allpauseranges = [];
$monthsums[0] += $projectlines[$day]->arbeitszeit;
$totalmonthsum += $projektlines[$day]->arbeitszeit;
}
}
@@ -301,10 +404,6 @@ $workbook->setVersion(8);
// sending HTTP headers
$workbook->send('Projektliste_'.$month.'_'.$year.'.xls');
// Creating a worksheet
$worksheet =& $workbook->addWorksheet($p->t('zeitaufzeichnung/projektliste'));
$worksheet->setInputEncoding('utf-8');
// Define formats
$format_heading_left =& $workbook->addFormat();
$format_heading_left->setBold();
@@ -365,6 +464,12 @@ $format_cell_rightline->setBorder(1);
$format_cell_rightline->setVAlign('vcenter');
$format_cell_rightline->setRight(2);
$format_cell_leftrightline =& $workbook->addFormat();
$format_cell_leftrightline->setBottom(1);
$format_cell_leftrightline->setVAlign('vcenter');
$format_cell_leftrightline->setLeft(2);
$format_cell_leftrightline->setRight(2);
$format_cell_centered =& $workbook->addFormat();
$format_cell_centered->setBorder(1);
$format_cell_centered->setAlign('center');
@@ -372,7 +477,6 @@ $format_cell_centered->setVAlign('vcenter');
$format_cell_centered_leftline =& $workbook->addFormat();
$format_cell_centered_leftline->setRight(1);
$format_cell_centered_leftline->setLeft(1);
$format_cell_centered_leftline->setBottom(1);
$format_cell_centered_leftline->setAlign('center');
$format_cell_centered_leftline->setVAlign('vcenter');
@@ -384,6 +488,20 @@ $format_cell_centered_rightline->setAlign('center');
$format_cell_centered_rightline->setVAlign('vcenter');
$format_cell_centered_rightline->setRight(2);
$format_cell_centered_leftrightline =& $workbook->addFormat();
$format_cell_centered_leftrightline->setBottom(1);
$format_cell_centered_leftrightline->setAlign('center');
$format_cell_centered_leftrightline->setVAlign('vcenter');
$format_cell_centered_leftrightline->setLeft(2);
$format_cell_centered_leftrightline->setRight(2);
$format_cell_centered_topbottomline =& $workbook->addFormat();
$format_cell_centered_topbottomline->setBorder(1);
$format_cell_centered_topbottomline->setAlign('center');
$format_cell_centered_topbottomline->setVAlign('vcenter');
$format_cell_centered_topbottomline->setBottom(2);
$format_cell_centered_topbottomline->setTop(2);
$format_cell_centered_topbottomleftline =& $workbook->addFormat();
$format_cell_centered_topbottomleftline->setBorder(1);
$format_cell_centered_topbottomleftline->setAlign('center');
@@ -406,178 +524,243 @@ $format_cell_centered_alllines->setAlign('center');
$format_cell_centered_alllines->setVAlign('vcenter');
//define column widths
$nrProjects = count($projectnames);
$nrProjects = count($projektnames);
$totalwidth = 150;
$daywidth = 4;
$totalworktimewidth = 13;
$worktimewidth = 8;
$worksheet->setColumn(0, 1, $daywidth);
$worksheet->setColumn(2, 2, $totalworktimewidth);
$worktimewidth = 14;
$timecolumnswidth = 2 * $daywidth + $totalworktimewidth + $worktimewidth;
//calculate max width for project descriptions
$maxwidthprojects = $totalworktimewidth * (12 - $nrProjects);
$projectcolumnwidths = array_fill_keys($projectnames, $worktimewidth);
//set project column width depending on project description widths
foreach ($projectlines as $line)
if ($nrProjects < 1)//no projekts - merge all cells and write notice
{
foreach ($line->projekte as $key => $project)
$projektnames[] = "Keine Projekte vorhanden";
}
foreach ($projektnames as $projektname)
{
//Creating a worksheet
$worksheet =& $workbook->addWorksheet($projektname);
$worksheet->setInputEncoding('utf-8');
//general options
$worksheet->setLandscape();
$worksheet->hideGridlines();
$worksheet->hideScreenGridlines();
$worksheet->setmargins(0.4);
//fixed width columns
$worksheet->setColumn(0, 1, $daywidth);
$worksheet->setColumn(2, 2, $totalworktimewidth);
//calculate number of columns of projekt with phases
$nrPhases = isset($projektphasenames[$projektname]) ? count($projektphasenames[$projektname]) : 0;
//get taetigkeiten column width -
//minimum is wordlength, maximum restwidth after subraction of projektphase minimum width
$mintaetigkeitenwidth = strlen($p->t('zeitaufzeichnung/taetigkeit'));
$maxtaetigkeitenlimit = $totalwidth - $timecolumnswidth - $nrPhases * $worktimewidth;
if (isset($projektlines->projekte[$projektname]))
{
if ($projectcolumnwidths[$key] < strlen($project->beschreibung))
$projectcolumnwidths[$key] = strlen($project->beschreibung);
}
}
//distribute width remainder evenly among projects
if ($nrProjects != 0)
$remwidth = ($maxwidthprojects - array_sum($projectcolumnwidths)) / $nrProjects;
foreach ($projectcolumnwidths as $projectname => $width)
$projectcolumnwidths[$projectname] += $remwidth;
//calculating spaces for centering global header texts
$numberspaces = ($maxwidthprojects - 10 - strlen($username));
$spacesstringFirst = '';
while ($numberspaces > 0)
{
$spacesstringFirst .= ' ';
$numberspaces--;
}
$numberspaces = ($maxwidthprojects - 14 - strlen($persnr));
$spacesstringSecond = '';
while ($numberspaces > 0)
{
$spacesstringSecond .= ' ';
$numberspaces--;
}
$spalte = $zeile = 0;
//set language options
$decpoint = $sprache_index === '2' ? '.' : ',';
$thousandsep = $sprache_index === '2' ? ',' : '.';
//write global header
$lastspalte = ($nrProjects > 0) ? 2 + count($projectnames) * 2 : 14;
$worksheet->setMerge($zeile, $spalte, $zeile + 1, $spalte + 2);
$worksheet->write($zeile, $spalte, $monthtext.' '.$year, $format_heading_left);
$worksheet->write($zeile + 1, $spalte, $monthtext.' '.$year, $format_heading_left);
for ($i = 1; $i < 3; $i++)
{
$worksheet->write($zeile, $spalte + $i, '', $format_heading_topline);
$worksheet->write($zeile + 1, $spalte + $i, '', $format_heading_bottomline);
}
$worksheet->setMerge($zeile, $spalte + 3, $zeile, $lastspalte);
$worksheet->setMerge($zeile + 1, $spalte + 3, $zeile + 1, $lastspalte);
$worksheet->write($zeile, $spalte + 3, $p->t('zeitaufzeichnung/projektlistegedruckt').$spacesstringFirst.$username, $format_heading_right);
for ($i = 4; $i < $lastspalte; $i++)
{
$worksheet->write($zeile, $i, '', $format_heading_topline);
$worksheet->write($zeile + 1, $i, '', $format_heading_bottomline);
}
$worksheet->write($zeile, $lastspalte, '', $format_heading_right);
$worksheet->write($zeile + 1, $spalte + 3, date('d.m.Y H:i').$spacesstringSecond.$p->t('zeitaufzeichnung/personalnr').$persnr, $format_heading_right_bottomline);
$worksheet->write($zeile + 1, $lastspalte, '', $format_heading_right_bottomline);
$zeile += 3;
//general options
$worksheet->setLandscape();
$worksheet->hideGridlines();
$worksheet->hideScreenGridlines();
//write table header
$worksheet->setMerge($zeile, $spalte, $zeile + 1, $spalte + 1);
$worksheet->write($zeile, $spalte, $p->t('zeitaufzeichnung/tag'), $format_bold_centered_alllines);
$worksheet->write($zeile + 1, $spalte, '', $format_bold_centered_alllines);
$worksheet->write($zeile, $spalte + 1, $p->t('zeitaufzeichnung/tag'), $format_bold_centered_alllines);
$worksheet->write($zeile + 1, ++$spalte, '', $format_bold_centered_alllines);
$worksheet->setMerge($zeile, ++$spalte, $zeile + 1, $spalte);
$worksheet->write($zeile, $spalte, $p->t('zeitaufzeichnung/arbeitszeit'), $format_bold_centered_alllines);
$worksheet->write($zeile + 1, $spalte, '', $format_bold_centered_alllines);
$spalte++;
foreach ($projectnames as $project)
{
$worksheet->setMerge($zeile, $spalte, $zeile, $spalte + 1);
$worksheet->write($zeile, $spalte, $project, $format_bold_centered_toprightline);
$worksheet->write($zeile, $spalte + 1, '', $format_bold_centered_toprightline);
$worksheet->write($zeile + 1, $spalte, $p->t('zeitaufzeichnung/stunden'), $format_bold_centered_bottomline);
$worksheet->write($zeile + 1, $spalte + 1, $p->t('zeitaufzeichnung/taetigkeit'), $format_bold_centered_bottomrightline);
$spalte += 2;
}
$zeile += 2;
//write table body
for ($daysnmbr = 1; $daysnmbr <= $daysinmonth; $daysnmbr++)
{
//write day and weekday
$spalte = 0;
$monthstr = ($month < 10) ? '0'.$month : $month;
$daystr = ($daysnmbr < 10) ? '0'.$daysnmbr : $daysnmbr;
$datestring = $year.'-'.$monthstr.'-'.$daystr;
$weekday = substr($tagbez[$sprache_index][$date->formatDatum($datestring, 'N')], 0, 2);
$worksheet->write($zeile, $spalte++, $weekday, $format_cell_centered_leftline);
$worksheet->write($zeile, $spalte++, $daysnmbr, $format_cell_centered_rightline);
if (array_key_exists($daysnmbr, $projectlines))
{
//write worktime
$worksheet->writeString($zeile, $spalte++, number_format($projectlines[$daysnmbr]->arbeitszeit, 2, $decpoint, $thousandsep), $format_cell_centered_rightline);
$spaltetemp = $spalte;
//write projects
foreach ($projectnames as $project)
foreach ($projektlines->projekte[$projektname] as $projekt)
{
if (array_key_exists($project, $projectlines[$daysnmbr]->projekte))
$projektbeschreibunglength = strlen($projekt->beschreibung);
if ($projektbeschreibunglength >= $maxtaetigkeitenlimit)
{
$worksheet->setColumn($spalte, $spalte, $worktimewidth);
$worksheet->writeString($zeile, $spalte++, number_format($projectlines[$daysnmbr]->projekte[$project]->stunden, 2, $decpoint, $thousandsep), $format_cell_centered_leftline);
$worksheet->setColumn($spalte, $spalte, $projectcolumnwidths[$project]);
$worksheet->write($zeile, $spalte++, $projectlines[$daysnmbr]->projekte[$project]->beschreibung, $format_cell_rightline);
}
else
{
$worksheet->write($zeile, $spalte++, '', $format_cell_centered_leftline);
$worksheet->write($zeile, $spalte++, '', $format_cell_rightline);
$mintaetigkeitenwidth = $maxtaetigkeitenlimit;
break;
}
elseif ($projektbeschreibunglength > $mintaetigkeitenwidth)
$mintaetigkeitenwidth = $projektbeschreibunglength;
}
}
//get projektphase width, width depending on bezeichnung
$phasewidth = 0;
$phasewidthlimit = $nrPhases > 0
? ($totalwidth - $timecolumnswidth - $mintaetigkeitenwidth) / $nrPhases
: $totalwidth - 4 * $daywidth - $worktimewidth - $mintaetigkeitenwidth;
if (isset($projektphasenames[$projektname]))
{
foreach ($projektphasenames[$projektname] as $projektphasename)
{
$projektphasewidth = strlen($projektphasename);
if ($projektphasewidth >= $phasewidthlimit)
{
$phasewidth = $phasewidthlimit;
break;
}
elseif ($projektphasewidth > $phasewidth)
$phasewidth = $projektphasewidth;
}
}
//width remainder used for taetigkeit
$taetigkeitenwidth = $totalwidth - $timecolumnswidth - $phasewidth * $nrPhases;
$lastspalte = 4 + $nrPhases;
//calculating spaces for centering global header texts
$usernamelength = strlen($username) * 1.77;
$numberspacesfirstrow = $totalwidth - $daywidth * 2 - $worktimewidth - $usernamelength;
$numberspacessecondrow = $numberspacesfirstrow + $usernamelength - strlen($p->t('zeitaufzeichnung/personalnr').$persnr) - 4;
$spacesstringfirstrow = str_repeat(' ', $numberspacesfirstrow);
$spacesstringsecondrow = str_repeat(' ', $numberspacessecondrow);
$spalte = $zeile = 0;
//set language options
$decpoint = $sprache_index === '2' ? '.' : ',';
$thousandsep = $sprache_index === '2' ? ',' : '.';
//write global header
$worksheet->setMerge($zeile, $spalte, $zeile + 1, $spalte + 2);
$worksheet->write($zeile, $spalte, $monthtext.' '.$year, $format_heading_left);
$worksheet->write($zeile + 1, $spalte, $monthtext.' '.$year, $format_heading_left);
for ($i = 1; $i < 3; $i++)
{
$worksheet->write($zeile, $spalte + $i, '', $format_heading_topline);
$worksheet->write($zeile + 1, $spalte + $i, '', $format_heading_bottomline);
}
$worksheet->setMerge($zeile, $spalte + 3, $zeile, $lastspalte);
$worksheet->setMerge($zeile + 1, $spalte + 3, $zeile + 1, $lastspalte);
$worksheet->write($zeile, $spalte + 3, $p->t('zeitaufzeichnung/projektlistegedruckt').$spacesstringfirstrow.$username, $format_heading_right);
for ($i = 4; $i < $lastspalte; $i++)
{
$worksheet->write($zeile, $i, '', $format_heading_topline);
$worksheet->write($zeile + 1, $i, '', $format_heading_bottomline);
}
$worksheet->write($zeile, $lastspalte, '', $format_heading_right);
$worksheet->write($zeile + 1, $spalte + 3, date('d.m.Y H:i').$spacesstringsecondrow.$p->t('zeitaufzeichnung/personalnr').$persnr, $format_heading_right_bottomline);
$worksheet->write($zeile + 1, $lastspalte, '', $format_heading_right_bottomline);
$zeile += 3;
$spalte = 0;
//write table header
$worksheet->setMerge($zeile, $spalte, $zeile + 1, $spalte + 1);
$worksheet->write($zeile, $spalte, $p->t('zeitaufzeichnung/tag'), $format_bold_centered_alllines);
$worksheet->write($zeile + 1, $spalte, '', $format_bold_centered_alllines);
$worksheet->write($zeile, $spalte + 1, $p->t('zeitaufzeichnung/tag'), $format_bold_centered_alllines);
$worksheet->write($zeile + 1, ++$spalte, '', $format_bold_centered_alllines);
$worksheet->setMerge($zeile, ++$spalte, $zeile + 1, $spalte);
$worksheet->write($zeile, $spalte, $p->t('zeitaufzeichnung/arbeitszeit'), $format_bold_centered_alllines);
$worksheet->write($zeile + 1, $spalte, '', $format_bold_centered_alllines);
$spalte++;
if (isset($projektphasenames[$projektname]))
{
$phasenames = $projektphasenames[$projektname];
$phasenameslength = count($phasenames);
}
else
{
//write empty cells until end of table
$worksheet->writeString($zeile, $spalte, number_format(0, 2, $decpoint, $thousandsep), $format_cell_centered_leftline);
$toskip = count($projectnames) * 2;
for ($i = 0; $i <= $toskip; $i++)
{
if ($i % 2 == 0)
$worksheet->write($zeile, $spalte, '', $format_cell_centered_rightline);
else
$worksheet->write($zeile, $spalte, '', $format_cell_centered);
$spalte++;
}
$phasenames = array();
$phasenameslength = 0;
}
$zeile++;
$worksheet->write($zeile, $spalte + $phasenameslength + 1, '', $format_bold_centered_toprightline);
$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;
$zeile += 2;
//write table body
for ($daysnmbr = 1; $daysnmbr <= $daysinmonth; $daysnmbr++)
{
//write day and weekday
$spalte = 0;
$monthstr = ($month < 10) ? '0'.$month : $month;
$daystr = ($daysnmbr < 10) ? '0'.$daysnmbr : $daysnmbr;
$datestring = $year.'-'.$monthstr.'-'.$daystr;
$weekday = substr($tagbez[$sprache_index][$date->formatDatum($datestring, 'N')], 0, 2);
$worksheet->write($zeile, $spalte++, $weekday, $format_cell_centered_leftline);
$worksheet->write($zeile, $spalte++, $daysnmbr, $format_cell_centered_rightline);
if (array_key_exists($daysnmbr, $projektlines))
{
//write worktime
$worksheet->writeString($zeile, $spalte++, number_format($projektlines[$daysnmbr]->arbeitszeit, 2, $decpoint, $thousandsep), $format_cell_centered_rightline);
$spaltetemp = $spalte;
//write projekt
if (array_key_exists($projektname, $projektlines[$daysnmbr]->projekte))
{
$projekt = $projektlines[$daysnmbr]->projekte[$projektname];
$worksheet->setColumn($spalte, $spalte, $worktimewidth);
$worksheet->writeString($zeile, $spalte++, number_format($projekt->stunden, 2, $decpoint, $thousandsep), $format_cell_centered_leftrightline);
foreach ($projekt->projektphasen as $projektphase)
{
$worksheet->setColumn($spalte, $spalte, $phasewidth);
$worksheet->writeString($zeile, $spalte++, number_format($projektphase->stunden, 2, $decpoint, $thousandsep), $format_cell_centered);
}
$worksheet->setColumn($spalte, $spalte, $phasewidth);
$worksheet->write($zeile, $spalte++, $projekt->beschreibung, $format_cell_leftrightline);
}
}
else
{
$worksheet->writeString($zeile, $spalte++, number_format(0, 2, $decpoint, $thousandsep), $format_cell_centered_leftrightline);
}
if (!array_key_exists($daysnmbr, $projektlines) || !array_key_exists($projektname, $projektlines[$daysnmbr]->projekte))
{
if (isset($projektphasenames[$projektname]))
{
//write empty cells until end of table
$worksheet->write($zeile, $spalte, '', $format_cell_centered_leftrightline);
$toskip = count($projektphasenames[$projektname]);
for ($i = 0; $i <= $toskip; $i++)
{
if ($i == 0)
$format = $format_cell_centered_leftrightline;
else
$format = $format_cell_centered;
$worksheet->write($zeile, $spalte++, '', $format);
}
$worksheet->write($zeile, $spalte, '', $format_cell_centered_leftrightline);
}
}
$zeile++;
}
//write monthly sums
$spalte = 0;
$worksheet->setMerge($zeile, $spalte, $zeile, $spalte + 1);
$worksheet->write($zeile, $spalte, $p->t('zeitaufzeichnung/summe'), $format_bold_centered_alllines);
$worksheet->write($zeile, $spalte + 1, '', $format_bold_centered_alllines);
$spalte += 2;
$worksheet->writeString($zeile, $spalte++, number_format($totalmonthsum, 2, $decpoint, $thousandsep), $format_cell_centered_alllines);
if (isset($projektmonthsums[$projektname]))
{
$worksheet->writeString($zeile, $spalte++, number_format($projektmonthsums[$projektname]->sum, 2, $decpoint, $thousandsep), $format_cell_centered_alllines);
foreach ($projektmonthsums[$projektname]->projektphasen as $projektphase)
{
$worksheet->writeString($zeile, $spalte++, number_format($projektphase, 2, $decpoint, $thousandsep), $format_cell_centered_topbottomline);
}
$worksheet->write($zeile, $spalte++, '', $format_cell_centered_alllines);
}
$zeile += 2;
$worksheet->fitToPages(1, 1);
}
if ($nrProjects < 1)
//no projects - merge all cells and write notice
{
$worksheet->setMerge(3, 3, 4 + $daysinmonth, $lastspalte);
$worksheet->write(3, 3, $p->t('zeitaufzeichnung/keineprojekte'), $format_bold_centered_alllines);
$worksheet->write(3, $lastspalte, '', $format_bold_centered_alllines);
}
//write monthly sums
$spalte = 0;
$worksheet->setMerge($zeile, $spalte, $zeile, $spalte + 1);
$worksheet->write($zeile, $spalte, $p->t('zeitaufzeichnung/summe'), $format_bold_centered_alllines);
$worksheet->write($zeile, $spalte + 1, '', $format_bold_centered_alllines);
$spalte += 2;
$worksheet->writeString($zeile, $spalte++, number_format($monthsums[0], 2, $decpoint, $thousandsep), $format_cell_centered_alllines);
foreach ($projectnames as $project)
{
$worksheet->writeString($zeile, $spalte++, number_format($monthsums[$project], 2, $decpoint, $thousandsep), $format_cell_centered_topbottomleftline);
$worksheet->write($zeile, $spalte++, '', $format_cell_centered_topbottomrightline);
}
$worksheet->fitToPages(1, 1);
$workbook->close();
@@ -0,0 +1,28 @@
<?php
require_once('../../../config/cis.config.inc.php');
/*require_once('../../../include/functions.inc.php');*/
require_once('../../../include/basis_db.class.php');
require_once('../../../include/projektphase.class.php');
if (!$db = new basis_db())
die('Es konnte keine Verbindung zum Server aufgebaut werden.');
//$uid=get_uid();
if(isset($_GET['projekt_kurzbz'])) // TODO maybe check that phasen only shown if projekt is projekt of logged in user
{
$projekt_kurzbz = $_GET['projekt_kurzbz'];
$projektphase = new projektphase();
if($projektphase->getProjektphasen($projekt_kurzbz))
{
$result_obj = array();
foreach($projektphase->result as $row)
{
$item['projektphase_id']=$row->projektphase_id;
$item['bezeichnung']=$row->bezeichnung;
$result_obj[]=$item;
}
echo json_encode($result_obj);
}
exit;
}
+1 -1
View File
@@ -60,7 +60,7 @@ foreach ($mitarbeiterDAO->result as $key => $foo)
array_multisort($nachname, SORT_ASC, $vorname, SORT_ASC, $mitarbeiterDAO->result);
$spalte = array('titelpre', 'vorname', 'vornamen', 'nachname', 'titelpost','gebdatum','svnr','ersatzkennzeichen',
$spalte = array('anrede','titelpre', 'vorname', 'vornamen', 'nachname', 'titelpost','gebdatum','svnr','ersatzkennzeichen',
'aktiv','personalnummer', 'kurzbz','fixangestellt','lektor');
$anzSpalten = count($spalte);
@@ -292,6 +292,8 @@ echo '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>';
<vbox>
<box class="Datum" id="student-abschlusspruefung-datum-datum" disabled="true"/>
</vbox>
<label value="Anmerkung" control="student-abschlusspruefung-textbox-anmerkung" />
<textbox id="student-abschlusspruefung-textbox-anmerkung" multiline="true" maxlength="256" disabled="true"/>
</row>
<row id="student-abschlusspruefung-datum-uhrzeit-row">
<vbox>
@@ -300,8 +302,6 @@ echo '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>';
<vbox>
<timepicker id="student-abschlusspruefung-datum-uhrzeit" hideseconds="true" disabled="true"/>
</vbox>
<label value="Anmerkung" control="student-abschlusspruefung-textbox-anmerkung" />
<textbox id="student-abschlusspruefung-textbox-anmerkung" multiline="true" maxlength="256" disabled="true"/>
</row>
<row>
<vbox>
+6 -6
View File
@@ -32,7 +32,7 @@
*/
class File_Match
{
// {{{ Properties (All private)
var $find;
@@ -61,7 +61,7 @@ class File_Match
* feature only works with the "normal" search.
*
*/
function File_Match($find, $files, $directories = '', $include_subdir = 1, $ignore_lines = array())
function __construct($find, $files, $directories = '', $include_subdir = 1, $ignore_lines = array())
{
$this->find = $find;
@@ -309,7 +309,7 @@ class File_Match
$file = fread($fp = fopen($filename, 'r'), filesize($filename));
fclose($fp);
$this->occurences = preg_match($this->find, $file, $this->match);
$this->occurences = preg_match($this->find, $file, $this->match);
}
// }}}
@@ -342,7 +342,7 @@ class File_Match
// }}}
// {{{ writeout()
/**
* Function to writeout the file contents.
*
@@ -430,7 +430,7 @@ class File_Match
// }}}
// {{{ doFind()
/**
* This starts the search/replace off. Call this to do the search.
* First do whatever files are specified, and/or if directories are specified,
@@ -447,7 +447,7 @@ class File_Match
if ($this->directories != '') $this->doDirectories($this->find_function);
}
}
// }}}
}
+5 -5
View File
@@ -32,7 +32,7 @@
*/
class File_SearchReplace
{
// {{{ Properties (All private)
var $find;
@@ -63,7 +63,7 @@ class File_SearchReplace
*
* @author Richard Heyes <richard.heyes@heyes-computing.net>
*/
function File_SearchReplace($find, $replace, $files, $directories = '', $include_subdir = 1, $ignore_lines = array())
function __construct($find, $replace, $files, $directories = '', $include_subdir = 1, $ignore_lines = array())
{
$this->find = $find;
@@ -367,7 +367,7 @@ class File_SearchReplace
// }}}
// {{{ writeout()
/**
* Function to writeout the file contents.
*
@@ -455,7 +455,7 @@ class File_SearchReplace
// }}}
// {{{ doSearch()
/**
* This starts the search/replace off. Call this to do the search.
* First do whatever files are specified, and/or if directories are specified,
@@ -472,7 +472,7 @@ class File_SearchReplace
if ($this->directories != '') $this->doDirectories($this->search_function);
}
}
// }}}
}
+1 -1
View File
@@ -213,7 +213,7 @@ class dvb extends basis_db
return ErrorHandler::error($errormsg);
}
$studienjahr = substr($studiensemester_kurzbz, 4);
$studienjahr = substr($studiensemester_kurzbz, 2);
$art = substr($studiensemester_kurzbz, 0, 2);
if ($art == 'SS')
$studienjahr = $studienjahr - 1;
+3 -3
View File
@@ -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';
+35 -35
View File
@@ -17,7 +17,7 @@
*
* Authors: Karl Burkhart <burkhart@technikum-wien.at>.
*/
require_once(dirname(__FILE__).'/basis_db.class.php');
require_once(dirname(__FILE__).'/benutzerberechtigung.class.php');
@@ -35,7 +35,7 @@ class webservicerecht extends basis_db
public $new; // boolean
public $result = array(); // webservicerecht object array
/**
* Konstruktor - Laedt optional einen DS
* @param $webservicerecht_id
@@ -47,85 +47,85 @@ class webservicerecht extends basis_db
if(!is_null($webservicerecht_id))
$this->load($webservicerecht_id);
}
/**
* Überprüft ob ein User die Berechtigung für eine Methode zum lesen besitzt
* true wenn user lesen darf, false wenn nicht
*
*
* @param $user
* @param $methode
* @param $methode
* @param $klasse
*/
public function isUserAuthorized($user, $methode, $klasse=null)
{
$berechtigung = new benutzerberechtigung();
$berechtigung = new benutzerberechtigung();
$berechtigung->getBerechtigungen($user);
$berechtigungArray = array();
$berechtigungArray = array();
foreach ($berechtigung->berechtigungen as $recht)
{
{
// ist berechtigung noch gültig
if(($recht->start < date('Y-m-d') || $recht->start=='') && ($recht->ende > date('Y-m-d') || $recht->ende==''))
$berechtigungArray[] = $recht->berechtigung_kurzbz;
$berechtigungArray[] = $recht->berechtigung_kurzbz;
}
$qry = "SELECT 1 from system.tbl_webservicerecht where methode = ".$this->db_add_param($methode)."
$qry = "SELECT 1 from system.tbl_webservicerecht where methode = ".$this->db_add_param($methode)."
AND berechtigung_kurzbz IN (".$this->implode4SQL($berechtigungArray).')';
if(!is_null($klasse))
$qry.=" AND klasse=".$this->db_add_param($klasse);
if($result = $this->db_query($qry))
{
if($this->db_num_rows($result) == 0 )
{
return false;
return false;
}
}
else
return false;
return true;
return false;
return true;
}
/**
* Löscht alle Attribute für die ein User keine Berechtiung hat
*
*
* @param $user
* @param $methode
* @param $objec
*
*
*/
public function clearResponse($user, $methode, $object)
{
$berechtigung = new benutzerberechtigung();
$berechtigung = new benutzerberechtigung();
$berechtigung->getBerechtigungen($user);
$berechtigungArray = array();
$attributArray = array();
$berechtigungArray = array();
$attributArray = array();
foreach ($berechtigung->berechtigungen as $recht)
$berechtigungArray[] = $recht->berechtigung_kurzbz;
$qry = "SELECT attribut from system.tbl_webservicerecht where methode = ".$this->db_add_param($methode)."
$berechtigungArray[] = $recht->berechtigung_kurzbz;
$qry = "SELECT attribut from system.tbl_webservicerecht where methode = ".$this->db_add_param($methode)."
AND berechtigung_kurzbz IN (".$this->implode4SQL($berechtigungArray).');';
if($result = $this->db_query($qry))
{
while($row = $this->db_fetch_object($result))
{
$attributArray[] = $row->attribut;
$attributArray[] = $row->attribut;
}
}
$helpObject = new stdClass();
$helpObject = new stdClass();
for($i = 0; $i<sizeof($attributArray); $i++)
{
if(isset($object->$attributArray[$i]))
$helpObject->$attributArray[$i] = $object->$attributArray[$i];
if(isset($object->{$attributArray[$i]}))
$helpObject->{$attributArray[$i]} = $object->{$attributArray[$i]};
}
return $helpObject;
return $helpObject;
}
}
File diff suppressed because it is too large Load Diff
+61 -60
View File
@@ -1,60 +1,61 @@
<?php
$this->phrasen['zeitaufzeichnung/zeitaufzeichnung']='Zeitaufzeichnung';
$this->phrasen['zeitaufzeichnung/benutzerWurdeNichtGefunden']='Benutzer %s wurde nicht gefunden';
$this->phrasen['zeitaufzeichnung/zeitaufzeichnungVon']='Zeitaufzeichnung von';
$this->phrasen['zeitaufzeichnung/neu']='NEU';
$this->phrasen['zeitaufzeichnung/projekt']='Projekt';
$this->phrasen['zeitaufzeichnung/keineAuswahl']='keine Auswahl';
$this->phrasen['zeitaufzeichnung/aktivitaet']='Aktivität';
$this->phrasen['zeitaufzeichnung/id']='ID';
$this->phrasen['zeitaufzeichnung/user']='User';
$this->phrasen['zeitaufzeichnung/start']='Start';
$this->phrasen['zeitaufzeichnung/ende']='Ende';
$this->phrasen['zeitaufzeichnung/dauer']='Dauer';
$this->phrasen['zeitaufzeichnung/gesamtdauer']='Gesamtdauer';
$this->phrasen['zeitaufzeichnung/sieSindDerzeitKeinenProjektenZugeordnet']='Sie sind derzeit keinen Projekten zugeordnet';
$this->phrasen['zeitaufzeichnung/fehlerBeimErmittelnDerProjekte']='Fehler beim Ermitteln der Projekte';
$this->phrasen['zeitaufzeichnung/organisationseinheit1']='Organisationseinheit 1';
$this->phrasen['zeitaufzeichnung/organisationseinheit2']='Organisationseinheit 2';
$this->phrasen['zeitaufzeichnung/organisationseinheiten']='Organisationseinheit';
$this->phrasen['zeitaufzeichnung/oe']='OE';
$this->phrasen['zeitaufzeichnung/service']='Service';
$this->phrasen['zeitaufzeichnung/kunde']='Kunde';
$this->phrasen['zeitaufzeichnung/alsNeuenEintragSpeichern']='Als neuen Eintrag speichern';
$this->phrasen['zeitaufzeichnung/kartennummer']='Kartennummer';
$this->phrasen['zeitaufzeichnung/oderKartennummerOptional']='oder Kartennummer (optional)';
$this->phrasen['zeitaufzeichnung/nameEingeben']='Name eingeben';
$this->phrasen['zeitaufzeichnung/aktuelleZeitLaden']='Aktuelle Zeit laden';
$this->phrasen['zeitaufzeichnung/alsEndzeitUebernehmen']='Als Endzeit übernehmen';
$this->phrasen['zeitaufzeichnung/alsStartzeitUebernehmen']='Als Startzeit übernehmen';
$this->phrasen['zeitaufzeichnung/uebersicht']='Projektübersicht';
$this->phrasen['zeitaufzeichnung/zeitraumAuffallendHoch']='Achtung, eingegebener Zeitraum ist auffallend hoch. \nWollen Sie die Daten dennoch speichern?';
$this->phrasen['zeitaufzeichnung/bisDatumKleinerAlsVonDatum']='Das Bis-Datum darf nicht kleiner als das Von-Datum sein';
$this->phrasen['zeitaufzeichnung/tagessumme']='Tagessumme:';
$this->phrasen['zeitaufzeichnung/wochensumme']='Wochensumme:';
$this->phrasen['zeitaufzeichnung/wochensummeEintraege']='Wochensumme Einträge';
$this->phrasen['zeitaufzeichnung/wochensummeArbeitszeit']='Wochensumme Arbeitszeit';
$this->phrasen['zeitaufzeichnung/xTageAnsicht']='%s Tage Ansicht';
$this->phrasen['zeitaufzeichnung/endeXTageAnsicht']='Ende der %s Tage Ansicht';
$this->phrasen['zeitaufzeichnung/alleAnzeigen']='Alle anzeigen';
$this->phrasen['zeitaufzeichnung/alleEintraege']='Alle Einträge';
$this->phrasen['zeitaufzeichnung/summeEintraege']='Summe Einträge';
$this->phrasen['zeitaufzeichnung/arbeitszeit']='Arbeitszeit';
$this->phrasen['zeitaufzeichnung/pause']='Pausen';
$this->phrasen['zeitaufzeichnung/inklusivePflichtpause']='inkl. 30 min. Pflichtpause';
$this->phrasen['zeitaufzeichnung/handbuchZeitaufzeichnung']='Arbeitszeitaufzeichnung Leitfaden';
$this->phrasen['zeitaufzeichnung/fiktiveNormalarbeitszeit']='Vereinbarung der fiktiven Normalarbeitszeit';
$this->phrasen['zeitaufzeichnung/projektexport']='Projektexport';
$this->phrasen['zeitaufzeichnung/projektliste']='Projektliste';
$this->phrasen['zeitaufzeichnung/projektlistegedruckt']='Projektliste gedruckt am:';
$this->phrasen['zeitaufzeichnung/personalnr']='Personal-Nr.:';
$this->phrasen['zeitaufzeichnung/jahr']='Jahr:';
$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/taetigkeit']='Tätigkeit';
$this->phrasen['zeitaufzeichnung/keineprojekte']='keine Projekte vorhanden';
$this->phrasen['zeitaufzeichnung/summe']='Summe:';
$this->phrasen['zeitaufzeichnung/dienstreise']='Dienstreise';
<?php
$this->phrasen['zeitaufzeichnung/zeitaufzeichnung']='Zeitaufzeichnung';
$this->phrasen['zeitaufzeichnung/benutzerWurdeNichtGefunden']='Benutzer %s wurde nicht gefunden';
$this->phrasen['zeitaufzeichnung/zeitaufzeichnungVon']='Zeitaufzeichnung von';
$this->phrasen['zeitaufzeichnung/neu']='NEU';
$this->phrasen['zeitaufzeichnung/projekt']='Projekt';
$this->phrasen['zeitaufzeichnung/projektphase']='Projektphase';
$this->phrasen['zeitaufzeichnung/keineAuswahl']='keine Auswahl';
$this->phrasen['zeitaufzeichnung/aktivitaet']='Aktivität';
$this->phrasen['zeitaufzeichnung/id']='ID';
$this->phrasen['zeitaufzeichnung/user']='User';
$this->phrasen['zeitaufzeichnung/start']='Start';
$this->phrasen['zeitaufzeichnung/ende']='Ende';
$this->phrasen['zeitaufzeichnung/dauer']='Dauer';
$this->phrasen['zeitaufzeichnung/gesamtdauer']='Gesamtdauer';
$this->phrasen['zeitaufzeichnung/sieSindDerzeitKeinenProjektenZugeordnet']='Sie sind derzeit keinen Projekten zugeordnet';
$this->phrasen['zeitaufzeichnung/fehlerBeimErmittelnDerProjekte']='Fehler beim Ermitteln der Projekte';
$this->phrasen['zeitaufzeichnung/organisationseinheit1']='Organisationseinheit 1';
$this->phrasen['zeitaufzeichnung/organisationseinheit2']='Organisationseinheit 2';
$this->phrasen['zeitaufzeichnung/organisationseinheiten']='Organisationseinheit';
$this->phrasen['zeitaufzeichnung/oe']='OE';
$this->phrasen['zeitaufzeichnung/service']='Service';
$this->phrasen['zeitaufzeichnung/kunde']='Kunde';
$this->phrasen['zeitaufzeichnung/alsNeuenEintragSpeichern']='Als neuen Eintrag speichern';
$this->phrasen['zeitaufzeichnung/kartennummer']='Kartennummer';
$this->phrasen['zeitaufzeichnung/oderKartennummerOptional']='oder Kartennummer (optional)';
$this->phrasen['zeitaufzeichnung/nameEingeben']='Name eingeben';
$this->phrasen['zeitaufzeichnung/aktuelleZeitLaden']='Aktuelle Zeit laden';
$this->phrasen['zeitaufzeichnung/alsEndzeitUebernehmen']='Als Endzeit übernehmen';
$this->phrasen['zeitaufzeichnung/alsStartzeitUebernehmen']='Als Startzeit übernehmen';
$this->phrasen['zeitaufzeichnung/uebersicht']='Projektübersicht';
$this->phrasen['zeitaufzeichnung/zeitraumAuffallendHoch']='Achtung, eingegebener Zeitraum ist auffallend hoch. \nWollen Sie die Daten dennoch speichern?';
$this->phrasen['zeitaufzeichnung/bisDatumKleinerAlsVonDatum']='Das Bis-Datum darf nicht kleiner als das Von-Datum sein';
$this->phrasen['zeitaufzeichnung/tagessumme']='Tagessumme:';
$this->phrasen['zeitaufzeichnung/wochensumme']='Wochensumme:';
$this->phrasen['zeitaufzeichnung/wochensummeEintraege']='Wochensumme Einträge';
$this->phrasen['zeitaufzeichnung/wochensummeArbeitszeit']='Wochensumme Arbeitszeit';
$this->phrasen['zeitaufzeichnung/xTageAnsicht']='%s Tage Ansicht';
$this->phrasen['zeitaufzeichnung/endeXTageAnsicht']='Ende der %s Tage Ansicht';
$this->phrasen['zeitaufzeichnung/alleAnzeigen']='Alle anzeigen';
$this->phrasen['zeitaufzeichnung/alleEintraege']='Alle Einträge';
$this->phrasen['zeitaufzeichnung/summeEintraege']='Summe Einträge';
$this->phrasen['zeitaufzeichnung/arbeitszeit']='Arbeitszeit';
$this->phrasen['zeitaufzeichnung/pause']='Pausen';
$this->phrasen['zeitaufzeichnung/inklusivePflichtpause']='inkl. 30 min. Pflichtpause';
$this->phrasen['zeitaufzeichnung/handbuchZeitaufzeichnung']='Arbeitszeitaufzeichnung Leitfaden';
$this->phrasen['zeitaufzeichnung/fiktiveNormalarbeitszeit']='Vereinbarung der fiktiven Normalarbeitszeit';
$this->phrasen['zeitaufzeichnung/projektexport']='Projektexport';
$this->phrasen['zeitaufzeichnung/projektliste']='Projektliste';
$this->phrasen['zeitaufzeichnung/projektlistegedruckt']='Projektliste gedruckt am:';
$this->phrasen['zeitaufzeichnung/personalnr']='Personal-Nr.:';
$this->phrasen['zeitaufzeichnung/jahr']='Jahr:';
$this->phrasen['zeitaufzeichnung/monat']='Monat:';
$this->phrasen['zeitaufzeichnung/tag']='Tag';
$this->phrasen['zeitaufzeichnung/startdatum']='Startdatum:';
$this->phrasen['zeitaufzeichnung/enddatum']='Enddatum:';
$this->phrasen['zeitaufzeichnung/projektstunden']='Projektstunden';
$this->phrasen['zeitaufzeichnung/taetigkeit']='Tätigkeit';
$this->phrasen['zeitaufzeichnung/keineprojekte']='keine Projekte vorhanden';
$this->phrasen['zeitaufzeichnung/summe']='Summe:';
$this->phrasen['zeitaufzeichnung/dienstreise']='Dienstreise';
+61 -60
View File
@@ -1,60 +1,61 @@
<?php
$this->phrasen['zeitaufzeichnung/zeitaufzeichnung']='Timesheet';
$this->phrasen['zeitaufzeichnung/benutzerWurdeNichtGefunden']='User %s not found';
$this->phrasen['zeitaufzeichnung/zeitaufzeichnungVon']='Timesheet for';
$this->phrasen['zeitaufzeichnung/neu']='NEW';
$this->phrasen['zeitaufzeichnung/projekt']='Project';
$this->phrasen['zeitaufzeichnung/keineAuswahl']='no selection';
$this->phrasen['zeitaufzeichnung/aktivitaet']='Activity';
$this->phrasen['zeitaufzeichnung/id']='ID';
$this->phrasen['zeitaufzeichnung/user']='User';
$this->phrasen['zeitaufzeichnung/start']='Start';
$this->phrasen['zeitaufzeichnung/ende']='End';
$this->phrasen['zeitaufzeichnung/dauer']='Length';
$this->phrasen['zeitaufzeichnung/gesamtdauer']='Total time';
$this->phrasen['zeitaufzeichnung/sieSindDerzeitKeinenProjektenZugeordnet']='You are not currently assigned to any projects';
$this->phrasen['zeitaufzeichnung/fehlerBeimErmittelnDerProjekte']='Error retrieving project data';
$this->phrasen['zeitaufzeichnung/organisationseinheit1']='Organisation Unit 1';
$this->phrasen['zeitaufzeichnung/organisationseinheit2']='Organisation Unit 2';
$this->phrasen['zeitaufzeichnung/organisationseinheiten']='Organisation Unit';
$this->phrasen['zeitaufzeichnung/oe']='OU';
$this->phrasen['zeitaufzeichnung/service']='Service';
$this->phrasen['zeitaufzeichnung/kunde']='Client';
$this->phrasen['zeitaufzeichnung/alsNeuenEintragSpeichern']='Save as new';
$this->phrasen['zeitaufzeichnung/kartennummer']='Number';
$this->phrasen['zeitaufzeichnung/oderKartennummerOptional']='or number of card (optional)';
$this->phrasen['zeitaufzeichnung/nameEingeben']='Enter name';
$this->phrasen['zeitaufzeichnung/aktuelleZeitLaden']='Load current time';
$this->phrasen['zeitaufzeichnung/alsEndzeitUebernehmen']='Transfer to endtime';
$this->phrasen['zeitaufzeichnung/alsStartzeitUebernehmen']='Transfer to starttime';
$this->phrasen['zeitaufzeichnung/uebersicht']='Projectoverview';
$this->phrasen['zeitaufzeichnung/zeitraumAuffallendHoch']='Warning! Period entered is noticeably long. \nDo you want to save the dates anyway?';
$this->phrasen['zeitaufzeichnung/bisDatumKleinerAlsVonDatum']='The \'To\' date may not be earlier than the \'From\' date.';
$this->phrasen['zeitaufzeichnung/tagessumme']='Total day:';
$this->phrasen['zeitaufzeichnung/wochensumme']='Total week:';
$this->phrasen['zeitaufzeichnung/wochensummeEintraege']='Total week';
$this->phrasen['zeitaufzeichnung/wochensummeArbeitszeit']='Total week working time';
$this->phrasen['zeitaufzeichnung/xTageAnsicht']='%s days view';
$this->phrasen['zeitaufzeichnung/endeXTageAnsicht']='End of %s days view';
$this->phrasen['zeitaufzeichnung/alleAnzeigen']='Show all';
$this->phrasen['zeitaufzeichnung/alleEintraege']='All entries';
$this->phrasen['zeitaufzeichnung/summeEintraege']='Total';
$this->phrasen['zeitaufzeichnung/arbeitszeit']='Working time';
$this->phrasen['zeitaufzeichnung/pause']='Breaks';
$this->phrasen['zeitaufzeichnung/inklusicePlichtpause']='incl. 30 min. lunch break';
$this->phrasen['zeitaufzeichnung/handbuchZeitaufzeichnung']='Timesheet howto';
$this->phrasen['zeitaufzeichnung/fiktiveNormalarbeitszeit']='Vereinbarung der fiktiven Normalarbeitszeit';
$this->phrasen['zeitaufzeichnung/projektexport']='Projectexport';
$this->phrasen['zeitaufzeichnung/projektliste']='Projectlist';
$this->phrasen['zeitaufzeichnung/projektlistegedruckt']='Projectlist printed on:';
$this->phrasen['zeitaufzeichnung/personalnr']='staff number ';
$this->phrasen['zeitaufzeichnung/jahr']='Year:';
$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/taetigkeit']='Activity';
$this->phrasen['zeitaufzeichnung/keineprojekte']='no projects exist';
$this->phrasen['zeitaufzeichnung/summe']='Sum:';
$this->phrasen['zeitaufzeichnung/dienstreise']='Business Trip';
<?php
$this->phrasen['zeitaufzeichnung/zeitaufzeichnung']='Timesheet';
$this->phrasen['zeitaufzeichnung/benutzerWurdeNichtGefunden']='User %s not found';
$this->phrasen['zeitaufzeichnung/zeitaufzeichnungVon']='Timesheet for';
$this->phrasen['zeitaufzeichnung/neu']='NEW';
$this->phrasen['zeitaufzeichnung/projekt']='Project';
$this->phrasen['zeitaufzeichnung/projektphase']='Projectphase';
$this->phrasen['zeitaufzeichnung/keineAuswahl']='no selection';
$this->phrasen['zeitaufzeichnung/aktivitaet']='Activity';
$this->phrasen['zeitaufzeichnung/id']='ID';
$this->phrasen['zeitaufzeichnung/user']='User';
$this->phrasen['zeitaufzeichnung/start']='Start';
$this->phrasen['zeitaufzeichnung/ende']='End';
$this->phrasen['zeitaufzeichnung/dauer']='Length';
$this->phrasen['zeitaufzeichnung/gesamtdauer']='Total time';
$this->phrasen['zeitaufzeichnung/sieSindDerzeitKeinenProjektenZugeordnet']='You are not currently assigned to any projects';
$this->phrasen['zeitaufzeichnung/fehlerBeimErmittelnDerProjekte']='Error retrieving project data';
$this->phrasen['zeitaufzeichnung/organisationseinheit1']='Organisation Unit 1';
$this->phrasen['zeitaufzeichnung/organisationseinheit2']='Organisation Unit 2';
$this->phrasen['zeitaufzeichnung/organisationseinheiten']='Organisation Unit';
$this->phrasen['zeitaufzeichnung/oe']='OU';
$this->phrasen['zeitaufzeichnung/service']='Service';
$this->phrasen['zeitaufzeichnung/kunde']='Client';
$this->phrasen['zeitaufzeichnung/alsNeuenEintragSpeichern']='Save as new';
$this->phrasen['zeitaufzeichnung/kartennummer']='Number';
$this->phrasen['zeitaufzeichnung/oderKartennummerOptional']='or number of card (optional)';
$this->phrasen['zeitaufzeichnung/nameEingeben']='Enter name';
$this->phrasen['zeitaufzeichnung/aktuelleZeitLaden']='Load current time';
$this->phrasen['zeitaufzeichnung/alsEndzeitUebernehmen']='Transfer to endtime';
$this->phrasen['zeitaufzeichnung/alsStartzeitUebernehmen']='Transfer to starttime';
$this->phrasen['zeitaufzeichnung/uebersicht']='Projectoverview';
$this->phrasen['zeitaufzeichnung/zeitraumAuffallendHoch']='Warning! Period entered is noticeably long. \nDo you want to save the dates anyway?';
$this->phrasen['zeitaufzeichnung/bisDatumKleinerAlsVonDatum']='The \'To\' date may not be earlier than the \'From\' date.';
$this->phrasen['zeitaufzeichnung/tagessumme']='Total day:';
$this->phrasen['zeitaufzeichnung/wochensumme']='Total week:';
$this->phrasen['zeitaufzeichnung/wochensummeEintraege']='Total week';
$this->phrasen['zeitaufzeichnung/wochensummeArbeitszeit']='Total week working time';
$this->phrasen['zeitaufzeichnung/xTageAnsicht']='%s days view';
$this->phrasen['zeitaufzeichnung/endeXTageAnsicht']='End of %s days view';
$this->phrasen['zeitaufzeichnung/alleAnzeigen']='Show all';
$this->phrasen['zeitaufzeichnung/alleEintraege']='All entries';
$this->phrasen['zeitaufzeichnung/summeEintraege']='Total';
$this->phrasen['zeitaufzeichnung/arbeitszeit']='Working time';
$this->phrasen['zeitaufzeichnung/pause']='Breaks';
$this->phrasen['zeitaufzeichnung/inklusicePlichtpause']='incl. 30 min. lunch break';
$this->phrasen['zeitaufzeichnung/handbuchZeitaufzeichnung']='Timesheet howto';
$this->phrasen['zeitaufzeichnung/fiktiveNormalarbeitszeit']='Vereinbarung der fiktiven Normalarbeitszeit';
$this->phrasen['zeitaufzeichnung/projektexport']='Projectexport';
$this->phrasen['zeitaufzeichnung/projektliste']='Projectlist';
$this->phrasen['zeitaufzeichnung/projektlistegedruckt']='Projectlist printed on:';
$this->phrasen['zeitaufzeichnung/personalnr']='staff number ';
$this->phrasen['zeitaufzeichnung/jahr']='Year:';
$this->phrasen['zeitaufzeichnung/monat']='Month:';
$this->phrasen['zeitaufzeichnung/tag']='Day';
$this->phrasen['zeitaufzeichnung/startdatum']='Startdate:';
$this->phrasen['zeitaufzeichnung/enddatum']='Enddate:';
$this->phrasen['zeitaufzeichnung/projektstunden']='Project hours';
$this->phrasen['zeitaufzeichnung/taetigkeit']='Activity';
$this->phrasen['zeitaufzeichnung/keineprojekte']='no projects exist';
$this->phrasen['zeitaufzeichnung/summe']='Sum:';
$this->phrasen['zeitaufzeichnung/dienstreise']='Business Trip';
+1
View File
@@ -29,6 +29,7 @@ $this->phrasen['zeitaufzeichnung/organisationseinheit2']='';
$this->phrasen['zeitaufzeichnung/organisationseinheiten']='';
$this->phrasen['zeitaufzeichnung/pause']='';
$this->phrasen['zeitaufzeichnung/projekt']='';
$this->phrasen['zeitaufzeichnung/projektphase']='';
$this->phrasen['zeitaufzeichnung/service']='';
$this->phrasen['zeitaufzeichnung/sieSindDerzeitKeinenProjektenZugeordnet']='';
$this->phrasen['zeitaufzeichnung/start']='';
+16
View File
@@ -114,6 +114,22 @@
width: 100px;
}
.text-red {
color: red;
}
.text-orange {
color: orange;
}
.text-blue {
color: blue;
}
.text-green {
color: green;
}
#dragAndDropFieldsArea
{
display: inline-table !important;
@@ -0,0 +1,7 @@
/* styles for infocenter overview page */
/* horizontal line after Studiensemester in dataset table header */
hr.studiensemesterline
{
margin: 6px 6px;
}
+20 -3
View File
@@ -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
@@ -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 = '<form id="sendMsgsForm" method="post" action="'+ url +'" target="_blank"></form>';
$("#datasetActionsTop").before(formHtml);
var studienSemesterHtml = '<button class="btn btn-default btn-xs decStudiensemester">' +
'<i class="fa fa-chevron-left"></i>' +
'</button>&nbsp;' +
infocenter_studiensemester +
'&nbsp;<button class="btn btn-default btn-xs incStudiensemester">' +
'<i class="fa fa-chevron-right"></i>' +
'</button>';
var selectAllHtml =
'<a href="javascript:void(0)" class="selectAll">' +
'<i class="fa fa-check"></i>&nbsp;Alle</a>&nbsp;&nbsp;' +
@@ -44,6 +52,21 @@ var InfocenterPersonDataset = {
var legendHtml = '<i class="fa fa-circle text-danger"></i> Gesperrt&nbsp;&nbsp;&nbsp;&nbsp;' +
'<i class="fa fa-circle text-info"></i> Geparkt';
// userdefined Semestervariable shown independently of personcount,
// it is possible to change the semester
$("#datasetActionsTop, #datasetActionsBottom").append(
"<div class='row'>"+
"<div class='col-xs-12 text-center'>"+studienSemesterHtml+"</div>"+
"</div><div class='h-divider'></div><hr class='studiensemesterline'>");
$("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(
"<div class='row'>"+
"<div class='col-xs-6'>" + selectAllHtml + "&nbsp;&nbsp;" + actionHtml + "</div>"+
"<div class='col-xs-4'>" + legendHtml + "</div>"+
"<div class='col-xs-2 text-right'>" +
"<div class='col-xs-4'>" + selectAllHtml + "&nbsp;&nbsp;" + actionHtml + "</div>"+
"<div class='col-xs-4 text-center'>" + legendHtml + "</div>"+
"<div class='col-xs-4 text-right'>" +
"<span class='filterTableDatasetCntFiltered'></span>" +
countHtml + "</div>"+
"<div class='clearfix'></div>"+
@@ -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);
});
+2 -2
View File
@@ -109,7 +109,7 @@ function verifyData($parameters)
}
// überprüfe vorname
if($person->vorname != $parameters->Vorname)
if(mb_strtolower($person->vorname) != mb_strtolower($parameters->Vorname))
{
// es wurde keine übereinstimmung gefunden
$obj->result = 'false';
@@ -117,7 +117,7 @@ function verifyData($parameters)
return $obj;
}
if($person->nachname != $parameters->Name)
if(mb_strtolower($person->nachname) != mb_strtolower($parameters->Name))
{
// es wurde keine übereinstimmung gefunden
$obj->result = 'false';
+2 -2
View File
@@ -58,7 +58,7 @@ if($result = $db->db_query($qry))
$message .= " - Ihr Home-Verzeichnis (inkl. aller Dateien) gelöscht werden.\n";
$message .= "\n";
$message .= "Falls es sich bei der Deaktivierung um einen Irrtum handelt, würden wir Sie bitten, sich umgehend mit den KollegInnen in der Personalabteilung in Verbindung zu setzen: ";
$message .= "Frau Natalie König, natalie.koenig@technikum-wien.at\n";
$message .= "Frau Dragana Vitorovic, dragana.vitorovic@technikum-wien.at\n";
$message .= "\n";
$message .= "Mit freundlichen Grüßen\n";
$message .= "\n";
@@ -212,7 +212,7 @@ if($result = $db->db_query($qry))
$message .= " - Ihr Home-Verzeichnis (inkl. aller Dateien) gelöscht werden\n";
$message .= "\n";
$message .= "Falls es sich bei der Deaktivierung um einen Irrtum handelt, würden wir Sie bitten, sich umgehend mit den KollegInnen in der Personalabteilung in Verbindung zu setzen: ";
$message .= "Frau Natalie König, natalie.koenig@technikum-wien.at\n";
$message .= "Frau Dragana Vitorovic, dragana.vitorovic@technikum-wien.at\n";
$message .= "\n";
$message .= "Mit freundlichen Grüßen\n";
$message .= "\n";
+81
View File
@@ -3030,6 +3030,86 @@ if(!$result = @$db->db_query("SELECT stufe FROM public.tbl_dokumentstudiengang L
echo '<br>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 '<strong>public.tbl_variablenname ' . $db->db_last_error() . '</strong><br>';
else
echo '<br>Created public.tbl_variablenname';
// 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 '<strong>public.tbl_variablenname ' . $db->db_last_error() . '</strong><br>';
else
echo '<br>Granted privileges to <strong>web</strong> 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 '<strong>public.tbl_variablenname ' . $db->db_last_error() . '</strong><br>';
else
echo '<br>Granted privileges to <strong>vilesci</strong> on public.tbl_variablenname';
}
// 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 '<strong>campus.tbl_zeitaufzeichnung: '.$db->db_last_error().'</strong><br>';
else
echo '<br>campus.tbl_zeitaufzeichnung: Spalte projektphase_id 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 '<strong>system.tbl_webservicetyp '.$db->db_last_error().'</strong><br>';
else
echo ' system.tbl_webservicetyp: Added webservice type "job"<br>';
}
}
// *** Pruefung und hinzufuegen der neuen Attribute und Tabellen
echo '<H2>Pruefe Tabellen und Attribute!</H2>';
@@ -3258,6 +3338,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"),
+166 -1
View File
@@ -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,171 @@ $filters = array(
}
',
'oe_kurzbz' => null,
),
array(
'app' => 'core',
'dataset_name' => 'logs',
'filter_kurzbz' => 'last7days',
'description' => '{Last 7 days logs}',
'sort' => 1,
'default_filter' => true,
'filter' => '
{
"name": "All logs from the last 7 days",
"columns": [
{"name": "RequestId"},
{"name": "ExecutionTime"},
{"name": "ExecutedBy"},
{"name": "Description"},
{"name": "Data"}
],
"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,
)
);