Merge branch 'master' into feature-4026/TabulatorWidget

This commit is contained in:
Paolo
2019-11-04 15:08:42 +01:00
319 changed files with 24476 additions and 44629 deletions
+1 -1
View File
@@ -119,7 +119,7 @@
- **[DEPRECATED]** Spalte ort_kurzbz in tbl_reihungstest wird nicht mehr verwendet und in zukünftigen Versionen entfernt
Zum Update auf diese Version folgen Sie den Anweisungen auf folgender Seite:
http://fhcomplete.technikum-wien.at/dokuwiki/doku.php?id=fh-complete:codeigniter
https://wiki.fhcomplete.org/doku.php?id=fh-complete:codeigniter
## [3.1.0] - 2015-11-12
### Added
+2 -2
View File
@@ -1,5 +1,5 @@
# FH-Complete
* [FH-Complete Homepage](http://www.fhcomplete.org)
* [Wiki](http://fhcomplete.technikum-wien.at/dokuwiki/)
* [FH-Complete Homepage](https://www.fhcomplete.org)
* [Wiki](https://wiki.fhcomplete.org/)
* [Changelog](CHANGELOG.md)
+12
View File
@@ -503,3 +503,15 @@ $config['rewrite_short_tags'] = FALSE;
| Array: array('10.0.1.200', '192.168.5.0/24')
*/
$config['proxy_ips'] = '';
/*
|--------------------------------------------------------------------------
| FHComplete Build Version
|--------------------------------------------------------------------------
|
| Version Number of the Current Build
| This is used to invalidate Cache for JS and CSS Files
|
| Example: 2019102901
*/
$config['fhcomplete_build_version'] = '2019102903';
+7
View File
@@ -82,6 +82,13 @@ $config['navigation_header'] = array(
'expand' => true,
'sort' => 10,
'requiredPermissions' => 'admin:r'
),
'logsviewer' => array(
'link' => site_url('system/LogsViewer'),
'description' => 'Logs',
'expand' => true,
'sort' => 20,
'requiredPermissions' => 'system/developer:r'
)
)
)
+19 -372
View File
@@ -1,6 +1,6 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
defined('BASEPATH') OR exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------
@@ -10,79 +10,7 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
| Set to force the use of HTTPS for REST API calls
|
*/
$config['force_https'] = FALSE;
/*
|--------------------------------------------------------------------------
| REST Output Format
|--------------------------------------------------------------------------
|
| The default format of the response
|
| 'array': Array data structure
| 'csv': Comma separated file
| 'json': Uses json_encode(). Note: If a GET query string
| called 'callback' is passed, then jsonp will be returned
| 'html' HTML using the table library in CodeIgniter
| 'php': Uses var_export()
| 'serialized': Uses serialize()
| 'xml': Uses simplexml_load_string()
|
*/
$config['rest_default_format'] = 'json';
/*
|--------------------------------------------------------------------------
| REST Supported Output Formats
|--------------------------------------------------------------------------
|
| The following setting contains a list of the supported/allowed formats.
| You may remove those formats that you don't want to use.
| If the default format $config['rest_default_format'] is missing within
| $config['rest_supported_formats'], it will be added silently during
| REST_Controller initialization.
|
*/
$config['rest_supported_formats'] = [
'json',
'array',
'csv',
'html',
'jsonp',
'php',
'serialized',
'xml',
];
/*
|--------------------------------------------------------------------------
| REST Status Field Name
|--------------------------------------------------------------------------
|
| The field name for the status inside the response
|
*/
$config['rest_status_field_name'] = 'status';
/*
|--------------------------------------------------------------------------
| REST Message Field Name
|--------------------------------------------------------------------------
|
| The field name for the message inside the response
|
*/
$config['rest_message_field_name'] = 'error';
/*
|--------------------------------------------------------------------------
| Enable Emulate Request
|--------------------------------------------------------------------------
|
| Should we enable emulation of the request (e.g. used in Mootools request)
|
*/
$config['enable_emulate_request'] = TRUE;
$config['force_https'] = TRUE;
/*
|--------------------------------------------------------------------------
@@ -104,8 +32,8 @@ $config['rest_realm'] = 'FHC REST API';
| Set to specify the REST API requires to be logged in
|
| FALSE No login required
| 'basic' Unsecure login
| 'digest' More secure login
| 'basic' Unsecured login
| 'digest' More secured login
| 'session' Check for a PHP session variable. See 'auth_source' to set the
| authorization key
|
@@ -119,8 +47,7 @@ $config['rest_auth'] = 'basic';
|
| Is login required and if so, the user store to use
|
| '' Use config based users or wildcard testing, only for testing purpose
| it would be very unsecure to let unset in a production environment
| '' Use config based users or wildcard testing
| 'ldap' Use LDAP authentication
| 'library' Use a authentication library
|
@@ -140,94 +67,34 @@ $config['auth_source'] = 'library';
| In other cases override the function _perform_library_auth in your controller
|
| For digest authentication the library function should return already a stored
| password for that username, even if it is hashed
| md5(username:restrealm:password) for that username
|
| e.g: md5('admin:REST API:1234') = '1e957ebc35631ab22d5bd6526bd14ea2'
|
*/
$config['auth_library_class'] = 'AuthLib';
// rest_auth is basic
$config['auth_library_function'] = 'basicAuthentication';
// rest_auth is digest
//$config['auth_library_function'] = 'digestAuthentication';
/*
|--------------------------------------------------------------------------
| Override auth types for specific class/method
| Global IP White-listing
|--------------------------------------------------------------------------
|
| Set specific authentication types for methods within a class (controller)
|
| Set as many config entries as needed. Any methods not set will use the default 'rest_auth' config value.
|
| e.g:
|
| $config['auth_override_class_method']['deals']['view'] = 'none';
| $config['auth_override_class_method']['deals']['insert'] = 'digest';
| $config['auth_override_class_method']['accounts']['user'] = 'basic';
| $config['auth_override_class_method']['dashboard']['*'] = 'none|digest|basic';
|
| Here 'deals', 'accounts' and 'dashboard' are controller names, 'view', 'insert' and 'user' are methods within.
* An asterisk may also be used to specify an authentication method for an entire classes methods.
* Ex: $config['auth_override_class_method']['dashboard']['*'] = 'basic'; (NOTE: leave off the '_get' or '_post' from the end
* of the method name)
| Acceptable values are; 'none', 'digest' and 'basic'.
|
*/
// $config['auth_override_class_method']['deals']['view'] = 'none';
// $config['auth_override_class_method']['deals']['insert'] = 'digest';
// $config['auth_override_class_method']['accounts']['user'] = 'basic';
// $config['auth_override_class_method']['dashboard']['*'] = 'basic';
// ---Uncomment list line for the wildard unit test
// $config['auth_override_class_method']['wildcard_test_cases']['*'] = 'basic';
/*
|--------------------------------------------------------------------------
| Override auth types for specfic 'class/method/HTTP method'
|--------------------------------------------------------------------------
|
| example:
|
| $config['auth_override_class_method_http']['deals']['view']['get'] = 'none';
| $config['auth_override_class_method_http']['deals']['insert']['post'] = 'none';
| $config['auth_override_class_method_http']['deals']['*']['options'] = 'none';
*/
// ---Uncomment list line for the wildard unit test
// $config['auth_override_class_method_http']['wildcard_test_cases']['*']['options'] = 'basic';
/*
|--------------------------------------------------------------------------
| REST Login Usernames
|--------------------------------------------------------------------------
|
| Array of usernames and passwords for login, if ldap (even library) is configured this is ignored
|
*/
//$config['rest_valid_logins'] = ['admin' => '1234', 'test' => 'test'];
/*
|--------------------------------------------------------------------------
| Global IP Whitelisting
|--------------------------------------------------------------------------
|
| Limit connections to your REST server to whitelisted IP addresses
| Limit connections to your REST server to White-listed IP addresses
|
| Usage:
| 1. Set to TRUE and select an auth option for extreme security (client's IP
| address must be in whitelist and they must also log in)
| 2. Set to TRUE with auth set to FALSE to allow whitelisted IPs access with no login
| 3. Set to FALSE but set 'auth_override_class_method' to 'whitelist' to
| restrict certain methods to IPs in your whitelist
| address must be in white-list and they must also log in)
| 2. Set to TRUE with auth set to FALSE to allow White-listed IPs access with no login
| 3. Set to FALSE but set 'auth_override_class_method' to 'white-list' to
| restrict certain methods to IPs in your white-list
|
*/
$config['rest_ip_whitelist_enabled'] = TRUE;
/*
|--------------------------------------------------------------------------
| REST IP Whitelist
| REST IP White-list
|--------------------------------------------------------------------------
|
| Limit connections to your REST server with a comma separated
@@ -240,42 +107,6 @@ $config['rest_ip_whitelist_enabled'] = TRUE;
*/
$config['rest_ip_whitelist'] = '127.0.0.1';
/*
|--------------------------------------------------------------------------
| Global IP Blacklisting
|--------------------------------------------------------------------------
|
| Prevent connections to the REST server from blacklisted IP addresses
|
| Usage:
| 1. Set to TRUE and add any IP address to 'rest_ip_blacklist'
|
*/
$config['rest_ip_blacklist_enabled'] = FALSE;
/*
|--------------------------------------------------------------------------
| REST IP Blacklist
|--------------------------------------------------------------------------
|
| Prevent connections from the following IP addresses
|
| e.g: '123.456.789.0, 987.654.32.1'
|
*/
$config['rest_ip_blacklist'] = '';
/*
|--------------------------------------------------------------------------
| REST Database Group
|--------------------------------------------------------------------------
|
| Connect to a database group for keys, logging, etc. It will only connect
| if you have any of these features enabled
|
*/
$config['rest_database_group'] = 'default';
/*
|--------------------------------------------------------------------------
| REST API Keys Table Name
@@ -298,6 +129,7 @@ $config['rest_keys_table'] = 'ci_apikey';
| Default table schema:
| CREATE TABLE `keys` (
| `id` INT(11) NOT NULL AUTO_INCREMENT,
| `user_id` INT(11) NOT NULL,
| `key` VARCHAR(40) NOT NULL,
| `level` INT(2) NOT NULL,
| `ignore_limits` TINYINT(1) NOT NULL DEFAULT '0',
@@ -310,45 +142,6 @@ $config['rest_keys_table'] = 'ci_apikey';
*/
$config['rest_enable_keys'] = TRUE;
/*
|--------------------------------------------------------------------------
| REST Table Key Column Name
|--------------------------------------------------------------------------
|
| If not using the default table schema in 'rest_enable_keys', specify the
| column name to match e.g. my_key
|
*/
$config['rest_key_column'] = 'key';
/*
|--------------------------------------------------------------------------
| REST API Limits method
|--------------------------------------------------------------------------
|
| Specify the method used to limit the API calls
|
| Available methods are :
| $config['rest_limits_method'] = 'API_KEY'; // Put a limit per api key
| $config['rest_limits_method'] = 'METHOD_NAME'; // Put a limit on method calls
| $config['rest_limits_method'] = 'ROUTED_URL'; // Put a limit on the routed URL
|
*/
$config['rest_limits_method'] = 'ROUTED_URL';
/*
|--------------------------------------------------------------------------
| REST Key Length
|--------------------------------------------------------------------------
|
| Length of the created keys. Check your default database schema on the
| maximum length allowed
|
| Note: The maximum length is 40
|
*/
$config['rest_key_length'] = 40;
/*
|--------------------------------------------------------------------------
| REST API Key Variable
@@ -364,156 +157,10 @@ $config['rest_key_name'] = 'FHC-API-KEY';
/*
|--------------------------------------------------------------------------
| REST Enable Logging
| REST Methods name format
|--------------------------------------------------------------------------
|
| When set to TRUE, the REST API will log actions based on the column names 'key', 'date',
| 'time' and 'ip_address'. This is a general rule that can be overridden in the
| $this->method array for each controller
|
| Default table schema:
| CREATE TABLE `logs` (
| `id` INT(11) NOT NULL AUTO_INCREMENT,
| `uri` VARCHAR(255) NOT NULL,
| `method` VARCHAR(6) NOT NULL,
| `params` TEXT DEFAULT NULL,
| `api_key` VARCHAR(40) NOT NULL,
| `ip_address` VARCHAR(45) NOT NULL,
| `time` INT(11) NOT NULL,
| `rtime` FLOAT DEFAULT NULL,
| `authorized` VARCHAR(1) NOT NULL,
| `response_code` smallint(3) DEFAULT '0',
| PRIMARY KEY (`id`)
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
| REST Controllers methods name format
|
*/
$config['rest_enable_logging'] = FALSE;
/*
|--------------------------------------------------------------------------
| REST API Logs Table Name
|--------------------------------------------------------------------------
|
| If not using the default table schema in 'rest_enable_logging', specify the
| table name to match e.g. my_logs
|
*/
$config['rest_logs_table'] = 'logs';
/*
|--------------------------------------------------------------------------
| REST Method Access Control
|--------------------------------------------------------------------------
| When set to TRUE, the REST API will check the access table to see if
| the API key can access that controller. 'rest_enable_keys' must be enabled
| to use this
|
| Default table schema:
| CREATE TABLE `access` (
| `id` INT(11) unsigned NOT NULL AUTO_INCREMENT,
| `key` VARCHAR(40) NOT NULL DEFAULT '',
| `controller` VARCHAR(50) NOT NULL DEFAULT '',
| `date_created` DATETIME DEFAULT NULL,
| `date_modified` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
| PRIMARY KEY (`id`)
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
*/
$config['rest_enable_access'] = FALSE;
/*
|--------------------------------------------------------------------------
| REST API Access Table Name
|--------------------------------------------------------------------------
|
| If not using the default table schema in 'rest_enable_access', specify the
| table name to match e.g. my_access
|
*/
$config['rest_access_table'] = 'access';
/*
|--------------------------------------------------------------------------
| REST API Param Log Format
|--------------------------------------------------------------------------
|
| When set to TRUE, the REST API log parameters will be stored in the database as JSON
| Set to FALSE to log as serialized PHP
|
*/
$config['rest_logs_json_params'] = FALSE;
/*
|--------------------------------------------------------------------------
| REST Enable Limits
|--------------------------------------------------------------------------
|
| When set to TRUE, the REST API will count the number of uses of each method
| by an API key each hour. This is a general rule that can be overridden in the
| $this->method array in each controller
|
| Default table schema:
| CREATE TABLE `limits` (
| `id` INT(11) NOT NULL AUTO_INCREMENT,
| `uri` VARCHAR(255) NOT NULL,
| `count` INT(10) NOT NULL,
| `hour_started` INT(11) NOT NULL,
| `api_key` VARCHAR(40) NOT NULL,
| PRIMARY KEY (`id`)
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
| To specify the limits within the controller's __construct() method, add per-method
| limits with:
|
| $this->method['METHOD_NAME']['limit'] = [NUM_REQUESTS_PER_HOUR];
|
| See application/controllers/api/example.php for examples
*/
$config['rest_enable_limits'] = FALSE;
/*
|--------------------------------------------------------------------------
| REST API Limits Table Name
|--------------------------------------------------------------------------
|
| If not using the default table schema in 'rest_enable_limits', specify the
| table name to match e.g. my_limits
|
*/
$config['rest_limits_table'] = 'limits';
/*
|--------------------------------------------------------------------------
| REST Ignore HTTP Accept
|--------------------------------------------------------------------------
|
| Set to TRUE to ignore the HTTP Accept and speed up each request a little.
| Only do this if you are using the $this->rest_format or /format/xml in URLs
|
*/
$config['rest_ignore_http_accept'] = FALSE;
/*
|--------------------------------------------------------------------------
| REST AJAX Only
|--------------------------------------------------------------------------
|
| Set to TRUE to allow AJAX requests only. Set to FALSE to accept HTTP requests
|
| Note: If set to TRUE and the request is not AJAX, a 505 response with the
| error message 'Only AJAX requests are accepted.' will be returned.
|
| Hint: This is good for production environments
|
*/
$config['rest_ajax_only'] = FALSE;
/*
|--------------------------------------------------------------------------
| REST Language File
|--------------------------------------------------------------------------
|
| Language file to load from the language directory
|
*/
$config['rest_language'] = 'english';
$config['rest_methods_name_format'] = '%2$s%1$s';
+10 -10
View File
@@ -1,5 +1,6 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
defined('BASEPATH') OR exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
@@ -11,7 +12,7 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
| and its corresponding controller class/method. The segments in a
| URL normally follow this pattern:
|
| example.com/class/method/id/
| example.com/class/method/id/
|
| In some instances, however, you may want to remap this relationship
| so that a different class/function is called than the one
@@ -19,7 +20,7 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
|
| Please see the user guide for complete details:
|
| http://codeigniter.com/user_guide/general/routing.html
| https://codeigniter.com/user_guide/general/routing.html
|
| -------------------------------------------------------------------------
| RESERVED ROUTES
@@ -27,18 +28,18 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
|
| There are three reserved routes:
|
| $route['default_controller'] = 'welcome';
| $route['default_controller'] = 'welcome';
|
| This route indicates which controller class should be loaded if the
| URI contains no data. In the above example, the "welcome" class
| would be loaded.
|
| $route['404_override'] = 'errors/page_missing';
| $route['404_override'] = 'errors/page_missing';
|
| This route will tell the Router which controller/method to use if those
| provided in the URL cannot be matched to a valid route.
|
| $route['translate_uri_dashes'] = FALSE;
| $route['translate_uri_dashes'] = FALSE;
|
| This is not exactly a route, but allows you to automatically route
| controller and method names that contain dashes. '-' isn't a valid
@@ -46,11 +47,10 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
| When you set this option to TRUE, it will replace ALL dashes in the
| controller and method URI segments.
|
| Examples: my-controller/index -> my_controller/index
| my-controller/my-method -> my_controller/my_method
| Examples: my-controller/index -> my_controller/index
| my-controller/my-method -> my_controller/my_method
*/
$route['default_controller'] = 'Vilesci';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;
// Class name conflicts
@@ -59,4 +59,4 @@ $route['api/v1/organisation/[F|f]achbereich/(:any)'] = 'api/v1/organisation/fach
$route['api/v1/organisation/[G|g]eschaeftsjahr/(:any)'] = 'api/v1/organisation/geschaeftsjahr2/$1';
$route['api/v1/organisation/[O|o]rganisationseinheit/(:any)'] = 'api/v1/organisation/organisationseinheit2/$1';
$route['api/v1/ressource/[B|b]etriebsmittelperson/(:any)'] = 'api/v1/ressource/betriebsmittelperson2/$1';
$route['api/v1/system/[S|s]prache/(:any)'] = 'api/v1/system/sprache2/$1';
$route['api/v1/system/[S|s]prache/(:any)'] = 'api/v1/system/sprache2/$1';
@@ -2,7 +2,7 @@
if (!defined('BASEPATH')) exit('No direct script access allowed');
class CheckUserAuth extends REST_Controller
class CheckUserAuth extends RESTFul_Controller
{
/**
* Course API constructor.
+1 -1
View File
@@ -5,7 +5,7 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Testing class for REST calls and authentication
*/
class Test extends REST_Controller
class Test extends RESTFul_Controller
{
public function __construct()
{
@@ -37,7 +37,7 @@ class Benutzer extends APIv1_Controller
if (isset($uid))
{
$result = $this->BenutzerModel->load($uid);
$result = $this->BenutzerModel->load(array('uid' => $uid));
$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 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);
}
}
@@ -37,7 +37,8 @@ class Prestudentstatus extends CLI_Controller
tbl_prestudent.studiengang_kz,
tbl_prestudentstatus.studienplan_id,
tbl_studienplan.orgform_kurzbz,
tbl_prestudent.person_id');
tbl_prestudent.person_id,
tbl_studienplan.sprache');
$this->PrestudentstatusModel->addJoin('public.tbl_prestudent', 'prestudent_id');
$this->PrestudentstatusModel->addJoin('lehre.tbl_studienplan', 'studienplan_id','LEFT');
$this->PrestudentstatusModel->addJoin('lehre.tbl_studienordnung', 'studienordnung_id','LEFT');
@@ -64,7 +65,8 @@ class Prestudentstatus extends CLI_Controller
$row_status->studiengang_kz,
$row_status->studiensemester_kurzbz,
$row_status->ausbildungssemester,
$row_status->orgform_kurzbz);
$row_status->orgform_kurzbz,
$row_status->sprache);
if(isSuccess($studienplan) && count($studienplan->retval) == 1)
{
@@ -2,8 +2,10 @@
if (! defined('BASEPATH')) exit('No direct script access allowed');
class UDF extends Auth_Controller
class FAS_UDF extends Auth_Controller
{
const FAS_UDF_SESSION_NAME = 'fasUdfSessionName';
public function __construct()
{
parent::__construct(
@@ -22,31 +24,33 @@ class UDF extends Auth_Controller
*/
public function index()
{
$fasUdfSession = getSession(self::FAS_UDF_SESSION_NAME);
$person_id = $this->input->get('person_id');
if (isset($this->session->person_id))
if (isset($fasUdfSession['person_id']))
{
if (!isset($person_id))
{
$person_id = $this->session->person_id;
$person_id = $fasUdfSession['person_id'];
}
unset($this->session->person_id);
unset($fasUdfSession['person_id']);
}
$prestudent_id = $this->input->get('prestudent_id');
if (isset($this->session->prestudent_id))
if (isset($fasUdfSession['prestudent_id']))
{
if (!isset($prestudent_id))
{
$prestudent_id = $this->session->prestudent_id;
$prestudent_id = $fasUdfSession['prestudent_id'];
}
unset($this->session->prestudent_id);
unset($fasUdfSession['prestudent_id']);
}
$result = null;
if (isset($this->session->result))
if (isset($fasUdfSession['result']))
{
$result = clone $this->session->result;
$this->session->set_userdata('result', null);
$result = clone $fasUdfSession['result'];
setSessionElement(self::FAS_UDF_SESSION_NAME, 'result', null);
}
$data = array('result' => $result);
@@ -71,7 +75,7 @@ class UDF extends Auth_Controller
}
}
$this->load->view('system/udf', $data);
$this->load->view('system/fas_udf', $data);
}
/**
@@ -90,9 +94,9 @@ class UDF extends Auth_Controller
if (isSuccess($validation))
{
// Load model UDF_model
$this->load->model('system/UDF_model', 'UDFModel');
$this->load->model('system/FAS_UDF_model', 'FASUDFModel');
$result = $this->UDFModel->saveUDFs($udfs);
$result = $this->FASUDFModel->saveUDFs($udfs);
$userdata['result'] = $result;
}
@@ -101,8 +105,11 @@ class UDF extends Auth_Controller
$userdata['result'] = $validation;
}
$this->session->set_userdata($userdata);
redirect('system/UDF');
setSessionElement(self::FAS_UDF_SESSION_NAME, 'person_id', $userdata['person_id']);
setSessionElement(self::FAS_UDF_SESSION_NAME, 'prestudent_id', $userdata['prestudent_id']);
setSessionElement(self::FAS_UDF_SESSION_NAME, 'result', $userdata['result']);
redirect('system/FAS_UDF');
}
/**
@@ -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' => 'system/developer: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');
}
}
@@ -24,6 +24,8 @@ class InfoCenter extends Auth_Controller
const FILTER_ID = 'filter_id';
const PREV_FILTER_ID = 'prev_filter_id';
const RELOAD_DATASET = 'reloadDataset';
const KEEP_TABLESORTER_FILTER = 'keepTsFilter';
private $_uid; // contains the UID of the logged user
@@ -100,9 +102,11 @@ class InfoCenter extends Auth_Controller
'reloadNotizen' => 'infocenter:r',
'reloadLogs' => 'infocenter:r',
'outputAkteContent' => 'infocenter:r',
'getParkedDate' => 'infocenter:r',
'getPostponeDate' => 'infocenter:r',
'park' => 'infocenter:rw',
'unpark' => 'infocenter:rw',
'setOnHold' => 'infocenter:rw',
'removeOnHold' => 'infocenter:rw',
'getStudienjahrEnd' => 'infocenter:r',
'setNavigationMenuArrayJson' => 'infocenter:r'
)
@@ -136,6 +140,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
}
@@ -232,7 +238,7 @@ class InfoCenter extends Auth_Controller
$redirectLink = '/'.self::INFOCENTER_URI.'?'.self::FHC_CONTROLLER_ID.'='.$this->getControllerId();
// Force reload of Dataset after Unlock
$redirectLink .= '&reloadDataset=true';
$redirectLink .= '&'.self::RELOAD_DATASET.'=true&'.self::KEEP_TABLESORTER_FILTER.'=true';
$currentFilterId = $this->input->get(self::FILTER_ID);
if (isset($currentFilterId))
@@ -709,11 +715,32 @@ class InfoCenter extends Auth_Controller
* Gets the date until which a person is parked
* @param $person_id
*/
public function getParkedDate($person_id)
public function getPostponeDate($person_id)
{
$result = array(
'type' => null,
'date' => null
);
$parkedDate = $this->personloglib->getParkedDate($person_id);
$this->outputJsonSuccess(array($parkedDate));
if (isset($parkedDate))
{
$result['type'] = 'parked';
$result['date'] = $parkedDate;
}
else
{
$onholdDate = $this->personloglib->getOnHoldDate($person_id);
if (isset($onholdDate))
{
$result['type'] = 'onhold';
$result['date'] = $onholdDate;
}
}
$this->outputJsonSuccess($result);
}
/**
@@ -741,6 +768,31 @@ class InfoCenter extends Auth_Controller
$this->outputJson($result);
}
/**
* Sets a person on hold ("zurückstellen")
*/
public function setOnHold()
{
$person_id = $this->input->post('person_id');
$date = $this->input->post('onholddate');
$result = $this->personloglib->setOnHold($person_id, date_format(date_create($date), 'Y-m-d'), self::TAETIGKEIT, self::APP, null, $this->_uid);
$this->outputJson($result);
}
/**
* Removed on hold status of a person
*/
public function removeOnHold()
{
$person_id = $this->input->post('person_id');
$result = $this->personloglib->removeOnHold($person_id);
$this->outputJson($result);
}
/**
* Gets the End date of the current Studienjahr
*/
@@ -892,10 +944,16 @@ class InfoCenter extends Auth_Controller
$freigegebenLink = site_url(self::INFOCENTER_URI.'/'.self::FREIGEGEBEN_PAGE);
$reihungstestAbsolviertLink = site_url(self::INFOCENTER_URI.'/'.self::REIHUNGSTESTABSOLVIERT_PAGE);
$currentFilterId = $this->input->get(self::FILTER_ID);
$reloadDatasetParam = self::RELOAD_DATASET.'=true';
if (isset($currentFilterId))
{
$freigegebenLink .= '?'.self::PREV_FILTER_ID.'='.$currentFilterId;
$reihungstestAbsolviertLink .= '?'.self::PREV_FILTER_ID.'='.$currentFilterId;
$freigegebenLink .= '?'.self::PREV_FILTER_ID.'='.$currentFilterId.'&'.$reloadDatasetParam;
$reihungstestAbsolviertLink .= '?'.self::PREV_FILTER_ID.'='.$currentFilterId.'&'.$reloadDatasetParam;
}
else
{
$freigegebenLink .= '?'.$reloadDatasetParam;
$reihungstestAbsolviertLink .= '?'.$reloadDatasetParam;
}
$this->navigationlib->setSessionMenu(
@@ -948,7 +1006,7 @@ class InfoCenter extends Auth_Controller
$origin_page = $this->input->get(self::ORIGIN_PAGE);
$link = site_url(self::INFOCENTER_URI.'/'.self::INDEX_PAGE);
$link = site_url(self::INFOCENTER_URI);
if ($origin_page == self::FREIGEGEBEN_PAGE)
{
$link = site_url(self::INFOCENTER_URI.'/'.self::FREIGEGEBEN_PAGE);
@@ -961,7 +1019,7 @@ class InfoCenter extends Auth_Controller
$prevFilterId = $this->input->get(self::PREV_FILTER_ID);
if (isset($prevFilterId))
{
$link .= '?'.self::FILTER_ID.'='.$prevFilterId;
$link .= '?'.self::FILTER_ID.'='.$prevFilterId.'&'.self::RELOAD_DATASET.'=true&'.self::KEEP_TABLESORTER_FILTER.'=true';
}
$this->navigationlib->setSessionMenu(
@@ -991,13 +1049,14 @@ class InfoCenter extends Auth_Controller
$this->load->library('NavigationLib', array(self::NAVIGATION_PAGE => self::INFOCENTER_URI.'/'.$page));
// Generate the home link with the eventually loaded filter
$homeLink = site_url(self::INFOCENTER_URI.'/'.self::INDEX_PAGE);
$freigegebenLink = site_url(self::INFOCENTER_URI.'/'.self::FREIGEGEBEN_PAGE);
$absolviertLink = site_url(self::INFOCENTER_URI.'/'.self::REIHUNGSTESTABSOLVIERT_PAGE);
$reloadDatasetParam = '?'.self::RELOAD_DATASET.'=true';
$homeLink = site_url(self::INFOCENTER_URI.'/'.self::INDEX_PAGE.$reloadDatasetParam);
$freigegebenLink = site_url(self::INFOCENTER_URI.'/'.self::FREIGEGEBEN_PAGE.$reloadDatasetParam);
$absolviertLink = site_url(self::INFOCENTER_URI.'/'.self::REIHUNGSTESTABSOLVIERT_PAGE.$reloadDatasetParam);
$prevFilterId = $this->input->get(self::PREV_FILTER_ID);
if (isset($prevFilterId))
{
$homeLink .= '?'.self::FILTER_ID.'='.$prevFilterId;
$homeLink .= '&'.self::FILTER_ID.'='.$prevFilterId;
}
$this->navigationlib->setSessionElementMenu(
@@ -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
+7 -4
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 RESTFul_Controller
{
private $_requiredPermissions;
@@ -21,13 +23,14 @@ class APIv1_Controller extends REST_Controller
/**
* This method is automatically called by CodeIgniter after the execution of the constructor is completed
* - Cheks if the AuthLib was loaded, if not it means that the authentication failed
* - Cheks if the Authlib was loaded, if not it means that the authentication failed
* - Loads the permsission lib and calls permissionlib->isEntitled
* - Checks if the caller is allowed to access to this content with the given permissions
* if it is not allowed will set the HTTP header with code 401
* - Calls the parent (REST_Controller) _remap method to performs other checks
* NOTE: this methods override the parent method!!!
*/
public function _remap($object_called, $arguments)
public function _remap($object_called, $arguments = [])
{
if (isset($this->authlib)) // if set then the authentication is ok
{
+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;
}
}
}
+215
View File
@@ -0,0 +1,215 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
* NOTE: this class overrides parent's methods and properties
*/
class RESTFul_Controller extends REST_Controller
{
protected $is_valid_request = TRUE; // Change the accessibility of this property
/**
* Totally overriden
*/
protected function early_checks()
{
// Loads helper message to manage returning messages
$this->load->helper('hlp_return_object');
// Loads helper session to manage the php session
$this->load->helper('hlp_session');
// Loads helper with generic utility function
$this->load->helper('hlp_common');
}
/**
* Totally overrode parent's _perform_library_auth method to keep file and class name
* for AuthLib and to call AuthLib with the extra parameter
*/
protected function _perform_library_auth($username = '', $password = NULL)
{
if (empty($username))
{
log_message('error', 'Library Auth: Failure, empty username');
return FALSE;
}
$auth_library_class = $this->config->item('auth_library_class');
$auth_library_function = $this->config->item('auth_library_function');
if (empty($auth_library_class))
{
log_message('debug', 'Library Auth: Failure, empty auth_library_class');
return FALSE;
}
if (empty($auth_library_function))
{
log_message('debug', 'Library Auth: Failure, empty auth_library_function');
return FALSE;
}
if (is_callable([$auth_library_class, $auth_library_function]) === FALSE)
{
$this->load->library($auth_library_class, array(false));
}
return $this->{strtolower($auth_library_class)}->$auth_library_function($username, $password);
}
/**
* Totally overrode parent's _remap method to change the naming convention of controllers methods
*/
public function _remap($object_called, $arguments = [])
{
// Should we answer if not over SSL?
if ($this->config->item('force_https') && $this->request->ssl === FALSE)
{
$this->response([
$this->config->item('rest_status_field_name') => FALSE,
$this->config->item('rest_message_field_name') => $this->lang->line('text_rest_unsupported')
], self::HTTP_FORBIDDEN);
$this->is_valid_request = false;
}
// Remove the supported format from the function name e.g. index.json => index
$object_called = preg_replace('/^(.*)\.(?:'.implode('|', array_keys($this->_supported_formats)).')$/', '$1', $object_called);
// NOTE: START changes
$controller_method = $object_called.'_'.$this->request->method; // Method name fallback
// If the config entry rest_methods_name_format is provided and is not empty then use it to produce the method name
if (!empty($this->config->item('rest_methods_name_format')))
{
$controller_method = sprintf($this->config->item('rest_methods_name_format'), $object_called, $this->request->method);
}
// END changes
// Does this method exist? If not, try executing an index method
if (!method_exists($this, $controller_method)) {
$controller_method = "index_" . $this->request->method;
array_unshift($arguments, $object_called);
}
// Do we want to log this method (if allowed by config)?
$log_method = ! (isset($this->methods[$controller_method]['log']) && $this->methods[$controller_method]['log'] === FALSE);
// Use keys for this method?
$use_key = ! (isset($this->methods[$controller_method]['key']) && $this->methods[$controller_method]['key'] === FALSE);
// They provided a key, but it wasn't valid, so get them out of here
if ($this->config->item('rest_enable_keys') && $use_key && $this->_allow === FALSE)
{
if ($this->config->item('rest_enable_logging') && $log_method)
{
$this->_log_request();
}
// fix cross site to option request error
if($this->request->method == 'options') {
exit;
}
$this->response([
$this->config->item('rest_status_field_name') => FALSE,
$this->config->item('rest_message_field_name') => sprintf($this->lang->line('text_rest_invalid_api_key'), $this->rest->key)
], self::HTTP_FORBIDDEN);
$this->is_valid_request = false;
}
// Check to see if this key has access to the requested controller
if ($this->config->item('rest_enable_keys') && $use_key && empty($this->rest->key) === FALSE && $this->_check_access() === FALSE)
{
if ($this->config->item('rest_enable_logging') && $log_method)
{
$this->_log_request();
}
$this->response([
$this->config->item('rest_status_field_name') => FALSE,
$this->config->item('rest_message_field_name') => $this->lang->line('text_rest_api_key_unauthorized')
], self::HTTP_UNAUTHORIZED);
$this->is_valid_request = false;
}
// Sure it exists, but can they do anything with it?
if (! method_exists($this, $controller_method))
{
$this->response([
$this->config->item('rest_status_field_name') => FALSE,
$this->config->item('rest_message_field_name') => $this->lang->line('text_rest_unknown_method')
], self::HTTP_METHOD_NOT_ALLOWED);
$this->is_valid_request = false;
}
// Doing key related stuff? Can only do it if they have a key right?
if ($this->config->item('rest_enable_keys') && empty($this->rest->key) === FALSE)
{
// Check the limit
if ($this->config->item('rest_enable_limits') && $this->_check_limit($controller_method) === FALSE)
{
$response = [$this->config->item('rest_status_field_name') => FALSE, $this->config->item('rest_message_field_name') => $this->lang->line('text_rest_api_key_time_limit')];
$this->response($response, self::HTTP_UNAUTHORIZED);
$this->is_valid_request = false;
}
// If no level is set use 0, they probably aren't using permissions
$level = isset($this->methods[$controller_method]['level']) ? $this->methods[$controller_method]['level'] : 0;
// If no level is set, or it is lower than/equal to the key's level
$authorized = $level <= $this->rest->level;
// IM TELLIN!
if ($this->config->item('rest_enable_logging') && $log_method)
{
$this->_log_request($authorized);
}
if($authorized === FALSE)
{
// They don't have good enough perms
$response = [$this->config->item('rest_status_field_name') => FALSE, $this->config->item('rest_message_field_name') => $this->lang->line('text_rest_api_key_permissions')];
$this->response($response, self::HTTP_UNAUTHORIZED);
$this->is_valid_request = false;
}
}
//check request limit by ip without login
elseif ($this->config->item('rest_limits_method') == "IP_ADDRESS" && $this->config->item('rest_enable_limits') && $this->_check_limit($controller_method) === FALSE)
{
$response = [$this->config->item('rest_status_field_name') => FALSE, $this->config->item('rest_message_field_name') => $this->lang->line('text_rest_ip_address_time_limit')];
$this->response($response, self::HTTP_UNAUTHORIZED);
$this->is_valid_request = false;
}
// No key stuff, but record that stuff is happening
elseif ($this->config->item('rest_enable_logging') && $log_method)
{
$this->_log_request($authorized = TRUE);
}
// Call the controller method and passed arguments
try
{
if ($this->is_valid_request) {
call_user_func_array([$this, $controller_method], $arguments);
}
}
catch (Exception $ex)
{
if ($this->config->item('rest_handle_exceptions') === FALSE) {
throw $ex;
}
// If the method doesn't exist, then the error will be caught and an error response shown
$_error = &load_class('Exceptions', 'core');
$_error->show_exception($ex);
}
}
}
File diff suppressed because it is too large Load Diff
@@ -34,3 +34,31 @@ function getAuthUID()
return isLogged() ? ($ci->authlib->getAuthObj())->{AuthLib::AO_USERNAME} : null;
}
/**
* If the user is NOT logged then a null value is returned.
* If the user is alredy logged, then it is possible to access to the authentication object
* that contains the firstname of the logged user
* NOTE: if the user is logged with a "foreign" method (ex. Bewerbungstool),
* then it is possible that the firstname is null!
*/
function getAuthFirstname()
{
$ci =& get_instance(); // get CI instance
return isLogged() ? ($ci->authlib->getAuthObj())->{AuthLib::AO_NAME} : null;
}
/**
* If the user is NOT logged then a null value is returned.
* If the user is alredy logged, then it is possible to access to the authentication object
* that contains the surname of the logged user
* NOTE: if the user is logged with a "foreign" method (ex. Bewerbungstool),
* then it is possible that the surname is null!
*/
function getAuthSurname()
{
$ci =& get_instance(); // get CI instance
return isLogged() ? ($ci->authlib->getAuthObj())->{AuthLib::AO_SURNAME} : null;
}
+8 -2
View File
@@ -46,13 +46,16 @@ function generateCSSsInclude($CSSs)
{
$cssLink = '<link rel="stylesheet" type="text/css" href="%s" />';
$ci =& get_instance();
$cachetoken = '?'.$ci->config->item('fhcomplete_build_version');
if (isset($CSSs))
{
$tmpCSSs = is_array($CSSs) ? $CSSs : array($CSSs);
for ($tmpCSSsCounter = 0; $tmpCSSsCounter < count($tmpCSSs); $tmpCSSsCounter++)
{
$toPrint = sprintf($cssLink, base_url($tmpCSSs[$tmpCSSsCounter])).PHP_EOL;
$toPrint = sprintf($cssLink, base_url($tmpCSSs[$tmpCSSsCounter]).$cachetoken).PHP_EOL;
if ($tmpCSSsCounter > 0) $toPrint = "\t\t".$toPrint;
@@ -108,13 +111,16 @@ function generateJSsInclude($JSs)
{
$jsInclude = '<script type="text/javascript" src="%s"></script>';
$ci =& get_instance();
$cachetoken = '?'.$ci->config->item('fhcomplete_build_version');
if (isset($JSs))
{
$tmpJSs = is_array($JSs) ? $JSs : array($JSs);
for ($tmpJSsCounter = 0; $tmpJSsCounter < count($tmpJSs); $tmpJSsCounter++)
{
$toPrint = sprintf($jsInclude, base_url($tmpJSs[$tmpJSsCounter])).PHP_EOL;
$toPrint = sprintf($jsInclude, base_url($tmpJSs[$tmpJSsCounter].$cachetoken)).PHP_EOL;
if ($tmpJSsCounter > 0) $toPrint = "\t\t".$toPrint;
@@ -1,17 +0,0 @@
<?php
/*
* English language
*/
$lang['text_rest_invalid_api_key'] = 'Invalid API key %s'; // %s is the REST API key
$lang['text_rest_invalid_credentials'] = 'Invalid credentials';
$lang['text_rest_ip_denied'] = 'IP denied';
$lang['text_rest_ip_unauthorized'] = 'IP unauthorized';
$lang['text_rest_unauthorized'] = 'Unauthorized';
$lang['text_rest_ajax_only'] = 'Only AJAX requests are allowed';
$lang['text_rest_api_key_unauthorized'] = 'This API key does not have access to the requested controller';
$lang['text_rest_api_key_permissions'] = 'This API key does not have enough permissions';
$lang['text_rest_api_key_time_limit'] = 'This API key has reached the time limit for this method';
$lang['text_rest_unknown_method'] = 'Unknown method';
$lang['text_rest_unsupported'] = 'Unsupported protocol';
-361
View File
@@ -1,361 +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
'MigrationLib', // virtually dangerous, DB manipulation
'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;
}
}
@@ -532,6 +532,14 @@ class FilterWidgetLib
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
*/
-531
View File
@@ -1,531 +0,0 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Format class
* Help convert between various formats such as XML, JSON, CSV, etc.
*
* @author Phil Sturgeon, Chris Kacerguis, @softwarespot
* @license http://www.dbad-license.org/
*/
class Format {
/**
* Array output format
*/
const ARRAY_FORMAT = 'array';
/**
* Comma Separated Value (CSV) output format
*/
const CSV_FORMAT = 'csv';
/**
* Json output format
*/
const JSON_FORMAT = 'json';
/**
* HTML output format
*/
const HTML_FORMAT = 'html';
/**
* PHP output format
*/
const PHP_FORMAT = 'php';
/**
* Serialized output format
*/
const SERIALIZED_FORMAT = 'serialized';
/**
* XML output format
*/
const XML_FORMAT = 'xml';
/**
* Default format of this class
*/
const DEFAULT_FORMAT = self::JSON_FORMAT; // Couldn't be DEFAULT, as this is a keyword
/**
* CodeIgniter instance
*
* @var object
*/
private $_CI;
/**
* Data to parse
*
* @var mixed
*/
protected $_data = [];
/**
* Type to convert from
*
* @var string
*/
protected $_from_type = NULL;
/**
* DO NOT CALL THIS DIRECTLY, USE factory()
*
* @param NULL $data
* @param NULL $from_type
* @throws Exception
*/
public function __construct($data = NULL, $from_type = NULL)
{
// Get the CodeIgniter reference
$this->_CI = &get_instance();
// Load the inflector helper
$this->_CI->load->helper('inflector');
// If the provided data is already formatted we should probably convert it to an array
if ($from_type !== NULL)
{
if (method_exists($this, '_from_' . $from_type))
{
$data = call_user_func([$this, '_from_' . $from_type], $data);
}
else
{
throw new Exception('Format class does not support conversion from "' . $from_type . '".');
}
}
// Set the member variable to the data passed
$this->_data = $data;
}
/**
* Create an instance of the format class
* e.g: echo $this->format->factory(['foo' => 'bar'])->to_csv();
*
* @param mixed $data Data to convert/parse
* @param string $from_type Type to convert from e.g. json, csv, html
*
* @return object Instance of the format class
*/
public function factory($data, $from_type = NULL)
{
// $class = __CLASS__;
// return new $class();
return new static($data, $from_type);
}
// FORMATTING OUTPUT ---------------------------------------------------------
/**
* Format data as an array
*
* @param mixed|NULL $data Optional data to pass, so as to override the data passed
* to the constructor
* @return array Data parsed as an array; otherwise, an empty array
*/
public function to_array($data = NULL)
{
// If no data is passed as a parameter, then use the data passed
// via the constructor
if ($data === NULL && func_num_args() === 0)
{
$data = $this->_data;
}
// Cast as an array if not already
if (is_array($data) === FALSE)
{
$data = (array) $data;
}
$array = [];
foreach ((array) $data as $key => $value)
{
if (is_object($value) === TRUE || is_array($value) === TRUE)
{
$array[$key] = $this->to_array($value);
}
else
{
$array[$key] = $value;
}
}
return $array;
}
/**
* Format data as XML
*
* @param mixed|NULL $data Optional data to pass, so as to override the data passed
* to the constructor
* @param NULL $structure
* @param string $basenode
* @return mixed
*/
public function to_xml($data = NULL, $structure = NULL, $basenode = 'xml')
{
if ($data === NULL && func_num_args() === 0)
{
$data = $this->_data;
}
// turn off compatibility mode as simple xml throws a wobbly if you don't.
if (ini_get('zend.ze1_compatibility_mode') == 1)
{
ini_set('zend.ze1_compatibility_mode', 0);
}
if ($structure === NULL)
{
$structure = simplexml_load_string("<?xml version='1.0' encoding='utf-8'?><$basenode />");
}
// Force it to be something useful
if (is_array($data) === FALSE && is_object($data) === FALSE)
{
$data = (array) $data;
}
foreach ($data as $key => $value)
{
//change false/true to 0/1
if (is_bool($value))
{
$value = (int) $value;
}
// no numeric keys in our xml please!
if (is_numeric($key))
{
// make string key...
$key = (singular($basenode) != $basenode) ? singular($basenode) : 'item';
}
// replace anything not alpha numeric
$key = preg_replace('/[^a-z_\-0-9]/i', '', $key);
if ($key === '_attributes' && (is_array($value) || is_object($value)))
{
$attributes = $value;
if (is_object($attributes))
{
$attributes = get_object_vars($attributes);
}
foreach ($attributes as $attribute_name => $attribute_value)
{
$structure->addAttribute($attribute_name, $attribute_value);
}
}
// if there is another array found recursively call this function
elseif (is_array($value) || is_object($value))
{
$node = $structure->addChild($key);
// recursive call.
$this->to_xml($value, $node, $key);
}
else
{
// add single node.
$value = htmlspecialchars(html_entity_decode($value, ENT_QUOTES, 'UTF-8'), ENT_QUOTES, 'UTF-8');
$structure->addChild($key, $value);
}
}
return $structure->asXML();
}
/**
* Format data as HTML
*
* @param mixed|NULL $data Optional data to pass, so as to override the data passed
* to the constructor
* @return mixed
*/
public function to_html($data = NULL)
{
// If no data is passed as a parameter, then use the data passed
// via the constructor
if ($data === NULL && func_num_args() === 0)
{
$data = $this->_data;
}
// Cast as an array if not already
if (is_array($data) === FALSE)
{
$data = (array) $data;
}
// Check if it's a multi-dimensional array
if (isset($data[0]) && count($data) !== count($data, COUNT_RECURSIVE))
{
// Multi-dimensional array
$headings = array_keys($data[0]);
}
else
{
// Single array
$headings = array_keys($data);
$data = [$data];
}
// Load the table library
$this->_CI->load->library('table');
$this->_CI->table->set_heading($headings);
foreach ($data as $row)
{
// Suppressing the "array to string conversion" notice
// Keep the "evil" @ here
$row = @array_map('strval', $row);
$this->_CI->table->add_row($row);
}
return $this->_CI->table->generate();
}
/**
* @link http://www.metashock.de/2014/02/create-csv-file-in-memory-php/
* @param mixed|NULL $data Optional data to pass, so as to override the data passed
* to the constructor
* @param string $delimiter The optional delimiter parameter sets the field
* delimiter (one character only). NULL will use the default value (,)
* @param string $enclosure The optional enclosure parameter sets the field
* enclosure (one character only). NULL will use the default value (")
* @return string A csv string
*/
public function to_csv($data = NULL, $delimiter = ',', $enclosure = '"')
{
// Use a threshold of 1 MB (1024 * 1024)
$handle = fopen('php://temp/maxmemory:1048576', 'w');
if ($handle === FALSE)
{
return NULL;
}
// If no data is passed as a parameter, then use the data passed
// via the constructor
if ($data === NULL && func_num_args() === 0)
{
$data = $this->_data;
}
// If NULL, then set as the default delimiter
if ($delimiter === NULL)
{
$delimiter = ',';
}
// If NULL, then set as the default enclosure
if ($enclosure === NULL)
{
$enclosure = '"';
}
// Cast as an array if not already
if (is_array($data) === FALSE)
{
$data = (array) $data;
}
// Check if it's a multi-dimensional array
if (isset($data[0]) && count($data) !== count($data, COUNT_RECURSIVE))
{
// Multi-dimensional array
$headings = array_keys($data[0]);
}
else
{
// Single array
$headings = array_keys($data);
$data = [$data];
}
// Apply the headings
fputcsv($handle, $headings, $delimiter, $enclosure);
foreach ($data as $record)
{
// If the record is not an array, then break. This is because the 2nd param of
// fputcsv() should be an array
if (is_array($record) === FALSE)
{
break;
}
// Suppressing the "array to string conversion" notice.
// Keep the "evil" @ here.
$record = @ array_map('strval', $record);
// Returns the length of the string written or FALSE
fputcsv($handle, $record, $delimiter, $enclosure);
}
// Reset the file pointer
rewind($handle);
// Retrieve the csv contents
$csv = stream_get_contents($handle);
// Close the handle
fclose($handle);
return $csv;
}
/**
* Encode data as json
*
* @param mixed|NULL $data Optional data to pass, so as to override the data passed
* to the constructor
* @return string Json representation of a value
*/
public function to_json($data = NULL)
{
// If no data is passed as a parameter, then use the data passed
// via the constructor
if ($data === NULL && func_num_args() === 0)
{
$data = $this->_data;
}
// Get the callback parameter (if set)
$callback = $this->_CI->input->get('callback');
if (empty($callback) === TRUE)
{
return json_encode($data);
}
// We only honour a jsonp callback which are valid javascript identifiers
elseif (preg_match('/^[a-z_\$][a-z0-9\$_]*(\.[a-z_\$][a-z0-9\$_]*)*$/i', $callback))
{
// Return the data as encoded json with a callback
return $callback . '(' . json_encode($data) . ');';
}
// An invalid jsonp callback function provided.
// Though I don't believe this should be hardcoded here
$data['warning'] = 'INVALID JSONP CALLBACK: ' . $callback;
return json_encode($data);
}
/**
* Encode data as a serialized array
*
* @param mixed|NULL $data Optional data to pass, so as to override the data passed
* to the constructor
* @return string Serialized data
*/
public function to_serialized($data = NULL)
{
// If no data is passed as a parameter, then use the data passed
// via the constructor
if ($data === NULL && func_num_args() === 0)
{
$data = $this->_data;
}
return serialize($data);
}
/**
* Format data using a PHP structure
*
* @param mixed|NULL $data Optional data to pass, so as to override the data passed
* to the constructor
* @return mixed String representation of a variable
*/
public function to_php($data = NULL)
{
// If no data is passed as a parameter, then use the data passed
// via the constructor
if ($data === NULL && func_num_args() === 0)
{
$data = $this->_data;
}
return var_export($data, TRUE);
}
// INTERNAL FUNCTIONS
/**
* @param $data XML string
* @return SimpleXMLElement XML element object; otherwise, empty array
*/
protected function _from_xml($data)
{
return $data ? (array) simplexml_load_string($data, 'SimpleXMLElement', LIBXML_NOCDATA) : [];
}
/**
* @param string $data CSV string
* @param string $delimiter The optional delimiter parameter sets the field
* delimiter (one character only). NULL will use the default value (,)
* @param string $enclosure The optional enclosure parameter sets the field
* enclosure (one character only). NULL will use the default value (")
* @return array A multi-dimensional array with the outer array being the number of rows
* and the inner arrays the individual fields
*/
protected function _from_csv($data, $delimiter = ',', $enclosure = '"')
{
// If NULL, then set as the default delimiter
if ($delimiter === NULL)
{
$delimiter = ',';
}
// If NULL, then set as the default enclosure
if ($enclosure === NULL)
{
$enclosure = '"';
}
return str_getcsv($data, $delimiter, $enclosure);
}
/**
* @param $data Encoded json string
* @return mixed Decoded json string with leading and trailing whitespace removed
*/
protected function _from_json($data)
{
return json_decode(trim($data));
}
/**
* @param string Data to unserialized
* @return mixed Unserialized data
*/
protected function _from_serialize($data)
{
return unserialize(trim($data));
}
/**
* @param $data Data to trim leading and trailing whitespace
* @return string Data with leading and trailing whitespace removed
*/
protected function _from_php($data)
{
return trim($data);
}
}
+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;
}
-466
View File
@@ -1,466 +0,0 @@
<?php
if (! defined("BASEPATH")) exit("No direct script access allowed");
/**
* Utility class to be used in the database migration process
*/
class MigrationLib extends CI_Migration
{
/**
* Object initialization
*/
public function __construct()
{
parent::__construct();
// Loads EPrintfLib
$this->load->library('EPrintfLib');
}
/**
* Check if a column exists in a table and schema
*/
private function columnExists($name, $schema, $table)
{
$query = sprintf("SELECT %s FROM %s.%s LIMIT 1", $name, $schema, $table);
if (@$this->db->simple_query($query))
{
return true;
}
return false;
}
/**
* Print an info about the starting of method up
*/
protected function startUP()
{
$this->eprintflib->printInfo(
sprintf("%s Start method up of class %s %s", EPrintfLib::SEPARATOR, get_called_class(), EPrintfLib::SEPARATOR)
);
}
/**
* Print an info about the ending of method up
*/
protected function endUP()
{
$this->eprintflib->printInfo(
sprintf("%s End method up of class %s %s", EPrintfLib::SEPARATOR, get_called_class(), EPrintfLib::SEPARATOR)
);
}
/**
* Print an info about the starting of method down
*/
protected function startDown()
{
$this->eprintflib->printInfo(
sprintf("%s Start method down of class %s %s", EPrintfLib::SEPARATOR, get_called_class(), EPrintfLib::SEPARATOR)
);
}
/**
* Print an info about the ending of method down
*/
protected function endDown()
{
$this->eprintflib->printInfo(
sprintf("%s End method down of class %s %s", EPrintfLib::SEPARATOR, get_called_class(), EPrintfLib::SEPARATOR)
);
}
/**
* Adds a column, with attributes, to a table and schema
*/
protected function addColumn($schema, $table, $fields)
{
foreach ($fields as $name => $definition)
{
if (!$this->columnExists($name, $schema, $table))
{
if ($this->dbforge->add_column($schema.'.'.$table, array($name => $definition)))
{
$this->eprintflib->printMessage(sprintf("Column %s.%s.%s of type %s added", $schema, $table, $name, $definition["type"]));
}
else
{
$this->eprintflib->printError(sprintf("Error while adding column %s.%s.%s of type %s", $schema, $table, $name, $definition["type"]));
}
}
else
{
$this->eprintflib->printInfo(sprintf("Column %s.%s.%s already exists", $schema, $table, $name));
}
}
}
/**
* Modifies a column, and its attributes, of a table and schema
*/
protected function modifyColumn($schema, $table, $fields)
{
foreach ($fields as $name => $definition)
{
if ($this->columnExists($name, $schema, $table))
{
if ($this->dbforge->modify_column($schema.'.'.$table, array($name => $definition)))
{
$this->eprintflib->printMessage(sprintf("Column %s.%s.%s has been modified", $schema, $table, $name));
}
else
{
$this->eprintflib->printError(sprintf("Error while modifying column %s.%s.%s", $schema, $table, $name));
}
}
else
{
$this->eprintflib->printInfo(sprintf("Column %s.%s.%s doesn't exist", $schema, $table, $name));
}
}
}
/**
* Drops a column from a table and schema
*/
protected function dropColumn($schema, $table, $field)
{
if ($this->columnExists($field, $schema, $table))
{
if ($this->dbforge->drop_column($schema.'.'.$table, $field))
{
$this->eprintflib->printMessage(sprintf("Column %s.%s.%s has been dropped", $schema, $table, $field));
}
else
{
$this->eprintflib->printError(sprintf("Error while dropping column %s.%s.%s", $schema, $table, $field));
}
}
else
{
$this->eprintflib->printInfo(sprintf("Column %s.%s.%s doesn't exist", $schema, $table, $field));
}
}
/**
* Sets a column as primary key of a table and schema
*/
protected function addPrimaryKey($schema, $table, $name, $fields)
{
$stringFields = null;
if (is_array($fields))
{
if (count($fields) > 0)
{
$stringFields = "";
for ($i = 0; $i < count($fields); $i++)
{
$stringFields .= $fields[$i];
if ($i != count($fields) - 1)
{
$stringFields .= ", ";
}
}
$query = sprintf("ALTER TABLE %s.%s ADD CONSTRAINT %s PRIMARY KEY (%s)", $schema, $table, $name, $stringFields);
}
}
else
{
$query = sprintf("ALTER TABLE %s.%s ADD CONSTRAINT %s PRIMARY KEY (%s)", $schema, $table, $name, $fields);
}
if (@$this->db->simple_query($query))
{
$this->eprintflib->printMessage(sprintf("Added primary key %s on table %s.%s", $name, $schema, $table));
}
else
{
$this->eprintflib->printError(sprintf("Adding primary key %s on table %s.%s", $name, $schema, $table));
}
}
/**
* Sets a column as foreign key of a table and schema
*/
protected function addForeingKey($schema, $table, $name, $field, $schemaDest, $tableDest, $fieldDest, $attributes)
{
$query = sprintf(
"ALTER TABLE %s.%s ADD CONSTRAINT %s FOREIGN KEY (%s) REFERENCES %s.%s (%s) %s",
$schema,
$table,
$name,
$field,
$schemaDest,
$tableDest,
$fieldDest,
$attributes
);
if (@$this->db->simple_query($query))
{
$this->eprintflib->printMessage(sprintf("Added foreign key %s on table %s.%s", $name, $schema, $table));
}
else
{
$this->eprintflib->printError(sprintf("Adding foreign key %s on table %s.%s", $name, $schema, $table));
}
}
/**
* Sets a column as unique key of a table and schema
*/
protected function addUniqueKey($schema, $table, $name, $fields)
{
$stringFields = null;
if (is_array($fields))
{
if (count($fields) > 0)
{
$stringFields = "";
for ($i = 0; $i < count($fields); $i++)
{
$stringFields .= $fields[$i];
if ($i != count($fields) - 1)
{
$stringFields .= ", ";
}
}
$query = sprintf("CREATE UNIQUE INDEX %s ON %s.%s (%s)", $name, $schema, $table, $stringFields);
}
}
else
{
$query = sprintf("CREATE UNIQUE INDEX %s ON %s.%s (%s)", $name, $schema, $table, $fields);
}
if (@$this->db->simple_query($query))
{
$this->eprintflib->printMessage(sprintf("Added unique key %s on table %s.%s", $name, $schema, $table));
}
else
{
$this->eprintflib->printError(sprintf("Adding unique key %s on table %s.%s", $name, $schema, $table));
}
}
/**
* Grants permissions to a user on a table and schema
*/
protected function grantTable($permissions, $schema, $table, $user)
{
$stringPermission = null;
if (is_array($permissions))
{
if (count($permissions) > 0)
{
$stringPermission = "";
for ($i = 0; $i < count($permissions); $i++)
{
$stringPermission .= $permissions[$i];
if ($i != count($permissions) - 1)
{
$stringPermission .= ", ";
}
}
$query = sprintf("GRANT %s ON TABLE %s.%s TO %s", $stringPermission, $schema, $table, $user);
}
}
else
{
$query = sprintf("GRANT %s ON TABLE %s.%s TO %s", $permissions, $schema, $table, $user);
}
if (@$this->db->simple_query($query))
{
$this->eprintflib->printMessage(
sprintf(
"Granted permissions %s on table %s.%s to user %s",
is_null($stringPermission) ? $permissions : $stringPermission,
$schema,
$table,
$user
)
);
}
else
{
$this->eprintflib->printError(
sprintf(
"Granting permissions %s on table %s.%s to user %s",
is_null($stringPermission) ? $permissions : $stringPermission,
$schema,
$table,
$user
)
);
}
}
/**
* Creates a table in a schema with columns
*/
protected function createTable($schema, $table, $fields)
{
$this->dbforge->add_field($fields);
if ($this->dbforge->create_table($schema.'.'.$table, true))
{
$this->eprintflib->printMessage(sprintf("Table %s.%s created or existing", $schema, $table));
}
else
{
$this->eprintflib->printError(sprintf("Creating table %s.%s", $schema, $table));
}
}
/**
* Drops a table from a schema
*/
protected function dropTable($schema, $table)
{
if ($this->dbforge->drop_table($schema.".".$table))
{
$this->eprintflib->printMessage(sprintf("Table %s.%s has been dropped", $schema, $table));
}
else
{
$this->eprintflib->printError(sprintf("Dropping table %s.%s", $schema, $table));
}
}
/**
* Initializes a sequence with the max value of a column
*/
protected function initializeSequence($schemaSrc, $sequence, $schemaDst, $table, $field)
{
$query = sprintf("SELECT SETVAL('%s.%s', (SELECT MAX(%s) FROM %s.%s))", $schemaSrc, $sequence, $field, $schemaDst, $table);
if (@$this->db->simple_query($query))
{
$this->eprintflib->printMessage(sprintf("Sequence %s.%s has been initialized", $schemaSrc, $sequence));
}
else
{
$this->eprintflib->printError(sprintf("Initializing sequence %s.%s", $schemaSrc, $sequence));
}
}
/**
* Add comment to a column
*/
protected function addCommentToColumn($schema, $table, $field, $comment)
{
$query = sprintf("COMMENT ON COLUMN %s.%s.%s IS ?", $schema, $table, $field);
if (@$this->db->query($query, array($comment)))
{
$this->eprintflib->printMessage(sprintf("Comment added to %s.%s.%s", $schema, $table, $field));
}
else
{
$this->eprintflib->printError(sprintf("Error while adding comment to %s.%s.%s", $schema, $table, $field));
}
}
/**
* Add comment to a table
*/
protected function addCommentToTable($schema, $table, $comment)
{
$query = sprintf("COMMENT ON TABLE %s.%s IS ?", $schema, $table, $field);
if (@$this->db->query($query, array($comment)))
{
$this->eprintflib->printMessage(sprintf("Comment added to %s.%s", $schema, $table));
}
else
{
$this->eprintflib->printError(sprintf("Error while adding comment to %s.%s", $schema, $table));
}
}
/**
* Grants permissions to a user on a sequence
*/
protected function grantSequence($permissions, $schema, $sequence, $user)
{
$stringPermission = null;
if (is_array($permissions))
{
if (count($permissions) > 0)
{
$stringPermission = "";
for ($i = 0; $i < count($permissions); $i++)
{
$stringPermission .= $permissions[$i];
if ($i != count($permissions) - 1)
{
$stringPermission .= ", ";
}
}
$query = sprintf("GRANT %s ON SEQUENCE %s.%s TO %s", $stringPermission, $schema, $sequence, $user);
}
}
else
{
$query = sprintf("GRANT %s ON SEQUENCE %s.%s TO %s", $permissions, $schema, $sequence, $user);
}
if (@$this->db->simple_query($query))
{
$this->eprintflib->printMessage(
sprintf(
"Granted permissions %s on sequence %s.%s to user %s",
is_null($stringPermission) ? $permissions : $stringPermission,
$schema,
$sequence,
$user
)
);
}
else
{
$this->eprintflib->printError(
sprintf(
"Granting permissions %s on sequence %s.%s to user %s",
is_null($stringPermission) ? $permissions : $stringPermission,
$schema,
$sequence,
$user
)
);
}
}
/**
* Executes the given query
*/
protected function execQuery($query)
{
if (! @$this->db->simple_query($query))
{
$error = $this->db->error();
if (is_array($error) && isset($error["message"]))
{
$this->eprintflib->printError($error["message"]);
}
else
{
$this->eprintflib->printError("Error while executing a query");
}
}
$this->eprintflib->printInfo(
"Query correctly executed: ".
substr(preg_replace("/\s+/", " ", trim($query)), 0, EPrintfLib::PRINT_QUERY_LEN).
(strlen($query) > EPrintfLib::PRINT_QUERY_LEN ? "..." : "")
);
}
}
+116 -22
View File
@@ -8,6 +8,7 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
class PersonLogLib
{
const PARKED_LOGNAME = 'Parked';
const ONHOLD_LOGNAME = 'Onhold';
/**
* Constructor
@@ -91,26 +92,20 @@ class PersonLogLib
*/
public function park($person_id, $date, $taetigkeit_kurzbz, $app = 'core', $oe_kurzbz = null, $user = null)
{
$logdata = array(
$onhold = $this->getOnHoldDate($person_id);
if (hasData($onhold))
return error("Person already on hold");
$logjson = array(
'name' => self::PARKED_LOGNAME
);
$data = array(
'person_id' => $person_id,
'zeitpunkt' => $date,
'taetigkeit_kurzbz' => $taetigkeit_kurzbz,
'app' => $app,
'oe_kurzbz' => $oe_kurzbz,
'logtype_kurzbz' => 'Processstate',
'logdata' => json_encode($logdata),
'insertvon' => $user
);
return $this->ci->PersonLogModel->insert($data);
return $this->_savePsLog($person_id, $date, $taetigkeit_kurzbz, $logjson, $app, $oe_kurzbz, $user);
}
/**
* Unparks a person, i.e. removes all log entries in the future
* Unparks a person, i.e. removes all log entries in the future with logname for parking
* @param $person_id
* @return array with deleted logids
*/
@@ -131,17 +126,9 @@ class PersonLogLib
{
$deleted[] = $log->log_id;
}
else
{
return $delresult;
}
}
}
}
else
{
return $result;
}
return success($deleted);
}
@@ -172,4 +159,111 @@ class PersonLogLib
return $parkeddate;
}
/**
* Sets person on hold, i.e. marks a person so no actions are expected for the person (e.g. as a prestudent).
* Done by adding a logentry with a special name. can be undone only manually by clicking button.
* @param $person_id
* @param $date
* @param $taetigkeit_kurzbz
* @param string $app
* @param null $oe_kurzbz
* @param null $user
* @return array
*/
public function setOnHold($person_id, $date, $taetigkeit_kurzbz, $app = 'core', $oe_kurzbz = null, $user = null)
{
$parked = $this->getParkedDate($person_id);
if (hasData($parked))
return error("Person already parked");
$logjson = array(
'name' => self::ONHOLD_LOGNAME
);
return $this->_savePsLog($person_id, $date, $taetigkeit_kurzbz, $logjson, $app, $oe_kurzbz, $user);
}
/**
* Removes on hold status, i.e. removes all log entries with logname for on hold
* @param $person_id
* @return array
*/
public function removeOnHold($person_id)
{
$deleted = array();
$result = $this->ci->PersonLogModel->filterLog($person_id);
if (hasData($result))
{
foreach ($result->retval as $log)
{
$logdata = json_decode($log->logdata);
if (isset($logdata->name) && $logdata->name === self::ONHOLD_LOGNAME)
{
$delresult = $this->ci->PersonLogModel->deleteLog($log->log_id);
if (isSuccess($delresult))
{
$deleted[] = $log->log_id;
}
}
}
}
return success($deleted);
}
/**
* Gets date until which a person is on hold
* @param $person_id
* @return the date if person is on hold, null otherwise
*/
public function getOnHoldDate($person_id)
{
$result = $this->ci->PersonLogModel->filterLog($person_id);
$onholddate = null;
if (hasData($result))
{
foreach ($result->retval as $log)
{
$logdata = json_decode($log->logdata);
if (isset($logdata->name) && $logdata->name === self::ONHOLD_LOGNAME)
{
$onholddate = $log->zeitpunkt;
break;
}
}
}
return $onholddate;
}
/**
* Saves a processstate log with specified parameters, including a specified log date.
* @param $person_id
* @param $date
* @param $taetigkeit_kurzbz
* @param $logjson
* @param string $app
* @param null $oe_kurzbz
* @param null $user
* @return mixed
*/
private function _savePsLog($person_id, $date, $taetigkeit_kurzbz, $logjson, $app = 'core', $oe_kurzbz = null, $user = null)
{
$data = array(
'person_id' => $person_id,
'zeitpunkt' => $date,
'taetigkeit_kurzbz' => $taetigkeit_kurzbz,
'app' => $app,
'oe_kurzbz' => $oe_kurzbz,
'logtype_kurzbz' => 'Processstate',
'logdata' => json_encode($logjson),
'insertvon' => $user
);
return $this->ci->PersonLogModel->insert($data);
}
}
+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);
}
}
}
@@ -0,0 +1,15 @@
<?php
class Bisiozweck_model extends DB_Model
{
/**
* Constructor
*/
public function __construct()
{
parent::__construct();
$this->dbTable = 'bis.tbl_bisio_zweck';
$this->pk = array('bisio_id', 'zweck_code');
$this->hasSequence = false;
}
}
+2 -4
View File
@@ -10,6 +10,8 @@ class Prestudent_model extends DB_Model
parent::__construct();
$this->dbTable = 'public.tbl_prestudent';
$this->pk = 'prestudent_id';
$this->load->model('crm/prestudentstatus_model', 'PrestudentstatusModel');
}
/**
@@ -208,7 +210,6 @@ class Prestudent_model extends DB_Model
return error('prestudent could not be loaded');
//Prestudentstatus
$this->load->model('crm/prestudentstatus_model', 'PrestudentstatusModel');
$lastStatus = $this->PrestudentstatusModel->getLastStatus($prestudent_id);
if ($lastStatus->error)
@@ -310,8 +311,6 @@ class Prestudent_model extends DB_Model
if (!hasData($prestudents))
return $bewerbungen;
$this->load->model('crm/prestudentstatus_model', 'PrestudentstatusModel');
foreach ($prestudents->retval as $prestudent)
{
$lastStatus = $this->PrestudentstatusModel->getLastStatus($prestudent->prestudent_id, $studiensemester_kurzbz);
@@ -424,7 +423,6 @@ class Prestudent_model extends DB_Model
if (!hasData($prestudent))
return false;
$this->load->model('prestudentstatus_model', 'PrestudentstatusModel');
$lastStatus = $this->PrestudentstatusModel->getLastStatus($prestudent_id, null, 'Interessent');
if (!hasData($lastStatus))
@@ -98,8 +98,8 @@ class Lehreinheitgruppe_model extends DB_Model
'semester' => $lvadata->semester,
'bezeichnung' => $bezeichnung,
'aktiv' => true,
'mailgrp' => false,
'sichtbar' => true,
'mailgrp' => true,
'sichtbar' => false,
'generiert' => false,
'insertamum' => date('Y-m-d H:i:s'),
'insertvon' => $loggedInUser,
@@ -10,6 +10,9 @@ class Lehrveranstaltung_model extends DB_Model
parent::__construct();
$this->dbTable = 'lehre.tbl_lehrveranstaltung';
$this->pk = 'lehrveranstaltung_id';
$this->load->model('organisation/studiengang_model', 'StudiengangModel');
$this->load->model('organisation/studiensemester_model', 'StudiensemesterModel');
}
/**
@@ -22,8 +25,6 @@ class Lehrveranstaltung_model extends DB_Model
*/
public function getLehrveranstaltungGroupNames($studiensemester_kurzbz, $ausbildungssemester = null, $studiengang_kz = null, $lehrveranstaltung_ids = null)
{
$this->load->model('organisation/studiengang_model', 'StudiengangModel');
$studiengang_kz_arr = array();
$ausbildungssemester_arr = array();
$lehrveranstaltung_id_arr = array();
@@ -59,7 +60,6 @@ class Lehrveranstaltung_model extends DB_Model
}
else
{
$this->load->model('organisation/studiensemester_model', 'StudiensemesterModel');
foreach ($studiengang_kz_arr as $studiengang_kz_item)
{
$result = $this->StudiensemesterModel->getAusbildungssemesterByStudiensemesterAndStudiengang($studiensemester_kurzbz, $studiengang_kz_item);
@@ -214,8 +214,6 @@ class Lehrveranstaltung_model extends DB_Model
*/
public function getLvsWithIncomingPlaces($studiensemester_kurzbz)
{
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
$studsemres = $this->StudiensemesterModel->load($studiensemester_kurzbz);
if (!hasData($studsemres))
@@ -19,7 +19,7 @@ class Studienplan_model extends DB_Model
return $this->loadWhere(array("studiengang_kz" => $studiengang_kz));
}
public function getStudienplaeneBySemester($studiengang_kz, $studiensemester_kurzbz, $ausbildungssemester = null, $orgform_kurzbz = null)
public function getStudienplaeneBySemester($studiengang_kz, $studiensemester_kurzbz, $ausbildungssemester = null, $orgform_kurzbz = null, $sprache = null)
{
$this->addJoin("lehre.tbl_studienordnung", "studienordnung_id");
$this->addJoin("lehre.tbl_studienplan_semester", "studienplan_id");
@@ -40,6 +40,11 @@ class Studienplan_model extends DB_Model
$whereArray["orgform_kurzbz"] = $orgform_kurzbz;
}
if(!is_null($sprache))
{
$whereArray["tbl_studienplan.sprache"] = $sprache;
}
return $this->StudienplanModel->loadWhere($whereArray);
}
@@ -61,7 +61,7 @@ class Studiensemester_model extends DB_Model
start,
ende
FROM public.tbl_studiensemester
WHERE start > (
WHERE start >= (
SELECT ende
FROM public.tbl_studiensemester
WHERE studiensemester_kurzbz = ?
@@ -72,6 +72,26 @@ class Studiensemester_model extends DB_Model
return $this->execQuery($query, array($studiensemester_kurzbz));
}
/**
* getPreviousFrom
*/
public function getPreviousFrom($studiensemester_kurzbz)
{
$query = 'SELECT studiensemester_kurzbz,
start,
ende
FROM public.tbl_studiensemester
WHERE ende <= (
SELECT start
FROM public.tbl_studiensemester
WHERE studiensemester_kurzbz = ?
)
ORDER BY start DESC
LIMIT 1';
return $this->execQuery($query, array($studiensemester_kurzbz));
}
/**
* getNearest
*/
+3 -3
View File
@@ -10,6 +10,9 @@ class Person_model extends DB_Model
parent::__construct();
$this->dbTable = 'public.tbl_person';
$this->pk = 'person_id';
$this->load->model('person/kontakt_model', 'KontaktModel');
$this->load->model('person/adresse_model', 'AdresseModel');
}
/**
@@ -162,9 +165,6 @@ class Person_model extends DB_Model
if(count($person->retval) < 1)
return success(null);
$this->load->model('person/kontakt_model', 'KontaktModel');
$this->load->model('person/adresse_model', 'AdresseModel');
$this->KontaktModel->addDistinct();
$this->KontaktModel->addSelect('kontakttyp, anmerkung, kontakt, zustellung');
$this->KontaktModel->addOrder('kontakttyp');
+169
View File
@@ -0,0 +1,169 @@
<?php
class FAS_UDF_model extends DB_Model
{
// String values of booleans
const STRING_NULL = 'null';
const STRING_TRUE = 'true';
const STRING_FALSE = 'false';
const UDF_DROPDOWN_TYPE = 'dropdown';
const UDF_MULTIPLEDROPDOWN_TYPE = 'multipledropdown';
/**
* Methods to save data from FAS
*/
public function saveUDFs($udfs)
{
$result = error('No way man!');
$resultPerson = success('person');
$resultPrestudent = success('prestudent');
$person_id = null;
if (isset($udfs['person_id'])) $person_id = $udfs['person_id'];
unset($udfs['person_id']);
$prestudent_id = null;
if (isset($udfs['prestudent_id'])) $prestudent_id = $udfs['prestudent_id'];
unset($udfs['prestudent_id']);
$jsons = array();
//
if (isset($person_id))
{
// Load model Person_model
$this->load->model('person/Person_model', 'PersonModel');
$result = $this->load(array('public', 'tbl_person'));
if (isSuccess($result) && count($result->retval) == 1)
{
$jsons = json_decode($result->retval[0]->jsons);
}
$udfs = $this->_fillMissingTextUDF($udfs, $jsons);
$udfs = $this->_fillMissingChkboxUDF($udfs, $jsons);
$udfs = $this->_fillMissingDropdownUDF($udfs, $jsons);
$resultPerson = $this->PersonModel->update($person_id, $udfs);
}
//
if (isset($prestudent_id))
{
// Load model Prestudent_model
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
$result = $this->load(array('public', 'tbl_prestudent'));
if (isSuccess($result) && count($result->retval) == 1)
{
$jsons = json_decode($result->retval[0]->jsons);
}
$udfs = $this->_fillMissingTextUDF($udfs, $jsons);
$udfs = $this->_fillMissingChkboxUDF($udfs, $jsons);
$udfs = $this->_fillMissingDropdownUDF($udfs, $jsons);
$resultPrestudent = $this->PrestudentModel->update($prestudent_id, $udfs);
}
if (isSuccess($resultPerson) && isSuccess($resultPrestudent))
{
$result = success(array($resultPerson->retval, $resultPrestudent->retval));
}
else if(isError($resultPerson))
{
$result = $resultPerson;
}
else if(isError($resultPrestudent))
{
$result = $resultPrestudent;
}
return $result;
}
/**
*
*/
private function _fillMissingChkboxUDF($udfs, $jsons)
{
$_fillMissingChkboxUDF = $udfs;
foreach($jsons as $udfDescription)
{
if ($udfDescription->{UDFLib::TYPE} == UDFLib::CHKBOX_TYPE)
{
if (!isset($_fillMissingChkboxUDF[$udfDescription->{UDFLib::NAME}]))
{
$_fillMissingChkboxUDF[$udfDescription->{UDFLib::NAME}] = false;
}
else
{
if ($_fillMissingChkboxUDF[$udfDescription->{UDFLib::NAME}] == UDF_model::STRING_FALSE)
{
$_fillMissingChkboxUDF[$udfDescription->{UDFLib::NAME}] = false;
}
else if ($_fillMissingChkboxUDF[$udfDescription->{UDFLib::NAME}] == UDF_model::STRING_TRUE)
{
$_fillMissingChkboxUDF[$udfDescription->{UDFLib::NAME}] = true;
}
}
}
}
return $_fillMissingChkboxUDF;
}
/**
*
*/
private function _fillMissingDropdownUDF($udfs, $jsons)
{
$_fillMissingDropdownUDF = $udfs;
foreach($jsons as $udfDescription)
{
if ($udfDescription->{UDFLib::TYPE} == UDF_model::UDF_DROPDOWN_TYPE
|| $udfDescription->{UDFLib::TYPE} == UDF_model::UDF_MULTIPLEDROPDOWN_TYPE)
{
if (!isset($_fillMissingDropdownUDF[$udfDescription->{UDFLib::NAME}]))
{
$_fillMissingDropdownUDF[$udfDescription->{UDFLib::NAME}] = null;
}
else if($_fillMissingDropdownUDF[$udfDescription->{UDFLib::NAME}] == UDF_model::STRING_NULL)
{
$_fillMissingDropdownUDF[$udfDescription->{UDFLib::NAME}] = null;
}
}
}
return $_fillMissingDropdownUDF;
}
/**
*
*/
private function _fillMissingTextUDF($udfs, $jsons)
{
$_fillMissingTextUDF = $udfs;
foreach($jsons as $udfDescription)
{
if ($udfDescription->{UDFLib::TYPE} == 'textarea'
|| $udfDescription->{UDFLib::TYPE} == 'textfield')
{
if (!isset($_fillMissingTextUDF[$udfDescription->{UDFLib::NAME}]))
{
$_fillMissingTextUDF[$udfDescription->{UDFLib::NAME}] = null;
}
else if(trim($_fillMissingTextUDF[$udfDescription->{UDFLib::NAME}]) == '')
{
$_fillMissingTextUDF[$udfDescription->{UDFLib::NAME}] = null;
}
}
}
return $_fillMissingTextUDF;
}
}
-168
View File
@@ -2,14 +2,6 @@
class UDF_model extends DB_Model
{
// String values of booleans
const STRING_NULL = 'null';
const STRING_TRUE = 'true';
const STRING_FALSE = 'false';
const UDF_DROPDOWN_TYPE = 'dropdown';
const UDF_MULTIPLEDROPDOWN_TYPE = 'multipledropdown';
/**
* Constructor
*/
@@ -38,164 +30,4 @@ class UDF_model extends DB_Model
return $udfResults;
}
// ------------------------------------------------------------------------------------
// These methods work only with the this version of FAS, not with the future versions
/**
* Methods to save data from FAS
*/
public function saveUDFs($udfs)
{
$result = error('No way man!');
$resultPerson = success('person');
$resultPrestudent = success('prestudent');
$person_id = null;
if (isset($udfs['person_id'])) $person_id = $udfs['person_id'];
unset($udfs['person_id']);
$prestudent_id = null;
if (isset($udfs['prestudent_id'])) $prestudent_id = $udfs['prestudent_id'];
unset($udfs['prestudent_id']);
$jsons = array();
//
if (isset($person_id))
{
// Load model Person_model
$this->load->model('person/Person_model', 'PersonModel');
$result = $this->load(array('public', 'tbl_person'));
if (isSuccess($result) && count($result->retval) == 1)
{
$jsons = json_decode($result->retval[0]->jsons);
}
$udfs = $this->_fillMissingTextUDF($udfs, $jsons);
$udfs = $this->_fillMissingChkboxUDF($udfs, $jsons);
$udfs = $this->_fillMissingDropdownUDF($udfs, $jsons);
$resultPerson = $this->PersonModel->update($person_id, $udfs);
}
//
if (isset($prestudent_id))
{
// Load model Prestudent_model
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
$result = $this->load(array('public', 'tbl_prestudent'));
if (isSuccess($result) && count($result->retval) == 1)
{
$jsons = json_decode($result->retval[0]->jsons);
}
$udfs = $this->_fillMissingTextUDF($udfs, $jsons);
$udfs = $this->_fillMissingChkboxUDF($udfs, $jsons);
$udfs = $this->_fillMissingDropdownUDF($udfs, $jsons);
$resultPrestudent = $this->PrestudentModel->update($prestudent_id, $udfs);
}
if (isSuccess($resultPerson) && isSuccess($resultPrestudent))
{
$result = success(array($resultPerson->retval, $resultPrestudent->retval));
}
else if(isError($resultPerson))
{
$result = $resultPerson;
}
else if(isError($resultPrestudent))
{
$result = $resultPrestudent;
}
return $result;
}
/**
*
*/
private function _fillMissingChkboxUDF($udfs, $jsons)
{
$_fillMissingChkboxUDF = $udfs;
foreach($jsons as $udfDescription)
{
if ($udfDescription->{UDFLib::TYPE} == UDFLib::CHKBOX_TYPE)
{
if (!isset($_fillMissingChkboxUDF[$udfDescription->{UDFLib::NAME}]))
{
$_fillMissingChkboxUDF[$udfDescription->{UDFLib::NAME}] = false;
}
else
{
if ($_fillMissingChkboxUDF[$udfDescription->{UDFLib::NAME}] == UDF_model::STRING_FALSE)
{
$_fillMissingChkboxUDF[$udfDescription->{UDFLib::NAME}] = false;
}
else if ($_fillMissingChkboxUDF[$udfDescription->{UDFLib::NAME}] == UDF_model::STRING_TRUE)
{
$_fillMissingChkboxUDF[$udfDescription->{UDFLib::NAME}] = true;
}
}
}
}
return $_fillMissingChkboxUDF;
}
/**
*
*/
private function _fillMissingDropdownUDF($udfs, $jsons)
{
$_fillMissingDropdownUDF = $udfs;
foreach($jsons as $udfDescription)
{
if ($udfDescription->{UDFLib::TYPE} == UDF_model::UDF_DROPDOWN_TYPE
|| $udfDescription->{UDFLib::TYPE} == UDF_model::UDF_MULTIPLEDROPDOWN_TYPE)
{
if (!isset($_fillMissingDropdownUDF[$udfDescription->{UDFLib::NAME}]))
{
$_fillMissingDropdownUDF[$udfDescription->{UDFLib::NAME}] = null;
}
else if($_fillMissingDropdownUDF[$udfDescription->{UDFLib::NAME}] == UDF_model::STRING_NULL)
{
$_fillMissingDropdownUDF[$udfDescription->{UDFLib::NAME}] = null;
}
}
}
return $_fillMissingDropdownUDF;
}
/**
*
*/
private function _fillMissingTextUDF($udfs, $jsons)
{
$_fillMissingTextUDF = $udfs;
foreach($jsons as $udfDescription)
{
if ($udfDescription->{UDFLib::TYPE} == 'textarea'
|| $udfDescription->{UDFLib::TYPE} == 'textfield')
{
if (!isset($_fillMissingTextUDF[$udfDescription->{UDFLib::NAME}]))
{
$_fillMissingTextUDF[$udfDescription->{UDFLib::NAME}] = null;
}
else if(trim($_fillMissingTextUDF[$udfDescription->{UDFLib::NAME}]) == '')
{
$_fillMissingTextUDF[$udfDescription->{UDFLib::NAME}] = null;
}
}
}
return $_fillMissingTextUDF;
}
}
@@ -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';
}
+1
View File
@@ -3,6 +3,7 @@ $this->load->view('templates/FHC-Header',
array(
'title' => 'FH-Complete',
'jquery' => true,
'jqueryui' => true,
'bootstrap' => true,
'fontawesome' => true,
'sbadmintemplate' => true,
@@ -47,7 +47,7 @@
}
}
?>
<form action="<?php echo site_url('system/UDF/saveUDF'); ?>" method="POST">
<form action="<?php echo site_url('system/FAS_UDF/saveUDF'); ?>" method="POST">
<div class="div-table">
<div class="div-row">
@@ -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')
)
);
@@ -7,20 +7,14 @@
$TAETIGKEIT_KURZBZ = '\'bewerbung\', \'kommunikation\'';
$LOGDATA_NAME = '\'Login with code\', \'Login with user\', \'New application\', \'Interessent rejected\'';
$LOGDATA_NAME_PARKED = '\'Parked\'';
$LOGDATA_NAME_ONHOLD = '\'Onhold\'';
$LOGTYPE_KURZBZ = '\'Processstate\'';
$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",
@@ -31,6 +25,7 @@
pl.zeitpunkt AS "LockDate",
pl.lockuser AS "LockUser",
pd.parkdate AS "ParkDate",
ohd.onholddate AS "OnholdDate",
(
SELECT l.zeitpunkt
FROM system.tbl_log l
@@ -100,13 +95,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 +121,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 +146,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 +171,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 +196,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",
@@ -229,6 +230,14 @@
AND l.logdata->>\'name\' = '.$LOGDATA_NAME_PARKED.'
AND l.zeitpunkt >= NOW()
) pd USING(person_id)
LEFT JOIN (
SELECT l.person_id,
l.zeitpunkt AS onholddate
FROM system.tbl_log l
WHERE l.logtype_kurzbz = '.$LOGTYPE_KURZBZ.'
AND l.logdata->>\'name\' = '.$LOGDATA_NAME_ONHOLD.'
AND l.zeitpunkt >= NOW()
) ohd USING(person_id)
WHERE
EXISTS (
SELECT 1
@@ -252,7 +261,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';
@@ -279,6 +288,7 @@
ucfirst($this->p->t('global', 'sperrdatum')),
ucfirst($this->p->t('global', 'gesperrtVon')),
ucfirst($this->p->t('global', 'parkdatum')),
ucfirst($this->p->t('global', 'rueckstelldatum')),
ucfirst($this->p->t('global', 'letzteAktion')),
'Aktionstyp',
'AnzahlAktePflicht',
@@ -341,6 +351,11 @@
$datasetRaw->{'ParkDate'} = '-';
}
if ($datasetRaw->{'OnholdDate'} == null)
{
$datasetRaw->{'OnholdDate'} = '-';
}
if ($datasetRaw->{'StgAbgeschickt'} == null)
{
$datasetRaw->{'StgAbgeschickt'} = '-';
@@ -377,6 +392,11 @@
$mark = FilterWidget::DEFAULT_MARK_ROW_CLASS;
}
if ($datasetRaw->OnholdDate != null)
{
$mark = "text-success";
}
// Parking has priority over locking
if ($datasetRaw->ParkDate != null)
{
@@ -34,7 +34,14 @@
'nichtsZumAusparken',
'fehlerBeimAusparken',
'fehlerBeimParken',
'bewerberGeparktBis'
'bewerberGeparktBis',
'bewerberOnHold',
'bewerberOnHoldEntfernen',
'bewerberOnHoldBis',
'nichtsZumEntfernen',
'fehlerBeimEntfernen',
'rueckstelldatumUeberschritten',
'parkenZurueckstellenInfo'
),
'ui' => array(
'gespeichert',
@@ -176,7 +183,7 @@
</div>
</div>
<div class="col-lg-6">
<div id="parking"></div>
<div id="postponing"></div>
<div id="logs">
<?php $this->load->view('system/infocenter/logs.php'); ?>
</div>
@@ -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
@@ -233,6 +235,7 @@
'filter_id' => $this->input->get('filter_id'),
'requiredPermissions' => 'infocenter',
'datasetRepresentation' => 'tablesorter',
'reloadDataset' => ($this->input->get('reloadDataset')=='true'?true:false),
'checkboxes' => 'PersonId',
'additionalColumns' => array('Details'),
'columnsAliases' => array(
@@ -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';
@@ -203,6 +204,7 @@
'filter_id' => $this->input->get('filter_id'),
'requiredPermissions' => 'infocenter',
'datasetRepresentation' => 'tablesorter',
'reloadDataset' => ($this->input->get('reloadDataset')=='true'?true:false),
'checkboxes' => 'PersonId',
'additionalColumns' => array('Details'),
'columnsAliases' => array(
@@ -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);
?>
+5
View File
@@ -20,6 +20,8 @@
* Rudolf Hangl < rudolf.hangl@technikum-wien.at >
* Gerald Simane-Sequens < gerald.simane-sequens@technikum-wien.at >
*/
session_start();
require_once('../../config/cis.config.inc.php');
require_once('../../include/wochenplan.class.php');
require_once('../../include/benutzerberechtigung.class.php');
@@ -1972,6 +1974,9 @@ function personen_id_read_mitarbeiter_oder_student($db,$person_id)
*/
function read_create_html_news($db,$fachbereich_kurzbz,$studiengang_kz,$semester)
{
if(defined('CIS_INFOSCREEN_NEWS_ANZEIGEN') && CIS_INFOSCREEN_NEWS_ANZEIGEN==false)
return '';
// ------------------------------------------------------------------------------------------
// Lesen Newstickerzeilen
// ------------------------------------------------------------------------------------------
+148 -302
View File
@@ -23,8 +23,6 @@
*/
// Oberflaeche zum Upload von Bildern
//session_cache_limiter('none'); //muss gesetzt werden damit der upload in chrome und das automatische updaten des profilbildes funktioniert
require_once('../../config/cis.config.inc.php');
require_once('../../include/functions.inc.php');
require_once('../../include/person.class.php');
@@ -32,67 +30,52 @@ require_once('../../include/benutzer.class.php');
require_once('../../include/akte.class.php');
require_once('../../include/phrasen.class.php');
require_once('../../include/fotostatus.class.php');
$user = get_uid();
$sprache = getSprache();
$p = new phrasen($sprache);
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../../vendor/twbs/bootstrap/dist/css/bootstrap.min.css">
<link href="../../skin/style.css.php" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="../../vendor/components/jqueryui/themes/base/jquery-ui.min.css">
<link rel="stylesheet" type="text/css" href="../../skin/simplecropper.css">'.
cropCss().'
<link rel="stylesheet" type="text/css" href="../../skin/jquery-ui-1.9.2.custom.min.css">
<script type="text/javascript" src="../../vendor/jquery/jqueryV1/jquery-1.12.4.min.js"></script>
<script type="text/javascript" src="../../vendor/christianbach/tablesorter/jquery.tablesorter.min.js"></script>
<script type="text/javascript" src="../../vendor/components/jqueryui/jquery-ui.min.js"></script>
<script type="text/javascript" src="../../include/js/jquery.ui.datepicker.translation.js"></script>
<script type="text/javascript" src="../../vendor/jquery/sizzle/sizzle.js"></script>
<script type="text/javascript" src="../../vendor/tapmodo/Jcrop/js/Jcrop.min.js"></script>
<script type="text/javascript" src="../../vendor/tomazdragar/SimpleCropper/scripts/jquery.SimpleCropper.js"></script>
<script type="text/javascript" src="../../include/js/cropper.js"></script>
<script type="text/javascript" src="../../vendor/jquery/jqueryV1/jquery-1.12.4.min.js"></script>
<script type="text/javascript" src="../../vendor/twbs/bootstrap/dist/js/bootstrap.min.js"></script>
<title>'.$p->t('profil/Bildupload').'</title>
</head>
<body>
<div style="padding: 10px">
<h1>'.$p->t('profil/Bildupload').'</h1>';
function resize($filename, $width, $height)
{
$ext = explode('.',$_FILES['bild']['name']);
$ext = strtolower($ext[count($ext)-1]);
$ext = explode('.',$_FILES['bild']['name']);
$ext = strtolower($ext[count($ext)-1]);
// Hoehe und Breite neu berechnen
list($width_orig, $height_orig) = getimagesize($filename);
if ($width && ($width_orig < $height_orig))
{
$width = ($height / $height_orig) * $width_orig;
}
else
{
$height = ($width / $width_orig) * $height_orig;
}
// Hoehe und Breite neu berechnen
list($width_orig, $height_orig) = getimagesize($filename);
$image_p = imagecreatetruecolor($width, $height);
if ($width && ($width_orig < $height_orig))
{
$width = ($height / $height_orig) * $width_orig;
}
else
{
$height = ($width / $width_orig) * $height_orig;
}
$image = imagecreatefromjpeg($filename);
$image_p = imagecreatetruecolor($width, $height);
//Bild nur verkleinern aber nicht vergroessern
if($width_orig>$width || $height_orig>$height)
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);
else
$image_p = $image;
$image = imagecreatefromjpeg($filename);
imagejpeg($image_p, $filename, 80);
//Bild nur verkleinern aber nicht vergroessern
if($width_orig>$width || $height_orig>$height)
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);
else
$image_p = $image;
imagejpeg($image_p, $filename, 80);
@imagedestroy($image_p);
@imagedestroy($image);
@imagedestroy($image_p);
@imagedestroy($image);
}
if(isset($_GET['person_id']))
{
$benutzer = new benutzer();
@@ -107,269 +90,132 @@ if(isset($_GET['person_id']))
}
else
die($p->t('global/fehlerBeiDerParameteruebergabe'));
//Bei Upload des Bildes
if(isset($_POST['submitbild']))
{
if(isset($_FILES['bild']['tmp_name']))
{
//Extension herausfiltern
$ext = explode('.',$_FILES['bild']['name']);
$ext = mb_strtolower($ext[count($ext)-1]);
$width=101;
$height=130;
echo '<br>';
echo $p->t('profil/BilduploadInfotext',array($p->t('dms_link/bildRichtlinien'))).'<br><br>';
echo '<div class="simple-cropper-images">
'.$p->t('profil/fotoAuswählen').'
<div class="cropme" id="croppingdiv" style="width: 300px; height: 400px; background-image:url(../../skin/images/photoupload.png); margin:10px; cursor:pointer;"></div>
<script>
// Init Simple Cropper
$(".cropme").simpleCropper();
</script>
</div>
<input type="button" name="submitbild" id="saveimgbutton" value="'.$p->t('profil/bildSpeichern').'" style="margin-left:90px;"/>
<input type="hidden" id="person_id" value="'.$_GET['person_id'].'" />';
//--check that it's a jpeg
if ($ext=='jpg' || $ext=='jpeg')
{
$filename = $_FILES['bild']['tmp_name'];
if (isset($_POST['src'])) {
$src = $_POST['src'];
echo $src;
//groesse auf maximal 827x1063 begrenzen
resize($filename, 827, 1063);
$fp = fopen($filename,'r');
//auslesen
$content = fread($fp, filesize($filename));
fclose($fp);
$akte = new akte();
if($akte->getAkten($_GET['person_id'], 'Lichtbil'))
{
if(count($akte->result)>0)
{
$akte = $akte->result[0];
$akte->new = false;
}
else
$akte->new = true;
}
else
{
$akte->new = true;
}
$akte->dokument_kurzbz = 'Lichtbil';
$akte->person_id = $_GET['person_id'];
$akte->inhalt = base64_encode($content);
$akte->mimetype = "image/jpg";
$akte->erstelltam = date('Y-m-d H:i:s');
$akte->gedruckt = false;
$akte->titel = "Lichtbild_".$_GET['person_id'].".jpg";
$akte->bezeichnung = "Lichtbild gross";
$akte->updateamum = date('Y-m-d H:i:s');
$akte->updatevon = $user;
$akte->insertamum = date('Y-m-d H:i:s');
$akte->insertvon = $user;
$akte->uid = '';
if(!$akte->save())
{
echo '<div class="alert alert-danger">Fehler: '.$akte->errormsg.'</div>';
}
//groesse auf maximal 101x130 begrenzen
resize($filename, 101, 130);
//in DB speichern
//File oeffnen
$fp = fopen($filename,'r');
//auslesen
$content = fread($fp, filesize($filename));
fclose($fp);
//in base64-Werte umrechnen
$content = base64_encode($content);
$person = new person();
if($person->load($_GET['person_id']))
{
//base64 Wert in die Datenbank speichern
$person->foto = $content;
$person->new = false;
if($person->save())
{
$fs = new fotostatus();
$fs->person_id=$person->person_id;
$fs->fotostatus_kurzbz='hochgeladen';
$fs->datum = date('Y-m-d');
$fs->insertamum = date('Y-m-d H:i:s');
$fs->insertvon = $user;
$fs->updateamum = date('Y-m-d H:i:s');
$fs->updatevon = $user;
if(!$fs->save(true))
echo '<div class="alert alert-danger">Fehler beim Setzen des Bildstatus</div>';
else
{
echo "<div class='alert alert-success'>Bild wurde erfolgreich gespeichert</div>
<script language='Javascript'>
if(typeof(opener.StudentAuswahl) == 'function')
opener.StudentAuswahl();
if(typeof(opener.MitarbeiterAuswahl) == 'function')
opener.MitarbeiterAuswahl();
if(typeof(opener.RefreshImage) == 'function' ||
typeof(opener.RefreshImage) == 'object')
{
opener.RefreshImage();
}
window.close();
</script>";
}
}
else
echo '<div class="alert alert-danger">'.$person->errormsg.'</div>';
}
else
echo '<div class="alert alert-danger">'.$person->errormsg.'</div>';
}
else
echo '<div class="alert alert-danger">'.$p->t('profil/nurJPGBilder').'</div>';
}
}
function cropCss() {
return '
<style type="text/css">
/* jquery.Jcrop.css v0.9.12 - MIT License */
/*
The outer-most container in a typical Jcrop instance
If you are having difficulty with formatting related to styles
on a parent element, place any fixes here or in a like selector
You can also style this element if you want to add a border, etc
A better method for styling can be seen below with .jcrop-light
(Add a class to the holder and style elements for that extended class)
*/
.jcrop-holder {
direction: ltr;
text-align: left;
}
/* Selection Border */
.jcrop-vline,
.jcrop-hline {
background: #ffffff url("../images/Jcrop.gif");
font-size: 0;
position: absolute;
}
.jcrop-vline {
height: 100%;
width: 1px !important;
}
.jcrop-vline.right {
right: 0;
}
.jcrop-hline {
height: 1px !important;
width: 100%;
}
.jcrop-hline.bottom {
bottom: 0;
}
/* Invisible click targets */
.jcrop-tracker {
height: 100%;
width: 100%;
/* "turn off" link highlight */
-webkit-tap-highlight-color: transparent;
/* disable callout, image save panel */
-webkit-touch-callout: none;
/* disable cut copy paste */
-webkit-user-select: none;
}
/* Selection Handles */
.jcrop-handle {
background-color: #333333;
border: 1px #eeeeee solid;
width: 14px;
height: 14px;
font-size: 1px;
}
.jcrop-handle.ord-n {
left: 50%;
margin-left: -4px;
margin-top: -4px;
top: 0;
}
.jcrop-handle.ord-s {
bottom: 0;
left: 50%;
margin-bottom: -4px;
margin-left: -4px;
}
.jcrop-handle.ord-e {
margin-right: -4px;
margin-top: -4px;
right: 0;
top: 50%;
}
.jcrop-handle.ord-w {
left: 0;
margin-left: -4px;
margin-top: -4px;
top: 50%;
}
.jcrop-handle.ord-nw {
left: 0;
margin-left: -4px;
margin-top: -4px;
top: 0;
}
.jcrop-handle.ord-ne {
margin-right: -4px;
margin-top: -4px;
right: 0;
top: 0;
}
.jcrop-handle.ord-se {
bottom: 0;
margin-bottom: -4px;
margin-right: -4px;
right: 0;
}
.jcrop-handle.ord-sw {
bottom: 0;
left: 0;
margin-bottom: -4px;
margin-left: -4px;
}
/* Dragbars */
.jcrop-dragbar.ord-n,
.jcrop-dragbar.ord-s {
height: 7px;
width: 100%;
}
.jcrop-dragbar.ord-e,
.jcrop-dragbar.ord-w {
height: 100%;
width: 7px;
}
.jcrop-dragbar.ord-n {
margin-top: -4px;
}
.jcrop-dragbar.ord-s {
bottom: 0;
margin-bottom: -4px;
}
.jcrop-dragbar.ord-e {
margin-right: -4px;
right: 0;
}
.jcrop-dragbar.ord-w {
margin-left: -4px;
}
/* The "jcrop-light" class/extension */
.jcrop-light .jcrop-vline,
.jcrop-light .jcrop-hline {
background: #ffffff;
filter: alpha(opacity=70) !important;
opacity: .70!important;
}
.jcrop-light .jcrop-handle {
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
background-color: #000000;
border-color: #ffffff;
border-radius: 3px;
}
/* The "jcrop-dark" class/extension */
.jcrop-dark .jcrop-vline,
.jcrop-dark .jcrop-hline {
background: #000000;
filter: alpha(opacity=70) !important;
opacity: 0.7 !important;
}
.jcrop-dark .jcrop-handle {
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
background-color: #ffffff;
border-color: #000000;
border-radius: 3px;
}
/* Simple macro to turn off the antlines */
.solid-line .jcrop-vline,
.solid-line .jcrop-hline {
background: #ffffff;
}
/* Fix for twitter bootstrap et al. */
.jcrop-holder img,
img.jcrop-preview {
max-width: none;
}
.clear{
font-size: 0px;
line-height: 0px;
overflow: hidden;
width: 0px;
height: 0px;
clear: both;
}
.simple-cropper-images{
width: 820px;
margin: 0 auto 20px;
}
.cropme{
background-image: url(../../skin/images/photoupload.png);
}
.cropme:hover{
}
.text{
font-family: arial;
font-size: 14px;
color: #4e4e4e;
margin-bottom: 20px;
}
.code{
font-family: arial;
font-size: 14px;
color: #4e4e4e;
margin-bottom: 20px;
background-color: #f1f1f1;
padding: 10px;
}
#fileInput{
width:0;
height:0;
overflow:hidden;
}
#modal{
z-index: 10;
position: fixed;
top: 0px;
left: 0px;
width: 100%;
height: 100%;
background-color: #5F5F5F;
opacity: 0.95;
display: none;
}
#preview{
z-index: 11;
position: fixed;
top: 0px;
left: 0px;
display: none;
border: 4px solid #A5A2A2;
border-radius: 4px;
float: left;
font-size: 0px;
line-height: 0px;
}
#preview .buttons{
width: 36px;
position: absolute;
bottom:0px;
right: -44px;
}
</style>';
}
//echo '<br>';
echo $p->t('profil/BilduploadInfotext',array($p->t('dms_link/bildRichtlinien'))).'<br><br>
<form accept-charset="UTF-8" method="POST" enctype="multipart/form-data" action="'.$_SERVER['PHP_SELF'].'?person_id='.$_GET['person_id'].'">
'.$p->t('profil/Bild').': <input type="file" accept="image/jpeg" name="bild" /><br>
<button type="submit" class="btn btn-primary" name="submitbild">Upload</button>
</form>
</td></tr>';
?>
</div>
</body>
</html>
+18
View File
@@ -314,6 +314,24 @@ switch($work)
echo $coodletermin->errormsg;
break;
case 'countTermine':
if(isset($_POST['coodle_id']))
$coodle_id = $_POST['coodle_id'];
else
die('CoodleID fehlt');
$coodle = new coodle();
if ($coodle->getTermine($coodle_id))
{
echo count($coodle->result);
}
else
{
echo $coodle->errormsg;
}
break;
default:
die('Invalid Work Parameter');
}
+40 -9
View File
@@ -76,11 +76,12 @@ if(isset($_POST['action']) && $_POST['action']=='start')
// Start der Umfrage
$coodle_termine = new coodle();
$coodle_termine->getTermine($coodle_id);
if(count($coodle_termine->result)>0)
// Die Terminoption "keine Auswahl wird immer benötigt. Deshalb > 1
if(count($coodle_termine->result) > 1)
{
$coodle_ressource = new coodle();
$coodle_ressource->getRessourcen($coodle_id);
if(count($coodle_ressource->result)>0)
if(count($coodle_ressource->result) > 0)
{
// Status aendern
$coodle->coodle_status_kurzbz='laufend';
@@ -135,16 +136,18 @@ if(isset($_POST['action']) && $_POST['action']=='start')
Bitte folgen Sie dem Link, um Ihre Terminwünsche bekannt zu geben:
<a href="'.$link.'">Link zur Terminumfrage</a>
<br><br>
'.($coodle->beschreibung != '' ? '
Beschreibung:<br><br>
'.$coodle->beschreibung.'<br><br>
'.$coodle->beschreibung.'<br><br>' : '').'
'.nl2br($sign);
$text=$anrede."!\n\nSie wurden zu einer Terminumfrage zum Thema \"".$db->convert_html_chars($coodle->titel)."\" eingeladen.\n
Bitte folgen Sie dem Link, um Ihre Terminwünsche bekannt zu geben:\n
$link\n\n
".($coodle->beschreibung != "" ? "
Beschreibung:\n\n
".strip_tags($coodle->beschreibung)."
\n\n
\n\n" : "")."
$sign";
$mail = new mail($email, $von,'Terminumfrage - '.$coodle->titel, $text);
@@ -317,7 +320,6 @@ echo '<html>
</style>
<script type="text/javascript">
$(document).ready(function()
{
// Coodle Termin initialisieren
@@ -342,7 +344,6 @@ echo '<html>
});
});
// Kalender Initialisieren
$("#calendar").fullCalendar(
{
@@ -568,6 +569,35 @@ echo '<html>
}
}
});
$("#umfrageStartenSubmitButton").click(function(e)
{
e.preventDefault(); // avoid to execute the actual submit of the form.
var form = $(this).parents("form:first");
formdata = form.serialize();
formdata += (formdata!=="")? "&work=countTermine&coodle_id='.$coodle_id.'":"";
$.ajax({
type: "POST",
url:"coodle_worker.php",
data: formdata,
success: function(data)
{
if (parseInt(data) > 1)
{
form.submit();
}
else
{
alert("Bitte ziehen Sie mindestens einen Termin in den Kalender");
}
},
error: function(data)
{
alert("Error: "+data);
}
});
});
});
@@ -847,7 +877,8 @@ echo '
}
</script>
<p>
'.$p->t('coodle/ressourcenBeschreibung').'
'.$p->t('coodle/ressourcenBeschreibung');
echo '
<br><br><a href="#" onclick="showExterne(); return false;">'.$p->t('coodle/externePersonhinzu').'</a>
</div> <!-- RessourcenInput -->
<div id="externePersonen" style="display: none">
@@ -864,10 +895,10 @@ echo '
</div>
<div id="fertig">
<h4>'.$p->t('coodle/umfrageStarten').'</h4>
<form action="'.$_SERVER['PHP_SELF'].'" method="POST">
<form id="umfrageStartenForm" action="'.$_SERVER['PHP_SELF'].'" method="POST">
<input type="hidden" name="action" value="start" />
<input type="hidden" name="coodle_id" value="'.$db->convert_html_chars($coodle_id).'" />
<input type="submit" value="'.$p->t('coodle/umfrageStarten').'" />
<input id="umfrageStartenSubmitButton" type="submit" value="'.$p->t('coodle/umfrageStarten').'"/>
</form>
<p>
'.$p->t('coodle/startBeschreibung').'
+9 -7
View File
@@ -31,6 +31,7 @@ require_once('../../../include/lehrveranstaltung.class.php');
require_once('../../../include/lehreinheit.class.php');
require_once('../../../include/benutzerberechtigung.class.php');
require_once('../../../include/studiensemester.class.php');
require_once('../../../include/studiengang.class.php');
require_once('../../../include/functions.inc.php');
require_once('../../../include/erhalter.class.php');
require_once('../../../include/datum.class.php');
@@ -58,6 +59,9 @@ isset($_GET['stsem']) ? $studiensemester = $_GET['stsem'] : die('Ein Studienseme
$lv = new lehrveranstaltung();
$lv->load($lvid);
$stg = new studiengang();
$stg->load($lv->studiengang_kz);
$berechtigung = new benutzerberechtigung();
$berechtigung->getBerechtigungen($user);
@@ -96,17 +100,15 @@ if ($lehreinheit != '')
$gruppen_string = '';
$gruppen_string_arr = array();
$stg_typ = '';
$stg_typ = $stg->typ;
$stg_bezeichnung = $stg->bezeichnung;
//structure overall lehrveranstaltungs data
if ($result = $db->db_query($qry)) {
while ($row = $db->db_fetch_object($result)) {
//lehrveranstaltung
$lv_bezeichnung = $row->lv_bezeichnung;
//studiengang
$stg_bezeichnung = $row->stg_bez;
//studiengangstyp
$stg_typ = $row->stg_typ;
//collect all gruppenkürzel
if ($row->gruppe_kurzbz == '')
$gruppen_string = trim($row->kuerzel . '-' . $row->semester . $row->verband . $row->gruppe);
@@ -237,8 +239,8 @@ if ($result = $db->db_query($qry)) {
$row->foto_sperre = 'f';
//create foto (if not locked by student OR if fotolist is created by admin or assistenz)
$foto_url = '';
$foto_url = '';
if ($row->foto_sperre == 'f' && $row->foto != '') {
$foto_src = $row->foto;
$foto_url = sys_get_temp_dir() . '/foto' . trim($row->matrikelnr) . '.jpg';
+10 -9
View File
@@ -308,8 +308,12 @@ else
// Nur Noten, die aufs Zeugnis gedruckt werden für Durchschnittsberechnung addieren
if ($row->zeugnis == true)
{
$notenSummenArray[$row->lehrveranstaltung_id]['notenwert'] = (isset($notenarr[$row->note]['notenwert']) ? $notenarr[$row->note]['notenwert'] : '');
$notenSummenArray[$row->lehrveranstaltung_id]['ects'] = $row->ects;
// Noten ohne Wert werden entfernen
if(isset($notenarr[$row->note]['notenwert']))
{
$notenSummenArray[$row->lehrveranstaltung_id]['notenwert'] = $notenarr[$row->note]['notenwert'];
$notenSummenArray[$row->lehrveranstaltung_id]['ects'] = $row->ects;
}
}
}
$tblBody .= "</td>";
@@ -379,13 +383,10 @@ else
$anzahlLv = 0;
foreach ($notenSummenArray AS $key => $value)
{
if ($value['notenwert'] != '')
{
$anzahlLv++;
$notenSumme += $value['notenwert'];
$ectsSumme += $value['ects'];
$notenSummeGewichtet += $value['notenwert'] * $value['ects'];
}
$anzahlLv++;
$notenSumme += $value['notenwert'];
$ectsSumme += $value['ects'];
$notenSummeGewichtet += $value['notenwert'] * $value['ects'];
}
$tblBody .= "</tbody>";
+19 -12
View File
@@ -352,7 +352,9 @@ function writePruefungsTable(e, data, anmeldung)
var termin = d.von.split(" ");
var time = termin[1].substring(0,5);
termin = termin[0].split("-");
termin = new Date(termin[0], termin[1]-1,termin[2]);
var minimumFrist = new Date(termin[0], termin[1]-1,termin[2]);
minimumFrist.setMonth(minimumFrist.getMonth() - 2);
termin = new Date(termin[0], termin[1]-1,termin[2]);
var frist = termin;
termin = termin.getDate()+"."+(termin.getMonth()+1)+"."+termin.getFullYear();
frist = frist.getTime();
@@ -374,26 +376,29 @@ function writePruefungsTable(e, data, anmeldung)
button = "<p><a href='#' title='<?php echo $p->t('pruefung/stornierenMoeglichBis'); ?> "+frist+"'><input style='width: 140px;' type='button' value='"+termin+" "+time+"' onclick='stornoAnmeldung(\""+anmeldung_id+"\");'></a></p>";
}
else
else if(new Date() > minimumFrist)
{
button = "<p><a href='#' title='<?php echo $p->t('pruefung/anmeldenMoeglichBis'); ?> "+frist+"'><input style='width: 140px; background-color: green;' type='button' value='"+termin+" "+time+"' onclick='openDialog(\""+e.lehrveranstaltung[0].lehrveranstaltung_id+"\", \""+d.pruefungstermin_id+"\", \""+e.lehrveranstaltung[0].bezeichnung.replace("'", "&apos;")+"\", \""+d.von+"\", \""+d.bis+"\");'></a></p>";
}
}
else
{
{
button = "<p><input style='width: 180px;' type='button' value='<?php echo $p->t('pruefung/zurLvAnmeldung'); ?>' onclick='openAnmeldung(\""+e.lehrveranstaltung[0].lehrveranstaltung_id+"\", \""+e.pruefung.studiensemester_kurzbz+"\");'></p>";
}
row += button;
if(d.max === null)
{
teilnehmer += "<?php echo $p->t('pruefung/unbegrenzt'); ?><br />";
}
else
{
teilnehmer += "<p><span style='line-height: 24px'>"+(d.max - d.teilnehmer)+"/"+d.max+"</span></p>";
}
if(new Date() > minimumFrist)
{
if(d.max === null)
{
teilnehmer += "<?php echo $p->t('pruefung/unbegrenzt'); ?><br />";
}
else
{
teilnehmer += "<p><span style='line-height: 24px'>"+(d.max - d.teilnehmer)+"/"+d.max+"</span></p>";
}
}
});
row += "<td>"+teilnehmer+"</td>";
return row;
@@ -791,6 +796,8 @@ function writeAnmeldungen(data)
var liste = "<ul id='sortable'>";
var count = 0;
var studiensemester = $("#filter_studiensemester option:selected").val();
var listenLinks = "<a href='./pruefungsanmeldungen_liste.pdf.php?termin_id="+terminId+"&lehrveranstaltung_id="+lehrveranstaltung_id+"&studiensemester="+studiensemester+"' target='_blank'><?php echo $p->t('pruefung/listeDrucken'); ?></a><br>"
+ "<a href='./pruefungsanmeldungen_liste_ohne_namen.php?termin_id="+terminId+"&lehrveranstaltung_id="+lehrveranstaltung_id+"&studiensemester="+studiensemester+"' target='_blank'><?php echo $p->t('pruefung/listeOhneNamenDrucken'); ?></a>";
data.result.anmeldungen.forEach(function(d){
count++;
var vorname = d.student.vorname !== "null" ? d.student.vorname : "";
@@ -825,7 +832,7 @@ function writeAnmeldungen(data)
$("#reihungSpeichernButton").html("<input type='button' value='<?php echo $p->t('pruefung/reihungSpeichern'); ?>' onclick='saveReihung(\""+terminId+"\", \""+lehrveranstaltung_id+"\");'><input type='button' value='<?php echo $p->t('pruefung/alleBestaetigen'); ?>' onclick='alleBestaetigen(\""+terminId+"\", \""+lehrveranstaltung_id+"\");'>");
$("#lvdaten").html(lv_bezeichnung+" ("+prf_termin+")");
$("#anmeldeDaten").html(liste);
$("#listeDrucken").html("<a href='./pruefungsanmeldungen_liste.pdf.php?termin_id="+terminId+"&lehrveranstaltung_id="+lehrveranstaltung_id+"&studiensemester="+studiensemester+"' target='_blank'><?php echo $p->t('pruefung/listeDrucken'); ?></a>");
$("#listeDrucken").html(listenLinks);
if(ort_kurzbz !== null)
{
$("#raumLink").html("<span><?php echo $p->t('pruefung/pruefungsraum'); ?></span>"+ort_kurzbz);
@@ -178,7 +178,10 @@ function getPruefungByLv($aktStudiensemester = null, $uid = null)
$lveranstaltung = new lehrveranstaltung($lehreinheiten[0]->lehrfach_id);
$oe = new organisationseinheit($lveranstaltung->oe_kurzbz);
$prf->organisationseinheit = $oe->bezeichnung;
array_push($pruefungen, $prf);
// nur hinzufügen wenn zumindest 1 Termin vorhanden ist
if (!empty($prf->pruefung->termine))
array_push($pruefungen, $prf);
}
}
$anmeldung = new pruefungsanmeldung();
@@ -265,7 +268,10 @@ function getPruefungByLvFromStudiengang($aktStudiensemester = null, $uid = null)
$lveranstaltung = new lehrveranstaltung($lehreinheiten[0]->lehrfach_id);
$oe = new organisationseinheit($lveranstaltung->oe_kurzbz);
$prf->organisationseinheit = $oe->bezeichnung;
array_push($pruefungen, $prf);
// nur hinzufügen wenn zumindest 1 Termin vorhanden ist
if (!empty($prf->pruefung->termine))
array_push($pruefungen, $prf);
}
}
@@ -805,7 +811,10 @@ function getAllPruefungen($aktStudiensemester = null, $uid = null)
$lveranstaltung = new lehrveranstaltung($lehreinheiten[0]->lehrfach_id);
$oe = new organisationseinheit($lveranstaltung->oe_kurzbz);
$prf->organisationseinheit = $oe->bezeichnung;
array_push($pruefungen, $prf);
// nur hinzufügen wenn zumindest 1 Termin vorhanden ist
if (!empty($prf->pruefung->termine))
array_push($pruefungen, $prf);
}
}
@@ -1206,6 +1215,7 @@ function compareRaeume($a, $b)
function saveRaum($terminId, $ort_kurzbz, $uid)
{
$terminkollision = defined('CIS_PRUEFUNGSANMELDUNG_ERLAUBE_TERMINKOLLISION') ? CIS_PRUEFUNGSANMELDUNG_ERLAUBE_TERMINKOLLISION : false;
$pruefungstermin = new pruefungstermin($terminId);
$stunde = new stunde();
$datum_von = explode(" ", $pruefungstermin->von);
@@ -1218,7 +1228,7 @@ function saveRaum($terminId, $ort_kurzbz, $uid)
if($reservierung->isReserviert($ort_kurzbz, $datum_von[0], $h))
$reserviert = true;
}
if(!$reserviert || $pruefungstermin->sammelklausur == TRUE)
if($terminkollision || !$reserviert || $pruefungstermin->sammelklausur == TRUE)
{
$pruefung = new pruefungCis($pruefungstermin->pruefung_id);
$mitarbeiter = new mitarbeiter($pruefung->mitarbeiter_uid);
@@ -150,8 +150,8 @@ $studiensemester->getAll();
{
$("#accordion").accordion({
header: "h2",
autoHeight: false
});
heightStyle: "content"
});
$("#accordion").attr("style", "visibility: visible;");
}
});
@@ -35,6 +35,7 @@ require_once('../../../../include/datum.class.php');
require_once('../../../../include/phrasen.class.php');
require_once('../../../../include/globals.inc.php');
require_once('../../../../include/sprache.class.php');
require_once('../../../../include/studiengang.class.php');
$sprache = getSprache();
$lang = new sprache();
@@ -230,6 +231,7 @@ $rechte->getBerechtigungen($uid);
<th><?php echo $p->t('global/vorname'); ?></th>
<th><?php echo $p->t('global/nachname'); ?></th>
<th><?php echo $p->t('pruefung/matrikelnummer'); ?></th>
<th><?php echo $p->t('pruefung/studiengangAbkuerzung'); ?></th>
<th><?php echo $p->t('global/datum'); ?></th>
<th><?php echo $p->t('benotungstool/note'); ?></th>
<th><?php echo $p->t('global/anmerkung'); ?></th>
@@ -242,6 +244,7 @@ $rechte->getBerechtigungen($uid);
foreach($anmeldungen as $anmeldung)
{
$student = new student($anmeldung->uid);
$studiengang = new studiengang($student->studiengang_kz);
$prfTermin = new pruefungstermin($anmeldung->pruefungstermin_id);
if($einzeln)
@@ -262,6 +265,7 @@ $rechte->getBerechtigungen($uid);
echo '<td>'.$student->vorname.'</td>';
echo '<td>'.$student->nachname.'</td>';
echo '<td>'.$student->matr_nr.'</td>';
echo '<td>'.$studiengang->kurzbzlang.'</td>';
echo '<td>'.$date.'</td>';
echo '<td></td>';
echo '<td></td>';
@@ -0,0 +1,302 @@
<?php
/*
* Copyright 2014 fhcomplete.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*
*
* Authors: Stefan Puraner <puraner@technikum-wien.at>
*/
require_once('../../../../config/cis.config.inc.php');
require_once('../../../../include/functions.inc.php');
require_once('../../../../include/benutzerberechtigung.class.php');
require_once('../../../../include/pruefungsanmeldung.class.php');
require_once('../../../../include/pruefungCis.class.php');
require_once('../../../../include/pruefungstermin.class.php');
require_once('../../../../include/studiensemester.class.php');
require_once('../../../../include/lehrveranstaltung.class.php');
require_once('../../../../include/mitarbeiter.class.php');
require_once('../../../../include/student.class.php');
require_once('../../../../include/datum.class.php');
require_once('../../../../include/phrasen.class.php');
require_once('../../../../include/globals.inc.php');
require_once('../../../../include/sprache.class.php');
require_once('../../../../include/studiengang.class.php');
$sprache = getSprache();
$lang = new sprache();
$lang->load($sprache);
$p = new phrasen($sprache);
$uid = get_uid();
$rechte = new benutzerberechtigung();
$rechte->getBerechtigungen($uid);
?><!DOCTYPE html>
<html moznomarginboxes="">
<head>
<meta charset="UTF-8">
<script type="text/javascript" src="../../../../vendor/components/jquery/jquery.min.js"></script>
<script type="text/javascript" src="../../../../vendor/components/jqueryui/jquery-ui.min.js"></script>
<style type="text/css">
body {
margin: 0;
padding: 0;
}
* {
box-sizing: border-box;
-moz-box-sizing: border-box;
}
#page {
width: 210mm;
min-height: 297mm;
padding: 20mm;
margin: 10mm auto;
border: 1px #ffffff solid;
border-radius: 5px;
background: white;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
font-family: Arial, Helvetica;
}
#subpage {
padding: 10mm;
border: 1px white solid;
height: 256mm;
outline: 20mm;
}
#liste {
border: 1px solid black;
border-collapse: collapse;
width: 100%;
margin-top: 5mm;
font-size: 11pt;
}
h1 {
text-align: center;
}
.bold {
font-weight: bold;
}
td {
border: 1px solid black;
padding: 1mm;
}
th {
border: 1px solid black;
}
thead > tr {
background-color: white !important;
}
tr:nth-child(odd){
background-color: lightgrey;
}
span {
line-height: 16pt;
font-size: 12pt;
}
@page {
size: A4;
margin: 0;
}
@media print
{
html, body {
width: 210mm;
height: 250mm;
}
#page {
margin: 0;
border: initial;
border-radius: initial;
width: initial;
min-height: initial;
box-shadow: initial;
background: initial;
page-break-after: auto;
}
/*
* Workaround um beim Drucken jede zweite Zeile der Tabelle
* grau darzustellen. Standardmäßig werden von Browsern keine
* Hintergrundfarben gedruckt.
*/
tr:nth-child(odd) > td{
box-shadow: inset 0 0 0 1000px lightgrey;
}
//Veranlasst Chrome Hintergrundfarben zu drucken
body{
-webkit-print-color-adjust:exact;
background-color: #FFFFFF;
margin: 0;
}
//Anweisungen nur für Firefox
@-moz-document url-prefix() {
html, body {
height: 280mm;
}
}
@-moz-document url-prefix() {
#page {
padding: 15mm 25mm 25mm 15mm !important;
}
}
}
</style>
</head>
<body>
<script>
$(document).ready(function()
{
window.print();
});
</script>
<div id="page">
<div id="subpage">
<h1><?php echo $p->t('pruefung/anmeldungsliste'); ?></h1>
<?php
if(empty($pruefung->result) && !$rechte->isBerechtigt('lehre/pruefungsanmeldungAdmin'))
die('Sie haben keine Berechtigung für diese Seite');
$termin_id = filter_input(INPUT_GET,"termin_id");
$lehrveranstaltung_id = filter_input(INPUT_GET,"lehrveranstaltung_id");
$studiensemester = filter_input(INPUT_GET, "studiensemester");
if(is_null($lehrveranstaltung_id))
{
die($p->t('pruefung/fehlenderParam_lvid'));
}
else if(is_null($termin_id))
{
die($p->t('pruefung/fehlenderParam_terminid'));
}
else if(is_null($studiensemester))
{
die($p->t('pruefung/fehlenderParam_studiensemester'));
}
else
{
$datum = new datum();
$stdsem = new studiensemester($studiensemester);
$pruefungsanmeldung = new pruefungsanmeldung();
$anmeldungen = $pruefungsanmeldung->getAnmeldungenByTermin($termin_id, $lehrveranstaltung_id, $studiensemester, "bestaetigt");
$lehrveranstaltung = new lehrveranstaltung($lehrveranstaltung_id);
$einzeln = FALSE;
if(!empty($anmeldungen))
{
$pruefung = new pruefungCis($anmeldungen[0]->pruefung_id);
$pruefungstermin = new pruefungstermin($anmeldungen[0]->pruefungstermin_id);
$mitarbeiter = new mitarbeiter($pruefung->mitarbeiter_uid);
if($pruefung->einzeln)
{
$einzeln = TRUE;
$pruefungsintervall = $pruefung->pruefungsintervall;
}
?>
<span class="bold"><?php echo $p->t('global/lehrveranstaltung'); ?>: </span><span><?=$lehrveranstaltung->bezeichnung?></span><br/>
<span class="bold"><?php echo $p->t('global/studiensemester'); ?>: </span><span><?=$stdsem->bezeichnung?></span><br/>
<span class="bold"><?php echo $p->t('pruefung/pruefer'); ?>: </span><span><?=$mitarbeiter->getFullName(FALSE)?></span><br/>
<table id="liste">
<thead>
<tr>
<th>#</th>
<th><?php echo $p->t('pruefung/matrikelnummer'); ?></th>
<th><?php echo $p->t('pruefung/studiengangAbkuerzung'); ?></th>
<th><?php echo $p->t('global/datum'); ?></th>
<th><?php echo $p->t('benotungstool/note'); ?></th>
<th><?php echo $p->t('global/anmerkung'); ?></th>
</tr>
</thead>
<tbody>
<?php
$count = 0;
/*@var $anmeldung pruefungsanmeldung */
foreach($anmeldungen as $anmeldung)
{
$student = new student($anmeldung->uid);
$studiengang = new studiengang($student->studiengang_kz);
$prfTermin = new pruefungstermin($anmeldung->pruefungstermin_id);
if($einzeln)
{
$date = $datum->formatDatum($prfTermin->von, "Y-m-d H:i:s");
$date = strtotime($date);
$date = $date+(60*$pruefungsintervall*($anmeldung->reihung-1));
$date = $datum->formatDatum($prfTermin->von,"d.m.Y").' - '.date("H:i",$date);
$count++;
}
else
{
$date = $datum->formatDatum($prfTermin->von,"d.m.Y - H:i");
$count++;
}
echo '<tr>';
echo '<td>'.$count.'</td>';
echo '<td>'.$student->matr_nr.'</td>';
echo '<td>'.$studiengang->kurzbzlang.'</td>';
echo '<td>'.$date.'</td>';
echo '<td></td>';
echo '<td></td>';
echo '</tr>';
}
?>
</tbody>
<?php
}
else
{
?>
<span><?php echo $p->t('pruefung/keineBestaetigtenAnmeldungenVorhanden'); ?></span><br/>
<?php
exit;
}
}
?>
</table>
<br>
<table width="100%" id="liste">
<tr>
<td width="26%"><?php echo $p->t('pruefung/derLektor'); ?></td>
<td width="37%"><?php echo $mitarbeiter->getFullName(FALSE); ?></td>
<td width="37%"></td>
</tr>
<tr>
<td><?php echo $p->t('pruefung/dieKommission'); ?></td>
<td></td>
<td></td>
</tr
</table>
</div>
</div>
</body>
</html>
@@ -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>
+13 -2
View File
@@ -35,6 +35,7 @@ require_once('../../../include/ort.class.php');
require_once('../../../include/functions.inc.php');
require_once('../../../include/datum.class.php');
require_once('../../../include/phrasen.class.php');
require_once('../../../include/mitarbeiter.class.php');
$sprache = getSprache();
$p = new phrasen($sprache);
@@ -231,11 +232,21 @@ if ($num_rows_stpl>0)
$titel = trim($row->titel);
$gesamtanzahl = ($anzahl_grp!=0?$anzahl_grp:$anzahl_lvb);
$ort->load($ortkurzbz);
// no profile link for fake Mitarbeiter like Dummylektor, Personalnr must be > 0
$profileLink = true;
$mitarbeiter = new mitarbeiter();
if ($mitarbeiter->load($row->uid))
{
if (isset($mitarbeiter->personalnummer) && is_numeric($mitarbeiter->personalnummer) && (int)$mitarbeiter->personalnummer < 0)
$profileLink = false;
}
echo '
<tr class="liste'.($i%2).'">
<td>'.$db->convert_html_chars($unr).'</td>
<td><A class="Item" href="../profile/index.php?uid='.$row->uid.'" target="_self" onClick="window.resizeTo(1200,880)">'.$db->convert_html_chars($titelpre.' '.$pers_vorname.' '.$pers_nachname.' '.$titelpost).'</A></td>
<td>'.($profileLink ? '<A class="Item" href="../profile/index.php?uid='.$row->uid.'" target="_self" onClick="window.resizeTo(1200,880)">' : '').$db->convert_html_chars($titelpre.' '.$pers_vorname.' '.$pers_nachname.' '.$titelpost).($profileLink ? '</A>' : '').'</td>
<td title="'.$db->convert_html_chars($ort->bezeichnung).'">'.(!empty($ortkurzbz)?($ort->content_id!=''?'<a href="../../../cms/content.php?content_id='.$ort->content_id.'" target="_self" onClick="window.resizeTo(1200,880)">'.$db->convert_html_chars($ortkurzbz).'</a>':$db->convert_html_chars($ortkurzbz)):$db->convert_html_chars($ortkurzbz)).'</td>
<td>'.$db->convert_html_chars($lehrfachkurzbz).'</td>
<td>'.$db->convert_html_chars($bezeichnung).'</td>
+14 -14
View File
@@ -23,15 +23,15 @@ require_once('../../../config/cis.config.inc.php');
require_once('../../../include/functions.inc.php');
require_once('../../../include/datum.class.php');
require_once('../../../include/benutzerberechtigung.class.php');
require_once('../../../include/phrasen.class.php');
require_once('../../../include/reservierung.class.php');
require_once('../../../include/phrasen.class.php');
require_once('../../../include/reservierung.class.php');
if (!$db = new basis_db())
die($p->t('global/fehlerBeimOeffnenDerDatenbankverbindung'));
$sprache = getSprache();
$p=new phrasen($sprache);
$sprache = getSprache();
$p=new phrasen($sprache);
$uid = get_uid();
if (isset($_GET['id']))
@@ -67,7 +67,7 @@ if(!$rechte->isBerechtigt('lehre/reservierung:begrenzt', null, 'suid'))
$reservierung = new reservierung();
if($reservierung->load($id))
{
if(($reservierung->uid==$uid || $reservierung->insertvon==$uid) && $rechte->isBerechtigt('lehre/reservierung', null, 'suid'))
if(($reservierung->uid==$uid || $reservierung->insertvon==$uid) && $rechte->isBerechtigt('lehre/reservierung:begrenzt', null, 'suid'))
{
if($reservierung->delete($id))
echo '<b>'.$p->t('lvplan/reservierungWurdeGeloescht').'</b><br>';
@@ -79,17 +79,17 @@ if(!$rechte->isBerechtigt('lehre/reservierung:begrenzt', null, 'suid'))
echo '<b>'.$p->t('global/keineBerechtigung').'</b><br>';
}
}
else
else
echo '<b>'.$p->t('global/fehleraufgetreten').'!</b><br>';
}
//Aktuelle Reservierungen abfragen.
$datum = time();
$datum = date("Y-m-d",$datum);
//EIGENE
$sql_query="SELECT * FROM campus.vw_reservierung
WHERE datum>=".$db->db_add_param($datum)."
$sql_query="SELECT * FROM campus.vw_reservierung
WHERE datum>=".$db->db_add_param($datum)."
AND (uid=".$db->db_add_param($uid)." OR insertvon=".$db->db_add_param($uid).")
ORDER BY datum, titel, ort_kurzbz, stunde";
@@ -97,7 +97,7 @@ if(!$rechte->isBerechtigt('lehre/reservierung:begrenzt', null, 'suid'))
die($db->db_last_error());
$num_rows_res=$db->db_num_rows($erg_res);
if ($num_rows_res>0)
{
echo $p->t('lvplan/eigeneReservierungen').':<br>';
@@ -135,7 +135,7 @@ if(!$rechte->isBerechtigt('lehre/reservierung:begrenzt', null, 'suid'))
echo '<td>'.$db->convert_html_chars($pers_uid).'</td>';
echo '<td>'.$db->convert_html_chars($beschreibung).'<a name="liste'.$i.'">&nbsp;</a></td>';
$z=$i-1;
if (($pers_uid==$uid || $insertvon==$uid) && $rechte->isBerechtigt('lehre/reservierung', null, 'suid'))
if (($pers_uid==$uid || $insertvon==$uid) && $rechte->isBerechtigt('lehre/reservierung:begrenzt', null, 'suid'))
echo '<td><A class="Item" href="stpl_reserve_list.php?id='.$id.'#liste'.$z.'">Delete</A></td>';
echo '</tr>';
}
@@ -145,7 +145,7 @@ if(!$rechte->isBerechtigt('lehre/reservierung:begrenzt', null, 'suid'))
echo '<br><br>';
flush();
?>
</body>
</html>
+1 -1
View File
@@ -362,7 +362,7 @@ if (isset($reservtodelete))
$reservierung = new reservierung();
$reservdelcount = 0;
$reservberechtigt = $rechte->isBerechtigt('lehre/reservierung', null, 'suid');
$reservberechtigt = $rechte->isBerechtigt('lehre/reservierung:begrenzt', null, 'suid');
foreach ($reservtodelete as $delete_id)
{
+79 -22
View File
@@ -66,6 +66,9 @@ if (isset($_GET['uid']) && $_GET['uid'] != $uid)
$uid = stripslashes($_GET['uid']);
$ansicht = true;
}
$adminOrOwnUser = $rechte->isBerechtigt('admin') || !$ansicht;
if ($rechte->isBerechtigt('basis/kontakt'))
$ansicht = false;
@@ -127,6 +130,9 @@ if (!$user->load($uid))
if ($type == 'mitarbeiter')
{
if (isset($user->personalnummer) && is_numeric($user->personalnummer) && (int)$user->personalnummer < 0)
die($p->t('profil/keinGueltigesProfil'));
$vorwahl = '';
$kontakt = new kontakt();
$kontakt->loadFirmaKontakttyp($user->standort_id,'telefon');
@@ -156,12 +162,7 @@ echo '<!DOCTYPE HTML>
$(document).ready(function()
{
$("#t1").tablesorter(
{
sortList: [[0,0]],
widgets: ["zebra"]
});
$("#t2").tablesorter(
$("#t1, #t2, #tfuture").tablesorter(
{
sortList: [[0,0]],
widgets: ["zebra"]
@@ -504,36 +505,55 @@ echo '<tr>
if (!defined('CIS_PROFIL_FUNKTIONEN_ANZEIGEN') || CIS_PROFIL_FUNKTIONEN_ANZEIGEN)
{
//Funktionen
$qry = "SELECT
$baseqry = "SELECT
*, tbl_benutzerfunktion.oe_kurzbz as oe_kurzbz, tbl_organisationseinheit.bezeichnung as oe_bezeichnung,
tbl_benutzerfunktion.semester, tbl_benutzerfunktion.bezeichnung as bf_bezeichnung,
tbl_benutzerfunktion.datum_von, tbl_benutzerfunktion.datum_bis
tbl_benutzerfunktion.wochenstunden, tbl_benutzerfunktion.datum_von, tbl_benutzerfunktion.datum_bis
FROM
public.tbl_benutzerfunktion
JOIN public.tbl_funktion USING(funktion_kurzbz)
JOIN public.tbl_organisationseinheit USING(oe_kurzbz)
WHERE
uid=".$db->db_add_param($uid)." AND
(tbl_benutzerfunktion.datum_bis is null OR tbl_benutzerfunktion.datum_bis>=now())";
uid=".$db->db_add_param($uid);
if ($result_funktion = $db->db_query($qry))
$currfunkqry = $baseqry . " AND ((tbl_benutzerfunktion.datum_bis is null OR tbl_benutzerfunktion.datum_bis>=now())
AND (tbl_benutzerfunktion.datum_von is null OR tbl_benutzerfunktion.datum_von<=now()))";
$futurefunkqry = $baseqry . " AND (tbl_benutzerfunktion.datum_von>now())";
printFunctionsTable($currfunkqry, 'profil/funktionen', 't1', true);
printFunctionsTable($futurefunkqry, 'profil/zukuenftigeFunktionen', 'tfuture');
}
/**
* Print html table containing user functions.
* @param $query string execute for getting data
* @param $tableid string html table id
* @param $showVertragsstunden bool show Vertragsstunden sum near Wochenstunden sum
*/
function printFunctionsTable($query, $headingphrase, $tableid, $showVertragsstunden = false)
{
global $db, $p, $datum_obj, $uid, $adminOrOwnUser;
if ($result_funktion = $db->db_query($query))
{
if ($db->db_num_rows($result_funktion) > 0)
{
echo '<b>'.$p->t('profil/funktionen').'</b>
<table class="tablesorter" id="t1">
echo '<b>'.$p->t($headingphrase).'</b>';
echo '
<table class="tablesorter" id="'.$tableid.'">
<thead>
<tr>
<th>'.$p->t('global/bezeichnung').'</th>
<th>'.$p->t('global/organisationseinheit').'</th>
<th>'.$p->t('global/semester').'</th>
<th>'.$p->t('global/institut').'</th>
<th>'.$p->t('profil/gueltigvon').'</th>
<th>'.$p->t('profil/gueltigbis').'</th>
</tr>
<th>'.$p->t('profil/gueltigbis').'</th>'.
($adminOrOwnUser ? '<th>'.$p->t('profil/wochenstunden').'</th>' : '').
'</tr>
</thead>
<tbody>';
$wochenstunden_sum = 0.00;
while($row_funktion = $db->db_fetch_object($result_funktion))
{
echo "
@@ -544,13 +564,50 @@ if (!defined('CIS_PROFIL_FUNKTIONEN_ANZEIGEN') || CIS_PROFIL_FUNKTIONEN_ANZEIGEN
echo ' - '.$row_funktion->bf_bezeichnung;
echo "</td>
<td nowrap>".$row_funktion->organisationseinheittyp_kurzbz.' '.$row_funktion->oe_bezeichnung."</td>
<td>$row_funktion->semester</td>
<td>$row_funktion->fachbereich_kurzbz</td>
<td>".$datum_obj->formatDatum($row_funktion->datum_von,'d.m.Y')."</td>
<td>".$datum_obj->formatDatum($row_funktion->datum_bis,'d.m.Y')."</td>
</tr>";
<td>".$datum_obj->formatDatum($row_funktion->datum_bis,'d.m.Y')."</td>".
($adminOrOwnUser ? "<td>".number_format($row_funktion->wochenstunden, 2)."</td>" : "").
"</tr>";
if(isset($row_funktion->wochenstunden) && $adminOrOwnUser)
$wochenstunden_sum += (double)$row_funktion->wochenstunden;
}
echo '</tbody></table><br>';
echo '</tbody><br>';
//vertragsstunden
if ($showVertragsstunden === true && $adminOrOwnUser)
{
$vertragsstunden = 0.00;
$qry = "SELECT sum(vertragsstunden) AS vertragsstdsumme from bis.tbl_bisverwendung
WHERE mitarbeiter_uid = ".$db->db_add_param($uid)."
AND (ende > now() OR ende IS NULL)";
if ($result_vertragsstd = $db->db_query($qry))
{
if ($db->db_num_rows($result_vertragsstd) > 0)
{
while($row_vertragsstd = $db->db_fetch_object($result_vertragsstd))
{
$vertragsstunden = $row_vertragsstd->vertragsstdsumme;
}
}
}
}
if ($adminOrOwnUser)
{
echo "
<tfoot>
<tr>
<td></td>
<td></td>
<th colspan ='2'>Summe Wochenstunden".($showVertragsstunden === true ? " (".$p->t('profil/vertragsstunden').")" : "")."</th>
<th style='padding: 4pt 0'>&nbsp;".number_format($wochenstunden_sum, 2).($showVertragsstunden === true ?
"&nbsp;(".number_format($vertragsstunden, 2).")" : "")."</th>
</tr>
</tfoot>";
}
echo "</table>";
}
}
}
+55 -5
View File
@@ -247,7 +247,14 @@ require_once('../../../include/benutzerberechtigung.class.php');
echo '<td>'.$row->raumtypalternativ.'</td>';
echo '<td>'.$row->stundenblockung.'</td>';
echo '<td>'.$row->wochenrythmus.'</td>';
echo '<td>'.$row->semesterstunden.'</td>';
if(getSprache()=='German')
{
echo '<td>'.number_format($row->semesterstunden,2,$dec_point=",",$thousands_sep=".").'</td>';
}
else
{
echo '<td>'.number_format($row->semesterstunden,2,$dec_point=".",$thousands_sep=",").'</td>';
}
echo '<td>'.$row->start_kw.'</td>';
$lvangebot->getAllFromLvId($row->lehrveranstaltung_id, $row->studiensemester_kurzbz);
@@ -276,7 +283,7 @@ require_once('../../../include/benutzerberechtigung.class.php');
echo '<td>&nbsp;</td>';
echo '<td>&nbsp;</td>';
echo '<td>&nbsp;</td>';
echo '<td>&nbsp;</td>';
echo '<td>&nbsp;</td>';
echo '<td>&nbsp;</td>';
@@ -286,7 +293,14 @@ require_once('../../../include/benutzerberechtigung.class.php');
echo '<td>&nbsp;</td>';
echo '<td>&nbsp;</td>';
echo '<td align="right"><b>'.$p->t('lvaliste/summe').'</b></td>';
echo '<th class="header">'.number_format($summe_std,2).'</th>';
if(getSprache()=='German')
{
echo '<th>'.number_format($summe_std,2,$dec_point=",",$thousands_sep=".").'</th>';
}
else
{
echo '<th>'.number_format($summe_std,2,$dec_point=".",$thousands_sep=",").'</th>';
}
echo '<td>&nbsp;</td>';
echo '</tr>';
echo '</tfoot>';
@@ -304,7 +318,7 @@ require_once('../../../include/benutzerberechtigung.class.php');
tbl_lehrveranstaltung.bezeichnung, tbl_projektarbeit.titel,
(SELECT nachname || ' ' || vorname FROM public.tbl_benutzer JOIN public.tbl_person USING(person_id)
WHERE uid=student_uid) as student, tbl_lehrveranstaltung.studiengang_kz, tbl_lehrveranstaltung.semester,
tbl_studiengang.email, tbl_betreuerart.beschreibung AS beutreuerart_beschreibung
tbl_studiengang.email, tbl_betreuerart.beschreibung AS beutreuerart_beschreibung, tbl_projektbetreuer.stunden
FROM
lehre.tbl_lehreinheit, lehre.tbl_lehrveranstaltung, lehre.tbl_projektarbeit, lehre.tbl_projektbetreuer, public.tbl_studiengang, lehre.tbl_betreuerart
WHERE
@@ -318,6 +332,7 @@ require_once('../../../include/benutzerberechtigung.class.php');
$stg_obj = new studiengang();
$stg_obj->getAll(null,null);
$summe_std = 0;
if($result = $db->db_query($qry))
{
@@ -329,6 +344,7 @@ require_once('../../../include/benutzerberechtigung.class.php');
echo '<thead><tr>';
echo '<th>'.$p->t('lvaliste/studiengang').'</th>';
echo '<th>'.$p->t('lvaliste/semester').'</th>';
echo '<th>'.$p->t('lvaliste/stunden').'</th>';
echo '<th>'.$p->t('lvaliste/lvBezeichnung').'</th>';
echo '<th>'.$p->t('lvaliste/student').'</th>';
echo '<th>'.$p->t('lvaliste/betreuungsart').'</th>';
@@ -339,13 +355,46 @@ require_once('../../../include/benutzerberechtigung.class.php');
echo '<tr>';
echo '<td><a href="mailto:'.$row->email.'">'.$stg_obj->kuerzel_arr[$row->studiengang_kz].'</a></td>';
echo '<td>'.$row->semester.'</td>';
if(getSprache()=='German')
{
echo '<td>'.number_format($row->stunden,2,$dec_point =",", $thousands_sep ="."). '</td>';
}
else
{
echo '<td>'.number_format($row->stunden,2,$dec_point =".", $thousands_sep =","). '</td>';
}
echo '<td>'.$row->bezeichnung.'</td>';
echo '<td>'.$row->student.'</td>';
echo '<td>'.$row->beutreuerart_beschreibung.'</td>';
echo '<td>'.$row->titel.'</td>';
echo '</tr>';
$summe_std+=$row->stunden;
}
echo '</tbody>';
echo '<tfoot>';
echo '<tr>';
if(!defined('CIS_LVALISTE_NOTENEINGABE_ANZEIGEN') || CIS_LVALISTE_NOTENEINGABE_ANZEIGEN)
{
echo '<td>&nbsp;</td>';
}
if($lvinfo)
echo '<td align="right"><b>'.$p->t('lvaliste/summe').'</b></td>';
if(getSprache()=='German')
{
echo '<th>'.number_format($summe_std,2,$dec_point=",",$thousands_sep=".").'</th>';
}
else
{
echo '<th>'.number_format($summe_std,2,$dec_point=".",$thousands_sep=",").'</th>';
}
echo '<td>&nbsp;</td>';
echo '</tr>';
echo '</tbody></table>';
}
}
@@ -426,6 +475,7 @@ require_once('../../../include/benutzerberechtigung.class.php');
echo '<tr>';
echo '<td><a href="mailto:'.$row->email.'">'.$stg_obj->kuerzel_arr[$row->studiengang_kz].'</a></td>';
echo '<td>'.$row->semester.'</td>';
echo '<td>'.$row->stunden.'</td>';
echo '<td>'.$row->fachbereich_kurzbz.'</td>';
echo '<td>'.$row->bezeichnung.'</td>';
echo '<td>'.$lektoren.'</td>';
+1 -1
View File
@@ -235,7 +235,7 @@ $studiensemester_start = $prestudent->studiensemester_kurzbz;
$ausbildungssemester_start = $prestudent->ausbildungssemester;
$orgform_kurzbz = $prestudent->orgform_kurzbz;
$prestudent->getLastStatus($student->prestudent_id, 'Student');
$prestudent->getLastStatus($student->prestudent_id, '', 'Student');
$studienplan_id = $prestudent->studienplan_id;
$studienplan = new studienplan();
+277 -190
View File
@@ -1,190 +1,277 @@
<?php
/* Copyright (C) 2006 fhcomplete.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* Authors: Christian Paminger <christian.paminger@technikum-wien.at>,
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at> and
* Rudolf Hangl <rudolf.hangl@technikum-wien.at>.
*/
require_once('../../../config/cis.config.inc.php');
require_once('../../../include/functions.inc.php');
require_once('../../../include/studiensemester.class.php');
require_once('../../../include/konto.class.php');
require_once('../../../include/person.class.php');
require_once('../../../include/benutzer.class.php');
require_once('../../../include/datum.class.php');
require_once('../../../include/studiengang.class.php');
require_once('../../../include/phrasen.class.php');
require_once('../../../include/benutzerberechtigung.class.php');
$sprache = getSprache();
$p = new phrasen($sprache);
$uid=get_uid();
if(isset($_GET['uid']))
{
// Administratoren duerfen die UID als Parameter uebergeben um die Zahlungen
// von anderen Personen anzuzeigen
$rechte = new benutzerberechtigung();
$rechte->getBerechtigungen($uid);
if($rechte->isBerechtigt('admin'))
{
$uid = $_GET['uid'];
$getParam = "&uid=" . $uid;
}
else
$getParam = "";
}
else
$getParam='';
$datum_obj = new datum();
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>'.$p->t('tools/zahlungen').'</title>
<link href="../../../skin/style.css.php" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="../../../skin/tablesort.css" type="text/css"/>
<link rel="stylesheet" type="text/css" href="../../../skin/jquery-ui-1.9.2.custom.min.css">
<script type="text/javascript" src="../../../vendor/jquery/jqueryV1/jquery-1.12.4.min.js"></script>
<script type="text/javascript" src="../../../vendor/christianbach/tablesorter/jquery.tablesorter.min.js"></script>
<script type="text/javascript" src="../../../vendor/components/jqueryui/jquery-ui.min.js"></script>
<script type="text/javascript" src="../../../include/js/jquery.ui.datepicker.translation.js"></script>
<script type="text/javascript" src="../../../vendor/jquery/sizzle/sizzle.js"></script>
</head>
<style>
table.tablesorter
{
width: auto;
}
</style>
<script type="text/javascript">
$(document).ready(function()
{
$("#t1").tablesorter(
{
sortList: [[0,0],[1,0]],
widgets: ["zebra"]
});
});
</script>
<body>';
$studiengang = new studiengang();
$studiengang->getAll(null,null);
$stg_arr = array();
foreach ($studiengang->result as $row)
$stg_arr[$row->studiengang_kz]=$row->kuerzel;
$benutzer = new benutzer();
if(!$benutzer->load($uid))
die('Benutzer wurde nicht gefunden');
echo '<h1>'.$p->t('tools/zahlungen').' - '.$benutzer->vorname.' '.$benutzer->nachname.'</h1>';
$konto = new konto();
$konto->getBuchungstyp();
$buchungstyp = array();
foreach ($konto->result as $row)
$buchungstyp[$row->buchungstyp_kurzbz]=$row->beschreibung;
$konto = new konto();
$konto->getBuchungen($benutzer->person_id);
if(count($konto->result)>0)
{
echo '<br><br><table class="tablesorter" id="t1"><thead>';
echo '<tr>';
echo '
<th>'.$p->t('global/datum').'</th>
<th>'.$p->t('tools/zahlungstyp').'</th>
<th>'.$p->t('lvplan/stg').'</th>
<th>'.$p->t('global/studiensemester').'</th>
<th>'.$p->t('tools/buchungstext').'</th>
<th>'.$p->t('tools/betrag').'</th>
<th>'.$p->t('tools/zahlungsbestaetigung').'</th>';
echo '</tr></thead><tbody>';
foreach ($konto->result as $row)
{
$i=0; //Zaehler fuer Anzahl Gegenbuchungen
$buchungsnummern='';
if(!isset($row['parent']))
continue;
$betrag = $row['parent']->betrag;
if(isset($row['childs']))
{
foreach ($row['childs'] as $key => $row_child)
{
$betrag += $row_child->betrag;
$betrag = round($betrag, 2);
$buchungsnummern .= ';'.$row['childs'][$key]->buchungsnr;
$i = $key; //Zaehler auf letzten Gegenbuchungseintrag setzen
}
}
else
$buchungsnummern = $row['parent']->buchungsnr;
if($betrag<0)
$style='style="background-color: #FF8888;"';
elseif($betrag>0)
$style='style="background-color: #88DD88;"';
else
$style='';
echo "<tr>";
echo '<td '.$style.'>'.date('d.m.Y',$datum_obj->mktime_fromdate(isset($row['childs'][$i])?$row['childs'][$i]->buchungsdatum:$row['parent']->buchungsdatum)).'</td>';
echo '<td '.$style.'>'.$buchungstyp[$row['parent']->buchungstyp_kurzbz].'</td>';
echo '<td '.$style.'>'.$stg_arr[$row['parent']->studiengang_kz].'</td>';
echo '<td '.$style.'>'.$row['parent']->studiensemester_kurzbz.'</td>';
echo '<td '.$style.'>'.$row['parent']->buchungstext.'</td>';
echo '<td align="right" '.$style.'>'.($betrag<0?'-':($betrag>0?'+':'')).sprintf('%.2f',abs($row['parent']->betrag)).' €</td>';
echo '<td align="center" '.$style.'>';
if($betrag>=0 && $row['parent']->betrag<=0)
echo '<a href="../pdfExport.php?xml=konto.rdf.php&xsl=Zahlung&uid='.$uid.'&buchungsnummern='.$buchungsnummern.'" title="'.$p->t('tools/bestaetigungDrucken').'"><img src="../../../skin/images/pdfpic.gif" alt="'.$p->t('tools/bestaetigungDrucken').'"></a>';
elseif($row['parent']->betrag>0)
{
//Auszahlung
}
else
{
echo '<a onclick="window.open(';
echo "'zahlungen_details.php?buchungsnr=".$row['parent']->buchungsnr.$getParam."','Zahlungsdetails','height=500,width=550,left=0,top=0,hotkeys=0,resizable=yes,status=no,scrollbars=no,toolbar=no,location=no,menubar=no,dependent=yes');return false;";
echo '" href="#">'.$p->t('tools/offen').'</a> ('.sprintf('%.2f',$betrag*-1).' €)';
echo '</td>';
}
echo '</tr>';
}
echo '</tbody></table>';
}
else
{
echo $p->t('tools/keineZahlungenVorhanden');
}
echo '</td></tr></table';
echo '</body></html>';
?>
<?php
/* Copyright (C) 2006 fhcomplete.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* Authors: Christian Paminger <christian.paminger@technikum-wien.at>,
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at> and
* Rudolf Hangl <rudolf.hangl@technikum-wien.at>.
*/
require_once('../../../config/cis.config.inc.php');
require_once('../../../include/functions.inc.php');
require_once('../../../include/studiensemester.class.php');
require_once('../../../include/konto.class.php');
require_once('../../../include/person.class.php');
require_once('../../../include/benutzer.class.php');
require_once('../../../include/datum.class.php');
require_once('../../../include/studiengang.class.php');
require_once('../../../include/phrasen.class.php');
require_once('../../../include/benutzerberechtigung.class.php');
$sprache = getSprache();
$p = new phrasen($sprache);
$uid=get_uid();
if(isset($_GET['uid']))
{
// Administratoren duerfen die UID als Parameter uebergeben um die Zahlungen
// von anderen Personen anzuzeigen
$rechte = new benutzerberechtigung();
$rechte->getBerechtigungen($uid);
if($rechte->isBerechtigt('admin'))
{
$uid = $_GET['uid'];
$getParam = "&uid=" . $uid;
}
else
$getParam = "";
}
else
$getParam='';
$datum_obj = new datum();
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>'.$p->t('tools/zahlungen').'</title>
<link href="../../../skin/style.css.php" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="../../../skin/tablesort.css" type="text/css"/>';
include('../../../include/meta/jquery.php');
include('../../../include/meta/jquery-tablesorter.php');
echo ' <script type="text/javascript" src="../../../vendor/components/jqueryui/jquery-ui.min.js"></script>
<script type="text/javascript" src="../../../include/js/jquery.ui.datepicker.translation.js"></script>
<script type="text/javascript" src="../../../vendor/jquery/sizzle/sizzle.js"></script>
</head>
<style>
table.tablesorter
{
width: auto;
}
table.tablesorter tbody td
{
padding: 1px 3px;
}
</style>
<script type="text/javascript">
// Parser für Datum DD.MM.YYYY
$.tablesorter.addParser({
id: "customDate",
is: function(s) {
//return false;
//use the above line if you don\'t want table sorter to auto detected this parser
// match dd.mm.yyyy e.g. 01.01.2001 as regex
return /\d{1,2}.\d{1,2}.\d{1,4}/.test(s);
},
// replace regex-wildcards and return new date
format: function(s) {
s = s.replace(/\-/g," ");
s = s.replace(/:/g," ");
s = s.replace(/\./g," ");
s = s.split(" ");
return $.tablesorter.formatFloat(new Date(s[2], s[1]-1, s[0]).getTime());
},
type: "numeric"
});
// Parser für Betrag
$.tablesorter.addParser({
id: "customCurrancy",
is: function(s) {
//return false;
//use the above line if you don\'t want table sorter to auto detected this parser
// match dd.mm.yyyy e.g. 01.01.2001 as regex
//alert(/€\s\d*.*/.test(s))
return /€\s\d*.*/.test(s);
},
// replace regex-wildcards and return new date
format: function(s) {
s = s.replace(/\-/g," ");
s = s.replace(/:/g," ");
s = s.replace(/\./g," ");
s = s.split(" ");
return $.tablesorter.formatFloat(s[1]);
},
type: "numeric"
});
// Parser für Studiensemester
$.tablesorter.addParser({
// set a unique id
id: "studiensemester",
is: function(s) {
// return false so this parser is not auto detected
return false;
},
format: function(s) {
// format data for normalization
var result = s.substr(2) + s.substr(0, 2);
return result;
},
// set type, either numeric or text
type: "text"
});
// For correct sorting of Umlauts
$.tablesorter.characterEquivalents = {
"a" : "\u00e1\u00e0\u00e2\u00e3\u00e4\u0105\u00e5", // áàâãäąå
"A" : "\u00c1\u00c0\u00c2\u00c3\u00c4\u0104\u00c5", // ÁÀÂÃÄĄÅ
"c" : "\u00e7\u0107\u010d", // çćč
"C" : "\u00c7\u0106\u010c", // ÇĆČ
"e" : "\u00e9\u00e8\u00ea\u00eb\u011b\u0119", // éèêëěę
"E" : "\u00c9\u00c8\u00ca\u00cb\u011a\u0118", // ÉÈÊËĚĘ
"i" : "\u00ed\u00ec\u0130\u00ee\u00ef\u0131", // íìİîïı
"I" : "\u00cd\u00cc\u0130\u00ce\u00cf", // ÍÌİÎÏ
"o" : "\u00f3\u00f2\u00f4\u00f5\u00f6\u014d", // óòôõöō
"O" : "\u00d3\u00d2\u00d4\u00d5\u00d6\u014c", // ÓÒÔÕÖŌ
"ss": "\u00df", // ß (s sharp)
"SS": "\u1e9e", // ẞ (Capital sharp s)
"u" : "\u00fa\u00f9\u00fb\u00fc\u016f", // úùûüů
"U" : "\u00da\u00d9\u00db\u00dc\u016e" // ÚÙÛÜŮ
};
$(document).ready(function()
{
$("#t1").tablesorter(
{
// Adding Function for sorting images by title
textExtraction:function(s)
{
if($(s).find(\'img\').length == 0) return $(s).text();
return $(s).find(\'img\').attr(\'title\');
},
sortList: [[0,1],[1,1]],
widgets: ["zebra"],
sortLocaleCompare : true,
headers: { 0: { sorter: "customDate"}, 3: { sorter: "studiensemester"}, 5: { sorter: "customCurrancy"}, 6: { sorter: false}}
});
});
</script>
<body>';
$studiengang = new studiengang();
$studiengang->getAll(null,null);
$stg_arr = array();
foreach ($studiengang->result as $row)
$stg_arr[$row->studiengang_kz]=$row->kuerzel;
$benutzer = new benutzer();
if(!$benutzer->load($uid))
die('Benutzer wurde nicht gefunden');
echo '<h1>'.$p->t('tools/zahlungen').' - '.$benutzer->vorname.' '.$benutzer->nachname.'</h1>';
$konto = new konto();
$konto->getBuchungstyp();
$buchungstyp = array();
foreach ($konto->result as $row)
$buchungstyp[$row->buchungstyp_kurzbz]=$row->beschreibung;
$konto = new konto();
$konto->getBuchungen($benutzer->person_id);
if(count($konto->result)>0)
{
echo '<br><br><table class="tablesorter" id="t1"><thead>';
echo '<tr>';
echo '
<th>'.$p->t('global/datum').'</th>
<th>'.$p->t('tools/zahlungstyp').'</th>
<th>'.$p->t('lvplan/stg').'</th>
<th>'.$p->t('global/studiensemester').'</th>
<th>'.$p->t('tools/buchungstext').'</th>
<th>'.$p->t('tools/betrag').'</th>
<th>'.$p->t('tools/zahlungsbestaetigung').'</th>';
echo '</tr></thead><tbody>';
foreach ($konto->result as $row)
{
$i=0; //Zaehler fuer Anzahl Gegenbuchungen
$buchungsnummern='';
if(!isset($row['parent']))
continue;
$betrag = $row['parent']->betrag;
if(isset($row['childs']))
{
foreach ($row['childs'] as $key => $row_child)
{
$betrag += $row_child->betrag;
$betrag = round($betrag, 2);
$buchungsnummern .= ';'.$row['childs'][$key]->buchungsnr;
$i = $key; //Zaehler auf letzten Gegenbuchungseintrag setzen
}
}
else
$buchungsnummern = $row['parent']->buchungsnr;
if($betrag<0)
$style='style="background-color: #FF8888;"';
elseif($betrag>0)
$style='style="background-color: #88DD88;"';
else
$style='';
echo "<tr>";
echo '<td '.$style.'>'.date('d.m.Y',$datum_obj->mktime_fromdate(isset($row['childs'][$i])?$row['childs'][$i]->buchungsdatum:$row['parent']->buchungsdatum)).'</td>';
echo '<td '.$style.'>'.$buchungstyp[$row['parent']->buchungstyp_kurzbz].'</td>';
echo '<td '.$style.'>'.$stg_arr[$row['parent']->studiengang_kz].'</td>';
echo '<td '.$style.'>'.$row['parent']->studiensemester_kurzbz.'</td>';
echo '<td '.$style.'>'.$row['parent']->buchungstext.'</td>';
echo '<td align="right" '.$style.'>€ '.($betrag<0?'-':($betrag>0?'+':'')).sprintf('%.2f',abs($row['parent']->betrag)).'</td>';
echo '<td align="center" '.$style.'>';
if($betrag>=0 && $row['parent']->betrag<=0)
{
echo '<a href="../pdfExport.php?xml=konto.rdf.php&xsl=Zahlung&uid='.$uid.'&buchungsnummern='.$buchungsnummern.'" title="'.$p->t('tools/bestaetigungDrucken').'"><img src="../../../skin/images/pdfpic.gif" alt="'.$p->t('tools/bestaetigungDrucken').'"></a>';
}
elseif($row['parent']->betrag>0)
{
//Auszahlung
}
else
{
echo '<a onclick="window.open(';
echo "'zahlungen_details.php?buchungsnr=".$row['parent']->buchungsnr.$getParam."','Zahlungsdetails','height=500,width=550,left=0,top=0,hotkeys=0,resizable=yes,status=no,scrollbars=no,toolbar=no,location=no,menubar=no,dependent=yes');return false;";
echo '" href="#">'.$p->t('tools/offen').'</a>(€ '.sprintf('%.2f',$betrag*-1).')';
echo '</td>';
}
echo '</tr>';
}
echo '</tbody></table>';
}
else
{
echo $p->t('tools/keineZahlungenVorhanden');
}
echo '</td></tr></table';
echo '</body></html>';
?>
+37 -2
View File
@@ -118,8 +118,29 @@ $fixangestellt = $ma->fixangestellt;
$ss = new Studiensemester();
$ss->getNextStudiensemester();
$next_ss = $ss->studiensemester_kurzbz;
$current_ss = $ss->getakt();
// Erklärung zu Pausen bei geteilten Arbeitszeiten speichern
if (isset($_GET['selbstverwaltete-pause-akt']) && !empty($_GET['submit-akt']))
{
$selbstverwaltete_pause = ($_GET['selbstverwaltete-pause-akt'] == 'yes') ? true : false;
$zeitaufzeichnung_gd = new Zeitaufzeichnung_gd();
$zeitaufzeichnung_gd->uid = $uid;
$zeitaufzeichnung_gd->studiensemester_kurzbz = $current_ss;
$zeitaufzeichnung_gd->selbstverwaltete_pause = $selbstverwaltete_pause;
$za_gd = new Zeitaufzeichnung_gd();
$za_gd->load($uid, $current_ss);
if ($za_gd->uid)
{
echo 'Bereits eingetragen';
}
else if (!$zeitaufzeichnung_gd->save())
{
echo $zeitaufzeichnung_gd->errormsg;
}
}
if (isset($_GET['selbstverwaltete-pause']) && !empty($_GET['submit']))
{
$selbstverwaltete_pause = ($_GET['selbstverwaltete-pause'] == 'yes') ? true : false;
@@ -191,10 +212,24 @@ if (isset($_GET['selbstverwaltete-pause']) && !empty($_GET['submit']))
<?php
echo $p->t('zeitwunsch/geteilteArbeitszeit');
$gd = new zeitaufzeichnung_gd();
$gd->load($uid, $current_ss);
if ( ! $gd->uid )
{
echo '<br><br><h3>Zustimmung für '.$current_ss.': ';
echo '<input type="radio" name="selbstverwaltete-pause-akt" value="yes">ja';
echo '<input type="radio" name="selbstverwaltete-pause-akt" value="no">nein';
echo '</h3><br><br><input type="submit" name="submit-akt" value="'.$p->t('global/speichern').'" style="float: right"><br>';
}
else
{
$zustimmung = ($gd->selbstverwaltete_pause) ? ' erteilt' : 'abgelehnt';
echo '<br><br><h3>Zustimmung für '.$current_ss.': '.$zustimmung.' am '.$datum_obj->formatDatum($gd->insertamum,'d.m.Y H:i:s').'</h3>';
}
$gd = new zeitaufzeichnung_gd();
$gd->load($uid, $next_ss);
if ( ! $gd->uid )
{
echo '<br><br><h3>Zustimmung für '.$next_ss.': ';
echo '<h3>Zustimmung für '.$next_ss.': ';
echo '<input type="radio" name="selbstverwaltete-pause" value="yes">ja';
echo '<input type="radio" name="selbstverwaltete-pause" value="no">nein';
echo '</h3><br><br><input type="submit" name="submit" value="'.$p->t('global/speichern').'" style="float: right"><br>';
@@ -202,7 +237,7 @@ if (isset($_GET['selbstverwaltete-pause']) && !empty($_GET['submit']))
else
{
$zustimmung = ($gd->selbstverwaltete_pause) ? ' erteilt' : 'abgelehnt';
echo '<br><br><h3>Zustimmung für '.$next_ss.': '.$zustimmung.' am '.$datum_obj->formatDatum($gd->insertamum,'d.m.Y H:i:s').'</h3>';
echo '<h3>Zustimmung für '.$next_ss.': '.$zustimmung.' am '.$datum_obj->formatDatum($gd->insertamum,'d.m.Y H:i:s').'</h3>';
}
//var_dump($gd);
?>
+14 -8
View File
@@ -38,7 +38,7 @@ else
function ip_increment($ip = "")
{
$ip = split("\.", $ip);
$ip = explode(".", $ip);
if($ip[3] > 0 && $ip[3] < 254)
{
@@ -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
@@ -128,7 +134,7 @@ function ip_increment($ip = "")
{
$VLAN = $mfiles->match[1];
$fuser = $mfiles->match[2];
$fuser = split(" ", $fuser);
$fuser = explode(" ", $fuser);
$fuser = $fuser[0];
//hier könnte man noch eine email oder dgl. schicken
if ($fuser != $txtUID)
@@ -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>';
}
+2 -1
View File
@@ -113,7 +113,8 @@ function searchPerson($searchItems)
{
global $db, $p, $noalias, $uid;
$bn = new benutzer();
$bn->search($searchItems, 21);
//search only active and Mitarbeiter with positive Personalnr
$bn->search($searchItems, 21, true, true);
if(count($bn->result)>0)
{
+302 -142
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');
@@ -81,8 +82,8 @@ else {
$datum = new datum();
$fieldheadings = array(
'id' => $p->t("zeitaufzeichnung/id"), 'user' => $p->t("zeitaufzeichnung/user"), 'projekt' => $p->t("zeitaufzeichnung/projekt"),
'oe1' => $p->t("zeitaufzeichnung/oe").'1', 'oe2' => $p->t("zeitaufzeichnung/oe").'2', 'aktivitaet' => $p->t("zeitaufzeichnung/aktivitaet"),
'id' => $p->t("zeitaufzeichnung/id"), 'user' => $p->t("zeitaufzeichnung/user"), 'projekt' => $p->t("zeitaufzeichnung/projekt"), 'ap' => $p->t("zeitaufzeichnung/projektphase"),
'oe1' => $p->t("zeitaufzeichnung/oe"), 'oe2' => $p->t("zeitaufzeichnung/oe").'2', 'aktivitaet' => $p->t("zeitaufzeichnung/aktivitaet"),
'service' => $p->t("zeitaufzeichnung/service"), 'start' => $p->t("zeitaufzeichnung/start"), 'ende' => $p->t("zeitaufzeichnung/ende"),
'dauer' => $p->t("zeitaufzeichnung/dauer"), 'kunde' => $p->t("zeitaufzeichnung/kunde"), 'beschreibung' => $p->t("global/beschreibung"), 'aktion' => $p->t("global/aktion"),
'datum' => $p->t("global/datum")
@@ -91,12 +92,12 @@ $fieldheadings = array(
if ($rechte->isBerechtigt('basis/servicezeitaufzeichnung'))
{
$za_simple = 0;
$activities = array('Design', 'Operativ', 'Betrieb', 'Pause', 'Lehre', 'Arztbesuch', 'DienstreiseMT', 'Behoerde', 'Ersatzruhe');
$activities = array('Design', 'Operativ', 'Betrieb', 'Pause', 'FuE', 'Lehre', 'Arztbesuch', 'DienstreiseMT', 'Behoerde', 'Ersatzruhe');
}
else
{
$za_simple = 1;
$activities = array('Arbeit', 'Pause', 'Lehre', 'Arztbesuch', 'DienstreiseMT', 'Behoerde', 'Ersatzruhe');
$activities = array('Admin', 'FuE','Lehre', 'Pause', 'Arztbesuch', 'DienstreiseMT', 'Behoerde', 'Ersatzruhe');
}
$activities_str = "'".implode("','", $activities)."'";
@@ -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']:'');
@@ -252,6 +252,13 @@ echo '
}
});
$("#projekt").change(
function()
{
getProjektphasen($(this).val());
}
)
});
function setbisdatum()
@@ -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>
@@ -506,6 +556,29 @@ if($kartennummer != '')
$kunde_uid = $betriebsmittel->uid;
}
//Speichern der Daten
function checkVals ($oe_val, $project_val, $phase_val, $service_val)
{
$error = 0;
if ($service_val && ( filter_var($service_val, FILTER_VALIDATE_INT) === false ))
$error = 1;
if ($phase_val && ( filter_var($phase_val, FILTER_VALIDATE_INT) === false ))
$error = 1;
if ($oe_val)
{
$oecheck = new organisationseinheit($oe_val);
if ($oecheck->errormsg)
$error = 1;
}
if ($project_val)
{
$procheck = new projekt($project_val);
if ($procheck->errormsg)
$error = 1;
}
return $error;
}
if(isset($_POST['save']) || isset($_POST['edit']) || isset($_POST['import']))
{
$zeit = new zeitaufzeichnung();
@@ -530,13 +603,35 @@ if(isset($_POST['save']) || isset($_POST['edit']) || isset($_POST['import']))
{
if($data[0] == $user)
{
if (!isset($data[5]))
$data[5] = NULL;
if (!isset($data[6]))
$data[6] = NULL;
if (!isset($data[7]))
$data[7] = NULL;
if (!isset($data[8]))
$data[8] = NULL;
if ($datum->formatDatum($data[2], $format='Y-m-d H:i:s') < $sperrdatum)
echo '<span style="color:red"><b>'.$p->t("global/fehlerBeimSpeichernDerDaten").': Eingabe nicht möglich da vor dem Sperrdatum ('.$data[2].')</b></span><br>';
//elseif (isset($data[8]) && ( filter_var($data[8], FILTER_VALIDATE_INT) === false ))
//{
// echo '<span style="color:red"><b>'.$p->t("global/fehlerBeimSpeichernDerDaten").': Service ID ist keine Zahl ('.$data[8].')</b></span><br>';
//}
elseif (checkVals($data[5],$data[6],$data[7],$data[8]))
{
echo '<span style="color:red"><b>'.$p->t("global/fehlerBeimSpeichernDerDaten").': Fehlerhafte Werte ('.$data[2].')</b></span><br>';
}
else
{
if ($data[1] == 'LehreIntern')
$data[1] = 'Lehre';
$zeit->new = true;
$zeit->beschreibung = NULL;
$zeit->oe_kurzbz_1 = NULL;
$zeit->projekt_kurzbz = NULL;
$zeit->projektphase_id = NULL;
$zeit->service_id = NULL;
$zeit->insertamum = date('Y-m-d H:i:s');
$zeit->updateamum = date('Y-m-d H:i:s');
$zeit->updatevon = $user;
@@ -548,7 +643,13 @@ if(isset($_POST['save']) || isset($_POST['edit']) || isset($_POST['import']))
if (isset($data[4]))
$zeit->beschreibung = $data[4];
if (isset($data[5]))
$zeit->service_id = $data[5];
$zeit->oe_kurzbz_1 = $data[5];
if (isset($data[6]))
$zeit->projekt_kurzbz = $data[6];
if (isset($data[7]))
$zeit->projektphase_id = $data[7];
if (isset($data[8]))
$zeit->service_id = $data[8];
$tag = $datum->formatDatum($data[2], $format='Y-m-d');
if(!in_array($tag, $importtage_array))
@@ -571,10 +672,10 @@ if(isset($_POST['save']) || isset($_POST['edit']) || isset($_POST['import']))
$pause->aktivitaet_kurzbz = 'Pause';
$pause->start = $ende_vorher;
$pause->ende = $zeit->start;
$zeit->beschreibung = '';
$pause->beschreibung = '';
if(!$pause->save())
{
echo '<span style="color:red"><b>'.$p->t("global/fehlerBeimSpeichernDerDaten").': '.$pause->errormsg.'</b></span>';
echo '<span style="color:red"><b>'.$p->t("global/fehlerBeimSpeichernDerDaten").': '.$pause->errormsg.'</b></span><br>';
}
}
}
@@ -591,7 +692,7 @@ if(isset($_POST['save']) || isset($_POST['edit']) || isset($_POST['import']))
*/
if(!$zeit->save())
{
echo '<span style="color:red"><b>'.$p->t("global/fehlerBeimSpeichernDerDaten").': '.$zeit->errormsg.'</b>('.$zeit->start.')</span>';
echo '<span style="color:red"><b>'.$p->t("global/fehlerBeimSpeichernDerDaten").': '.$zeit->errormsg.'</b>('.$zeit->start.')</span><br>';
}
else
$anzahl++;
@@ -601,6 +702,10 @@ if(isset($_POST['save']) || isset($_POST['edit']) || isset($_POST['import']))
}
}
else if (strpos($data[0],'#') === false)
{
echo '<span style="color:red"><b>'.$p->t("global/fehlerBeimSpeichernDerDaten").': Falsche UID nicht importiert </b>('.$data[0].')</span><br>';
}
}
if($anzahl>0)
{
@@ -645,6 +750,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 +773,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 +826,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
{
@@ -828,87 +947,6 @@ if($projekt->getProjekteMitarbeiter($user, true))
echo '</form>';
}
//Projekte werden nicht angezeigt wenn es keine gibt
if($anzprojekte > 0)
{
//Projekt
echo '<tr>
<td>'.$p->t("zeitaufzeichnung/projekt").'</td>
<td colspan="4"><SELECT name="projekt" id="projekt">
<OPTION value="">-- '.$p->t('zeitaufzeichnung/keineAuswahl').' --</OPTION>';
sort($projekt->result);
foreach ($projekt->result as $row_projekt)
{
if ($projekt_kurzbz == $row_projekt->projekt_kurzbz || $filter == $row_projekt->projekt_kurzbz)
$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>';
}
if($za_simple == 0)
{
//OE_KURZBZ_1
echo '<tr><td nowrap>'.$p->t("zeitaufzeichnung/organisationseinheiten").'</td>
<td colspan="3"><SELECT style="width:200px;" name="oe_kurzbz_1">';
$oe = new organisationseinheit();
$oe->getFrequent($user,'180','3',true);
$trennlinie = true;
echo '<option value="">-- '.$p->t("zeitaufzeichnung/keineAuswahl").' --</option>';
foreach ($oe->result as $row)
{
if($row->oe_kurzbz == $oe_kurzbz_1)
$selected = 'selected';
else
$selected = '';
if($row->aktiv)
$class='';
else
$class='class="inaktiv"';
if ($row->anzahl =='0' && $trennlinie==true)
{
echo '<OPTION value="" disabled="disabled">------------------------</OPTION>';
$trennlinie = false;
}
echo '<option value="'.$db->convert_html_chars($row->oe_kurzbz).'" '.$selected.' '.$class.'>'.$db->convert_html_chars($row->bezeichnung.' ('.$row->organisationseinheittyp_kurzbz).')</option>';
}
echo '</SELECT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
//OE_KURZBZ_2
echo '<SELECT style="width:200px;" name="oe_kurzbz_2">';
echo '<option value="">-- '.$p->t("zeitaufzeichnung/keineAuswahl").' --</option>';
$trennlinie = true;
foreach ($oe->result as $row)
{
if($oe_kurzbz_2 == $row->oe_kurzbz)
$selected = 'selected';
else
$selected = '';
if($row->aktiv)
$class='';
else
$class='class="inaktiv"';
if ($row->anzahl =='0' && $trennlinie==true)
{
echo '<OPTION value="" disabled="disabled">------------------------</OPTION>';
$trennlinie = false;
}
echo '<option value="'.$db->convert_html_chars($row->oe_kurzbz).'" '.$selected.' '.$class.'>'.$db->convert_html_chars($row->bezeichnung.' ('.$row->organisationseinheittyp_kurzbz).')</option>';
}
echo '</SELECT></td></tr>';
}
//Aktivitaet
echo '<tr>';
echo '<td>'.$p->t("zeitaufzeichnung/aktivitaet").'</td><td colspan="4">';
@@ -936,49 +974,167 @@ if($projekt->getProjekteMitarbeiter($user, true))
}
echo '</td></tr>';
if($za_simple >= 0)
{
$oestyle = '';
if($za_simple == 0)
$oestyle = 'style="width:200px;"';
//OE_KURZBZ_1
echo '<tr><td nowrap>'.$p->t("zeitaufzeichnung/organisationseinheiten").'</td>
<td colspan="3"><SELECT '.$oestyle.' name="oe_kurzbz_1">';
$oe = new organisationseinheit();
$oe->getFrequent($user,'180','3',true);
$trennlinie = true;
echo '<option value="">-- '.$p->t("zeitaufzeichnung/keineAuswahl").' --</option>';
foreach ($oe->result as $row)
{
if($row->oe_kurzbz == $oe_kurzbz_1)
$selected = 'selected';
else
$selected = '';
if($row->aktiv)
$class='';
else
$class='class="inaktiv"';
if ($row->anzahl =='0' && $trennlinie==true)
{
echo '<OPTION value="" disabled="disabled">------------------------</OPTION>';
$trennlinie = false;
}
echo '<option value="'.$db->convert_html_chars($row->oe_kurzbz).'" '.$selected.' '.$class.'>'.$db->convert_html_chars($row->bezeichnung.' ('.$row->organisationseinheittyp_kurzbz).') ['.$row->oe_kurzbz.']</option>';
}
echo '</SELECT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
if($za_simple == 0)
{
//OE_KURZBZ_2
echo '<SELECT style="width:200px;" name="oe_kurzbz_2">';
echo '<option value="">-- '.$p->t("zeitaufzeichnung/keineAuswahl").' --</option>';
$trennlinie = true;
foreach ($oe->result as $row)
{
if($oe_kurzbz_2 == $row->oe_kurzbz)
$selected = 'selected';
else
$selected = '';
if($row->aktiv)
$class='';
else
$class='class="inaktiv"';
if ($row->anzahl =='0' && $trennlinie==true)
{
echo '<OPTION value="" disabled="disabled">------------------------</OPTION>';
$trennlinie = false;
}
echo '<option value="'.$db->convert_html_chars($row->oe_kurzbz).'" '.$selected.' '.$class.'>'.$db->convert_html_chars($row->bezeichnung.' ('.$row->organisationseinheittyp_kurzbz).')</option>';
}
echo '</SELECT>';
}
echo '</td></tr>';
}
//Projekte werden nicht angezeigt wenn es keine gibt
if($anzprojekte > 0)
{
//Projekt
echo '<tr>
<td>'.$p->t("zeitaufzeichnung/projekt").'</td>
<td colspan="4"><SELECT name="projekt" id="projekt">
<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();">-->';
//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)
{
// Service
echo '<tr>
<td>'.$p->t('zeitaufzeichnung/service').'</td>
<td colspan="4"><SELECT name="service_id">
<OPTION value="">-- '.$p->t('zeitaufzeichnung/keineAuswahl').' --</OPTION>';
$trennlinie = true;
$service = new service();
$service->getFrequentServices($user, '180','3');
foreach($service->result as $row)
{
if($row->service_id==$service_id)
$selected='selected';
else
$selected='';
if ($row->anzahl =='0' && $trennlinie==true)
// Service
echo '<tr>
<td>'.$p->t('zeitaufzeichnung/service').'</td>
<td colspan="4"><SELECT name="service_id">
<OPTION value="">-- '.$p->t('zeitaufzeichnung/keineAuswahl').' --</OPTION>';
$trennlinie = true;
$service = new service();
$service->getFrequentServices($user, '180','3');
foreach($service->result as $row)
{
echo '<OPTION value="" disabled="disabled">------------------------</OPTION>';
$trennlinie = false;
if($row->service_id==$service_id)
$selected='selected';
else
$selected='';
if ($row->anzahl =='0' && $trennlinie==true)
{
echo '<OPTION value="" disabled="disabled">------------------------</OPTION>';
$trennlinie = false;
}
echo '<OPTION title="'.$db->convert_html_chars($row->beschreibung).'" value="'.$db->convert_html_chars($row->service_id).'" '.$selected.'>'.$db->convert_html_chars($row->bezeichnung.' ('.$row->oe_kurzbz.')').'</OPTION>';
}
echo '<OPTION title="'.$db->convert_html_chars($row->beschreibung).'" value="'.$db->convert_html_chars($row->service_id).'" '.$selected.'>'.$db->convert_html_chars($row->bezeichnung.' ('.$row->oe_kurzbz.')').'</OPTION>';
}
echo '</SELECT></td>
echo '</SELECT></td>
</tr>';
// person für Kundenvoransicht laden
$kunde_name = '';
if($kunde_uid != '')
{
$user_kunde = new benutzer();
if($user_kunde->load($kunde_uid))
$kunde_name=$user_kunde->vorname.' '.$user_kunde->nachname;
}
echo '
<tr>
<td>'.$p->t("zeitaufzeichnung/kunde").'</td>
<td colspan="3"><input type="text" id="kunde_name" value="'.$kunde_name.'" placeholder="'.$p->t("zeitaufzeichnung/nameEingeben").'"><input type ="hidden" id="kunde_uid" name="kunde_uid" value="'.$kunde_uid.'"> '.$p->t("zeitaufzeichnung/oderKartennummerOptional").'
<input type="text" id="kartennummer" name="kartennummer" placeholder="'.$p->t("zeitaufzeichnung/kartennummer").'"></td>
</tr>';
// person für Kundenvoransicht laden
$kunde_name = '';
if($kunde_uid != '')
{
$user_kunde = new benutzer();
if($user_kunde->load($kunde_uid))
$kunde_name=$user_kunde->vorname.' '.$user_kunde->nachname;
}
echo '
<tr>
<td>'.$p->t("zeitaufzeichnung/kunde").'</td>
<td colspan="3"><input type="text" id="kunde_name" value="'.$kunde_name.'" placeholder="'.$p->t("zeitaufzeichnung/nameEingeben").'"><input type ="hidden" id="kunde_uid" name="kunde_uid" value="'.$kunde_uid.'"> '.$p->t("zeitaufzeichnung/oderKartennummerOptional").'
<input type="text" id="kartennummer" name="kartennummer" placeholder="'.$p->t("zeitaufzeichnung/kartennummer").'"></td>
</tr>';
echo '<tr><td colspan="4">&nbsp;</td></tr>';
echo '<tr><td colspan="4">&nbsp;</td></tr>';
}
//Start/Ende
@@ -1101,7 +1257,7 @@ if($projekt->getProjekteMitarbeiter($user, true))
{
//Uebersichtstabelle
$woche=date('W');
$colspan=($za_simple)?10:13;
$colspan=($za_simple)?12:14;
echo '
<table id="t1" class="" style="width:100%">
@@ -1184,7 +1340,7 @@ if($projekt->getProjekteMitarbeiter($user, true))
$tagessaldo = $tagessaldo-$pausesumme;
$tagessaldo = date('H:i', ($tagessaldo));
$colspan = ($za_simple)?4:7;
$colspan = ($za_simple)?6:8;
echo '<tr id="tag_row_'.$datum->formatDatum($tag,'d_m_Y').'"><td '.$style.' colspan="'.$colspan.'")>';
// Zusaetzlicher span fuer Addon Informationen
@@ -1259,7 +1415,7 @@ if($projekt->getProjekteMitarbeiter($user, true))
<!--</table>-->';
$colspan=($za_simple)?10:13;
$colspan=($za_simple)?12:14;
echo '
<!--<table id="t'.$datumwoche.'" class="tablesorter">-->
<tr><th colspan="'.$colspan.'">&nbsp;</th></tr>
@@ -1281,7 +1437,7 @@ if($projekt->getProjekteMitarbeiter($user, true))
// Diestreisen NEU
if (array_key_exists($datumtag, $dr_arr))
{
$colspan=($za_simple)?4:7;
$colspan=($za_simple)?6:8;
echo '<tr style="background-color: #aabb99"><td colspan="'.$colspan.'">'.$p->t('zeitaufzeichnung/dienstreise');
if (array_key_exists('start', $dr_arr[$datumtag]) && !array_key_exists('ende', $dr_arr[$datumtag]))
echo ' '.$p->t('global/beginn');
@@ -1335,14 +1491,17 @@ if($projekt->getProjekteMitarbeiter($user, true))
$summe = $row->summe;
$service = new service();
$service->load($row->service_id);
$projektphase = new projektphase($row->projektphase_id);
$ap = $projektphase->bezeichnung;
echo '<tr>
<td '.$style.'>'.$db->convert_html_chars($row->zeitaufzeichnung_id).'</td>
<td '.$style.'>'.$db->convert_html_chars($row->uid).'</td>
<td '.$style.'>'.$db->convert_html_chars($row->projekt_kurzbz).'</td>';
echo '<td '.$style.' > '.$db->convert_html_chars($ap).'</td>';
echo '<td '.$style.' > '.$db->convert_html_chars($row->oe_kurzbz_1).'</td>';
if(!$za_simple)
{
echo '<td '.$style.' > '.$db->convert_html_chars($row->oe_kurzbz_1).'</td>
<td '.$style.' > '.$db->convert_html_chars($row->oe_kurzbz_2).'</td>';
echo '<td '.$style.' > '.$db->convert_html_chars($row->oe_kurzbz_2).'</td>';
}
echo '<td '.$style.'>'.$db->convert_html_chars($row->aktivitaet_kurzbz).'</td>';
if(!$za_simple)
@@ -1417,11 +1576,12 @@ function printTableHeadings($fieldheadings, $za_simple = false){
echo '<tr>
<th style="background-color:#DCE4EF" align="center">'.$fieldheadings['id'].'</th>
<th style="background-color:#DCE4EF" align="center">'.$fieldheadings['user'].'</th>
<th style="background-color:#DCE4EF" align="center">'.$fieldheadings['projekt'].'</th>';
<th style="background-color:#DCE4EF" align="center">'.$fieldheadings['projekt'].'</th>
<th style="background-color:#DCE4EF" align="center">'.$fieldheadings['ap'].'</th>
<th style="background-color:#DCE4EF" align="center">'.$fieldheadings['oe1'].'</th>';
if (!$za_simple)
{
echo '<th style="background-color:#DCE4EF" align="center">'.$fieldheadings['oe1'].'</th>
<th style="background-color:#DCE4EF" align="center">'.$fieldheadings['oe2'].'</th>';
echo '<th style="background-color:#DCE4EF" align="center">'.$fieldheadings['oe2'].'</th>';
}
echo '<th style="background-color:#DCE4EF" align="center">'.$fieldheadings['aktivitaet'].'</th>';
if (!$za_simple)
@@ -1477,8 +1637,8 @@ function getDataForCSV($rawdata, $fieldheadings, $za_simple = false)
$datum = new datum();
$csvData = array();
//headers schreiben
$csvData[] = ($za_simple) ? array($fieldheadings['user'], $fieldheadings['datum'], $fieldheadings['start'], $fieldheadings['ende'], $fieldheadings['projekt'], $fieldheadings['aktivitaet'], $fieldheadings['beschreibung'])
: array($fieldheadings['user'], $fieldheadings['datum'], $fieldheadings['start'], $fieldheadings['ende'], $fieldheadings['projekt'], $fieldheadings['oe1'], $fieldheadings['oe2'], $fieldheadings['aktivitaet'], $fieldheadings['service'], $fieldheadings['kunde'], $fieldheadings['beschreibung']);
$csvData[] = ($za_simple) ? array($fieldheadings['user'], $fieldheadings['datum'], $fieldheadings['start'], $fieldheadings['ende'], $fieldheadings['projekt'], $fieldheadings['ap'], $fieldheadings['oe1'], $fieldheadings['aktivitaet'], $fieldheadings['beschreibung'])
: array($fieldheadings['user'], $fieldheadings['datum'], $fieldheadings['start'], $fieldheadings['ende'], $fieldheadings['projekt'], $fieldheadings['ap'], $fieldheadings['oe1'], $fieldheadings['oe2'], $fieldheadings['aktivitaet'], $fieldheadings['service'], $fieldheadings['kunde'], $fieldheadings['beschreibung']);
foreach ($rawdata as $zeitauf)
{
//Newline characters bei Beschreibung ersetzen
@@ -1491,13 +1651,13 @@ function getDataForCSV($rawdata, $fieldheadings, $za_simple = false)
if($za_simple)
{
$csvData[] = array($zeitauf->uid, $hauptdatum, $datum->formatDatum($zeitauf->start, 'H:i'),
$bisdatum, $zeitauf->projekt_kurzbz, $zeitauf->aktivitaet_kurzbz, $beschreibung);
$bisdatum, $zeitauf->projekt_kurzbz, $zeitauf->projektphase_id, $zeitauf->oe_kurzbz_1, $zeitauf->aktivitaet_kurzbz, $beschreibung);
}
else
{
$servicebez = ($service->load($zeitauf->service_id))?$service->bezeichnung:"";
$csvData[] = array($zeitauf->uid, $hauptdatum, $datum->formatDatum($zeitauf->start, 'H:i'), $bisdatum,
$zeitauf->projekt_kurzbz, $zeitauf->oe_kurzbz_1, $zeitauf->oe_kurzbz_2, $zeitauf->aktivitaet_kurzbz, $servicebez, $zeitauf->kunde_uid, $beschreibung);
$zeitauf->projekt_kurzbz, $zeitauf->projektphase_id, $zeitauf->oe_kurzbz_1, $zeitauf->oe_kurzbz_2, $zeitauf->aktivitaet_kurzbz, $servicebez, $zeitauf->kunde_uid, $beschreibung);
}
}
return $csvData;
@@ -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;
}
+665 -533
View File
File diff suppressed because it is too large Load Diff
+135
View File
@@ -0,0 +1,135 @@
<?php
/* Copyright (C) 2012 FH Technikum-Wien
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* Authors: Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at>
*/
/**
* Dieses Script liefert die iCal Informationen für die vorreservierten Coodle Termine
*
* Aufruf: http://www.example.com/cis/public/ical_coodle.php/[uid]
*/
require_once('../../config/cis.config.inc.php');
require_once('../../include/benutzer.class.php');
require_once('../../include/functions.inc.php');
require_once('../../include/coodle.class.php');
require_once('../../include/ical.class.php');
$uid = mb_substr($_SERVER['PATH_INFO'],1);
$bn = new benutzer();
if(!$bn->load($uid))
die('User invalid');
header("Content-Type: text/calendar; charset=UTF-8");
echo "BEGIN:VCALENDAR\n";
echo "VERSION:2.0\n";
echo "PRODID:-//FH TECHNIKUM WIEN//EN\n";
//echo "METHOD:PUBLISH\n";
//echo 'ORGANIZER;CN=',$bn->vorname,' ',$bn->nachname,':mailto:',$uid,'@',DOMAIN,"\n";
//echo 'DTSTAMP;TZID=Europe/Vienna:',date('Ymd', mktime(date('H'),date('i'),date('s'),date('m'),date('d')-5,date('Y'))),'T',date('Hms'),"\n";
echo 'DTSTART;TZID=Europe/Vienna:',date('Ymd', mktime(0,0,0,date('m'),date('d')-5,date('Y'))),"T000000\n";
echo 'DTEND;TZID=Europe/Vienna:',date('Ymd', mktime(0,0,0,date('m'),date('d')+30,date('Y'))),"T000000\n";
echo "BEGIN:VTIMEZONE
TZID:Europe/Vienna
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU
DTSTART:19810329T020000
TZNAME:GMT+02:00
TZOFFSETTO:+0200
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU
DTSTART:19961027T030000
TZNAME:GMT+01:00
TZOFFSETTO:+0100
END:STANDARD
END:VTIMEZONE\n";
//echo 'URL:',APP_ROOT,'cis/public/ical_coodle.php/',$uid,"\n";
echo "BEGIN:VEVENT";
// Alle Umfragen holen an denen der User beteiligt ist
$umfragen = new coodle();
$umfragen->getCoodleFromUser($uid);
$i = 0;
foreach($umfragen->result as $umfrage)
{
if($umfrage->coodle_status_kurzbz=='laufend')
{
// Bei laufenden Umfragen werden alle angekreuzten Vorschlaege zur FreeBusy hinzugefuegt
$ressource = new coodle();
if($ressource_id = $ressource->RessourceExists($umfrage->coodle_id, $uid))
{
// Terminvorschlaege laden die angekreuzt wurden
$termine = new coodle();
$termine->getRessourceTermin($umfrage->coodle_id, $ressource_id);
foreach($termine->result as $termin)
{
//Start und Ende berechnen
$date = new DateTime($termin->datum.' '.$termin->uhrzeit);
$dtstart = $date->format('Ymd\THis');
$interval =new DateInterval('PT'.$umfrage->dauer.'M');
$date->add($interval);
$uhrzeit_ende = $date->format('H:i:s');
$dtende = $date->format('Ymd\THis');
if ($i > 0)
{
echo "\nBEGIN:VEVENT";
}
echo "\nUID:Coodle_Terminoption".$dtstart."_".$dtende."";
echo "\nSUMMARY:Coodle Terminoption";
echo "\nDTSTART;TZID=Europe/Vienna:$dtstart";
echo "\nDTEND;TZID=Europe/Vienna:$dtende";
echo "\nTRANSP:OPAQUE";
echo "\nEND:VEVENT";
$i++;
}
}
}
// Bei abgeschlossene Umfragen wird ein iCal File mitgeschickt,
// deshalb müssen diese Termine nicht berücksichtigt werden
/*elseif($umfrage->coodle_status_kurzbz=='abgeschlossen')
{
// Bei abgeschlossenen Umfragen wird nur mehr der ausgewaehlte Termin zur FreeBusy hinzugefuegt
$termin = new coodle();
$coodle_termin_id=$termin->getTerminAuswahl($umfrage->coodle_id);
if($termin->loadTermin($coodle_termin_id))
{
//Start und Ende berechnen
$date = new DateTime($termin->datum.' '.$termin->uhrzeit);
$dtstart = $date->format('Ymd\THis');
$interval =new DateInterval('PT'.$umfrage->dauer.'M');
$date->add($interval);
$uhrzeit_ende = $date->format('H:i:s');
$dtende = $date->format('Ymd\THis');
echo "\nBEGIN:VEVENT";
echo "\nSUMMARY:Coodle Terminzusage";
echo "\nDTSTART;TZID=Europe/Vienna: $dtstart";
echo "\nDTEND;TZID=Europe/Vienna: $dtende";
echo "\nTRANSP:OPAQUE";
echo "\nEND:VEVENT";
}
}*/
// stornierte Umfragen werden nicht beruecksichtigt
}
echo "\nEND:VCALENDAR";
?>
+74 -106
View File
@@ -42,51 +42,20 @@ if (!$db = new basis_db())
$PHP_SELF=$_SERVER["PHP_SELF"];
function getSpracheUser()
{
if(isset($_SESSION['sprache_user']))
{
$sprache_user=$_SESSION['sprache_user'];
}
else
{
if(isset($_COOKIE['sprache_user']))
{
$sprache_user=$_COOKIE['sprache_user'];
}
else
{
$sprache_user=DEFAULT_LANGUAGE;
}
setSpracheUser($sprache_user);
}
return $sprache_user;
}
function setSpracheUser($sprache)
{
$_SESSION['sprache_user']=$sprache;
setcookie('sprache_user',$sprache,time()+60*60*24*30,'/');
}
if(isset($_GET['sprache_user']))
{
$sprache_user = new sprache();
if($sprache_user->load($_GET['sprache_user']))
{
setSpracheUser($_GET['sprache_user']);
}
else
setSpracheUser(DEFAULT_LANGUAGE);
}
$sprache_user = getSpracheUser();
$p = new phrasen($sprache_user);
$sprache = getSprache();
// Start session
session_start();
// If language is changed by language select menu, reset language variables
if (isset($_GET['sprache_user']) && !empty($_GET['sprache_user']))
{
$_SESSION['sprache_user'] = $_GET['sprache_user'];
$sprache_user = $_GET['sprache_user'];
}
// Set language variable, which impacts the question language
$sprache_user = (isset($_SESSION['sprache_user']) && !empty($_SESSION['sprache_user'])) ? $_SESSION['sprache_user'] : DEFAULT_LANGUAGE;
$p = new phrasen($sprache_user);
if(isset($_GET['gebiet_id']))
$gebiet_id = $_GET['gebiet_id'];
else
@@ -191,7 +160,7 @@ $gebiet = new gebiet($gebiet_id);
if($gebiet->level_start!='')
$levelgebiet=true;
else
else
$levelgebiet=false;
list($stunde, $minute, $sekunde) = explode(':',$gebiet->zeit);
@@ -209,20 +178,20 @@ if(isset($_GET['start']) && !$gestartet)
$frage = new frage();
if(!$frage->generateFragenpool($_SESSION['pruefling_id'], $gebiet_id))
die($p->t('testtool/fehlerBeimGenerierenDesFragenpools').':'.$frage->errormsg);
//Erste Frage des Pools holen
if(!$frage_id = $frage->getNextFrage($gebiet_id, $_SESSION['pruefling_id']))
die($p->t('testtool/esWurdeKeineFrageGefunden'));
//Beginnzeit Speichern
$prueflingfrage = new frage();
if(!$prueflingfrage->getPrueflingfrage($_SESSION['pruefling_id'], $frage_id))
die($p->t('testtool/fehler').':'.$prueflingfrage->errormsg);
$prueflingfrage->begintime = date('Y-m-d H:i:s');
if(!$prueflingfrage->save_prueflingfrage(false))
die($p->t('testtool/fehlerBeimStartvorgang'));
echo '<script language="Javascript">parent.menu.location.reload();</script>';
}
@@ -232,46 +201,46 @@ if(isset($_POST['submitantwort']) && isset($_GET['frage_id']))
// vor dem Speichern der Antworten, alle Antworten zu der Frage loeschen
// und die Antworten neu anlegen
// Unterscheidung ob mehrere oder nur eine Antwort uebergeben wird
if($levelgebiet && !isset($_POST['vorschlag_id']))
{
echo '<span class="error">'.$p->t('testtool/beiDiesemGebietMuessenSieJedeFrageBeantworten').'</span>';
}
else
{
$error=false;
$db->db_query('BEGIN;');
// alle vorhandenen Antworten zu dieser Frage loeschen
$qry = "DELETE FROM testtool.tbl_antwort WHERE antwort_id in(
SELECT antwort_id FROM testtool.tbl_antwort JOIN testtool.tbl_vorschlag USING(vorschlag_id)
WHERE frage_id=".$db->db_add_param($_GET['frage_id'])." AND pruefling_id=".$db->db_add_param($_SESSION['pruefling_id']).")";
$db->db_query($qry);
// Antwort nur Speichern wenn eine Antwort gewaehlt wurde
// Antwort nur Speichern wenn eine Antwort gewaehlt wurde
if(isset($_POST['vorschlag_id']) && $_POST['vorschlag_id']!='')
{
$vorschlaege = array();
//Falls nur eine einzelne Antwort kommt, diese auch in ein Array packen
if(!is_array($_POST['vorschlag_id']))
$vorschlaege[0]=$_POST['vorschlag_id'];
else
else
$vorschlaege = $_POST['vorschlag_id'];
//alle Antworten Speichern
foreach ($vorschlaege as $vorschlag_id)
foreach ($vorschlaege as $vorschlag_id)
{
if($vorschlag_id!='')
{
$antwort = new antwort();
$antwort->new = true;
$antwort->vorschlag_id = $vorschlag_id;
$antwort->pruefling_id = $_SESSION['pruefling_id'];
if(!$antwort->save())
{
$errormsg = $antwort->errormsg;
@@ -279,7 +248,7 @@ if(isset($_POST['submitantwort']) && isset($_GET['frage_id']))
}
}
}
if(!$error)
{
//Endzeit der Frage eintragen
@@ -290,7 +259,7 @@ if(isset($_POST['submitantwort']) && isset($_GET['frage_id']))
$error = true;
}
$prueflingfrage->endtime = date('Y-m-d H:i:s');
if(!$prueflingfrage->save_prueflingfrage(false))
{
$errormsg = $prueflingfrage->errormsg;
@@ -298,32 +267,32 @@ if(isset($_POST['submitantwort']) && isset($_GET['frage_id']))
}
}
}
if($error)
{
$db->db_query('ROLLBACK;');
die($p->t('testtool/fehler').':'.$errormsg);
}
else
else
{
$db->db_query('COMMIT;');
}
$frage = new frage();
if($levelgebiet)
{
//bei gelevelten Fragen die naechste Frage holen
$frage->generateFragenpool($_SESSION['pruefling_id'], $gebiet_id);
}
$frage_id = $frage->getNextFrage($gebiet_id, $_SESSION['pruefling_id'], $frage_id);
}
}
//Schauen ob dieses Gebiet schon gestartet wurde
$qry = "SELECT begintime
FROM
FROM
testtool.tbl_pruefling_frage JOIN testtool.tbl_frage USING(frage_id)
WHERE pruefling_id=".$db->db_add_param($_SESSION['pruefling_id'], FHC_INTEGER)." AND gebiet_id=".$db->db_add_param($gebiet_id, FHC_INTEGER)."
ORDER BY begintime ASC LIMIT 1";
@@ -352,7 +321,7 @@ else
$info='';
//Name und Studiengang anzeigen
$qry_pruefling = "SELECT vorname, nachname, stg_bez, tbl_studiengangstyp.bezeichnung FROM testtool.vw_pruefling
$qry_pruefling = "SELECT vorname, nachname, stg_bez, tbl_studiengangstyp.bezeichnung FROM testtool.vw_pruefling
JOIN public.tbl_studiengang USING (studiengang_kz)
JOIN public.tbl_studiengangstyp USING (typ)
WHERE pruefling_id=".$db->db_add_param($_SESSION['pruefling_id']);
@@ -373,7 +342,7 @@ if($levelgebiet)
$qry = "SELECT count(*) as anzahl FROM testtool.tbl_pruefling_frage JOIN testtool.tbl_frage USING(frage_id)
WHERE pruefling_id=".$db->db_add_param($_SESSION['pruefling_id'], FHC_INTEGER)."
AND gebiet_id=".$db->db_add_param($gebiet_id, FHC_INTEGER);
if($result_aktuell = $db->db_query($qry))
{
if($row_aktuell = $db->db_fetch_object($result_aktuell))
@@ -433,8 +402,8 @@ if($demo)
else
{
//Wenn es sich um eine Testfrage handelt, dann wird die verbleibende Zeit angezeigt
$qry = "SELECT '$gebiet->zeit'-(now()-min(begintime)) as time
FROM testtool.tbl_pruefling_frage JOIN testtool.tbl_frage USING(frage_id)
$qry = "SELECT '$gebiet->zeit'-(now()-min(begintime)) as time
FROM testtool.tbl_pruefling_frage JOIN testtool.tbl_frage USING(frage_id)
WHERE gebiet_id=".$db->db_add_param($gebiet_id, FHC_INTEGER)." AND pruefling_id=".$db->db_add_param($_SESSION['pruefling_id'], FHC_INTEGER);
$result = $db->db_query($qry);
$row = $db->db_fetch_object($result);
@@ -450,7 +419,7 @@ else
echo $p->t('testtool/bearbeitungszeit').': <span id="counter"></span>';
echo "<script>count_down($zeit)</script>";
if($zeit<0)
die('</td></tr></table><center><b>'.$p->t('testtool/dieZeitIstAbgelaufen').'</b></center></body></html>');
}
@@ -470,17 +439,17 @@ else
{
// wenn keine Frage uebergeben wurde und die maximale Fragenanzahl erreicht wurde
// dann ist das Gebiet fertig
$qry = "SELECT count(*) as anzahl FROM testtool.tbl_pruefling_frage JOIN testtool.tbl_frage USING(frage_id)
$qry = "SELECT count(*) as anzahl FROM testtool.tbl_pruefling_frage JOIN testtool.tbl_frage USING(frage_id)
WHERE gebiet_id=".$db->db_add_param($gebiet_id, FHC_INTEGER)." AND pruefling_id=".$db->db_add_param($_SESSION['pruefling_id'], FHC_INTEGER)." AND tbl_pruefling_frage.endtime is not null";
$result = $db->db_query($qry);
$row = $db->db_fetch_object($result);
if($row->anzahl>=$gebiet->maxfragen)
{
die("<script>document.location.href='gebietfertig.php';</script>");
}
}
$frage_id = $frage->getNextFrage($gebiet_id, $_SESSION['pruefling_id'], null, $demo, $levelgebiet);
$frage->load($frage_id);
}
@@ -489,7 +458,7 @@ else
if($frage->frage_id!='')
{
$frage_id = $frage->frage_id;
$frage->getFrageSprache($frage_id, $_SESSION['sprache']);
$frage->getFrageSprache($frage_id, $_SESSION['sprache_user']);
if(!$demo)
{
@@ -502,7 +471,7 @@ if($frage->frage_id!='')
$prueflingfrage = new frage();
if(!$prueflingfrage->getPrueflingfrage($_SESSION['pruefling_id'], $frage_id))
die($p->t('testtool/dieseFrageIstNichtFuerSieBestimmt'));
if($prueflingfrage->begintime=='')
{
$prueflingfrage->begintime = date('Y-m-d H:i:s');
@@ -515,8 +484,8 @@ if($frage->frage_id!='')
//Kopfzeile mit Weiter Button und Sprung direkt zu einer Frage
if(!$demo && !$levelgebiet)
{
$qry = "SELECT tbl_pruefling_frage.nummer, tbl_pruefling_frage.frage_id
FROM testtool.tbl_pruefling_frage JOIN testtool.tbl_frage USING(frage_id)
$qry = "SELECT tbl_pruefling_frage.nummer, tbl_pruefling_frage.frage_id
FROM testtool.tbl_pruefling_frage JOIN testtool.tbl_frage USING(frage_id)
WHERE gebiet_id=".$db->db_add_param($gebiet_id, FHC_INTEGER)." AND pruefling_id=".$db->db_add_param($_SESSION['pruefling_id'], FHC_INTEGER)." AND demo=false ORDER BY nummer";
echo "
@@ -546,9 +515,9 @@ if($frage->frage_id!='')
{
if($demo)
$value='';
else
else
$value=$p->t('testtool/blaettern').' &gt;&gt;';
echo " <a href='$PHP_SELF?gebiet_id=$gebiet_id&amp;frage_id=$nextfrage' class='Item'>$value</a>";
}
else
@@ -574,8 +543,8 @@ if($frage->frage_id!='')
{
echo '
<div class="row text-center">
<img class="testtoolfrage" src="bild.php?src=frage&amp;frage_id='. $frage->frage_id.'&amp;sprache='. $_SESSION["sprache"].'"></img><br/><br/><br/>
</div>
<img class="testtoolfrage" src="bild.php?src=frage&amp;frage_id='. $frage->frage_id.'&amp;sprache='. $_SESSION["sprache_user"].'"></img><br/><br/><br/>
</div>
';
}
$timestamp = time();
@@ -583,13 +552,13 @@ if($frage->frage_id!='')
//Sound einbinden
if($frage->audio!='')
{
echo '
echo '
<div class="row text-center">
<audio src="sound.php?src=frage&amp;frage_id='.$frage->frage_id.'&amp;sprache='.$_SESSION['sprache'].'&amp;'.$timestamp.'" controls="controls" type="audio/ogg">
<audio src="sound.php?src=frage&amp;frage_id='.$frage->frage_id.'&amp;sprache='.$_SESSION['sprache_user'].'&amp;'.$timestamp.'" controls="controls" type="audio/ogg">
<div>
<p>Ihr Browser unterstützt dieses Audioelement leider nicht.</p>
</div>
</audio>
</audio>
</div>
';
}
@@ -597,15 +566,15 @@ if($frage->frage_id!='')
$display_well = $frage->nummer == 0 ? '' : 'well'; // don't style frage 0 because this is always the introduction to gebiet
echo '
<div class="row">
<div class="col-xs-offset-1 col-xs-10 col-sm-offset-2 col-sm-8">
<div class="col-xs-offset-1 col-xs-10 col-sm-offset-2 col-sm-8">
<div class="'. $display_well. ' text-center">'. $frage->text. '</div>
</div>
</div>
</div>
</div>
';
//Vorschlaege laden
$vs = new vorschlag();
$vs->getVorschlag($frage->frage_id, $_SESSION['sprache'], $gebiet->zufallvorschlag);
$vs->getVorschlag($frage->frage_id, $_SESSION['sprache_user'], $gebiet->zufallvorschlag);
$letzte = $frage->getNextFrage($gebiet_id, $_SESSION['pruefling_id'], $frage_id, $demo);
echo "<form action=\"$PHP_SELF?gebiet_id=$gebiet_id&amp;frage_id=$frage->frage_id\" method=\"POST\" ".(!$letzte && !$levelgebiet?"onsubmit=\"letzteFrage()\"":"").">";
echo '
@@ -617,22 +586,22 @@ if($frage->frage_id!='')
$beantwortet = false;
$cnt = 0; // counter für foreach-Schleife
$len = count($vs->result);
//Antworten laden falls bereits vorhanden
$antwort = new antwort();
$antwort->getAntwort($_SESSION['pruefling_id'],$frage->frage_id);
//Vorschlaege anzeigen
foreach ($vs->result as $vorschlag)
{
echo "<td valign='top' style='padding: 25px;'>";
//Bei multipleresponse checkboxen anzeigen ansonsten radiobuttons
if($gebiet->multipleresponse)
$type='checkbox';
else
else
$type='radio';
//Antworten markieren wenn die Frage bereits beantwortet wurde
$checked=false;
reset($antwort->result);
@@ -644,15 +613,15 @@ if($frage->frage_id!='')
$beantwortet = true;
}
}
echo '<input type="'.$type.'" class="button_style" name="vorschlag_id[]" value="'.$vorschlag->vorschlag_id.'" '.$checked.'/>';
echo '<br/>';
if($vorschlag->bild!='')
echo "<img class='testtoolvorschlag' src='bild.php?src=vorschlag&amp;vorschlag_id=$vorschlag->vorschlag_id&amp;sprache=".$_SESSION['sprache']."' /><br/>";
echo "<img class='testtoolvorschlag' src='bild.php?src=vorschlag&amp;vorschlag_id=$vorschlag->vorschlag_id&amp;sprache=".$_SESSION['sprache_user']."' /><br/>";
if($vorschlag->audio!='')
{
echo ' <audio src="sound.php?src=vorschlag&amp;vorschlag_id='.$vorschlag->vorschlag_id.'&amp;sprache='.$_SESSION['sprache'].'" controls="controls">
echo ' <audio src="sound.php?src=vorschlag&amp;vorschlag_id='.$vorschlag->vorschlag_id.'&amp;sprache='.$_SESSION['sprache_user'].'" controls="controls">
<div>
<p>Ihr Browser unterstützt dieses Audioelement leider nicht.</p>
</div>
@@ -672,7 +641,7 @@ if($frage->frage_id!='')
$cnt++;
}
//wenn singleresponse und keine Levels und vorschlaege vorhanden sind, dann gibt es auch die
//wenn singleresponse und keine Levels und vorschlaege vorhanden sind, dann gibt es auch die
//moeglichkeit fuer keine Antwort
if(!$gebiet->multipleresponse && !$levelgebiet && count($vs->result)>0)
{
@@ -699,8 +668,8 @@ if($frage->frage_id!='')
//Naechste Frage holen und Weiter-Button anzeigen
//$frage = new frage();
//$nextfrage = $frage->getNextFrage($gebiet_id, $_SESSION['pruefling_id'], $frage_id, $demo);
$qry = "SELECT count(*) as anzahl FROM testtool.tbl_frage
$qry = "SELECT count(*) as anzahl FROM testtool.tbl_frage
WHERE tbl_frage.gebiet_id=".$db->db_add_param($gebiet_id, FHC_INTEGER)."
AND demo ";
if($row = $db->db_fetch_object($db->db_query($qry)))
@@ -713,10 +682,11 @@ if($frage->frage_id!='')
}
}
}
echo '
echo '
</div> <!--/.row-->
';
echo "</form>";
echo '</div></div>';
echo '<br/><br/><br/><br/><br/>';
}
else
@@ -725,7 +695,5 @@ else
echo "<br/><br/><center><b>".$p->t("testtool/startDrueckenUmZuBeginnen")."</b></center>";
}
?>
</div><!--/.col-->
</div><!--/.row-->
</body>
</html>
+10 -36
View File
@@ -19,6 +19,7 @@
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at> ,
* Rudolf Hangl <rudolf.hangl@technikum-wien.at>,
* Manfred Kindl <manfred.kindl@technikum-wien.at>
* Cristina Hainberger <hainberg@technikum-wien.at>
*/
require_once('../../config/cis.config.inc.php');
@@ -29,45 +30,18 @@ require_once '../../include/phrasen.class.php';
if (!$db = new basis_db())
die('Fehler beim Oeffnen der Datenbankverbindung');
function getSpracheUser()
// Start session
session_start();
// If language is changed by language select menu, reset language variables
if (isset($_GET['sprache_user']) && !empty($_GET['sprache_user']))
{
if(isset($_SESSION['sprache_user']))
{
$sprache_user=$_SESSION['sprache_user'];
}
else
{
if(isset($_COOKIE['sprache_user']))
{
$sprache_user=$_COOKIE['sprache_user'];
}
else
{
$sprache_user=DEFAULT_LANGUAGE;
}
setSpracheUser($sprache_user);
}
return $sprache_user;
$_SESSION['sprache_user'] = $_GET['sprache_user'];
$sprache_user = $_GET['sprache_user'];
}
function setSpracheUser($sprache)
{
$_SESSION['sprache_user']=$sprache;
setcookie('sprache_user',$sprache,time()+60*60*24*30,'/');
}
if(isset($_GET['sprache_user']))
{
$sprache_user = new sprache();
if($sprache_user->load($_GET['sprache_user']))
{
setSpracheUser($_GET['sprache_user']);
}
else
setSpracheUser(DEFAULT_LANGUAGE);
}
$sprache_user = getSpracheUser();
// Set language variable
$sprache_user = (isset($_SESSION['sprache_user']) && !empty($_SESSION['sprache_user'])) ? $_SESSION['sprache_user'] : DEFAULT_LANGUAGE;
$p = new phrasen($sprache_user);
?>
+131 -147
View File
@@ -38,69 +38,37 @@ require_once '../../include/datum.class.php';
if (!$db = new basis_db())
die('Fehler beim Oeffnen der Datenbankverbindung');
//if(isset($_GET['lang']))
// setSprache($_GET['lang']);
// Start session
session_start();
$date = new datum();
function getSpracheUser()
// Logout (triggered by logout button in menu.php)
if (isset($_GET['logout']) && $_GET['logout'] == true)
{
if(isset($_SESSION['sprache_user']))
{
$sprache_user=$_SESSION['sprache_user'];
}
else
{
if(isset($_COOKIE['sprache_user']))
{
$sprache_user=$_COOKIE['sprache_user'];
}
else
{
$sprache_user=DEFAULT_LANGUAGE;
}
setSpracheUser($sprache_user);
}
return $sprache_user;
}
// Unset global vars
unset($_GET['logout']);
unset($_GET['sprache_user']);
$_POST = [];
$_SESSION = [];
function setSpracheUser($sprache)
{
$_SESSION['sprache_user']=$sprache;
setcookie('sprache_user',$sprache,time()+60*60*24*30,'/');
}
// Destroy session
session_destroy();
if(isset($_GET['sprache_user']))
{
$sprache_user = new sprache();
if($sprache_user->load($_GET['sprache_user']))
{
setSpracheUser($_GET['sprache_user']);
}
else
setSpracheUser(DEFAULT_LANGUAGE);
echo '
<script language="Javascript">
location = location.pathname; // clean the login.php-url from querystring
parent.menu.location = parent.menu.location.pathname; // clean the menu.php-url from querystring
parent.topbar.location = parent.topbar.location.pathname; // clean the topbar.php-url from querystring
</script>
';
}
$sprache_user = getSpracheUser();
$p = new phrasen($sprache_user);
$gebdatum='';
$date = new datum();
session_start();
$reload=false;
$reload_parent=false;
$reload_menu=false;
$sg_var = new studiengang();
if (isset($_GET['logout']))
{
if(isset($_SESSION['prestudent_id']))
{
$reload = true;
session_destroy();
}
}
if(isset($_POST['gebdatum']) && $_POST['gebdatum']!='')
{
$gebdatum = $date->formatDatum($_POST['gebdatum'],'Y-m-d');
@@ -178,7 +146,6 @@ if (isset($_POST['prestudent']) && isset($gebdatum))
$_SESSION['vorname']=$ps->vorname;
$_SESSION['gebdatum']=$ps->gebdatum;
$stg_obj = new studiengang($studiengang);
$_SESSION['sprache']=$stg_obj->sprache;
$_SESSION['semester']=$semester;
$stg_obj->getStudiengangTyp($stg_obj->typ);
@@ -215,7 +182,6 @@ if (isset($_POST['prestudent']) && isset($gebdatum))
break;
}
}
// Sprachvorgaben zu STG mit höchster Prio ermitteln
// * 1. Sprache über Ablauf Vorgaben ermitteln
@@ -246,11 +212,11 @@ if (isset($_POST['prestudent']) && isset($gebdatum))
// * 4. Sprache setzen. Falls keine Sprache vorhanden -> DEFAULT language verwenden
if (empty($rt_sprache))
{
$_SESSION['sprache'] = DEFAULT_LANGUAGE;
$_SESSION['sprache_user'] = DEFAULT_LANGUAGE;
}
else
{
$_SESSION['sprache'] = $rt_sprache;
$_SESSION['sprache_user'] = $rt_sprache;
}
}
else
@@ -269,8 +235,38 @@ if (isset($_POST['prestudent']) && isset($gebdatum))
}
}
// Set language of user.
// NOTE: don't move the code in order to check first the right studies' reihungstest language
// (in case it was overruled by other STG with higher priority)
// Start with default language on first login (before any prestudent has been selected)
$sprache_user = DEFAULT_LANGUAGE;
if (isset($_SESSION['sprache_user']) && !empty($_SESSION['sprache_user']))
{
// If session var already exists, overwrite language var
// (session var changes e.g. when user selects other language with language-select-menu)
$sprache_user = $_SESSION['sprache_user'];
}
elseif (isset($_SESSION['prestudent_id']))
{
// If session var does not exist but prestudent is known, set the session var
$_SESSION['sprache_user'] = DEFAULT_LANGUAGE;
}
// If language is changed by language select menu, reset language variables
if(isset($_GET['sprache_user']) && !empty($_GET['sprache_user']))
{
$sprache_user = $_GET['sprache_user'];
$_SESSION['sprache_user'] = $_GET['sprache_user'];
}
// NOTE: leave phrasen here, as the final users language is not defined until here
$p = new phrasen($sprache_user);
if (isset($_SESSION['prestudent_id']))
$prestudent_id=$_SESSION['prestudent_id'];
{
$prestudent_id=$_SESSION['prestudent_id'];
}
else
{
//$prestudent_id=null;
@@ -279,10 +275,6 @@ else
$ps->getPrestudentRT($datum);
}
if(isset($_GET['type']) && $_GET['type']=='sprachechange' && isset($_GET['sprache']))
{
setSprache($_GET['sprache']);
}
if(isset($_SESSION['prestudent_id']) && !isset($_SESSION['pruefling_id']))
{
@@ -303,7 +295,7 @@ if(isset($_SESSION['prestudent_id']) && !isset($_SESSION['pruefling_id']))
if($pruefling->save())
{
$_SESSION['pruefling_id']=$pruefling->pruefling_id;
$reload_parent=true;
$reload_menu=true;
}
}
@@ -327,19 +319,19 @@ if(isset($_POST['save']) && isset($_SESSION['prestudent_id']))
{
$_SESSION['pruefling_id']=$pruefling->pruefling_id;
$_SESSION['semester']=$pruefling->semester;
$reload_parent=true;
$reload_menu=true;
}
}
?><!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../vendor/twbs/bootstrap/dist/css/bootstrap.min.css" type="text/css"/>
<link rel="stylesheet" href="../../vendor/twbs/bootstrap/dist/css/bootstrap.min.css" type="text/css"/>
<link href="../../skin/style.css.php" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="../../skin/jquery.css" type="text/css"/>
<script type="text/javascript" src="../../include/js/jquery1.9.min.js"></script>
<link rel="stylesheet" type="text/css" href="../../skin/jquery-ui-1.9.2.custom.min.css"/>
<script type="text/javascript" src="../../vendor/components/jquery/jquery.min.js"></script>
<link rel="stylesheet" href="../../vendor/components/jqueryui/themes/base/jquery-ui.min.css" type="text/css"/>
<script type="text/javascript" src="../../vendor/components/jquery/jquery.min.js"></script>
<script type="text/javascript" src="../../vendor/components/jqueryui/jquery-ui.min.js"></script>
<script type="text/javascript" src="../../vendor/components/jqueryui/ui/i18n/datepicker-de.js"></script>
<script type="text/javascript" src="../../vendor/twbs/bootstrap/dist/js/bootstrap.min.js"></script>
<script type="text/javascript">
$(document).ready(function()
@@ -371,24 +363,19 @@ if(isset($_POST['save']) && isset($_SESSION['prestudent_id']))
});
</script>
<?php
if($reload_parent)
if($reload_menu)
echo '<script language="Javascript">parent.menu.location.reload();</script>';
if($reload)
echo "<script language=\"Javascript\">parent.location.reload();</script>";
?>
</head>
<body scroll="no">
<div class="row">
<div class="col-xs-10 col-sm-9 col-lg-6">
<?php
//REIHUNGSTEST STARTSEITE (nach Login)
if (isset($prestudent_id))
{
$prestudent = new prestudent($prestudent_id);
$stg_obj = new studiengang($prestudent->studiengang_kz);
$pruefling = new pruefling();
@@ -399,7 +386,7 @@ if (isset($prestudent_id))
$ps = new Prestudent();
// * prinzipiell STG der session übernehmem
$firstPrio_studiengang_kz = $prestudent->studiengang_kz;;
$firstPrio_studiengang_kz = $prestudent->studiengang_kz;
// * wenn STG des eingeloggten Prestudenten vom Typ Bachelor ist, dann höchste Prio aller
// Bachelor-STG ermitteln, an denen die Person noch interessiert ist
@@ -419,15 +406,28 @@ if (isset($prestudent_id))
// Sprachwahl zu STG mit höchster Prio ermitteln
$ablauf = new Ablauf();
$sprachwahl = false;
if ($ablauf->getAblaufVorgabeStudiengang($firstPrio_studiengang_kz) && is_bool($ablauf->result[0]->sprachwahl))
if (isset($ablauf->result[0])
&& $ablauf->getAblaufVorgabeStudiengang($firstPrio_studiengang_kz)
&& is_bool($ablauf->result[0]->sprachwahl))
{
$sprachwahl = $ablauf->result[0]->sprachwahl;
}
// If language can be switched, display language select menu on the top
if ($sprachwahl)
{
$_SESSION['sprache_auswahl'] = true;
?>
<script type="text/javascript">
parent.topbar.location.reload();
</script>
<?php
}
//Prestudent Informationen
echo '<div class="col-xs-10 col-sm-9 col-lg-6">';
echo '
<h1 style="margin-top: -20px;">'. $p->t('testtool/begruessungstext'). '</h1><br/>
<p>'. $p->t('testtool/anmeldedaten'). '</p><br/>
<p>'. $p->t('testtool/anmeldedaten'). '</p><br/>
';
echo '
@@ -449,15 +449,15 @@ if (isset($prestudent_id))
echo '<br>';
echo '
<p>'. $p->t('testtool/fuerFolgendeStgAngemeldet'). '</p><br>
<table class="table table-bordered">
<table class="table table-bordered">
<thead>
<tr>
<th style="width: 50%;">'. $p->t('global/studiengang'). '</th>
<th>Status</th>
</tr>
</thead>
<tbody>
</thead>
<tbody>
';
// * wenn Prestudent an 1 - n Bachelor-Studiengängen interessiert ist, dann STG anführen
@@ -521,8 +521,8 @@ if (isset($prestudent_id))
echo '<td>'. $ps_master->status_mehrsprachig[$sprache_user]. '</td>';
}
echo '
</tbody>
echo '
</tbody>
</table>
';
@@ -538,53 +538,6 @@ if (isset($prestudent_id))
//echo '<tr><td></td><td><input type="submit" name="save" value="Semester ändern"></td>';
echo '</table>';
echo '</FORM>';
//Wenn die Sprachwahl fuer den priorisierten Studiengang aktiviert ist, dann die Sprachen anzeigen
if($sprachwahl==true)
{
//Liste der Sprachen, die in den Gebieten vorkommen koennen
$qry = "SELECT distinct sprache
FROM
testtool.tbl_pruefling
JOIN testtool.tbl_ablauf USING(studiengang_kz)
JOIN testtool.tbl_frage USING(gebiet_id)
JOIN testtool.tbl_frage_sprache USING(frage_id)
WHERE
tbl_pruefling.pruefling_id=".$db->db_add_param($pruefling->pruefling_id)."
ORDER BY sprache DESC";
if($result = $db->db_query($qry))
{
echo '
<p>'. $p->t('testtool/spracheDerTestfragen').':</p><br>
<div class="btn-group btn-group-justified" role="group">
';
while($row = $db->db_fetch_object($result))
{
$selected = ($_SESSION['sprache'] == $row->sprache) ? 'active' : '';
$row_sprache = $row->sprache;
if ($sprache_user == 'German')
{
if($row->sprache == 'English')
{
$row_sprache = 'Englisch';
}
elseif ($row->sprache == 'German')
{
$row_sprache = 'Deutsch';
}
}
echo "
<div class='btn-group' role='group'>
<a role='button' class='btn btn-default $selected' href='". $_SERVER['PHP_SELF']. "?type=sprachechange&sprache=". $row->sprache. "'>$row_sprache</a>
</div>
";
}
echo '</div>';
}
}
echo '<br><br>';
echo '
<div class="well well-lg text-center">
@@ -594,22 +547,45 @@ if (isset($prestudent_id))
if($pruefling->pruefling_id!='')
{
$_SESSION['pruefling_id']=$pruefling->pruefling_id;
//echo '<script language="Javascript">parent.menu.location.reload()</script>';
}
}
else
{
echo '<span class="error">'.$p->t('testtool/keinPrueflingseintragVorhanden').'</span>';
}
echo ' </div><!--/.col-->';
}
else
else // LOGIN Site (vor Login)
{
//LOGIN FORM (Startseite vor Login)
$prestudent_id_dummy_student = (defined('PRESTUDENT_ID_DUMMY_STUDENT')?PRESTUDENT_ID_DUMMY_STUDENT:'');
echo '<div class="col-xs-11">';
echo '<form method="post">
<SELECT name="prestudent">';
echo '<OPTION value="'.$prestudent_id_dummy_student.'">'.$p->t('testtool/nameAuswaehlen').'</OPTION>\n';
// Welcome text
echo '
<div class="row" style="margin-bottom: 10%; margin-top: 3%;">
<div class="col-xs-6 text-center" style="border-right: 1px solid lightgrey;">
<h1 style="white-space: normal">Herzlich Willkommen zum Reihungstest</h1><br><br>
Bitte warten Sie mit dem Login auf die Anweisung der Aufsichtsperson.<br><br>
Wir wünschen Ihnen einen erfolgreichen Start ins Studium.
</div>
<div class="col-xs-6 text-center">
<h1 style="white-space: normal">Welcome to the placement test</h1> <br><br>
Please wait for the tutor\'s instructions before you log in.<br><br>
We wish you a good start to your studies.
</div>
</div>
';
// Begin form
echo '<div class="row text-center">';
echo '<form method="post" class="form-inline">';
// Name select menu
echo '<div class="form-group">';
echo '<label for="select-prestudent" class="col-sm-2 control-label">Name</label>';
echo '<div class="col-sm-10">';
echo '<SELECT name="prestudent" id="select-prestudent" class="form-control">';
echo '<OPTION value="'.$prestudent_id_dummy_student.'">Bitte wählen / Please select...</OPTION>\n';
foreach($ps->result as $prestd)
{
$stg = new studiengang();
@@ -618,7 +594,8 @@ else
$selected = 'selected';
else
$selected='';
echo '<OPTION value="'.$prestd->prestudent_id.'" '.$selected.'>'.$prestd->nachname.' '.$prestd->vorname.' ('.(strtoupper($stg->typ.$stg->kurzbz)).')</OPTION>\n';
echo '
<OPTION value="'.$prestd->prestudent_id.'" '.$selected.'>'.$prestd->nachname.' '.$prestd->vorname.' ('.(strtoupper($stg->typ.$stg->kurzbz)).')</OPTION>\n';
}
// An der FHTW gibt es 3 Testuser für den Camus International
if (CAMPUS_NAME == 'FH Technikum Wien')
@@ -628,19 +605,26 @@ else
echo '<OPTION value="30889">Testuser Campus International 03</OPTION>\n';
}
echo '</SELECT>';
echo '&nbsp; '.$p->t('global/geburtsdatum').': ';
echo '<input type="text" id="datepicker" size="12" name="gebdatum" value="'.$date->formatDatum($gebdatum,'d.m.Y').'">';
echo '<INPUT type="submit" value="'.$p->t('testtool/login').'" />';
echo '</form>';
echo '</div>'; // end col-xs
echo '</div>'; // end form-group
echo '<br /><br /><br />
<center>
<span style="font-size: 1.2em; font-style: italic;">'.$p->t('testtool/willkommenstextTitel').'</span><br><br>
<span style="font-size: 1.2em; font-style: italic;">'.$p->t('testtool/willkommenstext').'</span>
</center>';
// Datepicker input
echo '<div class="form-group"> ';
echo '<label for="datepicker" class="col-sm-offset-1 col-sm-4 control-label">Geburtsdatum | Date of Birth</label>';
echo '<div class="col-sm-3">';
echo '<input type="text" id="datepicker" class="form-control" name="gebdatum" value="'.$date->formatDatum($gebdatum,'d.m.Y').'">';
echo '</div>'; // end col-xs
echo '</div>'; // end form-group
// Login button
echo '<button type="submit" class="btn btn-default" value="'.$p->t('testtool/login').'" />'.$p->t('testtool/login').'</button>';
echo '</form>'; // end form
echo '</div>'; // end row
echo '</div>'; // end col-xs-11
}
?>
</div><!--/.col-->
</div><!--/.row-->
</body>
</html>
+32 -64
View File
@@ -19,6 +19,7 @@
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at>,
* Rudolf Hangl <rudolf.hangl@technikum-wien.at>,
* Manfred Kindl <manfred.kindl@technikum-wien.at>
* Cristina Hainberger <hainberg@technikum-wien.at>
*/
require_once('../../config/cis.config.inc.php');
@@ -27,56 +28,25 @@ require_once('../../include/basis_db.class.php');
require_once('../../include/sprache.class.php');
require_once '../../include/phrasen.class.php';
require_once '../../include/studiengang.class.php';
require_once('../../include/gebiet.class.php');
if (!$db = new basis_db())
die('Fehler beim Oeffnen der Datenbankverbindung');
require_once('../../include/gebiet.class.php');
function getSpracheUser()
{
if(isset($_SESSION['sprache_user']))
{
$sprache_user=$_SESSION['sprache_user'];
}
else
{
if(isset($_COOKIE['sprache_user']))
{
$sprache_user=$_COOKIE['sprache_user'];
}
else
{
$sprache_user=DEFAULT_LANGUAGE;
}
setSpracheUser($sprache_user);
}
return $sprache_user;
}
function setSpracheUser($sprache)
{
$_SESSION['sprache_user']=$sprache;
setcookie('sprache_user',$sprache,time()+60*60*24*30,'/');
}
if(isset($_GET['sprache_user']))
{
$sprache_user = new sprache();
if($sprache_user->load($_GET['sprache_user']))
{
setSpracheUser($_GET['sprache_user']);
}
else
setSpracheUser(DEFAULT_LANGUAGE);
}
$sprache_user = getSpracheUser();
$p = new phrasen($sprache_user);
$sprache = getSprache();
// Start session
session_start();
// If language is changed by language select menu, reset language and session variables
if(isset($_GET['sprache_user']) && !empty($_GET['sprache_user']))
{
$sprache_user = $_GET['sprache_user'];
$_SESSION['sprache_user'] = $_GET['sprache_user'];
}
// Set language variable, which impacts the navigation menu
$sprache_user = (isset($_SESSION['sprache_user']) && !empty($_SESSION['sprache_user'])) ? $_SESSION['sprache_user'] : DEFAULT_LANGUAGE;
$p = new phrasen($sprache_user);
?><!DOCTYPE HTML>
<html>
<head>
@@ -89,6 +59,9 @@ session_start();
<body scroll="no">
<?php
$gebiet_hasMathML = false; // true, wenn irgendein Gebiet eine/n Frage/Vorschlag im MathML-Format enthält
$invalid_gebiete = false;
if (isset($_SESSION['pruefling_id']))
{
//content_id fuer Einfuehrung auslesen
@@ -110,7 +83,7 @@ if (isset($_SESSION['pruefling_id']))
{
echo '
<tr id="tr-einleitung"><td class="ItemTesttool" style="margin-left: 20px;" nowrap>
<a class="ItemTesttool navButton" href="../../cms/content.php?content_id='.$content_id->content_id.'&sprache='.$sprache.'" target="content">'.$p->t('testtool/einleitung').'</a>
<a class="ItemTesttool navButton" href="../../cms/content.php?content_id='.$content_id->content_id.'&sprache='.$sprache_user.'" target="content">'.$p->t('testtool/einleitung').'</a>
</td></tr>
';
}
@@ -183,13 +156,13 @@ if (isset($_SESSION['pruefling_id']))
/* Filter out all Abgewiesene */
AND NOT EXISTS (
SELECT
1
SELECT
1
FROM
tbl_prestudentstatus
WHERE
status_kurzbz = 'Abgewiesener'
AND
WHERE
status_kurzbz = 'Abgewiesener'
AND
prestudent_id = ps_status.prestudent_id
)
@@ -220,7 +193,7 @@ if (isset($_SESSION['pruefling_id']))
)
SELECT DISTINCT ON
SELECT DISTINCT ON
(gebiet_id, semester)
semester,
gebiet_id,
@@ -231,7 +204,7 @@ if (isset($_SESSION['pruefling_id']))
FROM (
SELECT
*
FROM (
FROM (
(SELECT
prestudent_data.semester AS ps_sem,
gebiet_id,
@@ -252,9 +225,9 @@ if (isset($_SESSION['pruefling_id']))
OR
(prestudent_data.semester= 3 AND tbl_ablauf.semester IN (1,3))
)
UNION
(
SELECT
prestudent_data.semester AS ps_sem,
@@ -278,15 +251,12 @@ if (isset($_SESSION['pruefling_id']))
)
) temp
) temp2
GROUP BY
semester,
gebiet_id,
bezeichnung,
bezeichnung_mehrsprachig_1,
bezeichnung_mehrsprachig_2,
bezeichnung_mehrsprachig_3,
bezeichnung_mehrsprachig_4
". $bezeichnung_mehrsprachig_sel ."
ORDER BY
semester,
@@ -296,8 +266,6 @@ if (isset($_SESSION['pruefling_id']))
$result = $db->db_query($qry);
$lastsemester = '';
$quereinsteiger_stg = '';
$gebiet_hasMathML = false; // true, wenn irgendein Gebiet eine/n Frage/Vorschlag im MathML-Format enthält
$invalid_gebiete = false;
while($row = $db->db_fetch_object($result))
{
//Jedes Semester in einer eigenen Tabelle anzeigen
@@ -404,7 +372,7 @@ if (isset($_SESSION['pruefling_id']))
// Link zum Logout
echo '<tr><td class="ItemTesttool" style="margin-left: 20px;" nowrap>
<a class="ItemTesttool navButton" href="login.php?logout" target="content">Logout</a>
<a class="ItemTesttool navButton" href="login.php?logout=true" target="content">Logout</a>
</td></tr>';
echo '</td></tr></table>';
@@ -425,7 +393,7 @@ else
// show message to use Mozilla Firefox
if ((ua.indexOf("Firefox") > -1) == false)
{
let hasMathML = "<?php echo $gebiet_hasMathML; ?>";
let hasMathML = "<?php echo (isset($gebiet_hasMathML)?$gebiet_hasMathML:''); ?>";
let userLang = "<?php echo $sprache_user; ?>";
if (hasMathML == true)
{
@@ -442,7 +410,7 @@ else
// Error massage if check_gebiet function returns false
$(function() {
var invalid_gebiete = "<?php echo $invalid_gebiete; ?>";
var invalid_gebiete = "<?php echo (isset($invalid_gebiete)?$invalid_gebiete:''); ?>";
if(invalid_gebiete == true)
{
$('#tr-einleitung').append('' +
+27 -51
View File
@@ -16,57 +16,33 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* Authors: Manfred Kindl <manfred.kindl@technikum-wien.at>.
* Cristina Hainberger <hainberg@technikum-wien.at>
*/
require_once('../../config/cis.config.inc.php');
require_once('../../include/basis_db.class.php');
require_once('../../include/sprache.class.php');
require_once '../../include/phrasen.class.php';
require_once('../../include/gebiet.class.php');
if (!$db = new basis_db())
die('Fehler beim Oeffnen der Datenbankverbindung');
require_once('../../include/gebiet.class.php');
function getSpracheUser()
// Start session
session_start();
// If language is changed by language select menu, reset session- and language variable
if (isset($_GET['sprache_user']) && !empty($_GET['sprache_user']))
{
if(isset($_SESSION['sprache_user']))
{
$sprache_user=$_SESSION['sprache_user'];
}
else
{
if(isset($_COOKIE['sprache_user']))
{
$sprache_user=$_COOKIE['sprache_user'];
}
else
{
$sprache_user=DEFAULT_LANGUAGE;
}
setSpracheUser($sprache_user);
}
return $sprache_user;
$_SESSION['sprache_user'] = $_GET['sprache_user'];
$sprache_user = $_GET['sprache_user'];
}
function setSpracheUser($sprache)
{
$_SESSION['sprache_user']=$sprache;
setcookie('sprache_user',$sprache,time()+60*60*24*30,'/');
}
// Set language variable, which impacts the language displayed in the language select menu
$sprache_user = (isset($_SESSION['sprache_user']) && !empty($_SESSION['sprache_user'])) ? $_SESSION['sprache_user'] : DEFAULT_LANGUAGE;
if(isset($_GET['sprache_user']))
{
$sprache_user = new sprache();
if($sprache_user->load($_GET['sprache_user']))
{
setSpracheUser($_GET['sprache_user']);
}
else
setSpracheUser(DEFAULT_LANGUAGE);
}
$sprache_user = getSpracheUser();
// The language select menu is only displayed if RT-Ablauf of STG allows to switch language
$display = (isset($_SESSION['sprache_auswahl']) && $_SESSION['sprache_auswahl'] == true) ? '' : 'hidden';
$p = new phrasen($sprache_user);
?>
@@ -85,16 +61,15 @@ $p = new phrasen($sprache_user);
<script type="text/javascript">
function changeSprache(sprache)
{
var content = '';
content = parent.content.location.pathname+parent.content.location.search;
window.location.href="topbar.php?sprache_user="+sprache;
parent.menu.location.href="menu.php?sprache_user="+sprache;
// Add or replace param 'sprache_user' to the contents URL
var content_url = new URL(parent.content.location); // url of contents' frame page (login.php or frage.php)
var content_params = new URLSearchParams(content_url.search.slice(1)); // retrieve the querystring params
content_params.set('sprache_user', sprache); // add or replace sprache_user
if (parent.content.location.search=='')
parent.content.location.href=content+"?sprache_user="+sprache;
else
parent.content.location.href=content+"&sprache_user="+sprache;
// Pass GET-param sprache_user to topbar.php, menu.php and content (login.php or frage.php) and refresh the frames.
location.href = location.pathname + '?sprache_user=' + sprache; // refreshes topbar.php
parent.menu.location.href = parent.menu.location.pathname + '?sprache_user=' + sprache; // refreshes menu.php
parent.content.location.href = parent.content.location.pathname + '?' + content_params; // refreshes login.php or frage.php
}
</script>
<body>
@@ -104,15 +79,17 @@ echo ' <table style="background-image: url(../../skin/images/header_testtool.png
<td valign="top" align="left">
<a href="index.html" target="_top"><img class="header_logo" style="min-height:65%; left: 16px; top: 10%;" src="../../skin/styles/'.DEFAULT_STYLE.'/logo_250x130.png" alt="logo"></a>
</td>
<td valign="middle">
<!--The language select menu is hidden by default.
Only displayed if RT-Ablauf of STG allows to switch language.-->
<td id="select_sprache" '. $display. '>
<div class="form-group form-inline pull-right">
<!-- <label for="select-sprache">Sprache Menü:&nbsp;&nbsp;</label>-->
<select id="select-sprache" class="form-control" style="width: 170px; margin-right: 50px;" onchange="if (typeof(this.value) != \'undefined\') changeSprache(this.value)">';
$sprache = new sprache();
$sprache->getAll(true);
foreach($sprache->result as $row)
{
echo ' <option value="'. $row->sprache. '" '.($row->sprache==$sprache_user?'selected':'').'>'.($row->bezeichnung_arr[getSprache()]).'&nbsp;&nbsp;</option>';
echo ' <option value="'. $row->sprache. '" '.($row->sprache == $sprache_user ? 'selected' : '').'>'.($row->bezeichnung_arr[$sprache_user]).'&nbsp;&nbsp;</option>';
}
echo '
</select>
@@ -140,4 +117,3 @@ echo ' <table style="background-image: url(../../skin/images/header_testtool.png
+221
View File
@@ -0,0 +1,221 @@
<?php
/* Copyright (C) 2011 FH Technikum Wien
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* Authors: Christian Paminger <christian.paminger@technikum-wien.at>,
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at> and
* Karl Burkhart <karl.burkhart@technikum-wien.at>.
*/
/**
* Zeigt eine Übersichtsliste für alle Content-Einträge an
*/
require_once('../config/cis.config.inc.php');
require_once('../config/global.config.inc.php');
require_once('../include/content.class.php');
require_once('../include/template.class.php');
require_once('../include/functions.inc.php');
require_once('../include/phrasen.class.php');
$db = new basis_db();
echo '<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="../skin/style.css.php" rel="stylesheet" type="text/css">';
include('../include/meta/jquery.php');
include('../include/meta/jquery-tablesorter.php');
echo ' </head>
<script type="text/javascript">
// For correct sorting of Umlauts
$.tablesorter.characterEquivalents = {
"a" : "\u00e1\u00e0\u00e2\u00e3\u00e4\u0105\u00e5", // áàâãäąå
"A" : "\u00c1\u00c0\u00c2\u00c3\u00c4\u0104\u00c5", // ÁÀÂÃÄĄÅ
"c" : "\u00e7\u0107\u010d", // çćč
"C" : "\u00c7\u0106\u010c", // ÇĆČ
"e" : "\u00e9\u00e8\u00ea\u00eb\u011b\u0119", // éèêëěę
"E" : "\u00c9\u00c8\u00ca\u00cb\u011a\u0118", // ÉÈÊËĚĘ
"i" : "\u00ed\u00ec\u0130\u00ee\u00ef\u0131", // íìİîïı
"I" : "\u00cd\u00cc\u0130\u00ce\u00cf", // ÍÌİÎÏ
"o" : "\u00f3\u00f2\u00f4\u00f5\u00f6\u014d", // óòôõöō
"O" : "\u00d3\u00d2\u00d4\u00d5\u00d6\u014c", // ÓÒÔÕÖŌ
"ss": "\u00df", // ß (s sharp)
"SS": "\u1e9e", // ẞ (Capital sharp s)
"u" : "\u00fa\u00f9\u00fb\u00fc\u016f", // úùûüů
"U" : "\u00da\u00d9\u00db\u00dc\u016e" // ÚÙÛÜŮ
};
$.tablesorter.addParser({
id: "customDate",
is: function(s) {
//return false;
//use the above line if you don\'t want table sorter to auto detected this parser
//else use the below line.
//attention: doesn\'t check for invalid stuff
//2009-77-77 77:77:77.0 would also be matched
//if that doesn\'t suit you alter the regex to be more restrictive
//return /\d{1,4}-\d{1,2}-\d{1,2} \d{1,2}:\d{1,2}:\d{1,2}\.\d+/.test(s);
return /\d{1,4}-\d{1,2}-\d{1,2} \d{1,2}:\d{1,2}:\d{1,2} .*/.test(s);
},
format: function(s) {
s = s.replace(/\-/g," ");
s = s.replace(/:/g," ");
s = s.replace(/\./g," ");
s = s.split(" ");
return $.tablesorter.formatFloat(new Date(s[0], s[1]-1, s[2], s[3], s[4], s[5]).getTime());
},
type: "numeric"
});
$(document).ready(function()
{
$("#t1").tablesorter(
{
sortList: [[1,0],[0,1]],
widgets: ["zebra", "filter", "stickyHeaders"],
headers: { 5: { sorter: "customDate"}, 10: { sorter: "customDate"}},
sortLocaleCompare : true
});
});
</script>
<style>
table.tablesorter tbody td
{
padding: 5px;
}
</style>
<body>
<div style="padding: 10px">
<h1>Content-Übersicht</h1>';
echo '<br><br><table class="tablesorter" id="t1"><thead>';
echo '<tr>';
echo ' <th>Content ID</th>
<th>Titel</th>
<th>Art</th>
<th>OE</th>
<th>Content-Aktiv</th>
<th>Eingefügt</th>
<th>Aktualisiert</th>
<th>Verwendet in</th>
<th>Sprache</th>
<th>Version</th>
<th>Eingefügt</th>
<th>Aktualisiert</th>
<th>Version sichtbar</th>';
echo '</tr></thead><tbody>';
$qry = "
SELECT
content.content_id,
tbl_contentsprache.titel,
content.template_kurzbz,
content.oe_kurzbz,
content.aktiv,
content.insertamum||' von '||content.insertvon AS content_eingefuegt,
content.updateamum||' von '||content.updatevon AS content_aktualisiert,
(
SELECT ARRAY_TO_STRING(array_agg(verwendung), '<br>') AS verwendung_in
FROM (
SELECT
'Infoscreen ID'||infoscreen_id AS art
FROM campus.tbl_infoscreen_content
WHERE content_id=content.content_id
UNION
SELECT
'Software ID'||software_id AS art
FROM addon.tbl_software
WHERE content_id=content.content_id
UNION
SELECT
'Ort '||ort_kurzbz AS art
FROM public.tbl_ort
WHERE content_id=content.content_id
UNION
SELECT
'Service ID'||service_id AS art
FROM public.tbl_service
WHERE content_id=content.content_id
UNION
SELECT
'Statistik '||statistik_kurzbz AS art
FROM public.tbl_statistik
WHERE content_id=content.content_id
UNION
SELECT
'Gebiet '||tbl_gebiet.bezeichnung||' in Studiengang '||tbl_ablauf.studiengang_kz AS art
FROM testtool.tbl_ablauf_vorgaben
JOIN testtool.tbl_ablauf USING (ablauf_vorgaben_id)
JOIN testtool.tbl_gebiet USING (gebiet_id)
WHERE content_id=content.content_id
UNION
SELECT
'Verlinkung von '||content_id AS art
FROM campus.tbl_contentsprache
WHERE content::text LIKE '%content.php?content_id='||content.content_id||'%'
/*WHERE content::text ~* '[\w\d\s]*content\.php\?content_id=1245[\w\d\s]*'*/
) verwendung
) AS verwendung_in,
tbl_contentsprache.sprache,
tbl_contentsprache.version,
tbl_contentsprache.insertamum||' von '||tbl_contentsprache.insertvon AS contentsprache_eingefuegt,
tbl_contentsprache.updateamum||' von '||tbl_contentsprache.updatevon AS contentsprache_aktualisiert,
tbl_contentsprache.sichtbar
FROM campus.tbl_content content
JOIN campus.tbl_contentsprache USING (content_id)
WHERE version=campus.get_highest_content_version (content.content_id)
AND template_kurzbz NOT IN ('news')
/*ORDER BY content_id ASC, sprache DESC, version DESC
LIMIT 200*/";
if($db->db_query($qry))
{
while ($row = $db->db_fetch_object())
{
echo ' <tr>
<td>'.$row->content_id.'</td>
<td>'.$row->titel.'</td>
<td>'.$row->template_kurzbz.'</td>
<td>'.$row->oe_kurzbz.'</td>
<td>'.($row->aktiv == 't' ? 'Ja':'Nein').'</td>
<td>'.$row->content_eingefuegt.'</td>
<td>'.$row->content_aktualisiert.'</td>
<td>'.$row->verwendung_in.'</td>
<td>'.$row->sprache.'</td>
<td>'.$row->version.'</td>
<td>'.$row->contentsprache_eingefuegt.'</td>
<td>'.$row->contentsprache_aktualisiert.'</td>
<td>'.($row->sichtbar == 't' ? 'Ja':'Nein').'</td>
</tr>';
}
}
echo '</tbody></table>';
echo ' </div></body>
</html>';
?>
+1
View File
@@ -83,6 +83,7 @@ if($doc->isLocked($id))
if (CAMPUS_NAME == 'FH Technikum Wien')
{
$dokumente_arr[] .= 'ZgvBaPre';
$dokumente_arr[] .= 'ZgvMaPre';
$dokumente_arr[] .= 'InvitLet';
}
if ($person_id!=$akte_person || !in_array($akte_dokument_kurzbz, $dokumente_arr))
+1 -2
View File
@@ -436,11 +436,10 @@ function getStgContent($studiengang_kz, $semester, $sprache)
if(CIS_EXT_MENU)
{
$xml.='<cis_ext_menu>
<lehrziele_name><![CDATA['.$p->t('global/lehrziele').']]></lehrziele_name>
<download_name><![CDATA['.$p->t('global/allgemeinerdownload').']]></download_name>
<newsgroup_name><![CDATA['.$p->t('global/newsgroups').']]></newsgroup_name>
<kurzbz><![CDATA['.strtolower($studiengang->kuerzel).']]></kurzbz>
<kurzbzlang><![CDATA['.strtolower($studiengang->kurzbzlang).']]></kurzbzlang>
<stg_kz><![CDATA['. $studiengang_kz.']]></stg_kz>
</cis_ext_menu>';
}
+3 -2
View File
@@ -179,7 +179,7 @@
"name": "nicolaskruchten/pivottable",
"version": "2.15.0",
"dist": {
"url": "https://github.com/nicolaskruchten/pivottable/archive/v2.15.0.zip",
"url": "https://github.com/nicolaskruchten/pivottable/archive/v2.21.0.zip",
"type": "zip"
}
}
@@ -250,6 +250,7 @@
"borgar/textile-js": "2.0.4",
"BlackrockDigital/startbootstrap-sb-admin-2": "^3.3",
"chriskacerguis/codeigniter-restserver": "^3.0",
"christianbach/tablesorter": "^1.0",
"codeigniter/framework": "3.*",
"components/jquery": "^3.2",
@@ -281,7 +282,7 @@
"nategood/httpful": "^0.2.20",
"netcarver/textile": "^3.5",
"nicolaskruchten/pivottable": "^2.15.0",
"nicolaskruchten/pivottable": "^2.21.0",
"olifolkerd/tabulator": "4.2.7",
Generated
+152 -71
View File
@@ -4,8 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "e3de1eee238160400fb63f68735b4144",
"content-hash": "5b71e8a3c356d52e43d788eb6f018151",
"hash": "44a02c1e72626f05e682de2030c8adad",
"content-hash": "e0898c2ba3d18593851989029e54bedb",
"packages": [
{
"name": "BlackrockDigital/startbootstrap-sb-admin-2",
@@ -47,7 +47,7 @@
],
"description": "Defacto way to enable use of HTML5 sectioning elements in legacy Internet Explorer.",
"homepage": "http://paulirish.com/2011/the-history-of-the-html5-shiv/",
"time": "2015-07-20 20:04:00"
"time": "2015-07-20T20:04:00+00:00"
},
{
"name": "alvaro-prieto/colResizable",
@@ -71,6 +71,45 @@
},
"type": "library"
},
{
"name": "chriskacerguis/codeigniter-restserver",
"version": "3.0.3",
"source": {
"type": "git",
"url": "https://github.com/chriskacerguis/codeigniter-restserver.git",
"reference": "3a5ba0dffdebd24cc215ef714b72208c88304203"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/chriskacerguis/codeigniter-restserver/zipball/3a5ba0dffdebd24cc215ef714b72208c88304203",
"reference": "3a5ba0dffdebd24cc215ef714b72208c88304203",
"shasum": ""
},
"require": {
"codeigniter/framework": "^3.0.4",
"php": ">=5.4.0"
},
"type": "library",
"autoload": {
"classmap": [
"application/libraries/Format.php",
"application/libraries/REST_Controller.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Chris Kacerguis",
"role": "Developer"
}
],
"description": "REST Server for the CodeIgniter framework",
"homepage": "https://github.com/chriskacerguis/codeigniter-restserver",
"time": "2017-09-23 16:44:55"
},
{
"name": "christianbach/tablesorter",
"version": "1.0.1",
@@ -87,7 +126,7 @@
},
"type": "library",
"notification-url": "https://packagist.org/downloads/",
"time": "2016-09-02 11:31:54"
"time": "2016-09-02T11:31:54+00:00"
},
{
"name": "codeigniter/framework",
@@ -120,7 +159,7 @@
],
"description": "The CodeIgniter framework",
"homepage": "https://codeigniter.com",
"time": "2019-01-16 15:49:35"
"time": "2019-01-16T15:49:35+00:00"
},
{
"name": "components/angular.js",
@@ -424,7 +463,7 @@
],
"description": "Shim repository for Angular.js",
"homepage": "http://angularjs.org",
"time": "2015-06-07 20:10:38"
"time": "2015-06-07T20:10:38+00:00"
},
{
"name": "components/font-awesome",
@@ -459,7 +498,7 @@
"OFL-1.1"
],
"description": "The iconic font designed for use with Twitter Bootstrap.",
"time": "2016-10-25 10:56:23"
"time": "2016-10-25T10:56:23+00:00"
},
{
"name": "components/jquery",
@@ -501,7 +540,7 @@
],
"description": "jQuery JavaScript Library",
"homepage": "http://jquery.com",
"time": "2018-03-04 13:23:48"
"time": "2018-03-04T13:23:48+00:00"
},
{
"name": "components/jqueryui",
@@ -586,7 +625,7 @@
}
],
"description": "jQuery UI is a curated set of user interface interactions, effects, widgets, and themes built on top of the jQuery JavaScript Library. Whether you're building highly interactive web applications or you just need to add a date picker to a form control, jQuery UI is the perfect choice.",
"time": "2016-09-16 05:47:55"
"time": "2016-09-16T05:47:55+00:00"
},
{
"name": "easyrdf/easyrdf",
@@ -648,7 +687,7 @@
"rdfa",
"sparql"
],
"time": "2015-02-27 09:45:49"
"time": "2015-02-27T09:45:49+00:00"
},
{
"name": "fgelinas/timepicker",
@@ -658,6 +697,12 @@
"url": "https://github.com/fgelinas/timepicker",
"reference": "9aebe413b784696639220bc36b7c1e8a30fda129"
},
"dist": {
"type": "zip",
"url": "https://fgelinas.com/code/timepicker/releases/jquery-ui-timepicker-0.3.3.zip",
"reference": null,
"shasum": null
},
"type": "library"
},
{
@@ -708,7 +753,7 @@
"faker",
"fixtures"
],
"time": "2018-07-12 10:23:15"
"time": "2018-07-12T10:23:15+00:00"
},
{
"name": "joeldbirch/superfish",
@@ -850,7 +895,7 @@
"json",
"schema"
],
"time": "2014-08-25 02:48:14"
"time": "2014-08-25T02:48:14+00:00"
},
{
"name": "kevinlebrun/colors.php",
@@ -901,7 +946,7 @@
"console",
"shell"
],
"time": "2018-05-30 08:34:23"
"time": "2018-05-30T08:34:23+00:00"
},
{
"name": "kingsquare/json-schema-form",
@@ -935,17 +980,11 @@
}
],
"description": "A framework-agnostic PHP Implementation for generating simple forms based on json-schema",
"time": "2014-07-10 12:27:19"
"time": "2014-07-10T12:27:19+00:00"
},
{
"name": "ludo/jquery-treetable",
"version": "3.2.0",
"dist": {
"type": "zip",
"url": "https://github.com/ludo/jquery-treetable/archive/3.2.0.zip",
"reference": null,
"shasum": null
},
"type": "library"
},
{
@@ -997,7 +1036,7 @@
"keywords": [
"markdown"
],
"time": "2015-03-01 12:03:08"
"time": "2015-03-01T12:03:08+00:00"
},
{
"name": "ml/iri",
@@ -1044,7 +1083,7 @@
"uri",
"url"
],
"time": "2014-01-21 13:43:39"
"time": "2014-01-21T13:43:39+00:00"
},
{
"name": "ml/json-ld",
@@ -1093,7 +1132,7 @@
"JSON-LD",
"jsonld"
],
"time": "2018-11-18 20:26:18"
"time": "2018-11-18T20:26:18+00:00"
},
{
"name": "moment/momentjs",
@@ -1155,7 +1194,7 @@
"sorting",
"table"
],
"time": "2018-11-20 21:54:28"
"time": "2018-11-20T21:54:28+00:00"
},
{
"name": "nategood/httpful",
@@ -1205,7 +1244,7 @@
"rest",
"restful"
],
"time": "2015-10-26 16:11:30"
"time": "2015-10-26T16:11:30+00:00"
},
{
"name": "netcarver/textile",
@@ -1258,18 +1297,54 @@
"plaintext",
"textile"
],
<<<<<<< HEAD
"time": "2019-06-08 17:57:17"
=======
"time": "2019-01-26T17:03:58+00:00"
>>>>>>> master
},
{
"name": "nicolaskruchten/pivottable",
"version": "2.15.0",
"version": "v2.23.0",
"source": {
"type": "git",
"url": "https://github.com/nicolaskruchten/pivottable.git",
"reference": "a9cabee5382be0aaf0984ac906d9fa2e0376d2c1"
},
"dist": {
"type": "zip",
"url": "https://github.com/nicolaskruchten/pivottable/archive/v2.15.0.zip",
"reference": null,
"shasum": null
"url": "https://api.github.com/repos/nicolaskruchten/pivottable/zipball/a9cabee5382be0aaf0984ac906d9fa2e0376d2c1",
"reference": "a9cabee5382be0aaf0984ac906d9fa2e0376d2c1",
"shasum": ""
},
"type": "library"
"require": {
"components/jquery": ">=1.9"
},
"type": "library",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Kruchten",
"email": "nicolas@kruchten.com"
}
],
"description": "Javascript Pivot Table (aka Pivot Grid, Pivot Chart, Cross-Tab) implementation with drag'n'drop.",
"homepage": "https://pivottable.js.org/",
"keywords": [
"crosstab",
"grid",
"jquery",
"jquery-plugin",
"pivot",
"pivotchart",
"pivotgrid",
"pivottable",
"table"
],
"time": "2018-11-04T18:21:09+00:00"
},
{
"name": "olifolkerd/tabulator",
@@ -1327,28 +1402,28 @@
"authors": [
{
"name": "Jim Wigginton",
"email": "terrafrost@php.net",
"role": "Lead Developer"
"role": "Lead Developer",
"email": "terrafrost@php.net"
},
{
"name": "Patrick Monnerat",
"email": "pm@datasphere.ch",
"role": "Developer"
"role": "Developer",
"email": "pm@datasphere.ch"
},
{
"name": "Andreas Fischer",
"email": "bantu@phpbb.com",
"role": "Developer"
"role": "Developer",
"email": "bantu@phpbb.com"
},
{
"name": "Hans-Jürgen Petrich",
"email": "petrich@tronic-media.com",
"role": "Developer"
"role": "Developer",
"email": "petrich@tronic-media.com"
},
{
"name": "Graham Campbell",
"email": "graham@alt-three.com",
"role": "Developer"
"role": "Developer",
"email": "graham@alt-three.com"
}
],
"description": "PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.",
@@ -1372,7 +1447,11 @@
"x.509",
"x509"
],
<<<<<<< HEAD
"time": "2019-06-23 16:33:11"
=======
"time": "2019-03-10T16:53:45+00:00"
>>>>>>> master
},
{
"name": "psr/log",
@@ -1419,7 +1498,7 @@
"psr",
"psr-3"
],
"time": "2018-11-20 15:27:04"
"time": "2018-11-20T15:27:04+00:00"
},
{
"name": "rdlowrey/auryn",
@@ -1480,17 +1559,11 @@
"dic",
"ioc"
],
"time": "2017-05-15 06:26:46"
"time": "2017-05-15T06:26:46+00:00"
},
{
"name": "rmariuzzo/jquery-checkboxes",
"version": "1.0.7",
"dist": {
"type": "zip",
"url": "https://github.com/rmariuzzo/checkboxes.js/archive/v1.0.7.zip",
"reference": null,
"shasum": null
},
"type": "library"
},
{
@@ -1542,7 +1615,7 @@
"php",
"template"
],
"time": "2016-02-01 16:31:13"
"time": "2016-02-01T16:31:13+00:00"
},
{
"name": "rougin/combustor",
@@ -1607,7 +1680,7 @@
"generator",
"php"
],
"time": "2016-02-14 10:36:58"
"time": "2016-02-14T10:36:58+00:00"
},
{
"name": "rougin/describe",
@@ -1660,7 +1733,7 @@
"describe",
"php"
],
"time": "2016-03-24 18:17:47"
"time": "2016-03-24T18:17:47+00:00"
},
{
"name": "rougin/refinery",
@@ -1725,7 +1798,7 @@
"php",
"refinery"
],
"time": "2016-03-04 16:55:32"
"time": "2016-03-04T16:55:32+00:00"
},
{
"name": "rougin/spark-plug",
@@ -1784,7 +1857,7 @@
"php",
"spark-plug"
],
"time": "2015-10-23 08:27:10"
"time": "2015-10-23T08:27:10+00:00"
},
{
"name": "scottjehl/Respond",
@@ -1856,7 +1929,7 @@
],
"description": "Symfony Console Component",
"homepage": "https://symfony.com",
"time": "2018-11-20 15:55:20"
"time": "2018-11-20T15:55:20+00:00"
},
{
"name": "symfony/debug",
@@ -1913,7 +1986,7 @@
],
"description": "Symfony Debug Component",
"homepage": "https://symfony.com",
"time": "2016-07-30 07:22:48"
"time": "2016-07-30T07:22:48+00:00"
},
{
"name": "symfony/polyfill-ctype",
@@ -1971,7 +2044,7 @@
"polyfill",
"portable"
],
"time": "2019-02-06 07:57:58"
"time": "2019-02-06T07:57:58+00:00"
},
{
"name": "symfony/polyfill-mbstring",
@@ -2030,7 +2103,7 @@
"portable",
"shim"
],
"time": "2019-02-06 07:57:58"
"time": "2019-02-06T07:57:58+00:00"
},
{
"name": "symfony/yaml",
@@ -2080,7 +2153,7 @@
],
"description": "Symfony Yaml Component",
"homepage": "https://symfony.com",
"time": "2018-11-11 11:18:13"
"time": "2018-11-11T11:18:13+00:00"
},
{
"name": "tapmodo/Jcrop",
@@ -2137,7 +2210,11 @@
"tinymce",
"wysiwyg"
],
<<<<<<< HEAD
"time": "2019-07-03 01:28:44"
=======
"time": "2019-03-20T13:56:58+00:00"
>>>>>>> master
},
{
"name": "tomazdragar/SimpleCropper",
@@ -2198,7 +2275,7 @@
"responsive",
"web"
],
"time": "2019-02-13 15:55:38"
"time": "2019-02-13T15:55:38+00:00"
},
{
"name": "twig/twig",
@@ -2244,19 +2321,19 @@
"authors": [
{
"name": "Fabien Potencier",
"role": "Lead Developer",
"email": "fabien@symfony.com",
"homepage": "http://fabien.potencier.org",
"role": "Lead Developer"
"homepage": "http://fabien.potencier.org"
},
{
"name": "Armin Ronacher",
"email": "armin.ronacher@active-4.com",
"role": "Project Founder"
"role": "Project Founder",
"email": "armin.ronacher@active-4.com"
},
{
"name": "Twig Team",
"homepage": "https://twig.symfony.com/contributors",
"role": "Contributors"
"role": "Contributors",
"homepage": "https://twig.symfony.com/contributors"
}
],
"description": "Twig, the flexible, fast, and secure template language for PHP",
@@ -2264,7 +2341,11 @@
"keywords": [
"templating"
],
<<<<<<< HEAD
"time": "2019-06-18 15:35:16"
=======
"time": "2019-05-14T11:59:08+00:00"
>>>>>>> master
},
{
"name": "zetacomponents/base",
@@ -2328,7 +2409,7 @@
],
"description": "The Base package provides the basic infrastructure that all packages rely on. Therefore every component relies on this package.",
"homepage": "https://github.com/zetacomponents",
"time": "2017-11-28 11:30:00"
"time": "2017-11-28T11:30:00+00:00"
},
{
"name": "zetacomponents/database",
@@ -2405,7 +2486,7 @@
],
"description": "A lightweight database layer on top of PHP's PDO that allows you to utilize a database without having to take care of differences in SQL dialects.",
"homepage": "https://github.com/zetacomponents",
"time": "2017-11-28 10:55:26"
"time": "2017-11-28T10:55:26+00:00"
},
{
"name": "zetacomponents/document",
@@ -2456,7 +2537,7 @@
],
"description": "The Document components provides a general conversion framework for different semantic document markup languages like XHTML, Docbook, RST and similar.",
"homepage": "https://github.com/zetacomponents",
"time": "2013-12-19 11:40:00"
"time": "2013-12-19T11:40:00+00:00"
},
{
"name": "zetacomponents/workflow",
@@ -2522,7 +2603,7 @@
],
"description": "The purpose of the Workflow component is to provide the core functionality of an activity-based workflow system including the definition and execution of workflow specifications.",
"homepage": "https://github.com/zetacomponents",
"time": "2014-09-27 19:26:10"
"time": "2014-09-27T19:26:10+00:00"
},
{
"name": "zetacomponents/workflow-database-tiein",
@@ -2589,7 +2670,7 @@
],
"description": "Contains the database backend for the Workflow component.",
"homepage": "https://github.com/zetacomponents",
"time": "2014-09-27 19:26:10"
"time": "2014-09-27T19:26:10+00:00"
},
{
"name": "zetacomponents/workflow-event-log-tiein",
@@ -2649,7 +2730,7 @@
],
"description": "Contains the EventLog listener for the Workflow component.",
"homepage": "https://github.com/zetacomponents",
"time": "2007-12-17 09:04:44"
"time": "2007-12-17T09:04:44+00:00"
}
],
"packages-dev": [],
+5
View File
@@ -216,6 +216,8 @@ define('CIS_DOKUMENTE_SELFSERVICE', true);
//**** INFOSCREEN ****
//Gibt an, ob der Lageplan im Infoterminal angezeigt werden soll.
define('CIS_INFOSCREEN_LAGEPLAN_ANZEIGEN',true);
//Gibt an, ob News im Infoterminal angezeigt werden soll.
define('CIS_INFOSCREEN_NEWS_ANZEIGEN',false);
//User, welcher für das Anlegen von Anrechnungen bei der Prüfungsanmeldung verwendet wird
define('CIS_PRUEFUNGSANMELDUNG_USER','p.pruefungsanmeldung');
@@ -234,6 +236,9 @@ define('CIS_PRUEFUNGSANMELDUNG_ANRECHNUNG', true);
//Gibt an, ob der Bereich zur Anmeldung zu Pruefungen des gesamten Studiengangs angezeigt werden soll
define('CIS_PRUEFUNGSANMELDUNG_LEHRVERANSTALTUNGEN_AUS_STUDIENGANG', true);
//Gibt an, ob mehrere Pruefungen zur selben Zeit im selben Raum stattfinden duerfen
define('CIS_PRUEFUNGSANMELDUNG_ERLAUBE_TERMINKOLLISION', true);
//Gibt an, wie viele Semester aus der Vergangenheit unter Meine LV angezeigt werden
define('CIS_MEINELV_ANZAHL_SEMESTER_PAST', 3);
+6 -4
View File
@@ -9,6 +9,9 @@ define('DEFAULT_LEHREINHEIT_LEHRFORM','UE');
// Defaul Trennzeichen fuer E-Mail Empfaenger wenn nicht ueber Variablen ueberschrieben
define('DEFAULT_EMAILADRESSENTRENNZEICHEN',',');
// Gibt an ob neue Mitarbeiter per default fixangestellt sind oder nicht
define('DEFAULT_MITARBEITER_FIXANGESTELLT', true);
//Anzeigeoptionen für Lehrveranstaltungen im CIS
define('CIS_LEHRVERANSTALTUNG_NEWSGROUPS_ANZEIGEN',true);
define('CIS_LEHRVERANSTALTUNG_FEEDBACK_ANZEIGEN',true);
@@ -196,6 +199,9 @@ define('SET_UID_AS_PERSONENKENNZEICHEN',false);
// Legt fest ob fuer Studierende eine Alias EMail Adresse generiert wird (true|false)
define('GENERATE_ALIAS_STUDENT',true);
// gibt an ob beim Anlegen von Mitarbeitern ein Alias generiert wird.
define('GENERATE_ALIAS_MITARBEITERIN',true);
// Wie viele Tage nach Semesterstart soll bei der Neuanlage von Studierenden noch das aktuelle Semester vorgeschlagen werden.
define('VILESCI_PERSON_NEU_STUDIENSEMESTER_UEBERGANGSFRIST',30);
@@ -259,8 +265,4 @@ define('STATUSGRUND_ID_EINSTIEG_SOMMERSEMESTER', null);
// Studiengangs_kz des Studiengangs "Qualifikationskurse". Der Studiengang hat eine Sonderstellung zB für das Bewerbungstool.
define('STUDIENGANG_KZ_QUALIFIKATIONKURSE', null);
// EinsteigerInnen ins Sommersemester werden mit einem Statusgrund versehen.
// Die ID dieses Statusgrundes kann hier eingegeben werden. Es wird zB vom Infocenter-Tool gesetzt und im Bewerbungstool abgefragt
define('STATUSGRUND_ID_EINSTIEG_SOMMERSEMESTER', null);
?>
+1 -1
View File
@@ -168,7 +168,7 @@ if(isset($_POST['submitbild']))
if(isset($_GET['person_id']))
{
$dokument = new dokument();
$dokument->getAllDokumente('Zeugnis');
$dokument->getAllDokumente('Zeugnis,DiplSupp,Bescheid');
echo " <!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'>
<html>
+2 -2
View File
@@ -116,7 +116,7 @@ var studentDDObserver=
uid = tree.view.getCellText(v,col);
if(uid=='')
{
alert('Es koennen nur Personen mit UID (Studenten/Mitarbeiter) verschoben werden');
alert('Es koennen nur Personen mit UID (Studierende/Mitarbeitende) verschoben werden');
return false;
}
paramList += ';'+uid;
@@ -295,7 +295,7 @@ var LektorFunktionDDObserver=
if(stg=='')
{
alert('Mitarbeiter kann nur auf einen Studiengang gezogen werden');
alert('MitarbeiterIn kann nur auf einen Studiengang gezogen werden');
return false;
}

Some files were not shown because too many files have changed in this diff Show More