mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-21 17:02:19 +00:00
Compare commits
127 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a78fc177a5 | |||
| 4c1d88a054 | |||
| 280df46d6d | |||
| 3e17e99ce9 | |||
| 790d0d99ec | |||
| 5499c522cb | |||
| ac5478f176 | |||
| 1805fc643e | |||
| af7ca6b524 | |||
| 2630a1190b | |||
| 0be1bb95a5 | |||
| 91a691c5f8 | |||
| 4edec4df00 | |||
| f5cd0f1a5d | |||
| 688f815178 | |||
| 273b1d3fe4 | |||
| de60d0d09e | |||
| 245b724314 | |||
| 10a5aaf9b4 | |||
| 544c6e7319 | |||
| a7ddc0d348 | |||
| 1e2cafef1d | |||
| 4205e490ef | |||
| 55ba874bb0 | |||
| 90eb25716d | |||
| bc7fc9611b | |||
| 1ecf011ba2 | |||
| 2f90112e4d | |||
| 774eb90bcc | |||
| bccaf72399 | |||
| 1def930147 | |||
| 30b8a406a5 | |||
| 093842274e | |||
| 64b6e4a009 | |||
| 40c18d3603 | |||
| fd2f4187fa | |||
| d948251736 | |||
| b2bebb7fa3 | |||
| e32cce57fe | |||
| af3d96abc7 | |||
| dc05d16545 | |||
| cb7a0f7669 | |||
| 68d97a5e97 | |||
| d27071528f | |||
| 17772c3738 | |||
| bbb4f8a01c | |||
| bf5ab6b7dd | |||
| fdbb93a5c5 | |||
| b7e48633ab | |||
| 04dc1eb07b | |||
| 50b229090b | |||
| 2d27a998c4 | |||
| 090e535466 | |||
| c4d35181db | |||
| 0ac6ef4599 | |||
| 7f13c128f1 | |||
| cb60ddcc94 | |||
| bd4ced9559 | |||
| a04d2acb86 | |||
| de2aabf00b | |||
| 685fc69e5d | |||
| 58a921b500 | |||
| 552faefa51 | |||
| 954397f028 | |||
| 80faa61c91 | |||
| 961ede66a9 | |||
| 6fec8382b5 | |||
| 4eb076d115 | |||
| 7427aa87ea | |||
| 85043e57db | |||
| 5beddbccb4 | |||
| e2ae9b88c8 | |||
| ca3abf9154 | |||
| f863c6d728 | |||
| 92a2053b42 | |||
| 70602be54e | |||
| dac71f597a | |||
| 3a646ffe77 | |||
| 26db4a5e7a | |||
| 98a10a2f55 | |||
| e48b94b858 | |||
| 13e8a1a9f6 | |||
| 0ff29ba6af | |||
| ba543448ae | |||
| f121f9b5a2 | |||
| 88b22f5490 | |||
| 4b7ee9abe1 | |||
| d499619cf3 | |||
| f489153ff3 | |||
| 9b79a07fa2 | |||
| 6ce14a25d7 | |||
| c701d92779 | |||
| 73e03ba901 | |||
| 95a7797ae9 | |||
| 3ce3eff022 | |||
| 21d80905a2 | |||
| 3a91b12f31 | |||
| ea0a249612 | |||
| 843894405e | |||
| 8fddbc3a32 | |||
| b2538075ee | |||
| 5c463c0866 | |||
| 423bbd95a6 | |||
| 386cc779bf | |||
| 08c6d58a50 | |||
| 3f53c5feba | |||
| 298dbbf400 | |||
| 2c057aad58 | |||
| 627a52e3d1 | |||
| 059b13938e | |||
| 36beb927f1 | |||
| ee41b2b68d | |||
| 6b816def31 | |||
| 5fbcf588ed | |||
| 41b2a6d1d4 | |||
| e054f1222b | |||
| c57eb1b8de | |||
| d1015956d1 | |||
| 726fce9fac | |||
| 27a91de5f6 | |||
| 7ccc26c878 | |||
| 9ebc847e8e | |||
| 511b04c1f8 | |||
| ec90d35e02 | |||
| 38e8f91fdf | |||
| ba6224bc78 | |||
| d542cf7720 |
@@ -119,6 +119,10 @@ $route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/prestudent/(:num)'] = 'a
|
||||
// // (studiensemester_kurzbz)/person/(person_id)
|
||||
$route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/person/(:num)'] = 'api/frontend/v1/stv/Students/getPerson/$1/$2';
|
||||
|
||||
|
||||
$route['lvplan/caldav'] = 'LvPlanCalDAV';
|
||||
$route['lvplan/caldav/.*'] = 'LvPlanCalDAV';
|
||||
|
||||
// load routes from extensions, also look for environment-specific configs
|
||||
$subdirs = ['application/config/extensions', 'application/config/' . ENVIRONMENT . '/extensions'];
|
||||
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
*/
|
||||
class LvPlanCalDAV extends FHC_Controller
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->library('sabredav/SabreDAVAuthLib');
|
||||
$this->load->library('sabredav/SabreDAVCalDAVLib');
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
public function index()
|
||||
{
|
||||
|
||||
$authBackend = new SabreDAVAuthLib();
|
||||
$principalBackend = new SabreDAVACLPrincipalBackend($authBackend);
|
||||
$calendarBackend = new SabreDAVCalDAVBackend($authBackend);
|
||||
|
||||
$tree = array(
|
||||
new \Sabre\CalDAV\Principal\Collection($principalBackend),
|
||||
new \Sabre\CalDAV\CalendarRoot($principalBackend, $calendarBackend)
|
||||
);
|
||||
|
||||
$server = new \Sabre\DAV\Server($tree);
|
||||
|
||||
$baseUri = '/' . implode('/', array_filter([
|
||||
trim(BASE_LOCATION, '/'),
|
||||
trim($this->config->item('index_page'), '/'),
|
||||
'lvplan',
|
||||
'caldav'
|
||||
]));
|
||||
$server->setBaseUri($baseUri);
|
||||
|
||||
$authBackend->setRealm('SabreDAV');
|
||||
$authPlugin = new \Sabre\DAV\Auth\Plugin($authBackend);
|
||||
$server->addPlugin($authPlugin);
|
||||
|
||||
$caldavPlugin = new \Sabre\CalDAV\Plugin();
|
||||
$server->addPlugin($caldavPlugin);
|
||||
|
||||
$aclPlugin = new \Sabre\DAVACL\Plugin();
|
||||
$server->addPlugin($aclPlugin);
|
||||
|
||||
$browser = new \Sabre\DAV\Browser\Plugin();
|
||||
$server->addPlugin($browser);
|
||||
|
||||
$server->exec();
|
||||
}
|
||||
}
|
||||
@@ -42,14 +42,22 @@ class Messages extends FHCAPI_Controller
|
||||
]);
|
||||
}
|
||||
|
||||
public function getMessages($id, $type_id, $size, $page)
|
||||
public function getMessages($id, $type_id, $size=null, $page=null)
|
||||
{
|
||||
if($type_id != 'person_id'){
|
||||
$id = $this->_getPersonId($id, $type_id);
|
||||
}
|
||||
|
||||
$offset = $size * ($page - 1);
|
||||
$limit = $size;
|
||||
if(!(is_null($size) && is_null($page)))
|
||||
{
|
||||
$offset = $size * ($page - 1);
|
||||
$limit = $size;
|
||||
}
|
||||
else
|
||||
{
|
||||
$offset = null;
|
||||
$limit = null;
|
||||
}
|
||||
|
||||
$result = $this->MessageModel->getMessagesForTable($id, $offset, $limit);
|
||||
|
||||
|
||||
@@ -78,52 +78,32 @@ class Dokumente extends FHCAPI_Controller
|
||||
$this->terminateWithError($this->p->t('ui', 'errorMissingValue', ['value' => 'Studiengang_kz']), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$resultPreDoc = $this->_getPrestudentDokumente($prestudent_id);
|
||||
|
||||
$arrayAccepted = [];
|
||||
$person_id = $this->_getPersonId($prestudent_id);
|
||||
|
||||
$docNames = array_map(function ($item) {
|
||||
return $item->dokument_kurzbz;
|
||||
}, $resultPreDoc);
|
||||
$mergedArray = [];
|
||||
|
||||
foreach($docNames as $doc)
|
||||
foreach ($resultPreDoc as $pre)
|
||||
{
|
||||
$result = $this->AkteModel->getAktenFAS($person_id, $doc, $studiengang_kz, $prestudent_id, true);
|
||||
$result = $this->AkteModel->getAktenFAS($person_id, $pre->dokument_kurzbz, $studiengang_kz, $prestudent_id, true);
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
return $this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
$data = getData($result);
|
||||
foreach ($data as $value)
|
||||
foreach (getData($result) as $doc)
|
||||
{
|
||||
array_push($arrayAccepted, $value);
|
||||
$merged = clone $doc;
|
||||
$merged->docdatum = $pre->docdatum;
|
||||
$merged->insertvonma = $pre->insertvonma;
|
||||
$merged->bezeichnung = $pre->bezeichnung;
|
||||
$mergedArray[] = $merged;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Mapping with document_kurzbz
|
||||
$preDocMap = [];
|
||||
foreach ($resultPreDoc as $pre) {
|
||||
$preDocMap[$pre->dokument_kurzbz] = $pre;
|
||||
}
|
||||
|
||||
$mergedArray = [];
|
||||
foreach ($arrayAccepted as $doc) {
|
||||
$merged = clone $doc;
|
||||
|
||||
if (isset($preDocMap[$doc->dokument_kurzbz])) {
|
||||
$merged->docdatum = $preDocMap[$doc->dokument_kurzbz]->docdatum;
|
||||
$merged->insertvonma = $preDocMap[$doc->dokument_kurzbz]->insertvonma;
|
||||
$merged->bezeichnung = $preDocMap[$doc->dokument_kurzbz]->bezeichnung;
|
||||
} else {
|
||||
$merged->akzeptiertdatum = null;
|
||||
$merged->akzeptiertvon = null;
|
||||
else
|
||||
{
|
||||
$mergedArray[] = $pre;
|
||||
}
|
||||
|
||||
$mergedArray[] = $merged;
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($mergedArray);
|
||||
|
||||
@@ -48,7 +48,8 @@ class Konto extends FHCAPI_Controller
|
||||
|
||||
// Load language phrases
|
||||
$this->loadPhrases([
|
||||
'konto'
|
||||
'konto',
|
||||
'lehre'
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -112,7 +113,7 @@ class Konto extends FHCAPI_Controller
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function getBuchungstypen()
|
||||
public function getBuchungstypen($studiensemester_kurzbz = null)
|
||||
{
|
||||
$this->load->model('crm/Buchungstyp_model', 'BuchungstypModel');
|
||||
|
||||
@@ -122,6 +123,7 @@ class Konto extends FHCAPI_Controller
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->_getOEHBeitrag($data, $studiensemester_kurzbz);
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
@@ -494,4 +496,43 @@ class Konto extends FHCAPI_Controller
|
||||
|
||||
$this->terminateWithSuccess();
|
||||
}
|
||||
|
||||
private function _getOEHBeitrag(&$data, $studiensemester_kurzbz = null)
|
||||
{
|
||||
if (is_null($studiensemester_kurzbz))
|
||||
{
|
||||
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
|
||||
$studiensemester_akt = $this->variablelib->getVar('semester_aktuell');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
if ($this->StudiensemesterModel->isValidStudiensemester($studiensemester_kurzbz))
|
||||
$studiensemester_akt = $studiensemester_kurzbz;
|
||||
else
|
||||
$this->terminateWithError($this->p->t('lehre', 'error_noStudiensemester'));
|
||||
}
|
||||
|
||||
$this->load->model('codex/Oehbeitrag_model', 'OehbeitragModel');
|
||||
$oehBeitrag = $this->OehbeitragModel->getByStudiensemester($studiensemester_akt);
|
||||
|
||||
$oehStandardbetrag = null;
|
||||
if (hasData($oehBeitrag))
|
||||
{
|
||||
$oeh = getData($oehBeitrag)[0];
|
||||
$summe = ($oeh->studierendenbeitrag + $oeh->versicherung) * -1;
|
||||
$oehStandardbetrag = number_format((float)$summe, 2, '.', '');
|
||||
}
|
||||
|
||||
if ($oehStandardbetrag !== null)
|
||||
{
|
||||
$data = array_map(function ($buchungstyp) use ($oehStandardbetrag) {
|
||||
if (isset($buchungstyp->buchungstyp_kurzbz) && (strtolower($buchungstyp->buchungstyp_kurzbz) === 'oeh'))
|
||||
{
|
||||
$buchungstyp->standardbetrag = $oehStandardbetrag;
|
||||
}
|
||||
return $buchungstyp;
|
||||
}, $data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -626,7 +626,7 @@ class Students extends FHCAPI_Controller
|
||||
$this->addFilter($studiensemester_kurzbz);
|
||||
|
||||
$result = $this->PrestudentModel->loadWhere($where);
|
||||
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
@@ -851,40 +851,44 @@ class Students extends FHCAPI_Controller
|
||||
$stdsemEsc = $studiensemester_kurzbz ? $this->PrestudentModel->escape($studiensemester_kurzbz) : 'NULL';
|
||||
|
||||
$this->load->config('stv');
|
||||
$tags = $this->config->item('stv_prestudent_tags');
|
||||
|
||||
$whereTags = '';
|
||||
if (is_array($tags) && !isEmptyArray($tags)) {
|
||||
$tags = array_keys($tags);
|
||||
if(defined('STV_TAGS_ENABLED') && STV_TAGS_ENABLED)
|
||||
{
|
||||
$tags = $this->config->item('stv_prestudent_tags');
|
||||
|
||||
foreach ($tags as $key => $tag) {
|
||||
$tags[$key] = $this->db->escape($tag);
|
||||
$whereTags = '';
|
||||
if (is_array($tags) && !isEmptyArray($tags)) {
|
||||
$tags = array_keys($tags);
|
||||
|
||||
foreach ($tags as $key => $tag) {
|
||||
$tags[$key] = $this->db->escape($tag);
|
||||
}
|
||||
$whereTags = " AND nt.typ_kurzbz IN (" . implode(",", $tags) . ")";
|
||||
}
|
||||
$whereTags = " AND nt.typ_kurzbz IN (" . implode(",", $tags) . ")";
|
||||
$subQueryTag = "
|
||||
(
|
||||
SELECT
|
||||
tag.prestudent_id,
|
||||
COALESCE(json_agg(tag ORDER BY tag.done), '[]'::json) AS tags
|
||||
FROM (
|
||||
SELECT DISTINCT ON (n.notiz_id)
|
||||
n.notiz_id AS id,
|
||||
nt.typ_kurzbz,
|
||||
array_to_json(nt.bezeichnung_mehrsprachig)->>0 AS beschreibung,
|
||||
n.text AS notiz,
|
||||
nt.style,
|
||||
n.erledigt AS done,
|
||||
nz.prestudent_id
|
||||
FROM public.tbl_notizzuordnung AS nz
|
||||
JOIN public.tbl_notiz AS n ON nz.notiz_id = n.notiz_id
|
||||
JOIN public.tbl_notiz_typ AS nt ON n.typ = nt.typ_kurzbz "
|
||||
. $whereTags .
|
||||
"
|
||||
) AS tag
|
||||
GROUP BY tag.prestudent_id
|
||||
) AS tag_data_agg
|
||||
";
|
||||
}
|
||||
$subQueryTag = "
|
||||
(
|
||||
SELECT
|
||||
tag.prestudent_id,
|
||||
COALESCE(json_agg(tag ORDER BY tag.done), '[]'::json) AS tags
|
||||
FROM (
|
||||
SELECT DISTINCT ON (n.notiz_id)
|
||||
n.notiz_id AS id,
|
||||
nt.typ_kurzbz,
|
||||
array_to_json(nt.bezeichnung_mehrsprachig)->>0 AS beschreibung,
|
||||
n.text AS notiz,
|
||||
nt.style,
|
||||
n.erledigt AS done,
|
||||
nz.prestudent_id
|
||||
FROM public.tbl_notizzuordnung AS nz
|
||||
JOIN public.tbl_notiz AS n ON nz.notiz_id = n.notiz_id
|
||||
JOIN public.tbl_notiz_typ AS nt ON n.typ = nt.typ_kurzbz "
|
||||
. $whereTags .
|
||||
"
|
||||
) AS tag
|
||||
GROUP BY tag.prestudent_id
|
||||
) AS tag_data_agg
|
||||
";
|
||||
|
||||
$this->PrestudentModel->addJoin('public.tbl_studiengang stg', 'studiengang_kz', 'LEFT');
|
||||
$this->PrestudentModel->addJoin('public.tbl_person p', 'person_id');
|
||||
@@ -907,11 +911,17 @@ class Students extends FHCAPI_Controller
|
||||
AND ps.studiensemester_kurzbz=public.get_stdsem_prestudent(tbl_prestudent.prestudent_id, ' . $stdsemEsc . ')
|
||||
AND ps.ausbildungssemester=public.get_absem_prestudent(tbl_prestudent.prestudent_id, ' . $stdsemEsc . ')', 'LEFT');
|
||||
|
||||
$this->PrestudentModel->addJoin($subQueryTag, 'tag_data_agg.prestudent_id = tbl_prestudent.prestudent_id', 'LEFT');
|
||||
if(defined('STV_TAGS_ENABLED') && STV_TAGS_ENABLED)
|
||||
{
|
||||
$this->PrestudentModel->addJoin($subQueryTag, 'tag_data_agg.prestudent_id = tbl_prestudent.prestudent_id', 'LEFT');
|
||||
}
|
||||
|
||||
|
||||
$this->PrestudentModel->addSelect("b.uid");
|
||||
$this->PrestudentModel->addSelect('tag_data_agg.tags');
|
||||
if(defined('STV_TAGS_ENABLED') && STV_TAGS_ENABLED)
|
||||
{
|
||||
$this->PrestudentModel->addSelect('tag_data_agg.tags');
|
||||
}
|
||||
$this->PrestudentModel->addSelect('titelpre');
|
||||
$this->PrestudentModel->addSelect('nachname');
|
||||
$this->PrestudentModel->addSelect('vorname');
|
||||
|
||||
@@ -31,7 +31,7 @@ class Config extends FHCAPI_Controller
|
||||
|
||||
$config = [];
|
||||
|
||||
$result = $this->_ci->VariableModel->getVariables(getAuthUID(), ['ignore_kollision', 'kollision_student', 'ignore_reservierung', 'ignore_zeitsperre']);
|
||||
$result = $this->_ci->VariableModel->getVariables(getAuthUID(), ['ignore_kollision', 'kollision_student', 'ignore_reservierung', 'ignore_zeitsperre', 'ignore_resources_collisions']);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$config['ignore_kollision'] = [
|
||||
@@ -60,7 +60,11 @@ class Config extends FHCAPI_Controller
|
||||
"value" => ($data['ignore_zeitsperre'] ?? 'false') === 'true'
|
||||
];
|
||||
|
||||
|
||||
$config['ignore_resources_collisions'] = [
|
||||
"type" => "checkbox",
|
||||
"label" => $this->p->t('ui', 'ignore_resources_collisions'),
|
||||
"value" => ($data['ignore_resources_collisions'] ?? 'false') === 'true'
|
||||
];
|
||||
|
||||
$this->terminateWithSuccess($config);
|
||||
}
|
||||
@@ -109,6 +113,11 @@ class Config extends FHCAPI_Controller
|
||||
'ignore_zeitsperre',
|
||||
$this->input->post('ignore_zeitsperre') === true ? 'true' : 'false'
|
||||
);
|
||||
$this->_ci->VariableModel->setVariable(
|
||||
getAuthUID(),
|
||||
'ignore_resources_collisions',
|
||||
$this->input->post('ignore_resources_collisions') === true ? 'true' : 'false'
|
||||
);
|
||||
$this->terminateWithSuccess();
|
||||
}
|
||||
|
||||
|
||||
@@ -38,8 +38,8 @@ class Kalender extends FHCAPI_Controller
|
||||
|
||||
$this->_ci->load->library('LogLib');
|
||||
$this->_ci->load->library('form_validation');
|
||||
$this->_ci->load->library('KalenderLib');
|
||||
$this->_ci->load->library('RaumvorschlagLib');
|
||||
$this->_ci->load->library('KalenderLib', ["uid" => getAuthUID()]);
|
||||
$this->_ci->load->library('RaumvorschlagLib', ["uid" => getAuthUID()]);
|
||||
$this->loadPhrases([
|
||||
'ui'
|
||||
]);
|
||||
@@ -222,7 +222,7 @@ class Kalender extends FHCAPI_Controller
|
||||
if (isError($result))
|
||||
$this->terminateWithError(getError($result), $result->code);
|
||||
|
||||
$this->terminateWithSuccess();
|
||||
$this->terminateWithSuccess(getData($result));
|
||||
}
|
||||
|
||||
public function getRaumvorschlag()
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class OperationalResourceToCalenderAPI extends FHCAPI_Controller
|
||||
{
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getAssignedResourcesByCalender' => ['admin:r', 'assistenz:r'],
|
||||
'storeResourcesToCalendarRelationship' => ['admin:w', 'assistenz:w'],
|
||||
'getSchedulableResourcesByCalendar' => ['admin:r', 'assistenz:r'],
|
||||
]);
|
||||
|
||||
$this->load->model('ressource/BetriebsmittelKalender_model', 'BetriebsmittelKalenderModel');
|
||||
$this->load->model('ressource/Betriebsmittel_model', 'BetriebsmittelModel');
|
||||
$this->load->model('ressource/Kalender_model', 'KalenderModel');
|
||||
|
||||
$this->_ci->load->library('CollisionChecker', ["uid" => getAuthUID()]);
|
||||
$this->_ci->load->library('KalenderLib', ["uid" => getAuthUID()]);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
public function getSchedulableResourcesByCalendar($calenderID)
|
||||
{
|
||||
if (!isset($calenderID)) $this->terminateWithError("Missing required parameter 'kalender_id'");
|
||||
|
||||
$result = $this->KalenderModel->loadWhere(['kalender_id' => $calenderID]);
|
||||
if (isError($result)) $this->terminateWithError("Calendar with id '$calenderID' does not have a valid group id");
|
||||
|
||||
$calender = $this->getDataOrTerminateWithError($result)[0];
|
||||
if (!isset($calender)) $this->terminateWithError("Calendar with id '$calenderID' not found");
|
||||
|
||||
$result = $this->BetriebsmittelModel->getSchedulableEntriesByDatetimeInterval($calender->von, $calender->bis);
|
||||
$this->terminateWithSuccess($this->getDataOrTerminateWithError($result));
|
||||
}
|
||||
|
||||
public function getAssignedResourcesByCalender($calenderID)
|
||||
{
|
||||
if (!isset($calenderID)) $this->terminateWithError("Missing required parameter 'kalender_id'");
|
||||
|
||||
$result = $this->KalenderModel->loadWhere(['kalender_id' => $calenderID]);
|
||||
if (empty($result)) $this->terminateWithError("Calendar with id '$calenderID' not found");
|
||||
|
||||
$calenderGroupID = $this->getDataOrTerminateWithError($result)[0]->eindeutige_gruppen_id;
|
||||
if (!isset($calenderGroupID)) $this->terminateWithError("Calendar with id '$calenderID' does not have a valid group id");
|
||||
|
||||
|
||||
$this->BetriebsmittelKalenderModel->addSelect(['tbl_betriebsmittel_kalender.*', 'tbl_betriebsmittel.beschreibung', 'tbl_betriebsmittel.verplanen']);
|
||||
$this->BetriebsmittelKalenderModel->addJoin('wawi.tbl_betriebsmittel', 'betriebsmittel_id');
|
||||
$result = $this->BetriebsmittelKalenderModel->loadWhere([
|
||||
'eindeutige_kalender_gruppen_id' => $calenderGroupID,
|
||||
'tbl_betriebsmittel.verplanen' => true,
|
||||
]);
|
||||
|
||||
$this->terminateWithSuccess($this->getDataOrTerminateWithError($result));
|
||||
}
|
||||
|
||||
public function storeResourcesToCalendarRelationship()
|
||||
{
|
||||
$calenderID = $this->input->post('kalender_id');
|
||||
$assignedResources = $this->input->post('assignedResources');
|
||||
|
||||
if (!isset($calenderID)) $this->terminateWithError("Missing required parameter 'kalender_id'", 'general');
|
||||
if (!isset($assignedResources)) $this->terminateWithError("Missing required parameter 'assignedResources'", 'general');
|
||||
|
||||
$result = $this->KalenderModel->loadWhere(['kalender_id' => $calenderID]);
|
||||
if (empty($result)) $this->terminateWithError("Calendar with id '$calenderID' not found");
|
||||
|
||||
$calendar = $this->getDataOrTerminateWithError($result)[0];
|
||||
|
||||
$calenderGroupID = $calendar->eindeutige_gruppen_id;
|
||||
if (!isset($calenderGroupID)) $this->terminateWithError("Calendar with id '$calenderID' does not have a valid group id");
|
||||
|
||||
$result = $this->kalenderlib->addOperationalResourcesToKalenderEvent($calendar, $assignedResources);
|
||||
if (isError($result))
|
||||
$this->terminateWithError(getError($result));
|
||||
|
||||
$this->terminateWithSuccess(['message' => 'Resources assigned successfully']);
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,7 @@ class Reservierung extends FHCAPI_Controller
|
||||
|
||||
$this->_ci->load->library('LogLib');
|
||||
$this->_ci->load->library('form_validation');
|
||||
$this->_ci->load->library('KalenderLib');
|
||||
$this->_ci->load->library('KalenderLib', ["uid" => getAuthUID()]);
|
||||
|
||||
$this->_ci->load->model('ressource/Ort_model', 'OrtModel');
|
||||
$this->_ci->load->model('ressource/Kalender_Event_Rolle_model', 'KalenderEventRolleModel');
|
||||
|
||||
@@ -13,7 +13,7 @@ class TempusJob extends JOB_Controller
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
$this->_ci->load->helper('hlp_sancho_helper');
|
||||
$this->_ci->load->library('KalenderLib');
|
||||
$this->_ci->load->library('KalenderLib', ["uid" => null]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ class MigrateKalender extends Auth_Controller
|
||||
parent::__construct(array(
|
||||
'migrateStundenplan' => ['admin:rw'],
|
||||
'migrateReservierung' => ['admin:rw'],
|
||||
'migrateStundenplanBetriebsmittelEntries' => ['admin:rw']
|
||||
));
|
||||
$this->load->model('ressource/Kalender_model', 'KalenderModel');
|
||||
$this->load->model('ressource/Kalender_Lehreinheit_model', 'KalenderLehreinheitModel');
|
||||
@@ -147,66 +148,6 @@ class MigrateKalender extends Auth_Controller
|
||||
$this->_insertSync($fehlende, $kalender_id);
|
||||
}
|
||||
}
|
||||
/*if(hasData($SyncResult))
|
||||
{
|
||||
//bereits vorhanden
|
||||
// TODO Update
|
||||
}
|
||||
else
|
||||
{
|
||||
// Neuen Eintrag anlegen
|
||||
|
||||
$von = $rowstpl->datum.' '.$rowstpl->beginn;
|
||||
$bis = $rowstpl->datum.' '.$rowstpl->ende;
|
||||
$typ = 'lehreinheit';
|
||||
$status = 'live';
|
||||
$insertamum = $rowstpl->insertamum;
|
||||
$insertvon = $rowstpl->insertvon;
|
||||
$updateamum = $rowstpl->updateamum;
|
||||
$updatevon = $rowstpl->updatevon;
|
||||
|
||||
$resultKalenderInsert = $this->KalenderModel->insert(
|
||||
array(
|
||||
'von' => $von,
|
||||
'bis' => $bis,
|
||||
'typ' => $typ,
|
||||
'status_kurzbz' => $status,
|
||||
'vorgaenger_kalender_id' => null,
|
||||
'insertamum' => $insertamum,
|
||||
'insertvon' => $insertvon,
|
||||
'updateamum' => $updateamum,
|
||||
'updatevon' => $updatevon
|
||||
)
|
||||
);
|
||||
|
||||
if(isSuccess($resultKalenderInsert))
|
||||
{
|
||||
$kalender_id = getData($resultKalenderInsert);
|
||||
|
||||
$resultKalenderInsert = $this->KalenderLehreinheitModel->insert(
|
||||
array(
|
||||
'kalender_id' => $kalender_id,
|
||||
'lehreinheit_id' => $rowstpl->lehreinheit_id,
|
||||
)
|
||||
);
|
||||
|
||||
$resultKalenderInsert = $this->KalenderOrtModel->insert(
|
||||
array(
|
||||
'kalender_id' => $kalender_id,
|
||||
'ort_kurzbz' => $rowstpl->ort_kurzbz,
|
||||
)
|
||||
);
|
||||
|
||||
$resultSyncInsert = $this->SyncModel->insert(
|
||||
array(
|
||||
'stundenplandev_id' => $rowstpl->stundenplandev_id,
|
||||
'kalender_id' => $kalender_id,
|
||||
'lastupdate' => date('Y-m-d H:i:s')
|
||||
)
|
||||
);
|
||||
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -247,7 +188,7 @@ class MigrateKalender extends Auth_Controller
|
||||
array_agg(DISTINCT r.uid) AS uids,
|
||||
array_agg(DISTINCT r.gruppe_kurzbz) AS gruppen_kurzbz,
|
||||
array_agg(DISTINCT ROW(r.semester, r.verband, r.gruppe)::text) AS svg_kombis,
|
||||
MIN(r.ort_kurzbz) AS ort_kurzbz,
|
||||
array_agg(DISTINCT r.ort_kurzbz) AS orte_kurzbz,
|
||||
MIN(r.studiengang_kz) AS studiengang_kz,
|
||||
MIN(r.veranstaltung_id) AS veranstaltung_id,
|
||||
MIN(r.reservierung_id) AS reservierung_id,
|
||||
@@ -267,58 +208,6 @@ class MigrateKalender extends Auth_Controller
|
||||
JOIN lehre.tbl_stunde s_von ON s_von.stunde = b.stunde_von
|
||||
JOIN lehre.tbl_stunde s_bis ON s_bis.stunde = b.stunde_bis
|
||||
ORDER BY b.reservierung_id DESC;";
|
||||
/*$qry = "WITH per_stunde AS (
|
||||
SELECT
|
||||
datum,
|
||||
titel,
|
||||
beschreibung, ort_kurzbz, studiengang_kz, stunde,
|
||||
veranstaltung_id,
|
||||
array_agg(DISTINCT uid) AS uids,
|
||||
array_agg(DISTINCT reservierung_id::text) AS reservierung_ids,
|
||||
array_agg(DISTINCT ROW(semester, verband, gruppe)::text) AS svg_kombis,
|
||||
array_agg(DISTINCT gruppe_kurzbz) AS gruppen_kurzbz,
|
||||
MIN(reservierung_id) AS reservierung_id,
|
||||
MAX(insertamum) AS insertamum,
|
||||
MAX(insertvon) AS insertvon
|
||||
FROM campus.tbl_reservierung
|
||||
WHERE datum >= ? AND datum <= ?
|
||||
GROUP BY datum, titel, beschreibung, ort_kurzbz, studiengang_kz, stunde, veranstaltung_id
|
||||
),
|
||||
numbered AS (
|
||||
SELECT
|
||||
per_stunde.*,
|
||||
stunde - ROW_NUMBER() OVER (PARTITION BY datum, titel, beschreibung, ort_kurzbz, studiengang_kz, veranstaltung_id ORDER BY stunde) AS grp
|
||||
FROM per_stunde
|
||||
),
|
||||
grouped AS (
|
||||
SELECT
|
||||
MIN(reservierung_id) AS reservierung_id,
|
||||
ort_kurzbz, studiengang_kz, datum,
|
||||
MIN(stunde) AS stunde_von,
|
||||
MAX(stunde) AS stunde_bis,
|
||||
titel, beschreibung,
|
||||
array_agg(DISTINCT gruppe_kurzbz_elem) AS gruppen_kurzbz,
|
||||
array_agg(DISTINCT uid_elem) AS uids,
|
||||
array_agg(DISTINCT res_id) AS reservierung_ids,
|
||||
array_agg(DISTINCT svg_elem) AS svg_kombis,
|
||||
veranstaltung_id,
|
||||
MAX(insertamum) AS insertamum,
|
||||
MAX(insertvon) AS insertvon
|
||||
FROM numbered,
|
||||
unnest(uids) AS uid_elem,
|
||||
unnest(reservierung_ids) AS res_id,
|
||||
unnest(gruppen_kurzbz) AS gruppe_kurzbz_elem,
|
||||
unnest(svg_kombis) AS svg_elem
|
||||
GROUP BY datum, titel, beschreibung, ort_kurzbz, studiengang_kz, veranstaltung_id, grp
|
||||
)
|
||||
SELECT
|
||||
grouped.*,
|
||||
(datum + s_von.beginn) AS von,
|
||||
(datum + s_bis.ende) AS bis
|
||||
FROM grouped
|
||||
JOIN lehre.tbl_stunde s_von ON s_von.stunde = grouped.stunde_von
|
||||
JOIN lehre.tbl_stunde s_bis ON s_bis.stunde = grouped.stunde_bis
|
||||
ORDER BY grouped.reservierung_id DESC";*/
|
||||
|
||||
array_push($params, $von, $bis);
|
||||
$reservierung_data = $db->execReadOnlyQuery($qry, $params);
|
||||
@@ -367,6 +256,107 @@ class MigrateKalender extends Auth_Controller
|
||||
}
|
||||
}
|
||||
|
||||
public function migrateStundenplanBetriebsmittelEntries() {
|
||||
$this->setKalendarEntriesGroupIDs();
|
||||
$this->setKalendarEntriesGroupIDsForChildren();
|
||||
|
||||
$dbModel = new DB_Model();
|
||||
|
||||
$deleteOldImportedTempusEntriesQuery = "DELETE from lehre.tbl_betriebsmittel_kalender WHERE quelle != 'tempus_neu' OR quelle IS NULL;";
|
||||
$createHelperTypeQuery = "DO $$
|
||||
BEGIN
|
||||
IF NOT EXISTS (
|
||||
SELECT 1
|
||||
FROM pg_type
|
||||
WHERE typname = 'betriebsmittel_info'
|
||||
) THEN
|
||||
CREATE TYPE betriebsmittel_info AS (
|
||||
betriebsmittel_id bigint,
|
||||
insertamum timestamp,
|
||||
insertvon text
|
||||
);
|
||||
END IF;
|
||||
END $$;";
|
||||
|
||||
$query = $deleteOldImportedTempusEntriesQuery .
|
||||
$createHelperTypeQuery .
|
||||
"WITH test AS (
|
||||
SELECT
|
||||
tk.eindeutige_gruppen_id AS eindeutige_gruppen_id,
|
||||
array_agg(tk.kalender_id),
|
||||
array_agg(
|
||||
ROW(tsb.betriebsmittel_id, tsb.insertamum, tsb.insertvon)::betriebsmittel_info
|
||||
) AS betriebsmittel_data
|
||||
FROM sync.tbl_stundenplandev_kalender AS sk
|
||||
JOIN lehre.tbl_kalender tk ON tk.kalender_id = sk.kalender_id
|
||||
JOIN lehre.tbl_stundenplan_betriebsmittel tsb ON tsb.stundenplandev_id = sk.stundenplandev_id
|
||||
GROUP BY tk.eindeutige_gruppen_id
|
||||
)
|
||||
INSERT INTO lehre.tbl_betriebsmittel_kalender (
|
||||
eindeutige_kalender_gruppen_id,
|
||||
betriebsmittel_id,
|
||||
insertamum,
|
||||
insertvon
|
||||
)
|
||||
SELECT
|
||||
t.eindeutige_gruppen_id,
|
||||
bm.betriebsmittel_id,
|
||||
bm.insertamum,
|
||||
bm.insertvon
|
||||
FROM test t
|
||||
CROSS JOIN LATERAL unnest(t.betriebsmittel_data) AS bm
|
||||
ON CONFLICT (eindeutige_kalender_gruppen_id, betriebsmittel_id) DO NOTHING;
|
||||
;";
|
||||
|
||||
$dbModel->db->query($query);
|
||||
}
|
||||
|
||||
private function setKalendarEntriesGroupIDs() {
|
||||
$dbModel = new DB_Model();
|
||||
|
||||
$query = "UPDATE lehre.tbl_kalender
|
||||
SET eindeutige_gruppen_id = gen_random_uuid()
|
||||
WHERE vorgaenger_kalender_id IS NULL
|
||||
AND eindeutige_gruppen_id IS NULL;";
|
||||
|
||||
$dbModel->db->query($query);
|
||||
|
||||
}
|
||||
|
||||
private function setKalendarEntriesGroupIDsForChildren() {
|
||||
$dbModel = new DB_Model();
|
||||
|
||||
$query = "WITH RECURSIVE tree AS
|
||||
(
|
||||
SELECT
|
||||
kalender_id,
|
||||
vorgaenger_kalender_id,
|
||||
kalender_id AS root_id,
|
||||
eindeutige_gruppen_id as root_eindeutige_gruppen_id
|
||||
FROM lehre.tbl_kalender
|
||||
WHERE vorgaenger_kalender_id IS NULL
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT
|
||||
i.kalender_id,
|
||||
i.vorgaenger_kalender_id,
|
||||
t.root_id,
|
||||
t.root_eindeutige_gruppen_id
|
||||
FROM lehre.tbl_kalender i
|
||||
JOIN tree t
|
||||
ON i.vorgaenger_kalender_id = t.kalender_id
|
||||
where i.eindeutige_gruppen_id is NULL
|
||||
|
||||
)
|
||||
UPDATE lehre.tbl_kalender k
|
||||
SET eindeutige_gruppen_id = t.root_eindeutige_gruppen_id
|
||||
FROM tree t
|
||||
WHERE k.kalender_id = t.kalender_id
|
||||
AND k.eindeutige_gruppen_id IS NULL;";
|
||||
|
||||
$dbModel->db->query($query);
|
||||
}
|
||||
|
||||
private function _insertKalender($block, $typ)
|
||||
{
|
||||
@@ -450,6 +440,21 @@ class MigrateKalender extends Auth_Controller
|
||||
}
|
||||
}
|
||||
|
||||
$rooms = is_array($block->orte_kurzbz) ? $block->orte_kurzbz : explode(',', $block->orte_kurzbz ?? '');
|
||||
foreach ($rooms as $room_kurzbz)
|
||||
{
|
||||
$room_kurzbz = trim($room_kurzbz);
|
||||
if (!empty($room_kurzbz))
|
||||
{
|
||||
$this->KalenderOrtModel->insert(
|
||||
array (
|
||||
'kalender_id' => $kalender_id,
|
||||
'ort_kurzbz' => $room_kurzbz
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($block->svg_kombis as $kombi_str)
|
||||
{
|
||||
$kombi_str = trim($kombi_str, '()');
|
||||
@@ -474,14 +479,6 @@ class MigrateKalender extends Auth_Controller
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$this->KalenderOrtModel->insert(
|
||||
array (
|
||||
'kalender_id' => $kalender_id,
|
||||
'ort_kurzbz' => $block->ort_kurzbz
|
||||
)
|
||||
);
|
||||
|
||||
return $kalender_id;
|
||||
}
|
||||
|
||||
|
||||
@@ -417,6 +417,7 @@ abstract class Notiz_Controller extends FHCAPI_Controller
|
||||
$notiz_id = $this->input->post('notiz_id');
|
||||
|
||||
$this->NotizModel->addSelect('campus.tbl_dms_version.*');
|
||||
$this->NotizModel->addSelect($this->NotizModel->escape(base_url('content/notizdokdownload.php?id=')) . ' || public.tbl_notiz_dokument.dms_id AS preview');
|
||||
|
||||
$this->NotizModel->addJoin('public.tbl_notiz_dokument', 'ON (public.tbl_notiz_dokument.notiz_id = public.tbl_notiz.notiz_id)');
|
||||
$this->NotizModel->addJoin('campus.tbl_dms_version', 'ON (public.tbl_notiz_dokument.dms_id = campus.tbl_dms_version.dms_id)');
|
||||
|
||||
@@ -570,3 +570,14 @@ function buildDropdownEntryPrintArray($id, $name, $parameterurl, $uid=null, $ord
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
function generateUUID()
|
||||
{
|
||||
$data = openssl_random_pseudo_bytes(16);
|
||||
|
||||
$data[6] = chr(ord($data[6]) & 0x0f | 0x40);
|
||||
$data[8] = chr(ord($data[8]) & 0x3f | 0x80);
|
||||
|
||||
return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4));
|
||||
}
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ class AntragLib
|
||||
return $this->_ci->StudierendenantragstatusModel->resumeAntraegeForAbmeldungStgl($antrag_id);
|
||||
}
|
||||
// NOTE(chris): get last status that is not pause
|
||||
$this->_ci->StudierendenantragstatusModel->addOrder('insertamum');
|
||||
$this->_ci->StudierendenantragstatusModel->addOrder('insertamum', 'DESC');
|
||||
$this->_ci->StudierendenantragstatusModel->addLimit(1);
|
||||
$result = $this->_ci->StudierendenantragstatusModel->loadWhere([
|
||||
'studierendenantrag_id' => $antrag_id,
|
||||
|
||||
@@ -9,19 +9,28 @@ class CollisionChecker
|
||||
private $_checks = [];
|
||||
|
||||
private $_ci;
|
||||
private $_uid;
|
||||
|
||||
public function __construct()
|
||||
public function __construct($params)
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
$this->_ci->load->library('collision/checks/RoomCollisionCheck');
|
||||
$this->_ci->load->library('collision/checks/LectureCollisionCheck');
|
||||
$this->_ci->load->library('collision/checks/VerbandCollisionCheck');
|
||||
$this->_ci->load->library('collision/checks/StudentCollisionCheck');
|
||||
if (isset($params['uid']) && !isEmptyString($params['uid'])){
|
||||
$this->_uid = $params['uid'];
|
||||
} else {
|
||||
show_error('uid of logged user not passed!');
|
||||
}
|
||||
|
||||
$this->_ci->load->library('collision/checks/RoomCollisionCheck', ['uid' => $this->_uid]);
|
||||
$this->_ci->load->library('collision/checks/LectureCollisionCheck', ['uid' => $this->_uid]);
|
||||
$this->_ci->load->library('collision/checks/VerbandCollisionCheck', ['uid' => $this->_uid]);
|
||||
$this->_ci->load->library('collision/checks/StudentCollisionCheck', ['uid' => $this->_uid]);
|
||||
$this->_ci->load->library('collision/checks/ResourcesCollisionCheck', ['uid' => $this->_uid]);
|
||||
$this->register($this->_ci->roomcollisioncheck);
|
||||
$this->register($this->_ci->lecturecollisioncheck);
|
||||
$this->register($this->_ci->verbandcollisioncheck);
|
||||
$this->register($this->_ci->studentcollisioncheck);
|
||||
$this->register($this->_ci->resourcescollisioncheck);
|
||||
Events::trigger('collision_register', $this);
|
||||
}
|
||||
|
||||
@@ -62,4 +71,4 @@ class CollisionChecker
|
||||
|
||||
return $results;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,15 +5,24 @@ if (! defined("BASEPATH")) exit("No direct script access allowed");
|
||||
class KalenderLib
|
||||
{
|
||||
private $_ci;
|
||||
public function __construct()
|
||||
private $_uid;
|
||||
|
||||
public function __construct($params)
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
if (isset($params['uid']) && !isEmptyString($params['uid'])){
|
||||
$this->_uid = $params['uid'];
|
||||
} else {
|
||||
show_error('uid of logged user not passed!');
|
||||
}
|
||||
|
||||
$this->_ci->load->model('ressource/Kalender_model', 'KalenderModel');
|
||||
$this->_ci->load->model('ressource/Kalender_Lehreinheit_model', 'KalenderLehreinheitModel');
|
||||
$this->_ci->load->model('ressource/Kalender_Event_model', 'KalenderEventModel');
|
||||
$this->_ci->load->model('ressource/Kalender_Event_Teilnehmer_model', 'KalenderEventTeilnehmerModel');
|
||||
$this->_ci->load->model('ressource/Kalender_Ort_model', 'KalenderOrtModel');
|
||||
$this->_ci->load->model('ressource/BetriebsmittelKalender_model', 'BetriebsmittelKalenderModel');
|
||||
$this->_ci->load->model('education/Lehreinheit_model', 'LehreinheitModel');
|
||||
$this->_ci->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel');
|
||||
$this->_ci->load->model('education/LehreinheitMitarbeiter_model', 'LehreinheitMitarbeiterModel');
|
||||
@@ -21,7 +30,7 @@ class KalenderLib
|
||||
$this->_ci->load->model('organisation/gruppe_model', 'GruppeModel');
|
||||
$this->_ci->load->model('organisation/Lehrverband_model', 'LehrverbandModel');
|
||||
|
||||
$this->_ci->load->library('CollisionChecker');
|
||||
$this->_ci->load->library('CollisionChecker', ['uid' => $this->_uid]);
|
||||
$this->_ci->load->library('PhrasesLib', array('ui'));
|
||||
|
||||
}
|
||||
@@ -31,11 +40,14 @@ class KalenderLib
|
||||
$end_date = date('Y-m-d', strtotime($end_date . ' +1 day'));
|
||||
|
||||
$this->_ci->KalenderModel->addSelect('tbl_kalender.kalender_id,
|
||||
tbl_kalender.eindeutige_gruppen_id,
|
||||
tbl_kalender.status_kurzbz,
|
||||
tbl_kalender.typ,
|
||||
tbl_kalender.von,
|
||||
tbl_kalender.bis,
|
||||
tbl_kalender_ort.ort_kurzbz,
|
||||
tbl_kalender_ort.ort_kurzbz as ko_ort_kurzbz,
|
||||
tbl_kalender_ort.location as ko_location,
|
||||
tbl_lehreinheit.lehreinheit_id,
|
||||
tbl_lehreinheit.lehrveranstaltung_id,
|
||||
tbl_lehreinheit.lehrfach_id,
|
||||
@@ -129,6 +141,8 @@ class KalenderLib
|
||||
|
||||
$this->_ci->KalenderModel->db->where('tbl_kalender.von >=', $start_date);
|
||||
$this->_ci->KalenderModel->db->where('tbl_kalender.bis <', $end_date);
|
||||
|
||||
$this->_ci->KalenderModel->addOrder('tbl_kalender.eindeutige_gruppen_id', 'DESC');
|
||||
}
|
||||
|
||||
private function _mapEvents($data, $collisionCheck = true)
|
||||
@@ -150,6 +164,8 @@ class KalenderLib
|
||||
$bis = new DateTime($row->bis);
|
||||
|
||||
$events[$id] = (object) [
|
||||
'kalender_id' => $id,
|
||||
'eindeutige_gruppen_id' => $row->eindeutige_gruppen_id,
|
||||
'type' => $row->typ,
|
||||
'beginn' => $von->format('H:i:s'),
|
||||
'ende' => $bis->format('H:i:s'),
|
||||
@@ -159,13 +175,14 @@ class KalenderLib
|
||||
'tooltip' => 'tip',
|
||||
'status_kurzbz' => $row->status_kurzbz,
|
||||
'ort_kurzbz' => isset($row->ort_kurzbz) ? $row->ort_kurzbz : '',
|
||||
'ko_ort_kurzbz' => isset($row->ko_ort_kurzbz) ? $row->ko_ort_kurzbz : '',
|
||||
'ko_location' => isset($row->ko_location) ? $row->ko_location : '',
|
||||
'lehrform' => isset($row->lehrform_kurzbz) ? $row->lehrform_kurzbz : '',
|
||||
'lehrfach' => isset($row->lehrfach_kurzbz) ? $row->lehrfach_kurzbz : '',
|
||||
'lehrfach_bez' => isset($row->lehrfach_bezeichnung) ? $row->lehrfach_bezeichnung : '',
|
||||
'farbe' => isset($row->farbe) ? $row->farbe : '',
|
||||
'lehrveranstaltung_id' => $row->lehrveranstaltung_id,
|
||||
'organisationseinheit' => isset($row->oe_kurzbz) ? $row->oe_kurzbz : '',
|
||||
'kalender_id' => $id,
|
||||
'lehreinheit_id' => [],
|
||||
'lektor' => [],
|
||||
'teilnehmer_gruppe' => [],
|
||||
@@ -174,7 +191,9 @@ class KalenderLib
|
||||
'titel' => isset($row->titel) ? $row->titel : '',
|
||||
'beschreibung' => isset($row->beschreibung) ? $row->beschreibung : '',
|
||||
'topic' => (isset($row->lehrfach_kurzbz) ? $row->lehrfach_kurzbz : '').' '.(isset($row->lehrform_kurzbz) ? $row->lehrform_kurzbz : ''),
|
||||
'collisions' => false
|
||||
'collisions' => false,
|
||||
'has_assigned_resources' => isset($row->has_assigned_resources) ? $row->has_assigned_resources : false,
|
||||
'updateamum' => isset($row->updateamum) ? $row->updateamum : null,
|
||||
];
|
||||
}
|
||||
|
||||
@@ -345,6 +364,14 @@ class KalenderLib
|
||||
WHERE nachfolger.vorgaenger_kalender_id = tbl_kalender.kalender_id)', null, false);
|
||||
|
||||
$this->_ci->KalenderModel->db->where_not_in('status_kurzbz', array('deleted'));
|
||||
|
||||
$this->_ci->KalenderModel->addSelect([
|
||||
"(
|
||||
SELECT COUNT(*) FROM lehre.tbl_betriebsmittel_kalender
|
||||
WHERE tbl_betriebsmittel_kalender.eindeutige_kalender_gruppen_id = tbl_kalender.eindeutige_gruppen_id
|
||||
) AS has_assigned_resources"
|
||||
]);
|
||||
|
||||
$data = $this->_ci->KalenderModel->load();
|
||||
|
||||
return $this->_mapEvents($data);
|
||||
@@ -354,6 +381,7 @@ class KalenderLib
|
||||
{
|
||||
$this->_getBasePlan($start_date, $end_date);
|
||||
|
||||
|
||||
$this->_ci->KalenderModel->db->where('status_kurzbz', 'live');
|
||||
|
||||
$data = $this->_ci->KalenderModel->load();
|
||||
@@ -361,6 +389,131 @@ class KalenderLib
|
||||
return $this->_mapEvents($data);
|
||||
}
|
||||
|
||||
public function getPlanForStudentByStudent($start_date, $end_date, $userUID)
|
||||
{
|
||||
$this->_getBasePlan($start_date, $end_date);
|
||||
|
||||
$escapedUserUID = $this->_ci->KalenderModel->db->escape($userUID);
|
||||
|
||||
$benutzerExists = "EXISTS (
|
||||
SELECT 1
|
||||
FROM public.tbl_benutzer student_benutzer
|
||||
WHERE student_benutzer.uid = $escapedUserUID
|
||||
)";
|
||||
|
||||
$directEventTeilnehmerExists = "EXISTS (
|
||||
SELECT 1
|
||||
FROM lehre.tbl_kalender_event_teilnehmer event_teilnehmer
|
||||
WHERE event_teilnehmer.kalender_id = tbl_kalender.kalender_id
|
||||
AND event_teilnehmer.uid = $escapedUserUID
|
||||
)";
|
||||
|
||||
$eventBenutzergruppeExists = "EXISTS (
|
||||
SELECT 1
|
||||
FROM lehre.tbl_kalender_event_teilnehmer event_gruppe
|
||||
JOIN public.tbl_benutzergruppe event_benutzergruppe
|
||||
ON event_benutzergruppe.gruppe_kurzbz = event_gruppe.gruppe_kurzbz
|
||||
AND (
|
||||
event_gruppe.studiensemester_kurzbz IS NULL
|
||||
OR event_benutzergruppe.studiensemester_kurzbz = event_gruppe.studiensemester_kurzbz
|
||||
)
|
||||
WHERE event_gruppe.kalender_id = tbl_kalender.kalender_id
|
||||
AND event_gruppe.gruppe_kurzbz IS NOT NULL
|
||||
AND event_benutzergruppe.uid = $escapedUserUID
|
||||
)";
|
||||
|
||||
$eventStudentlehrverbandExists = "EXISTS (
|
||||
SELECT 1
|
||||
FROM lehre.tbl_kalender_event_teilnehmer event_lehrverband
|
||||
JOIN public.tbl_studentlehrverband event_studentlehrverband
|
||||
ON event_studentlehrverband.student_uid = $escapedUserUID
|
||||
AND event_studentlehrverband.studiengang_kz = event_lehrverband.studiengang_kz
|
||||
AND (
|
||||
event_lehrverband.studiensemester_kurzbz IS NULL
|
||||
OR event_studentlehrverband.studiensemester_kurzbz = event_lehrverband.studiensemester_kurzbz
|
||||
)
|
||||
AND (
|
||||
event_lehrverband.semester IS NULL
|
||||
OR event_studentlehrverband.semester = event_lehrverband.semester
|
||||
)
|
||||
AND (
|
||||
event_lehrverband.verband = event_studentlehrverband.verband
|
||||
OR event_lehrverband.verband IS NULL
|
||||
OR btrim(event_lehrverband.verband::text) = ''
|
||||
OR event_studentlehrverband.verband IS NULL
|
||||
)
|
||||
AND (
|
||||
event_lehrverband.gruppe = event_studentlehrverband.gruppe
|
||||
OR event_lehrverband.gruppe IS NULL
|
||||
OR btrim(event_lehrverband.gruppe::text) = ''
|
||||
OR event_studentlehrverband.gruppe IS NULL
|
||||
)
|
||||
WHERE event_lehrverband.kalender_id = tbl_kalender.kalender_id
|
||||
AND event_lehrverband.gruppe_kurzbz IS NULL
|
||||
AND event_lehrverband.studiengang_kz IS NOT NULL
|
||||
)";
|
||||
|
||||
$lehreinheitBenutzergruppeExists = "EXISTS (
|
||||
SELECT 1
|
||||
FROM lehre.tbl_kalender_lehreinheit student_kalender_lehreinheit
|
||||
JOIN lehre.tbl_lehreinheit student_lehreinheit
|
||||
ON student_lehreinheit.lehreinheit_id = student_kalender_lehreinheit.lehreinheit_id
|
||||
JOIN lehre.tbl_lehreinheitgruppe student_lehreinheitgruppe
|
||||
ON student_lehreinheitgruppe.lehreinheit_id = student_lehreinheit.lehreinheit_id
|
||||
JOIN public.tbl_gruppe student_gruppe
|
||||
ON student_gruppe.studiengang_kz = student_lehreinheitgruppe.studiengang_kz
|
||||
AND student_gruppe.semester = student_lehreinheitgruppe.semester
|
||||
AND student_gruppe.gruppe_kurzbz = student_lehreinheitgruppe.gruppe_kurzbz
|
||||
JOIN public.tbl_benutzergruppe student_benutzergruppe
|
||||
ON student_benutzergruppe.gruppe_kurzbz = student_gruppe.gruppe_kurzbz
|
||||
AND student_benutzergruppe.studiensemester_kurzbz = student_lehreinheit.studiensemester_kurzbz
|
||||
WHERE student_kalender_lehreinheit.kalender_id = tbl_kalender.kalender_id
|
||||
AND student_lehreinheitgruppe.gruppe_kurzbz IS NOT NULL
|
||||
AND student_benutzergruppe.uid = $escapedUserUID
|
||||
)";
|
||||
|
||||
$lehreinheitStudentlehrverbandExists = "EXISTS (
|
||||
SELECT 1
|
||||
FROM lehre.tbl_kalender_lehreinheit student_kalender_lehreinheit
|
||||
JOIN lehre.tbl_lehreinheit student_lehreinheit
|
||||
ON student_lehreinheit.lehreinheit_id = student_kalender_lehreinheit.lehreinheit_id
|
||||
JOIN lehre.tbl_lehreinheitgruppe student_lehreinheitgruppe
|
||||
ON student_lehreinheitgruppe.lehreinheit_id = student_lehreinheit.lehreinheit_id
|
||||
JOIN public.tbl_studentlehrverband student_lehrverband
|
||||
ON student_lehrverband.student_uid = $escapedUserUID
|
||||
AND student_lehrverband.studiengang_kz = student_lehreinheitgruppe.studiengang_kz
|
||||
AND student_lehrverband.semester = student_lehreinheitgruppe.semester
|
||||
AND student_lehrverband.studiensemester_kurzbz = student_lehreinheit.studiensemester_kurzbz
|
||||
AND (
|
||||
student_lehreinheitgruppe.verband = student_lehrverband.verband
|
||||
OR student_lehreinheitgruppe.verband IS NULL
|
||||
OR btrim(student_lehreinheitgruppe.verband::text) = ''
|
||||
OR student_lehrverband.verband IS NULL
|
||||
)
|
||||
AND (
|
||||
student_lehreinheitgruppe.gruppe = student_lehrverband.gruppe
|
||||
OR student_lehreinheitgruppe.gruppe IS NULL
|
||||
OR btrim(student_lehreinheitgruppe.gruppe::text) = ''
|
||||
OR student_lehrverband.gruppe IS NULL
|
||||
)
|
||||
WHERE student_kalender_lehreinheit.kalender_id = tbl_kalender.kalender_id
|
||||
AND student_lehreinheitgruppe.gruppe_kurzbz IS NULL
|
||||
)";
|
||||
|
||||
$this->_ci->KalenderModel->db->where('status_kurzbz', 'live');
|
||||
$this->_ci->KalenderModel->db->where($benutzerExists, null, false);
|
||||
$this->_ci->KalenderModel->db->group_start();
|
||||
$this->_ci->KalenderModel->db->where($directEventTeilnehmerExists, null, false);
|
||||
$this->_ci->KalenderModel->db->or_where($eventBenutzergruppeExists, null, false);
|
||||
$this->_ci->KalenderModel->db->or_where($eventStudentlehrverbandExists, null, false);
|
||||
$this->_ci->KalenderModel->db->or_where($lehreinheitBenutzergruppeExists, null, false);
|
||||
$this->_ci->KalenderModel->db->or_where($lehreinheitStudentlehrverbandExists, null, false);
|
||||
$this->_ci->KalenderModel->db->group_end();
|
||||
|
||||
$data = $this->_ci->KalenderModel->load();
|
||||
|
||||
return $this->_mapEvents($data);
|
||||
}
|
||||
|
||||
public function getPlanForLecturer($start_date, $end_date)
|
||||
{
|
||||
@@ -380,6 +533,57 @@ class KalenderLib
|
||||
|
||||
return $this->_mapEvents($data);
|
||||
}
|
||||
|
||||
public function getPlanForLecturerByLecturer($start_date, $end_date, $userUID)
|
||||
{
|
||||
$this->_getBasePlan($start_date, $end_date);
|
||||
|
||||
$escapedUserUID = $this->_ci->KalenderModel->db->escape($userUID);
|
||||
|
||||
$lehreinheitMitarbeiterExists = "EXISTS (
|
||||
SELECT 1
|
||||
FROM lehre.tbl_kalender_lehreinheit lecturer_kalender_lehreinheit
|
||||
JOIN lehre.tbl_lehreinheit lecturer_lehreinheit
|
||||
ON lecturer_lehreinheit.lehreinheit_id = lecturer_kalender_lehreinheit.lehreinheit_id
|
||||
JOIN lehre.tbl_lehreinheitmitarbeiter lecturer_lehreinheitmitarbeiter
|
||||
ON lecturer_lehreinheitmitarbeiter.lehreinheit_id = lecturer_lehreinheit.lehreinheit_id
|
||||
WHERE lecturer_kalender_lehreinheit.kalender_id = tbl_kalender.kalender_id
|
||||
AND lecturer_lehreinheitmitarbeiter.mitarbeiter_uid = $escapedUserUID
|
||||
)";
|
||||
|
||||
$eventTeilnehmerExists = "EXISTS (
|
||||
SELECT 1
|
||||
FROM lehre.tbl_kalender_event_teilnehmer lecturer_event_teilnehmer
|
||||
WHERE lecturer_event_teilnehmer.kalender_id = tbl_kalender.kalender_id
|
||||
AND lecturer_event_teilnehmer.uid = $escapedUserUID
|
||||
)";
|
||||
|
||||
$eventBenutzergruppeExists = "EXISTS (
|
||||
SELECT 1
|
||||
FROM lehre.tbl_kalender_event_teilnehmer lecturer_event_gruppe
|
||||
JOIN public.tbl_benutzergruppe lecturer_benutzergruppe
|
||||
ON lecturer_benutzergruppe.gruppe_kurzbz = lecturer_event_gruppe.gruppe_kurzbz
|
||||
AND (
|
||||
lecturer_event_gruppe.studiensemester_kurzbz IS NULL
|
||||
OR lecturer_benutzergruppe.studiensemester_kurzbz = lecturer_event_gruppe.studiensemester_kurzbz
|
||||
)
|
||||
WHERE lecturer_event_gruppe.kalender_id = tbl_kalender.kalender_id
|
||||
AND lecturer_event_gruppe.gruppe_kurzbz IS NOT NULL
|
||||
AND lecturer_benutzergruppe.uid = $escapedUserUID
|
||||
)";
|
||||
|
||||
$this->_ci->KalenderModel->db->where('tbl_kalender.status_kurzbz', 'live');
|
||||
$this->_ci->KalenderModel->db->group_start();
|
||||
$this->_ci->KalenderModel->db->where($lehreinheitMitarbeiterExists, null, false);
|
||||
$this->_ci->KalenderModel->db->or_where($eventTeilnehmerExists, null, false);
|
||||
$this->_ci->KalenderModel->db->or_where($eventBenutzergruppeExists, null, false);
|
||||
$this->_ci->KalenderModel->db->group_end();
|
||||
|
||||
$data = $this->_ci->KalenderModel->load();
|
||||
|
||||
return $this->_mapEvents($data);
|
||||
}
|
||||
|
||||
public function getZeitsperren($start_date, $end_date, $emp)
|
||||
{
|
||||
$db = new DB_Model();
|
||||
@@ -495,6 +699,7 @@ class KalenderLib
|
||||
'bis' => $end_date,
|
||||
'typ' => 'lehreinheit',
|
||||
'status_kurzbz' => 'planning',
|
||||
'eindeutige_gruppen_id' => $this->_ci->KalenderModel->generateUniqueGroupId(),
|
||||
'insertvon' => getAuthUID(),
|
||||
'insertamum' => date('Y-m-d H:i:s')
|
||||
)
|
||||
@@ -577,6 +782,7 @@ class KalenderLib
|
||||
'bis' => $end_date,
|
||||
'typ' => 'reservierung',
|
||||
'status_kurzbz' => 'live',
|
||||
'eindeutige_gruppen_id' => $this->_ci->KalenderModel->generateUniqueGroupId(),
|
||||
'insertvon' => getAuthUID(),
|
||||
'insertamum' => date('Y-m-d H:i:s')
|
||||
)
|
||||
@@ -658,6 +864,81 @@ class KalenderLib
|
||||
return $kalenderresult;
|
||||
}
|
||||
|
||||
public function addOperationalResourcesToKalenderEvent($calendar, $assignedResources)
|
||||
{
|
||||
$checkerData = new stdClass();
|
||||
$checkerData->kalender_id = $calendar->kalender_id;
|
||||
$checkerData->betriebsmittel_ids = [];
|
||||
$checkerData->von = $calendar->von;
|
||||
$checkerData->bis = $calendar->bis;
|
||||
|
||||
foreach ($assignedResources as $assignedResource) {
|
||||
array_push($checkerData->betriebsmittel_ids, $assignedResource['betriebsmittel_id']);
|
||||
}
|
||||
|
||||
$errors = [];
|
||||
$result = $this->_ci->collisionchecker->run($checkerData);
|
||||
if (!empty($result))
|
||||
{
|
||||
$errors = $result;
|
||||
}
|
||||
|
||||
if (!empty($errors)) {
|
||||
return error($errors);
|
||||
}
|
||||
|
||||
$this->_ci->db->trans_start();
|
||||
|
||||
$allowedResourceIDs = array_filter(array_map(
|
||||
function ($resource) {
|
||||
return $resource['betriebsmittel_id'] ?? null;
|
||||
},
|
||||
$assignedResources
|
||||
));
|
||||
|
||||
if (!empty($allowedResourceIDs)) {
|
||||
$placeholders = implode(',', array_fill(0, count($allowedResourceIDs), '?'));
|
||||
|
||||
$query = "
|
||||
DELETE FROM lehre.tbl_betriebsmittel_kalender
|
||||
WHERE eindeutige_kalender_gruppen_id = ?
|
||||
AND betriebsmittel_id NOT IN ($placeholders)
|
||||
";
|
||||
|
||||
$params = array_merge(
|
||||
[$calendar->eindeutige_gruppen_id],
|
||||
$allowedResourceIDs
|
||||
);
|
||||
|
||||
$this->_ci->db->query($query, $params);
|
||||
} else {
|
||||
$this->_ci->db->where('eindeutige_kalender_gruppen_id', $calendar->eindeutige_gruppen_id);
|
||||
$this->_ci->db->delete('lehre.tbl_betriebsmittel_kalender');
|
||||
}
|
||||
|
||||
foreach ($assignedResources as $assignedResource) {
|
||||
$data = [
|
||||
'eindeutige_kalender_gruppen_id' => $calendar->eindeutige_gruppen_id,
|
||||
'betriebsmittel_id' => $assignedResource['betriebsmittel_id'],
|
||||
'anmerkung' => $assignedResource['anmerkung'] ?? null,
|
||||
'quelle' => 'tempus_neu',
|
||||
'updateamum' => date('c'),
|
||||
'updatevon' => getAuthUid(),
|
||||
];
|
||||
if (isset($assignedResource['betriebsmittel_kalender_id'])) {
|
||||
$result = $this->_ci->BetriebsmittelKalenderModel->update($assignedResource['betriebsmittel_kalender_id'], $data);
|
||||
} else {
|
||||
$result = $this->_ci->BetriebsmittelKalenderModel->insert(array_merge($data, [
|
||||
'insertvon' => getAuthUid(),
|
||||
'updateamum' => date('c'),
|
||||
]));
|
||||
}
|
||||
}
|
||||
$this->_ci->db->trans_complete();
|
||||
|
||||
return success('Operational resources added to calendar event successfully.');
|
||||
}
|
||||
|
||||
private function _addTeilnehmerToEvent($kalender_id, $uid, $rolle)
|
||||
{
|
||||
return $this->_ci->KalenderEventTeilnehmerModel->insert(
|
||||
@@ -748,9 +1029,22 @@ class KalenderLib
|
||||
$entryResult = $this->_loadKalenderEntry($kalender_id);
|
||||
if (isError($entryResult)) return $entryResult;
|
||||
|
||||
|
||||
$kalender_entry = getData($entryResult);
|
||||
|
||||
$calendarResources = $this->_ci->BetriebsmittelKalenderModel->loadWhere(['eindeutige_kalender_gruppen_id' => $kalender_entry->eindeutige_gruppen_id]);
|
||||
if (isError($calendarResources)) return $calendarResources;
|
||||
|
||||
$calendarResourcesItems = getData($calendarResources);
|
||||
$calendarResourcesIDs = [];
|
||||
if (is_array($calendarResourcesItems)) {
|
||||
$calendarResourcesIDs = array_map(function($resource) {
|
||||
return $resource->betriebsmittel_id;
|
||||
}, getData($calendarResources));
|
||||
}
|
||||
|
||||
$kalender_entry->ort_kurzbz = $ort_kurzbz ?? $kalender_entry->ort_kurzbz;
|
||||
$kalender_entry->betriebsmittel_ids = $calendarResourcesIDs;
|
||||
$kalender_entry->von = $start_time ?? $kalender_entry->von;
|
||||
$kalender_entry->bis = $end_time ?? $kalender_entry->bis;
|
||||
|
||||
@@ -775,7 +1069,7 @@ class KalenderLib
|
||||
if (isError($result)) return $result;
|
||||
}
|
||||
|
||||
return success('Erfolgreich');
|
||||
return success($result);
|
||||
}
|
||||
|
||||
public function updateZeit($kalender_id, $start_date, $end_date)
|
||||
@@ -888,6 +1182,7 @@ class KalenderLib
|
||||
'typ' => 'lehreinheit',
|
||||
'status_kurzbz' => 'planning',
|
||||
'vorgaenger_kalender_id' => $old_id,
|
||||
'eindeutige_gruppen_id' => $kalender_entry->eindeutige_gruppen_id,
|
||||
'insertvon' => getAuthUID(),
|
||||
'insertamum' => date('Y-m-d H:i:s')
|
||||
)
|
||||
|
||||
@@ -7,10 +7,18 @@ use CI3_Events as Events;
|
||||
class RaumvorschlagLib
|
||||
{
|
||||
private $_ci;
|
||||
public function __construct()
|
||||
private $_uid;
|
||||
|
||||
public function __construct($params)
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
if (isset($params['uid']) && !isEmptyString($params['uid'])){
|
||||
$this->_uid = $params['uid'];
|
||||
} else {
|
||||
show_error('uid of logged user not passed!');
|
||||
}
|
||||
|
||||
$this->_ci->load->model('ressource/Kalender_model', 'KalenderModel');
|
||||
$this->_ci->load->model('ressource/Kalender_Lehreinheit_model', 'KalenderLehreinheitModel');
|
||||
$this->_ci->load->model('ressource/Kalender_Event_model', 'KalenderEventModel');
|
||||
@@ -26,8 +34,8 @@ class RaumvorschlagLib
|
||||
$this->_ci->load->model('education/Lehreinheitgruppe_model', 'LehreinheitgruppeModel');
|
||||
$this->_ci->load->model('education/Lehreinheitgruppe_model', 'LehreinheitgruppeModel');
|
||||
|
||||
$this->_ci->load->library('CollisionChecker');
|
||||
$this->_ci->load->library('KalenderLib');
|
||||
$this->_ci->load->library('CollisionChecker', ["uid" => getAuthUID()]);
|
||||
$this->_ci->load->library('KalenderLib', ["uid" => getAuthUID()]);
|
||||
$this->_ci->load->library('PhrasesLib', array('ui'));
|
||||
}
|
||||
|
||||
|
||||
@@ -14,9 +14,9 @@ class VariableLib
|
||||
/**
|
||||
* VariableLib constructor.
|
||||
* Loads variable of logged in user.
|
||||
* @param $loggeduid
|
||||
* @param $params
|
||||
*/
|
||||
public function __construct($loggeduid)
|
||||
public function __construct($params)
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
@@ -25,8 +25,8 @@ class VariableLib
|
||||
$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']);
|
||||
if (isset($params['uid']) && !isEmptyString($params['uid']))
|
||||
$this->_setVariables($params['uid']);
|
||||
else
|
||||
{
|
||||
show_error('uid of logged user not passed!');
|
||||
|
||||
@@ -4,13 +4,21 @@ class LectureCollisionCheck implements ICollisionCheck
|
||||
{
|
||||
|
||||
private $_ci;
|
||||
private $_uid;
|
||||
|
||||
public function __construct()
|
||||
public function __construct($params)
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
if (isset($params['uid']) && !isEmptyString($params['uid'])){
|
||||
$this->_uid = $params['uid'];
|
||||
} else {
|
||||
show_error('uid of logged user not passed!');
|
||||
}
|
||||
|
||||
$this->_ci->load->model('ressource/Kalender_model', 'KalenderModel');
|
||||
$this->_ci->load->model('ressource/zeitsperre_model', 'ZeitsperreModel');
|
||||
$this->_ci->load->library('VariableLib', array('uid' => getAuthUID()));
|
||||
$this->_ci->load->library('VariableLib', ['uid' => $this->_uid]);
|
||||
$this->_ci->load->library('PhrasesLib', array('ui'));
|
||||
|
||||
}
|
||||
@@ -255,4 +263,4 @@ class LectureCollisionCheck implements ICollisionCheck
|
||||
}, getData($result));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
<?php
|
||||
|
||||
class ResourcesCollisionCheck implements ICollisionCheck
|
||||
{
|
||||
|
||||
private $_ci;
|
||||
private $_uid;
|
||||
|
||||
public function __construct($params)
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
if (isset($params['uid']) && !isEmptyString($params['uid'])){
|
||||
$this->_uid = $params['uid'];
|
||||
} else {
|
||||
show_error('uid of logged user not passed!');
|
||||
}
|
||||
|
||||
$this->_ci->load->model('ressource/Kalender_model', 'KalenderModel');
|
||||
$this->_ci->load->library('VariableLib', array('uid' => $this->_uid));
|
||||
$this->_ci->load->library('PhrasesLib', array('ui'));
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return 'resources';
|
||||
}
|
||||
|
||||
public function check($data)
|
||||
{
|
||||
if (!isset($data->betriebsmittel_ids, $data->von, $data->bis, $data->kalender_id)) return [];
|
||||
|
||||
if (empty($data->betriebsmittel_ids)) return [];
|
||||
|
||||
if ($this->_ci->variablelib->getVar('ignore_kollision') === 'true') return [];
|
||||
if ($this->_ci->variablelib->getVar('ignore_resources_collisions') === 'true') return [];
|
||||
|
||||
$this->_ci->KalenderModel->addSelect('kalender_id, von, bis, bm.beschreibung AS betriebsmittel_beschreibung');
|
||||
$this->_ci->KalenderModel->addJoin('lehre.tbl_betriebsmittel_kalender bk', 'bk.eindeutige_kalender_gruppen_id = tbl_kalender.eindeutige_gruppen_id');
|
||||
$this->_ci->KalenderModel->addJoin('wawi.tbl_betriebsmittel bm', 'bm.betriebsmittel_id = bk.betriebsmittel_id');
|
||||
|
||||
$this->_ci->KalenderModel->db->where('tbl_kalender.kalender_id !=', $data->kalender_id);
|
||||
$this->_ci->KalenderModel->db->where('tbl_kalender.kalender_id NOT IN (SELECT vorgaenger_kalender_id FROM lehre.tbl_kalender WHERE vorgaenger_kalender_id IS NOT NULL)', null, false);
|
||||
$this->_ci->KalenderModel->db->where_not_in('tbl_kalender.status_kurzbz', ['archived', 'deleted', 'to_delete']);
|
||||
$this->_ci->KalenderModel->db->where_in('bk.betriebsmittel_id', $data->betriebsmittel_ids);
|
||||
|
||||
|
||||
$result = $this->_ci->KalenderModel->loadWhere(array(
|
||||
'von <' => $data->bis,
|
||||
'bis >' => $data->von,
|
||||
));
|
||||
|
||||
if (isError($result)) return [];
|
||||
if (!hasData($result)) return [];
|
||||
|
||||
return array_map(function($row)
|
||||
{
|
||||
return [
|
||||
'errorCode' => 'resource_collision',
|
||||
'message' => $this->_ci->phraseslib->t('ui', 'resource_collision') . ': ' . $row->betriebsmittel_beschreibung . ' (' . date('d.m.Y H:i', strtotime($row->von)) . ' - ' . date('d.m.Y H:i', strtotime($row->bis)) . ')'
|
||||
];
|
||||
}, getData($result));
|
||||
}
|
||||
|
||||
public function checkAll($kalender_ids)
|
||||
{
|
||||
if (empty($kalender_ids)) return [];
|
||||
|
||||
$this->_ci->KalenderModel->addSelect('DISTINCT ON (tbl_kalender.kalender_id) tbl_kalender.kalender_id');
|
||||
$this->_ci->KalenderModel->addJoin('lehre.tbl_betriebsmittel_kalender current_bk', 'current_bk.eindeutige_kalender_gruppen_id = tbl_kalender.eindeutige_gruppen_id');
|
||||
$this->_ci->KalenderModel->addJoin('lehre.tbl_betriebsmittel_kalender other_bk', 'other_bk.betriebsmittel_id = current_bk.betriebsmittel_id');
|
||||
$this->_ci->KalenderModel->addJoin('lehre.tbl_kalender other_kalender', 'other_kalender.eindeutige_gruppen_id = other_bk.eindeutige_kalender_gruppen_id');
|
||||
|
||||
$this->_ci->KalenderModel->db->where('other_kalender.kalender_id != tbl_kalender.kalender_id', null, false);
|
||||
$this->_ci->KalenderModel->db->where('other_kalender.von < tbl_kalender.bis', null, false);
|
||||
$this->_ci->KalenderModel->db->where('other_kalender.bis > tbl_kalender.von', null, false);
|
||||
$this->_ci->KalenderModel->db->where_not_in('other_kalender.status_kurzbz', ['archived', 'deleted', 'to_delete']);
|
||||
$this->_ci->KalenderModel->db->where_in('tbl_kalender.kalender_id', $kalender_ids);
|
||||
$this->_ci->KalenderModel->db->where('other_kalender.kalender_id NOT IN (SELECT vorgaenger_kalender_id FROM lehre.tbl_kalender WHERE vorgaenger_kalender_id IS NOT NULL)', null, false);
|
||||
|
||||
$result = $this->_ci->KalenderModel->load();
|
||||
|
||||
if (isError($result) || !hasData($result)) return [];
|
||||
|
||||
$grouped = [];
|
||||
foreach (getData($result) as $row)
|
||||
{
|
||||
$grouped[$row->kalender_id][] = true;
|
||||
}
|
||||
|
||||
return $grouped;
|
||||
}
|
||||
}
|
||||
@@ -4,12 +4,20 @@ class RoomCollisionCheck implements ICollisionCheck
|
||||
{
|
||||
|
||||
private $_ci;
|
||||
private $_uid;
|
||||
|
||||
public function __construct()
|
||||
public function __construct($params)
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
if (isset($params['uid']) && !isEmptyString($params['uid'])){
|
||||
$this->_uid = $params['uid'];
|
||||
} else {
|
||||
show_error('uid of logged user not passed!');
|
||||
}
|
||||
|
||||
$this->_ci->load->model('ressource/Kalender_model', 'KalenderModel');
|
||||
$this->_ci->load->library('VariableLib', array('uid' => getAuthUID()));
|
||||
$this->_ci->load->library('VariableLib', array('uid' => $this->_uid));
|
||||
$this->_ci->load->library('PhrasesLib', array('ui'));
|
||||
}
|
||||
|
||||
@@ -77,4 +85,4 @@ class RoomCollisionCheck implements ICollisionCheck
|
||||
|
||||
return $grouped;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,12 +3,20 @@
|
||||
class StudentCollisionCheck implements ICollisionCheck
|
||||
{
|
||||
private $_ci;
|
||||
private $_uid;
|
||||
|
||||
public function __construct()
|
||||
public function __construct($params)
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
if (isset($params['uid']) && !isEmptyString($params['uid'])){
|
||||
$this->_uid = $params['uid'];
|
||||
} else {
|
||||
show_error('uid of logged user not passed!');
|
||||
}
|
||||
|
||||
$this->_ci->load->model('ressource/Kalender_model', 'KalenderModel');
|
||||
$this->_ci->load->library('VariableLib', array('uid' => getAuthUID()));
|
||||
$this->_ci->load->library('VariableLib', array('uid' => $this->_uid));
|
||||
$this->_ci->load->library('PhrasesLib', array('ui'));
|
||||
}
|
||||
|
||||
@@ -244,4 +252,4 @@ class StudentCollisionCheck implements ICollisionCheck
|
||||
|
||||
return $grouped;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,12 +4,20 @@ class VerbandCollisionCheck implements ICollisionCheck
|
||||
{
|
||||
|
||||
private $_ci;
|
||||
private $_uid;
|
||||
|
||||
public function __construct()
|
||||
public function __construct($params)
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
if (isset($params['uid']) && !isEmptyString($params['uid'])){
|
||||
$this->_uid = $params['uid'];
|
||||
} else {
|
||||
show_error('uid of logged user not passed!');
|
||||
}
|
||||
|
||||
$this->_ci->load->model('ressource/Kalender_model', 'KalenderModel');
|
||||
$this->_ci->load->library('VariableLib', array('uid' => getAuthUID()));
|
||||
$this->_ci->load->library('VariableLib', array('uid' => $this->_uid));
|
||||
$this->_ci->load->library('PhrasesLib', array('ui'));
|
||||
|
||||
}
|
||||
@@ -359,4 +367,4 @@ class VerbandCollisionCheck implements ICollisionCheck
|
||||
return $grouped;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
class SabreDAVAuthLib extends \Sabre\DAV\Auth\Backend\AbstractBasic
|
||||
{
|
||||
private $_ci;
|
||||
protected $currentUser = null;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
$this->_ci->load->library('AuthLib', array(false));
|
||||
$this->_ci->load->helper('hlp_authentication');
|
||||
}
|
||||
|
||||
public function getCurrentUser()
|
||||
{
|
||||
if ($this->currentUser)
|
||||
return $this->currentUser;
|
||||
|
||||
if (isLogged())
|
||||
return getAuthUID();
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
protected function validateUserPass($username, $password)
|
||||
{
|
||||
if (isSuccess($this->_ci->authlib->checkUserAuthByUsernamePassword($username, $password)))
|
||||
{
|
||||
$this->currentUser = $username;
|
||||
return true;
|
||||
}
|
||||
|
||||
$this->currentUser = null;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
require_once __DIR__.'/caldav/SabreDAVACLPrincipalBackend.php';
|
||||
require_once __DIR__.'/caldav/SabreDAVCalDAVBackend.php';
|
||||
|
||||
/**
|
||||
* Loads the SabreDAV CalDAV classes for the LVPlan calendar endpoint.
|
||||
*/
|
||||
class SabreDAVCalDAVLib
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,179 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* PDO principal backend
|
||||
*
|
||||
* This is a simple principal backend that maps exactly to the users table, as
|
||||
* used by Sabre_DAV_Auth_Backend_PDO.
|
||||
*
|
||||
* It assumes all principals are in a single collection. The default collection
|
||||
* is 'principals/', but this can be overriden.
|
||||
*
|
||||
* @package Sabre
|
||||
* @subpackage DAVACL
|
||||
* @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
|
||||
* @author Evert Pot (http://www.rooftopsolutions.nl/)
|
||||
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
|
||||
*/
|
||||
class SabreDAVACLPrincipalBackend implements \Sabre\DAVACL\PrincipalBackend\BackendInterface
|
||||
{
|
||||
/**
|
||||
* PDO table name for 'principals'
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $tableName;
|
||||
|
||||
/**
|
||||
* PDO table name for 'group members'
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $groupMembersTableName;
|
||||
|
||||
protected $result_ma;
|
||||
protected $auth;
|
||||
/**
|
||||
* Sets up the backend.
|
||||
*
|
||||
* @param PDO $pdo
|
||||
* @param string $tableName
|
||||
*/
|
||||
public function __construct($auth)
|
||||
{
|
||||
$this->auth = $auth;
|
||||
|
||||
/*
|
||||
$ma = new mitarbeiter();
|
||||
$this->result_ma = $ma->getMitarbeiter(null,null,null);
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
* Liefert den eingeloggten User
|
||||
*/
|
||||
function getUser()
|
||||
{
|
||||
return $this->auth->getCurrentUser();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns a list of principals based on a prefix.
|
||||
*
|
||||
* This prefix will often contain something like 'principals'. You are only
|
||||
* expected to return principals that are in this base path.
|
||||
*
|
||||
* You are expected to return at least a 'uri' for every user, you can
|
||||
* return any additional properties if you wish so. Common properties are:
|
||||
* {DAV:}displayname
|
||||
* {http://sabredav.org/ns}email-address - This is a custom SabreDAV
|
||||
* field that's actualy injected in a number of other properties. If
|
||||
* you have an email address, use this property.
|
||||
*
|
||||
* @param string $prefixPath
|
||||
* @return array
|
||||
*/
|
||||
public function getPrincipalsByPrefix($prefixPath)
|
||||
{
|
||||
//$prefixPath = principals
|
||||
//error_log('Principal.php/getPrincipalsByPrefix('.$prefixPath.')');
|
||||
$principals = array();
|
||||
$user = $this->getUser();
|
||||
|
||||
if($prefixPath=='principals')
|
||||
{
|
||||
|
||||
$principals[] = array(
|
||||
'id' => $user,
|
||||
'uri' => 'principals/'.$user,
|
||||
'{DAV:}displayname' => $user,
|
||||
'{http://sabredav.org/ns}email-address' => $user.'@example.com',
|
||||
);
|
||||
}
|
||||
|
||||
return $principals;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a specific principal, specified by it's path.
|
||||
* The returned structure should be the exact same as from
|
||||
* getPrincipalsByPrefix.
|
||||
*
|
||||
* @param string $path
|
||||
* @return array
|
||||
*/
|
||||
public function getPrincipalByPath($path)
|
||||
{
|
||||
$user = mb_substr($path,11);
|
||||
|
||||
$result = array(
|
||||
'id' => $user,
|
||||
'uri' => 'principals/'.$user,
|
||||
'{DAV:}displayname' => $user,
|
||||
'{http://sabredav.org/ns}email-address' => $user.'@example.com',
|
||||
);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the list of members for a group-principal
|
||||
*
|
||||
* @param string $principal
|
||||
* @return array
|
||||
*/
|
||||
public function getGroupMemberSet($principal)
|
||||
{
|
||||
$result = array();
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the list of groups a principal is a member of
|
||||
*
|
||||
* @param string $principal
|
||||
* @return array
|
||||
*/
|
||||
public function getGroupMembership($principal)
|
||||
{
|
||||
$result = array();
|
||||
if(preg_match('/^principals\/[0-9A-Za-z\-]*$/',$principal))
|
||||
{
|
||||
$user = mb_substr($principal,11);
|
||||
}
|
||||
return $result;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the list of group members for a group principal.
|
||||
*
|
||||
* The principals should be passed as a list of uri's.
|
||||
*
|
||||
* @param string $principal
|
||||
* @param array $members
|
||||
* @return void
|
||||
*/
|
||||
public function setGroupMemberSet($principal, array $members)
|
||||
{
|
||||
throw new \Sabre\DAV\Exception('Not implemented');
|
||||
}
|
||||
|
||||
public function updatePrincipal($path, \Sabre\DAV\PropPatch $propPatch)
|
||||
{
|
||||
$propPatch->setRemainingResultCode(403);
|
||||
}
|
||||
|
||||
public function searchPrincipals($prefixPath, array $searchProperties, $test = 'allof')
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
public function findByUri($uri, $principalPrefix)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,575 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* CalDAV backend
|
||||
*/
|
||||
class SabreDAVCalDAVBackend extends \Sabre\CalDAV\Backend\AbstractBackend
|
||||
{
|
||||
protected $auth;
|
||||
|
||||
protected $CI;
|
||||
|
||||
CONST CALENDAR_NAME = 'LVPlan';
|
||||
CONST CAL_CATEGORY_STUNDENPLAN = 'Stundenplan';
|
||||
CONST CAL_CATEGORY_STUNDENPLAN_EXAM = 'StundenplanExam';
|
||||
CONST CAL_CATEGORY_STUNDENPLAN_REMOTE = 'StundenplanRemote';
|
||||
|
||||
CONST CAL_CATEGORY_STUNDENPLAN_EXAM_ICON = '📝';
|
||||
CONST CAL_CATEGORY_STUNDENPLAN_ON_SITE_ICON = '🏫';
|
||||
CONST CAL_CATEGORY_STUNDENPLAN_REMOTE_ICON = '📍';
|
||||
CONST CAL_CATEGORY_RESERVATION_ICON = '📌';
|
||||
/**
|
||||
* Creates the backend
|
||||
*
|
||||
* @param AuthBackend $auth
|
||||
*/
|
||||
public function __construct($auth)
|
||||
{
|
||||
$this->auth = $auth;
|
||||
|
||||
$this->CI =& get_instance();
|
||||
}
|
||||
|
||||
/**
|
||||
* Liefert den eingeloggten User
|
||||
*/
|
||||
function getUser()
|
||||
{
|
||||
return $this->auth->getCurrentUser();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of calendars for a principal.
|
||||
*
|
||||
* Every project is an array with the following keys:
|
||||
* * id, a unique id that will be used by other functions to modify the
|
||||
* calendar. This can be the same as the uri or a database key.
|
||||
* * uri, which the basename of the uri with which the calendar is
|
||||
* accessed.
|
||||
* * principalUri. The owner of the calendar. Almost always the same as
|
||||
* principalUri passed to this method.
|
||||
*
|
||||
* Furthermore it can contain webdav properties in clark notation. A very
|
||||
* common one is '{DAV:}displayname'.
|
||||
*
|
||||
* @param string $principalUri
|
||||
* @return array
|
||||
*/
|
||||
public function getCalendarsForUser($principalUri)
|
||||
{
|
||||
$user = mb_substr($principalUri,11);
|
||||
$calendars = array();
|
||||
$calendar = array(
|
||||
'id' => $user,
|
||||
'uri' => self::CALENDAR_NAME.'-'.$user,
|
||||
'principaluri' => 'principals/'.$user,
|
||||
'{' . \Sabre\CalDAV\Plugin::NS_CALENDARSERVER . '}getctag' => $this->buildCalendarCtag($user),
|
||||
'{' . \Sabre\CalDAV\Plugin::NS_CALDAV . '}supported-calendar-component-set' => new \Sabre\CalDAV\Xml\Property\SupportedCalendarComponentSet(array('VEVENT')),
|
||||
'{DAV:}displayname' => self::CALENDAR_NAME,
|
||||
'{urn:ietf:params:xml:ns:caldav}calendar-description' => 'description comes here',
|
||||
'{urn:ietf:params:xml:ns:caldav}calendar-timezone' => 'Europe/Vienna',
|
||||
'{http://apple.com/ns/ical/}calendar-order' => '1',
|
||||
'{http://apple.com/ns/ical/}calendar-color' => '#FF0000',
|
||||
'{http://sabredav.org/ns}read-only' => 1
|
||||
);
|
||||
$calendars[] = $calendar;
|
||||
|
||||
return $calendars;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new calendar for a principal.
|
||||
*
|
||||
* If the creation was a success, an id must be returned that can be used to reference
|
||||
* this calendar in other methods, such as updateCalendar
|
||||
*
|
||||
* @param string $principalUri
|
||||
* @param string $calendarUri
|
||||
* @param array $properties
|
||||
*/
|
||||
public function createCalendar($principalUri,$calendarUri, array $properties)
|
||||
{
|
||||
return $calendarUri;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates properties for a calendar.
|
||||
*
|
||||
* The mutations array uses the propertyName in clark-notation as key,
|
||||
* and the array value for the property value. In the case a property
|
||||
* should be deleted, the property value will be null.
|
||||
*
|
||||
* This method must be atomic. If one property cannot be changed, the
|
||||
* entire operation must fail.
|
||||
*
|
||||
* If the operation was successful, true can be returned.
|
||||
* If the operation failed, false can be returned.
|
||||
*
|
||||
* Deletion of a non-existant property is always succesful.
|
||||
*
|
||||
* Lastly, it is optional to return detailed information about any
|
||||
* failures. In this case an array should be returned with the following
|
||||
* structure:
|
||||
*
|
||||
* array(
|
||||
* 403 => array(
|
||||
* '{DAV:}displayname' => null,
|
||||
* ),
|
||||
* 424 => array(
|
||||
* '{DAV:}owner' => null,
|
||||
* )
|
||||
* )
|
||||
*
|
||||
* In this example it was forbidden to update {DAV:}displayname.
|
||||
* (403 Forbidden), which in turn also caused {DAV:}owner to fail
|
||||
* (424 Failed Dependency) because the request needs to be atomic.
|
||||
*
|
||||
* @param string $calendarId
|
||||
* @param array $mutations
|
||||
* @return bool|array
|
||||
*/
|
||||
public function updateCalendar($calendarId, \Sabre\DAV\PropPatch $propPatch)
|
||||
{
|
||||
$propPatch->setRemainingResultCode(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a calendar and all it's objects
|
||||
*
|
||||
* @param string $calendarId
|
||||
* @return void
|
||||
*/
|
||||
public function deleteCalendar($calendarId)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public function getCalendarData($userUID, $objectUri=null)
|
||||
{
|
||||
$this->CI->load->model("ressource/Mitarbeiter_model", "MitarbeiterModel");
|
||||
$this->CI->load->model("person/Benutzer_model", "BenutzerModel");
|
||||
|
||||
$user = $this->CI->BenutzerModel->loadWhere(array("uid" => $userUID));
|
||||
if(!$user)
|
||||
die('User invalid');
|
||||
|
||||
$this->CI->load->library('KalenderLib', ['uid' => $userUID]);
|
||||
|
||||
$isUserEmployeeResult = $this->CI->MitarbeiterModel->isMitarbeiter($userUID);
|
||||
if (isError($isUserEmployeeResult)) {
|
||||
return;
|
||||
}
|
||||
$isUserEmployee = getData($isUserEmployeeResult);
|
||||
|
||||
$startDate = date('Y-m-d', mktime(0,0,0,date('m'),date('d')-14,date('Y')));
|
||||
$endDate = date('Y-m-d', mktime(0,0,0,date('m')+6,date('d'),date('Y')));
|
||||
|
||||
$data = [];
|
||||
|
||||
if ($isUserEmployee) {
|
||||
$data = $this->CI->kalenderlib->getPlanForLecturerByLecturer($startDate, $endDate, $userUID);
|
||||
} else {
|
||||
$data = $this->CI->kalenderlib->getPlanForStudentByStudent($startDate, $endDate, $userUID);
|
||||
}
|
||||
|
||||
if(!is_array($data))
|
||||
$data = array();
|
||||
|
||||
foreach($data as $item)
|
||||
{
|
||||
$item->calendarDataFragment = $this->buildCalendarDataFragment($item);
|
||||
}
|
||||
|
||||
if (is_null($objectUri))
|
||||
{
|
||||
return $data;
|
||||
}
|
||||
|
||||
$normalizedObjectUri = $this->normalizeObjectUri($objectUri);
|
||||
foreach($data as $row)
|
||||
{
|
||||
if(md5($row->eindeutige_gruppen_id) == $normalizedObjectUri)
|
||||
{
|
||||
return $row;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public function makeCal($event)
|
||||
{
|
||||
return $this->buildICalLine('BEGIN', 'VCALENDAR')
|
||||
.$this->buildICalLine('VERSION', '2.0')
|
||||
.$this->buildICalTextLine('PRODID', 'FH Technikum Wien')
|
||||
.$this->buildICalLine('BEGIN', 'VTIMEZONE')
|
||||
.$this->buildICalLine('TZID', 'Europe/Vienna')
|
||||
.$this->buildICalLine('BEGIN', 'DAYLIGHT')
|
||||
.$this->buildICalLine('TZOFFSETFROM', '+0100')
|
||||
.$this->buildICalLine('RRULE', 'FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU')
|
||||
.$this->buildICalLine('DTSTART', '19810329T020000')
|
||||
.$this->buildICalLine('TZNAME', 'GMT+02:00')
|
||||
.$this->buildICalLine('TZOFFSETTO', '+0200')
|
||||
.$this->buildICalLine('END', 'DAYLIGHT')
|
||||
.$this->buildICalLine('BEGIN', 'STANDARD')
|
||||
.$this->buildICalLine('TZOFFSETFROM', '+0200')
|
||||
.$this->buildICalLine('RRULE', 'FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU')
|
||||
.$this->buildICalLine('DTSTART', '19961027T030000')
|
||||
.$this->buildICalLine('TZNAME', 'GMT+01:00')
|
||||
.$this->buildICalLine('TZOFFSETTO', '+0100')
|
||||
.$this->buildICalLine('END', 'STANDARD')
|
||||
.$this->buildICalLine('END', 'VTIMEZONE')
|
||||
.$event
|
||||
.$this->buildICalLine('END', 'VCALENDAR');
|
||||
}
|
||||
|
||||
protected function buildCalendarDataFragment($item)
|
||||
{
|
||||
$summaryIcon = '';
|
||||
$summary = $item->type == 'reservierung' ? $item->titel : $item->topic;
|
||||
|
||||
$description = "";
|
||||
if ($item->type == 'reservierung') {
|
||||
$description = $item->beschreibung;
|
||||
} else {
|
||||
$description = $item->lehrfach_bez . "\r\n";
|
||||
|
||||
if (isset($item->lektor) && is_array($item->lektor) && count($item->lektor) > 0) {
|
||||
$description .= "Lektor*in: " . join(", ", array_map(function($teacher) { return $teacher["kurzbz"]; }, $item->lektor)) . "\r\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$category = self::CAL_CATEGORY_STUNDENPLAN;
|
||||
if ($item->type === 'lehreinheit') {
|
||||
if ($item->lehrform === 'EXAM') {
|
||||
$summaryIcon = self::CAL_CATEGORY_STUNDENPLAN_EXAM_ICON;
|
||||
$category = self::CAL_CATEGORY_STUNDENPLAN_EXAM;
|
||||
} else if (!isset($item->ko_ort_kurzbz) || $item->ko_ort_kurzbz === '') {
|
||||
$summaryIcon = self::CAL_CATEGORY_STUNDENPLAN_REMOTE_ICON;
|
||||
$category = self::CAL_CATEGORY_STUNDENPLAN_REMOTE;
|
||||
}
|
||||
} else if ($item->type === 'reservierung' && (!isset($item->ko_ort_kurzbz) || $item->ko_ort_kurzbz === '')) {
|
||||
$summaryIcon = self::CAL_CATEGORY_RESERVATION_ICON;
|
||||
$category = self::CAL_CATEGORY_STUNDENPLAN_REMOTE;
|
||||
}
|
||||
|
||||
if ($summaryIcon !== '') {
|
||||
$summary = $summaryIcon . ' ' . $summary;
|
||||
}
|
||||
|
||||
$parsedStartDate = $this->formatICalLocalDateTime($item->isostart);
|
||||
$parsedEndDate = $this->formatICalLocalDateTime($item->isoend);
|
||||
$lastModified = $this->formatICalUtcDateTime(isset($item->updateamum) ? $item->updateamum : null);
|
||||
$dtStamp = $lastModified ?: $this->formatICalUtcDateTime($item->isostart);
|
||||
|
||||
if($dtStamp === null)
|
||||
$dtStamp = '19700101T000000Z';
|
||||
|
||||
$fragment = $this->buildICalLine('BEGIN', 'VEVENT')
|
||||
.$this->buildICalTextLine('UID', $item->eindeutige_gruppen_id)
|
||||
.$this->buildICalLine('SEQUENCE', (int)$item->kalender_id)
|
||||
.$this->buildICalTextLine('SUMMARY', $summary)
|
||||
.$this->buildICalTextLine('DESCRIPTION', $description)
|
||||
.$this->buildICalTextLine('LOCATION', isset($item->ort_kurzbz) ? $item->ort_kurzbz : '')
|
||||
.$this->buildICalTextLine('CATEGORIES', $category)
|
||||
.$this->buildICalLine('DTSTART', $parsedStartDate, array('TZID' => 'Europe/Vienna'))
|
||||
.$this->buildICalLine('DTEND', $parsedEndDate, array('TZID' => 'Europe/Vienna'));
|
||||
|
||||
if($lastModified !== null)
|
||||
$fragment .= $this->buildICalLine('LAST-MODIFIED', $lastModified);
|
||||
|
||||
return $fragment
|
||||
.$this->buildICalLine('DTSTAMP', $dtStamp)
|
||||
.$this->buildICalLine('END', 'VEVENT');
|
||||
}
|
||||
|
||||
protected function buildCalendarCtag($userUID)
|
||||
{
|
||||
$data = $this->getCalendarData($userUID);
|
||||
if(!is_array($data))
|
||||
$data = array();
|
||||
|
||||
$fragments = array();
|
||||
foreach($data as $row)
|
||||
{
|
||||
$lastModified = isset($row->updateamum) ? $this->getLastModifiedTimestamp($row->updateamum) : null;
|
||||
$calendarData = isset($row->calendarDataFragment) ? $this->makeCal($row->calendarDataFragment) : '';
|
||||
$fragments[] = $this->getObjectUri($row).':'.$lastModified.':'.md5($calendarData);
|
||||
}
|
||||
|
||||
sort($fragments, SORT_STRING);
|
||||
return self::CALENDAR_NAME.'-'.$userUID.'-'.md5(implode('|', $fragments));
|
||||
}
|
||||
|
||||
protected function buildICalTextLine($name, $value, array $parameters = array())
|
||||
{
|
||||
return $this->buildICalLine($name, $this->escapeICalText($value), $parameters);
|
||||
}
|
||||
|
||||
protected function buildICalLine($name, $value, array $parameters = array())
|
||||
{
|
||||
$line = strtoupper($name);
|
||||
|
||||
foreach($parameters as $parameterName => $parameterValue)
|
||||
{
|
||||
$parameterValues = is_array($parameterValue) ? $parameterValue : array($parameterValue);
|
||||
$escapedValues = array();
|
||||
|
||||
foreach($parameterValues as $singleParameterValue)
|
||||
$escapedValues[] = $this->escapeICalParameterValue($singleParameterValue);
|
||||
|
||||
$line .= ';'.strtoupper($parameterName).'='.implode(',', $escapedValues);
|
||||
}
|
||||
|
||||
return $this->foldICalLine($line.':'.(string)$value);
|
||||
}
|
||||
|
||||
protected function foldICalLine($line)
|
||||
{
|
||||
$line = (string)$line;
|
||||
$folded = '';
|
||||
|
||||
while(strlen($line) > 75)
|
||||
{
|
||||
$part = mb_strcut($line, 0, 75, 'UTF-8');
|
||||
$folded .= $part."\r\n";
|
||||
$line = ' '.mb_strcut($line, strlen($part), strlen($line) - strlen($part), 'UTF-8');
|
||||
}
|
||||
|
||||
return $folded.$line."\r\n";
|
||||
}
|
||||
|
||||
protected function escapeICalText($value)
|
||||
{
|
||||
$value = (string)$value;
|
||||
$value = str_replace('\\', '\\\\', $value);
|
||||
$value = str_replace(array("\r\n", "\r", "\n"), '\n', $value);
|
||||
return str_replace(array(';', ','), array('\;', '\,'), $value);
|
||||
}
|
||||
|
||||
protected function escapeICalParameterValue($value)
|
||||
{
|
||||
$value = (string)$value;
|
||||
$value = str_replace(array('\\', '"', "\r", "\n"), array('\\\\', '\"', '', ''), $value);
|
||||
|
||||
if(preg_match('/[;:,]/', $value))
|
||||
return '"'.$value.'"';
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
protected function formatICalLocalDateTime($dateTime)
|
||||
{
|
||||
$dateTime = $this->createDateTime($dateTime);
|
||||
if($dateTime === null)
|
||||
return null;
|
||||
|
||||
$dateTime->setTimezone(new DateTimeZone('Europe/Vienna'));
|
||||
return $dateTime->format('Ymd\THis');
|
||||
}
|
||||
|
||||
protected function formatICalUtcDateTime($dateTime)
|
||||
{
|
||||
$dateTime = $this->createDateTime($dateTime);
|
||||
if($dateTime === null)
|
||||
return null;
|
||||
|
||||
$dateTime->setTimezone(new DateTimeZone('UTC'));
|
||||
return $dateTime->format('Ymd\THis\Z');
|
||||
}
|
||||
|
||||
protected function createDateTime($dateTime)
|
||||
{
|
||||
if($dateTime instanceof DateTime)
|
||||
return clone $dateTime;
|
||||
|
||||
if($dateTime === null || $dateTime === '')
|
||||
return null;
|
||||
|
||||
try
|
||||
{
|
||||
if(is_numeric($dateTime))
|
||||
return new DateTime('@'.(int)$dateTime);
|
||||
|
||||
return new DateTime($dateTime);
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
protected function getObjectUri($row)
|
||||
{
|
||||
return md5($row->eindeutige_gruppen_id).'.ics';
|
||||
}
|
||||
|
||||
protected function normalizeObjectUri($objectUri)
|
||||
{
|
||||
$normalizedObjectUri = (string)$objectUri;
|
||||
|
||||
if(substr($normalizedObjectUri, -4) === '.ics')
|
||||
$normalizedObjectUri = substr($normalizedObjectUri, 0, -4);
|
||||
|
||||
if(mb_strpos($normalizedObjectUri, '@') !== false)
|
||||
$normalizedObjectUri = mb_substr($normalizedObjectUri, mb_strpos($normalizedObjectUri, '@') + 1);
|
||||
|
||||
if($this->hasObjectUriDatePrefix($normalizedObjectUri))
|
||||
return mb_substr($normalizedObjectUri, mb_strpos($normalizedObjectUri, '-') + 1);
|
||||
|
||||
return $normalizedObjectUri;
|
||||
}
|
||||
|
||||
protected function hasObjectUriDatePrefix($objectUri)
|
||||
{
|
||||
$hyphenPosition = mb_strpos($objectUri, '-');
|
||||
if($hyphenPosition !== 15)
|
||||
return false;
|
||||
|
||||
return preg_match('/^\d{8}T\d{6}$/', mb_substr($objectUri, 0, 15)) === 1;
|
||||
}
|
||||
|
||||
protected function buildCalendarObject($row, $calendarId)
|
||||
{
|
||||
$calendarData = $this->makeCal($row->calendarDataFragment);
|
||||
|
||||
return array(
|
||||
"id"=>$row->eindeutige_gruppen_id,
|
||||
"calendardata"=>$calendarData,
|
||||
"uri"=>$this->getObjectUri($row),
|
||||
"lastmodified"=>$this->getLastModifiedTimestamp($row->updateamum),
|
||||
"etag"=>'"'.md5($calendarData).'"',
|
||||
"calendarid"=>$calendarId,
|
||||
"size"=>strlen($calendarData),
|
||||
"component"=>'vevent'
|
||||
);
|
||||
}
|
||||
|
||||
protected function getLastModifiedTimestamp($lastModified)
|
||||
{
|
||||
if($lastModified === null || $lastModified === '')
|
||||
return null;
|
||||
|
||||
if(is_numeric($lastModified))
|
||||
return (int)$lastModified;
|
||||
|
||||
$timestamp = strtotime($lastModified);
|
||||
if($timestamp === false)
|
||||
return null;
|
||||
|
||||
return $timestamp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all calendar objects within a calendar.
|
||||
*
|
||||
* Every item contains an array with the following keys:
|
||||
* * id - unique identifier which will be used for subsequent updates
|
||||
* * calendardata - The iCalendar-compatible calnedar data
|
||||
* * uri - a unique key which will be used to construct the uri. This can be any arbitrary string.
|
||||
* * lastmodified - a timestamp of the last modification time
|
||||
* * etag - An arbitrary string, surrounded by double-quotes. (e.g.:
|
||||
* ' "abcdef"')
|
||||
* * calendarid - The calendarid as it was passed to this function.
|
||||
*
|
||||
* Note that the etag is optional, but it's highly encouraged to return for
|
||||
* speed reasons.
|
||||
*
|
||||
* The calendardata is also optional. If it's not returned
|
||||
* 'getCalendarObject' will be called later, which *is* expected to return
|
||||
* calendardata.
|
||||
*
|
||||
* @param string $calendarId
|
||||
* @return array
|
||||
*/
|
||||
public function getCalendarObjects($calendarId)
|
||||
{
|
||||
//$user = $this->getUser();
|
||||
$user = $calendarId;
|
||||
$data = $this->getCalendarData($user);
|
||||
|
||||
//error_log("Caldav_Backend.php/getCalendarObjects($calendarId) ");
|
||||
$return = array();
|
||||
|
||||
if(!is_array($data))
|
||||
return $return;
|
||||
|
||||
foreach($data as $row)
|
||||
{
|
||||
$return[] = $this->buildCalendarObject($row, $calendarId);
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns information from a single calendar object, based on it's object
|
||||
* uri.
|
||||
*
|
||||
* The returned array must have the same keys as getCalendarObjects. The
|
||||
* 'calendardata' object is required here though, while it's not required
|
||||
* for getCalendarObjects.
|
||||
*
|
||||
* @param string $calendarId
|
||||
* @param string $objectUri
|
||||
* @return array
|
||||
*/
|
||||
public function getCalendarObject($calendarId,$objectUri)
|
||||
{
|
||||
$user = $calendarId;
|
||||
$data = $this->getCalendarData($user,$objectUri);
|
||||
|
||||
if(empty($data))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
elseif(is_object($data))
|
||||
{
|
||||
$ret = $this->buildCalendarObject($data, $calendarId);
|
||||
}
|
||||
|
||||
return isset($ret) ? $ret : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new calendar object.
|
||||
*
|
||||
* @param string $calendarId
|
||||
* @param string $objectUri
|
||||
* @param string $calendarData
|
||||
* @return void
|
||||
*/
|
||||
public function createCalendarObject($calendarId,$objectUri,$calendarData)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates an existing calendarobject, based on it's uri.
|
||||
*
|
||||
* @param string $calendarId
|
||||
* @param string $objectUri
|
||||
* @param string $calendarData
|
||||
* @return void
|
||||
*/
|
||||
public function updateCalendarObject($calendarId,$objectUri,$calendarData)
|
||||
{
|
||||
if(is_resource($calendarData))
|
||||
$calendarData = stream_get_contents($calendarData);
|
||||
|
||||
return '"'.md5((string)$calendarData).'"';
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes an existing calendar object.
|
||||
*
|
||||
* @param string $calendarId
|
||||
* @param string $objectUri
|
||||
* @return void
|
||||
*/
|
||||
public function deleteCalendarObject($calendarId,$objectUri)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
class SabreDAVReadOnlyACL
|
||||
{
|
||||
public static function getAcl($principalUri, $includeFreeBusy = false)
|
||||
{
|
||||
$acl = array(
|
||||
array(
|
||||
'privilege' => '{DAV:}read',
|
||||
'principal' => $principalUri,
|
||||
'protected' => true,
|
||||
),
|
||||
array(
|
||||
'privilege' => '{DAV:}read',
|
||||
'principal' => $principalUri.'/calendar-proxy-read',
|
||||
'protected' => true,
|
||||
),
|
||||
);
|
||||
|
||||
if($includeFreeBusy)
|
||||
{
|
||||
$acl[] = array(
|
||||
'privilege' => '{'.\Sabre\CalDAV\Plugin::NS_CALDAV.'}read-free-busy',
|
||||
'principal' => '{DAV:}authenticated',
|
||||
'protected' => true,
|
||||
);
|
||||
}
|
||||
|
||||
return $acl;
|
||||
}
|
||||
|
||||
public static function ignoreWrite()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
|
||||
class SabreDAVReadOnlyCalendar extends \Sabre\CalDAV\Calendar
|
||||
{
|
||||
protected $readOnlyCaldavBackend;
|
||||
protected $readOnlyCalendarInfo;
|
||||
|
||||
public function __construct(\Sabre\CalDAV\Backend\BackendInterface $caldavBackend, $calendarInfo)
|
||||
{
|
||||
parent::__construct($caldavBackend, $calendarInfo);
|
||||
$this->readOnlyCaldavBackend = $caldavBackend;
|
||||
$this->readOnlyCalendarInfo = $calendarInfo;
|
||||
}
|
||||
|
||||
public function getChild($name)
|
||||
{
|
||||
$obj = $this->readOnlyCaldavBackend->getCalendarObject($this->readOnlyCalendarInfo['id'], $name);
|
||||
|
||||
if(!$obj)
|
||||
throw new \Sabre\DAV\Exception\NotFound('Calendar object not found');
|
||||
|
||||
$obj['acl'] = $this->getCalendarObjectAcl();
|
||||
|
||||
return new SabreDAVReadOnlyCalendarObject($this->readOnlyCaldavBackend, $this->readOnlyCalendarInfo, $obj);
|
||||
}
|
||||
|
||||
public function getChildren()
|
||||
{
|
||||
$objs = $this->readOnlyCaldavBackend->getCalendarObjects($this->readOnlyCalendarInfo['id']);
|
||||
$children = array();
|
||||
|
||||
foreach($objs as $obj)
|
||||
{
|
||||
$obj['acl'] = $this->getCalendarObjectAcl();
|
||||
$children[] = new SabreDAVReadOnlyCalendarObject($this->readOnlyCaldavBackend, $this->readOnlyCalendarInfo, $obj);
|
||||
}
|
||||
|
||||
return $children;
|
||||
}
|
||||
|
||||
public function createFile($name, $calendarData = null)
|
||||
{
|
||||
return SabreDAVReadOnlyACL::ignoreWrite();
|
||||
}
|
||||
|
||||
public function createDirectory($name)
|
||||
{
|
||||
return SabreDAVReadOnlyACL::ignoreWrite();
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
return SabreDAVReadOnlyACL::ignoreWrite();
|
||||
}
|
||||
|
||||
public function setName($newName)
|
||||
{
|
||||
return SabreDAVReadOnlyACL::ignoreWrite();
|
||||
}
|
||||
|
||||
public function updateProperties($mutations)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function propPatch(\Sabre\DAV\PropPatch $propPatch)
|
||||
{
|
||||
$propPatch->setRemainingResultCode(200);
|
||||
}
|
||||
|
||||
public function getACL()
|
||||
{
|
||||
return SabreDAVReadOnlyACL::getAcl($this->getOwner(), true);
|
||||
}
|
||||
|
||||
protected function getCalendarObjectAcl()
|
||||
{
|
||||
return SabreDAVReadOnlyACL::getAcl($this->getOwner());
|
||||
}
|
||||
}
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
class SabreDAVReadOnlyCalendarHome extends \Sabre\CalDAV\CalendarHome
|
||||
{
|
||||
protected $readOnlyCaldavBackend;
|
||||
protected $readOnlyPrincipalInfo;
|
||||
|
||||
public function __construct(\Sabre\CalDAV\Backend\BackendInterface $caldavBackend, $principalInfo)
|
||||
{
|
||||
parent::__construct($caldavBackend, $principalInfo);
|
||||
$this->readOnlyCaldavBackend = $caldavBackend;
|
||||
$this->readOnlyPrincipalInfo = $principalInfo;
|
||||
}
|
||||
|
||||
public function getChildren()
|
||||
{
|
||||
$calendars = $this->readOnlyCaldavBackend->getCalendarsForUser($this->readOnlyPrincipalInfo['uri']);
|
||||
$objs = array();
|
||||
|
||||
foreach($calendars as $calendar)
|
||||
{
|
||||
$objs[] = new SabreDAVReadOnlyCalendar($this->readOnlyCaldavBackend, $calendar);
|
||||
}
|
||||
|
||||
return $objs;
|
||||
}
|
||||
|
||||
public function createExtendedCollection($name, \Sabre\DAV\MkCol $mkCol)
|
||||
{
|
||||
return SabreDAVReadOnlyACL::ignoreWrite();
|
||||
}
|
||||
|
||||
public function createFile($filename, $data = null)
|
||||
{
|
||||
return SabreDAVReadOnlyACL::ignoreWrite();
|
||||
}
|
||||
|
||||
public function createDirectory($filename)
|
||||
{
|
||||
return SabreDAVReadOnlyACL::ignoreWrite();
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
return SabreDAVReadOnlyACL::ignoreWrite();
|
||||
}
|
||||
|
||||
public function setName($name)
|
||||
{
|
||||
return SabreDAVReadOnlyACL::ignoreWrite();
|
||||
}
|
||||
|
||||
public function getACL()
|
||||
{
|
||||
return SabreDAVReadOnlyACL::getAcl($this->readOnlyPrincipalInfo['uri']);
|
||||
}
|
||||
}
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
|
||||
class SabreDAVReadOnlyCalendarObject extends \Sabre\CalDAV\CalendarObject
|
||||
{
|
||||
protected $readOnlyCalendarInfo;
|
||||
|
||||
public function __construct(\Sabre\CalDAV\Backend\BackendInterface $caldavBackend, array $calendarInfo, array $objectData)
|
||||
{
|
||||
parent::__construct($caldavBackend, $calendarInfo, $objectData);
|
||||
$this->readOnlyCalendarInfo = $calendarInfo;
|
||||
}
|
||||
|
||||
public function put($calendarData)
|
||||
{
|
||||
return $this->getCurrentETag();
|
||||
}
|
||||
|
||||
public function getETag()
|
||||
{
|
||||
if($this->isWriteRequest())
|
||||
{
|
||||
$ifMatch = isset($_SERVER['HTTP_IF_MATCH']) ? trim($_SERVER['HTTP_IF_MATCH']) : '';
|
||||
if($ifMatch !== '' && $ifMatch !== '*')
|
||||
{
|
||||
$requestedEtags = explode(',', $ifMatch);
|
||||
foreach($requestedEtags as $requestedEtag)
|
||||
{
|
||||
$requestedEtag = trim($requestedEtag);
|
||||
if($requestedEtag !== '')
|
||||
return $requestedEtag;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return parent::getETag();
|
||||
}
|
||||
|
||||
public function getLastModified()
|
||||
{
|
||||
if($this->isWriteRequest())
|
||||
{
|
||||
$ifUnmodifiedSince = isset($_SERVER['HTTP_IF_UNMODIFIED_SINCE']) ? trim($_SERVER['HTTP_IF_UNMODIFIED_SINCE']) : '';
|
||||
if($ifUnmodifiedSince !== '')
|
||||
{
|
||||
$timestamp = strtotime($ifUnmodifiedSince);
|
||||
if($timestamp !== false)
|
||||
return max(0, $timestamp - 1);
|
||||
}
|
||||
}
|
||||
|
||||
return parent::getLastModified();
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
return SabreDAVReadOnlyACL::ignoreWrite();
|
||||
}
|
||||
|
||||
public function setName($name)
|
||||
{
|
||||
return SabreDAVReadOnlyACL::ignoreWrite();
|
||||
}
|
||||
|
||||
public function getACL()
|
||||
{
|
||||
return SabreDAVReadOnlyACL::getAcl($this->readOnlyCalendarInfo['principaluri']);
|
||||
}
|
||||
|
||||
protected function isWriteRequest()
|
||||
{
|
||||
if(!isset($_SERVER['REQUEST_METHOD']))
|
||||
return false;
|
||||
|
||||
return in_array(strtoupper($_SERVER['REQUEST_METHOD']), array('PUT', 'DELETE', 'PROPPATCH', 'MOVE', 'COPY', 'PATCH'), true);
|
||||
}
|
||||
|
||||
protected function getCurrentETag()
|
||||
{
|
||||
if(isset($this->objectData['etag']) && $this->objectData['etag'] !== '')
|
||||
return $this->objectData['etag'];
|
||||
|
||||
return parent::getETag();
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
class SabreDAVReadOnlyCalendarRoot extends \Sabre\CalDAV\CalendarRoot
|
||||
{
|
||||
protected $readOnlyCaldavBackend;
|
||||
|
||||
public function __construct(\Sabre\DAVACL\PrincipalBackend\BackendInterface $principalBackend, \Sabre\CalDAV\Backend\BackendInterface $caldavBackend, $principalPrefix = 'principals')
|
||||
{
|
||||
parent::__construct($principalBackend, $caldavBackend, $principalPrefix);
|
||||
$this->readOnlyCaldavBackend = $caldavBackend;
|
||||
}
|
||||
|
||||
public function getChildForPrincipal(array $principal)
|
||||
{
|
||||
return new SabreDAVReadOnlyCalendarHome($this->readOnlyCaldavBackend, $principal);
|
||||
}
|
||||
}
|
||||
@@ -40,7 +40,9 @@ abstract class AbstractBestandteil implements IValidation
|
||||
|
||||
if( is_bool($new_value) && ($old_value !== $new_value) ) {
|
||||
$this->modifiedcolumns[$columnname] = $columnname;
|
||||
} else if($old_value != $new_value) {
|
||||
} else if(is_null($old_value) xor is_null($new_value)) {
|
||||
$this->modifiedcolumns[$columnname] = $columnname;
|
||||
} else if($old_value != $new_value) {
|
||||
$this->modifiedcolumns[$columnname] = $columnname;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ namespace vertragsbestandteil;
|
||||
|
||||
use Exception;
|
||||
use vertragsbestandteil\VertragsbestandteilStunden;
|
||||
use vertragsbestandteil\VertragsbestandteilLohnguide;
|
||||
|
||||
/**
|
||||
* Description of VertragsbestandteilFactory
|
||||
@@ -22,6 +23,7 @@ class VertragsbestandteilFactory
|
||||
const VERTRAGSBESTANDTEIL_URLAUBSANSPRUCH = 'urlaubsanspruch';
|
||||
const VERTRAGSBESTANDTEIL_ZEITAUFZEICHNUNG = 'zeitaufzeichnung';
|
||||
const VERTRAGSBESTANDTEIL_LEHRE = 'lehre';
|
||||
const VERTRAGSBESTANDTEIL_LOHNGUIDE = 'lohnguide';
|
||||
|
||||
public static function getVertragsbestandteil($data, $fromdb=false)
|
||||
{
|
||||
@@ -69,6 +71,11 @@ class VertragsbestandteilFactory
|
||||
$vertragsbestandteil = new VertragsbestandteilZeitaufzeichnung();
|
||||
$vertragsbestandteil->hydrateByStdClass($data, $fromdb);
|
||||
break;
|
||||
|
||||
case self::VERTRAGSBESTANDTEIL_LOHNGUIDE:
|
||||
$vertragsbestandteil = new VertragsbestandteilLohnguide();
|
||||
$vertragsbestandteil->hydrateByStdClass($data, $fromdb);
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new Exception('Unknown vertragsbestandteiltyp_kurzbz '
|
||||
@@ -127,6 +134,12 @@ class VertragsbestandteilFactory
|
||||
$vertragsbestandteildbmodel = $CI->VertragsbestandteilZeitaufzeichnung_model;
|
||||
break;
|
||||
|
||||
case self::VERTRAGSBESTANDTEIL_LOHNGUIDE:
|
||||
$CI->load->model('vertragsbestandteil/VertragsbestandteilLohnguide_model',
|
||||
'VertragsbestandteilLohnguide_model');
|
||||
$vertragsbestandteildbmodel = $CI->VertragsbestandteilLohnguide_model;
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new Exception('Unknown vertragsbestandteil_kurzbz '
|
||||
. $vertragsbestandteil_kurzbz);
|
||||
|
||||
@@ -10,6 +10,7 @@ require_once __DIR__ . '/VertragsbestandteilKuendigungsfrist.php';
|
||||
require_once __DIR__ . '/VertragsbestandteilUrlaubsanspruch.php';
|
||||
require_once __DIR__ . '/VertragsbestandteilFreitext.php';
|
||||
require_once __DIR__ . '/VertragsbestandteilKarenz.php';
|
||||
require_once __DIR__ . '/VertragsbestandteilLohnguide.php';
|
||||
require_once __DIR__ . '/VertragsbestandteilFactory.php';
|
||||
require_once __DIR__ . '/OverlapChecker.php';
|
||||
|
||||
|
||||
@@ -0,0 +1,161 @@
|
||||
<?php
|
||||
namespace vertragsbestandteil;
|
||||
|
||||
use vertragsbestandteil\Vertragsbestandteil;
|
||||
use vertragsbestandteil\VertragsbestandteilFactory;
|
||||
|
||||
class VertragsbestandteilLohnguide extends Vertragsbestandteil
|
||||
{
|
||||
protected $stellenbezeichnung;
|
||||
protected $vordienstzeit;
|
||||
protected $fachrichtung_kurzbz;
|
||||
protected $modellstelle_kurzbz;
|
||||
protected $kommentar_person;
|
||||
protected $kommentar_modellstelle;
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->setVertragsbestandteiltyp_kurzbz(
|
||||
VertragsbestandteilFactory::VERTRAGSBESTANDTEIL_LOHNGUIDE);
|
||||
}
|
||||
|
||||
public function getStellenbezeichnung()
|
||||
{
|
||||
return $this->stellenbezeichnung;
|
||||
}
|
||||
|
||||
public function setStellenbezeichnung($stellenbezeichnung): self
|
||||
{
|
||||
$this->markDirty('stellenbezeichnung', $this->stellenbezeichnung, $stellenbezeichnung);
|
||||
$this->stellenbezeichnung = $stellenbezeichnung;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getVordienstzeit()
|
||||
{
|
||||
return $this->vordienstzeit;
|
||||
}
|
||||
|
||||
public function setVordienstzeit($vordienstzeit): self
|
||||
{
|
||||
$this->markDirty('vordienstzeit', $this->vordienstzeit, $vordienstzeit);
|
||||
$this->vordienstzeit = $vordienstzeit;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getFachrichtung_kurzbz()
|
||||
{
|
||||
return $this->fachrichtung_kurzbz;
|
||||
}
|
||||
|
||||
public function setFachrichtung_kurzbz($fachrichtung_kurzbz): self
|
||||
{
|
||||
$this->markDirty('fachrichtung_kurzbz', $this->fachrichtung_kurzbz, $fachrichtung_kurzbz);
|
||||
$this->fachrichtung_kurzbz = $fachrichtung_kurzbz;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getModellstelle_kurzbz()
|
||||
{
|
||||
return $this->modellstelle_kurzbz;
|
||||
}
|
||||
|
||||
public function setModellstelle_kurzbz($modellstelle_kurzbz): self
|
||||
{
|
||||
$this->markDirty('modellstelle_kurzbz', $this->modellstelle_kurzbz, $modellstelle_kurzbz);
|
||||
$this->modellstelle_kurzbz = $modellstelle_kurzbz;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getKommentar_person()
|
||||
{
|
||||
return $this->kommentar_person;
|
||||
}
|
||||
|
||||
public function setKommentar_person($kommentar_person): self
|
||||
{
|
||||
$this->markDirty('kommentar_person', $this->kommentar_person, $kommentar_person);
|
||||
$this->kommentar_person = $kommentar_person;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getKommentar_modellstelle()
|
||||
{
|
||||
return $this->kommentar_modellstelle;
|
||||
}
|
||||
|
||||
public function setKommentar_modellstelle($kommentar_modellstelle): self
|
||||
{
|
||||
$this->markDirty('kommentar_modellstelle', $this->kommentar_modellstelle, $kommentar_modellstelle);
|
||||
$this->kommentar_modellstelle = $kommentar_modellstelle;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function hydrateByStdClass($data, $fromdb=false)
|
||||
{
|
||||
parent::hydrateByStdClass($data, $fromdb);
|
||||
$this->fromdb = $fromdb;
|
||||
isset($data->fachrichtung_kurzbz) && $this->setFachrichtung_kurzbz($data->fachrichtung_kurzbz);
|
||||
isset($data->stellenbezeichnung) && $this->setStellenbezeichnung($data->stellenbezeichnung);
|
||||
isset($data->vordienstzeit) && $this->setVordienstzeit($data->vordienstzeit);
|
||||
isset($data->modellstelle_kurzbz) && $this->setModellstelle_kurzbz($data->modellstelle_kurzbz);
|
||||
isset($data->kommentar_person) && $this->setKommentar_person($data->kommentar_person);
|
||||
isset($data->kommentar_modellstelle) && $this->setKommentar_modellstelle($data->kommentar_modellstelle);
|
||||
$this->fromdb = false;
|
||||
}
|
||||
|
||||
public function toStdClass(): \stdClass
|
||||
{
|
||||
$tmp = array(
|
||||
'vertragsbestandteil_id' => $this->getVertragsbestandteil_id(),
|
||||
'stellenbezeichnung' => $this->getStellenbezeichnung(),
|
||||
'vordienstzeit' => $this->getVordienstzeit(),
|
||||
'fachrichtung_kurzbz' => $this->getFachrichtung_kurzbz(),
|
||||
'modellstelle_kurzbz' => $this->getModellstelle_kurzbz(),
|
||||
'kommentar_person' => $this->getKommentar_person(),
|
||||
'kommentar_modellstelle' => $this->getKommentar_modellstelle(),
|
||||
);
|
||||
|
||||
$tmp = array_filter($tmp, function($k) {
|
||||
return in_array($k, $this->modifiedcolumns);
|
||||
}, ARRAY_FILTER_USE_KEY);
|
||||
|
||||
return (object) $tmp;
|
||||
}
|
||||
|
||||
public function __toString()
|
||||
{
|
||||
$txt = <<<EOTXT
|
||||
modellstelle_kurzbz: {$this->getModellstelle_kurzbz()}
|
||||
|
||||
EOTXT;
|
||||
return parent::__toString() . $txt;
|
||||
}
|
||||
|
||||
public function validate()
|
||||
{
|
||||
$value = $this->vordienstzeit;
|
||||
|
||||
if ($value === null || $value === '') {
|
||||
$result = null; // allow null value
|
||||
} else {
|
||||
$result = filter_var($value, FILTER_VALIDATE_INT, [
|
||||
'options' => [
|
||||
'min_range' => 0,
|
||||
'max_range' => 100
|
||||
]
|
||||
]);
|
||||
|
||||
if ($result === false) {
|
||||
$this->validationerrors[] = 'Vordienstjahre muss eine ganze Zahl (0 bis 100) enthalten oder leer sein.';
|
||||
}
|
||||
}
|
||||
|
||||
return parent::validate();
|
||||
}
|
||||
}
|
||||
@@ -402,14 +402,17 @@ class Lehrveranstaltung_model extends DB_Model
|
||||
SELECT
|
||||
vorname, nachname, mitarbeiter_uid, lehrfunktion_kurzbz
|
||||
FROM
|
||||
lehre.tbl_lehreinheit
|
||||
lehre.tbl_lehreinheit le
|
||||
JOIN lehre.tbl_lehreinheitmitarbeiter lema USING (lehreinheit_id)
|
||||
JOIN public.tbl_benutzer b ON b.uid = lema.mitarbeiter_uid
|
||||
JOIN public.tbl_person p using (person_id)
|
||||
WHERE
|
||||
tbl_lehreinheit.lehrveranstaltung_id= ?
|
||||
AND tbl_lehreinheit.studiensemester_kurzbz = ?
|
||||
le.lehrveranstaltung_id= ?
|
||||
AND le.studiensemester_kurzbz = ?
|
||||
AND lehrfunktion_kurzbz = 'LV-Leitung'
|
||||
AND lema.mitarbeiter_uid NOT like '_Dummy%'
|
||||
AND b.aktiv = TRUE
|
||||
AND p.aktiv = TRUE
|
||||
ORDER BY
|
||||
lema.insertamum DESC
|
||||
LIMIT 1
|
||||
|
||||
@@ -79,10 +79,10 @@ class Paabgabe_model extends DB_Model
|
||||
JOIN public.tbl_benutzer ON (public.tbl_benutzer.uid = student_uid)
|
||||
JOIN public.tbl_person USING (person_id)
|
||||
|
||||
WHERE (campus.tbl_paabgabe.insertamum >= NOW() - INTERVAL ?
|
||||
OR campus.tbl_paabgabe.updateamum >= NOW() - INTERVAL ?)
|
||||
AND campus.tbl_paabgabe.paabgabetyp_kurzbz IN ?";
|
||||
|
||||
WHERE (campus.tbl_paabgabe.insertamum::date = CURRENT_DATE - INTERVAL ?
|
||||
OR campus.tbl_paabgabe.updateamum::date = CURRENT_DATE - INTERVAL ?)
|
||||
AND campus.tbl_paabgabe.paabgabetyp_kurzbz IN ?";
|
||||
|
||||
return $this->execQuery($query, [$interval, $interval, $relevantTypes]);
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ class Paabgabe_model extends DB_Model
|
||||
JOIN public.tbl_person ON (public.tbl_benutzer.person_id = public.tbl_person.person_id)
|
||||
|
||||
WHERE campus.tbl_paabgabe.abgabedatum IS NOT NULL
|
||||
AND campus.tbl_paabgabe.abgabedatum >= NOW() - INTERVAL ?";
|
||||
AND campus.tbl_paabgabe.abgabedatum = CURRENT_DATE - INTERVAL ?";
|
||||
|
||||
if($relevantTypes !== null) {
|
||||
$query .= " AND campus.tbl_paabgabe.paabgabetyp_kurzbz IN ?";
|
||||
|
||||
@@ -594,7 +594,10 @@ class Studiengang_model extends DB_Model
|
||||
$this->addSelect('p.prestudent_id');
|
||||
$this->addSelect('pers.vorname');
|
||||
$this->addSelect('pers.nachname');
|
||||
$this->addSelect("CONCAT(UPPER(pers.nachname), ' ', pers.vorname, ' (', " . $this->dbTable . ".bezeichnung, ')') AS name");
|
||||
$this->addSelect("CONCAT(UPPER(pers.nachname), ' ', pers.vorname, ' (', "
|
||||
. $this->dbTable . ".bezeichnung, ', ', "
|
||||
. "UPPER(" . $this->dbTable . ".typ), "
|
||||
. "UPPER(" . $this->dbTable . ".kurzbz),')') AS name");
|
||||
|
||||
$this->addJoin('public.tbl_prestudent p', 'studiengang_kz');
|
||||
$this->addJoin(
|
||||
|
||||
@@ -261,6 +261,42 @@ class Benutzerfunktion_model extends DB_Model
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get active Kompetenzfeldleitung bei UID.
|
||||
*
|
||||
* @param $uid
|
||||
* @return array|stdClass|null
|
||||
*/
|
||||
public function getKFLByUID($uid)
|
||||
{
|
||||
$query = '
|
||||
SELECT
|
||||
bf.uid,
|
||||
bf.oe_kurzbz,
|
||||
oe.organisationseinheittyp_kurzbz
|
||||
FROM
|
||||
public.tbl_benutzerfunktion bf
|
||||
JOIN public.tbl_organisationseinheit oe USING (oe_kurzbz)
|
||||
JOIN public.tbl_benutzer b USING (uid)
|
||||
WHERE
|
||||
b.uid = ?
|
||||
AND b.aktiv = TRUE
|
||||
AND funktion_kurzbz = \'Leitung\'
|
||||
AND organisationseinheittyp_kurzbz = \'Kompetenzfeld\'
|
||||
AND (datum_von IS NULL OR datum_von <= now())
|
||||
AND (datum_bis IS NULL OR datum_bis >= now())
|
||||
';
|
||||
|
||||
$parameters_array = array();
|
||||
if (is_string($uid))
|
||||
{
|
||||
$parameters_array[] = $uid;
|
||||
}
|
||||
|
||||
return $this->execQuery($query, $parameters_array);
|
||||
}
|
||||
|
||||
|
||||
public function insertBenutzerfunktion($Json)
|
||||
{
|
||||
unset($Json['benutzerfunktion_id']);
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
class BetriebsmittelKalender_model extends DB_Model
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->dbTable = 'lehre.tbl_betriebsmittel_kalender';
|
||||
$this->pk = 'betriebsmittel_kalender_id';
|
||||
}
|
||||
}
|
||||
@@ -31,4 +31,26 @@ class Betriebsmittel_model extends DB_Model
|
||||
|
||||
return $this->execQuery($qry);
|
||||
}
|
||||
|
||||
public function getSchedulableEntriesByDatetimeInterval($from, $to)
|
||||
{
|
||||
$qry = "SELECT
|
||||
*
|
||||
FROM
|
||||
wawi.tbl_betriebsmittel
|
||||
WHERE
|
||||
verplanen=true
|
||||
AND
|
||||
NOT EXISTS(
|
||||
SELECT 1 FROM lehre.tbl_betriebsmittel_kalender
|
||||
JOIN lehre.tbl_kalender ON tbl_kalender.eindeutige_gruppen_id = tbl_betriebsmittel_kalender.eindeutige_kalender_gruppen_id
|
||||
WHERE
|
||||
betriebsmittel_id=tbl_betriebsmittel.betriebsmittel_id
|
||||
AND tbl_kalender.von <= ?
|
||||
AND tbl_kalender.bis >= ?
|
||||
)";
|
||||
|
||||
|
||||
return $this->execQuery($qry, array($from, $to));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,5 +10,18 @@ class Kalender_model extends DB_Model
|
||||
parent::__construct();
|
||||
$this->dbTable = 'lehre.tbl_kalender';
|
||||
$this->pk = 'kalender_id';
|
||||
|
||||
$this->load->helper('hlp_common');
|
||||
}
|
||||
|
||||
public function generateUniqueGroupId()
|
||||
{
|
||||
while (true) {
|
||||
$uniqueGroupId = generateUUID();
|
||||
$result = $this->loadWhere(['eindeutige_gruppen_id' => $uniqueGroupId]);
|
||||
if (!hasData($result)) {
|
||||
return $uniqueGroupId;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -242,6 +242,7 @@ class Message_model extends DB_Model
|
||||
*/
|
||||
public function getMessagesForTable($person_id, $offset, $limit)
|
||||
{
|
||||
$limitoffset = (!is_null($offset) && !is_null($limit)) ? 'limit ? offset ?' : '';
|
||||
$sql = <<<EOSQL
|
||||
with filtered_messages as (
|
||||
select
|
||||
@@ -310,11 +311,12 @@ class Message_model extends DB_Model
|
||||
public.tbl_person pr on pr.person_id = fm.recipient_id
|
||||
order by
|
||||
m.insertamum DESC
|
||||
limit ?
|
||||
offset ?;
|
||||
{$limitoffset}
|
||||
EOSQL;
|
||||
|
||||
$parametersArray = array($person_id, $person_id, $limit, $offset);
|
||||
$parametersArray = $limitoffset
|
||||
? array($person_id, $person_id, $limit, $offset)
|
||||
: array($person_id, $person_id);
|
||||
|
||||
$count = 0;
|
||||
$data = $this->execQuery($sql, $parametersArray);
|
||||
@@ -325,7 +327,7 @@ EOSQL;
|
||||
$data = getData($data);
|
||||
if($data)
|
||||
{
|
||||
$count = ceil($data[0]->total_msgs / $limit);
|
||||
$count = is_null($limit) ? 1 : ceil($data[0]->total_msgs / $limit);
|
||||
}
|
||||
|
||||
return success(['data' => $data, 'count' => $count]);
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
class VertragsbestandteilLohnguide_model extends DB_Model
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->dbTable = 'hr.tbl_vertragsbestandteil_lohnguide';
|
||||
$this->pk = 'vertragsbestandteil_id';
|
||||
}
|
||||
}
|
||||
@@ -37,7 +37,8 @@ class Vertragsbestandteil_model extends DB_Model
|
||||
kf.arbeitgeber_frist, kf.arbeitnehmer_frist,
|
||||
s.wochenstunden, s.teilzeittyp_kurzbz,
|
||||
u.tage,
|
||||
z.zeitaufzeichnung, z.azgrelevant, z.homeoffice
|
||||
z.zeitaufzeichnung, z.azgrelevant, z.homeoffice,
|
||||
lg.stellenbezeichnung, lg.vordienstzeit, lg.fachrichtung_kurzbz, lg.modellstelle_kurzbz, lg.kommentar_person, lg.kommentar_modellstelle
|
||||
FROM
|
||||
hr.tbl_vertragsbestandteil v
|
||||
LEFT JOIN
|
||||
@@ -63,6 +64,8 @@ class Vertragsbestandteil_model extends DB_Model
|
||||
hr.tbl_vertragsbestandteil_urlaubsanspruch u USING(vertragsbestandteil_id)
|
||||
LEFT JOIN
|
||||
hr.tbl_vertragsbestandteil_zeitaufzeichnung z USING(vertragsbestandteil_id)
|
||||
LEFT JOIN
|
||||
hr.tbl_vertragsbestandteil_lohnguide lg USING(vertragsbestandteil_id)
|
||||
EOSQL;
|
||||
return $sql;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
'primevue3' => true,
|
||||
'tabulator5' => true,
|
||||
'vuedatepicker11' => true,
|
||||
'momentjs2' => true,
|
||||
'phrases' => array(
|
||||
'global',
|
||||
'ui',
|
||||
|
||||
@@ -315,22 +315,15 @@
|
||||
WHERE tpl.app = '.$APP.'
|
||||
) pl USING(person_id)
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
SELECT DISTINCT ON (tbl_rueckstellung.person_id)
|
||||
tbl_rueckstellung.person_id,
|
||||
tbl_rueckstellung.datum_bis,
|
||||
tbl_rueckstellung.status_kurzbz,
|
||||
array_to_json(bezeichnung_mehrsprachig::varchar[])->>0 as bezeichnung
|
||||
FROM public.tbl_rueckstellung
|
||||
JOIN public.tbl_rueckstellung_status USING(status_kurzbz)
|
||||
JOIN public.tbl_person sp ON tbl_rueckstellung.person_id = sp.person_id
|
||||
WHERE tbl_rueckstellung.rueckstellung_id =
|
||||
(
|
||||
SELECT srueck.rueckstellung_id
|
||||
FROM public.tbl_rueckstellung srueck
|
||||
WHERE srueck.person_id = tbl_rueckstellung.person_id
|
||||
AND datum_bis >= NOW()
|
||||
ORDER BY srueck.datum_bis DESC LIMIT 1
|
||||
)
|
||||
WHERE tbl_rueckstellung.datum_bis >= NOW()
|
||||
ORDER BY tbl_rueckstellung.person_id, tbl_rueckstellung.datum_bis DESC
|
||||
) rueck ON rueck.person_id = p.person_id
|
||||
WHERE
|
||||
EXISTS (
|
||||
|
||||
@@ -24,22 +24,15 @@ $query = '
|
||||
WHERE tpl.app = '.$APP.'
|
||||
) pl ON p.person_id = pl.person_id
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
SELECT DISTINCT ON (tbl_rueckstellung.person_id)
|
||||
tbl_rueckstellung.person_id,
|
||||
tbl_rueckstellung.datum_bis,
|
||||
tbl_rueckstellung.status_kurzbz,
|
||||
array_to_json(bezeichnung_mehrsprachig::varchar[])->>0 as bezeichnung
|
||||
FROM public.tbl_rueckstellung
|
||||
JOIN public.tbl_rueckstellung_status USING(status_kurzbz)
|
||||
JOIN public.tbl_person sp ON tbl_rueckstellung.person_id = sp.person_id
|
||||
WHERE tbl_rueckstellung.rueckstellung_id =
|
||||
(
|
||||
SELECT srueck.rueckstellung_id
|
||||
FROM public.tbl_rueckstellung srueck
|
||||
WHERE srueck.person_id = tbl_rueckstellung.person_id
|
||||
AND datum_bis >= NOW()
|
||||
ORDER BY srueck.datum_bis DESC LIMIT 1
|
||||
)
|
||||
JOIN public.tbl_rueckstellung_status USING(status_kurzbz)
|
||||
WHERE tbl_rueckstellung.datum_bis >= NOW()
|
||||
ORDER BY tbl_rueckstellung.person_id, tbl_rueckstellung.datum_bis DESC
|
||||
) rueck ON rueck.person_id = p.person_id
|
||||
WHERE p.person_id NOT IN (SELECT person_id FROM public.tbl_prestudent)';
|
||||
|
||||
|
||||
@@ -46,12 +46,13 @@ echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<link rel="stylesheet" href="../../../skin/tablesort.css" type="text/css"/>
|
||||
<link rel="stylesheet" href="../../../skin/style.css.php" 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/jquery1/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>';
|
||||
|
||||
include('../../../include/meta/jquery.php');
|
||||
include('../../../include/meta/jquery-tablesorter.php');
|
||||
|
||||
const MOODLE_ADDON_KURZBZ = 'moodle';
|
||||
|
||||
// Load Addons to get Moodle_Path
|
||||
@@ -71,7 +72,7 @@ echo '
|
||||
$("#myTable").tablesorter(
|
||||
{
|
||||
sortList: [[0,0],[1,0]],
|
||||
widgets: [\'zebra\']
|
||||
widgets: [\'zebra\',\'filter\']
|
||||
});
|
||||
}
|
||||
);
|
||||
@@ -151,8 +152,9 @@ foreach($service->result as $row)
|
||||
$person = new person();
|
||||
$person->getPersonFromBenutzer($row->operativ_uid);
|
||||
$operativ = $person->nachname.' '.$person->vorname;
|
||||
$oeBez = new organisationseinheit($row->oe_kurzbz);
|
||||
echo '<tr>';
|
||||
echo '<td>',$row->oe_kurzbz,'</td>';
|
||||
echo '<td>',$oeBez->bezeichnung,'</td>';
|
||||
echo '<td><b>'.$row->bezeichnung.'</b></td>';
|
||||
echo '<td>',$row->beschreibung,'</td>';
|
||||
echo '<td><nobr><a href="../profile/index.php?uid='.$row->design_uid.'">',$design,'</a></nobr></td>';
|
||||
|
||||
+75
-11
@@ -80,9 +80,17 @@ echo '
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml; charset=UTF-8" />
|
||||
<link rel="stylesheet" href="../../vendor/components/jqueryui/themes/base/jquery-ui.min.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../vendor/twbs/bootstrap3/dist/css/bootstrap.min.css" type="text/css"/>
|
||||
<link href="../../skin/style.css.php" rel="stylesheet" type="text/css" />
|
||||
<style>
|
||||
.ui-dialog-titlebar-close
|
||||
{
|
||||
visibility: hidden !important;
|
||||
}
|
||||
</style>
|
||||
<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/twbs/bootstrap3/dist/js/bootstrap.min.js"></script>
|
||||
<script language="Javascript" type="text/javascript">
|
||||
//<![CDATA[
|
||||
@@ -131,22 +139,78 @@ echo '
|
||||
}
|
||||
}
|
||||
|
||||
function GebietStarten(bezeichnung,stunde,minute,sekunde,gebiet_id)
|
||||
function GebietStarten(bezeichnung, stunde, minute, sekunde, gebiet_id)
|
||||
{
|
||||
var check = confirm(<?php echo "'".$p->t('testtool/okKlickenUmZuStarten')."'"?>+' '+stunde+'h '+minute+'m '+sekunde+'s');
|
||||
if (check == true) {
|
||||
var sprache_user = <?php echo "'".$sprache_user."'"?>;
|
||||
document.location.href = 'frage.php?gebiet_id='+gebiet_id+'&start=true';
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
let message = <?php echo "'".$p->t('testtool/okKlickenUmZuStarten')."'"?> + ' ' + stunde + 'h ' + minute + 'm ' + sekunde + 's';
|
||||
let title = <?php echo "'".$p->t('testtool/startGebiet')."'"?>;
|
||||
let abbrechen = <?php echo "'".$p->t('testtool/abbrechen')."'"?>;
|
||||
|
||||
if ($('#gebiet-dialog').length === 0)
|
||||
{
|
||||
$('body').append(
|
||||
'<div id="gebiet-dialog" title="' + title + '">' +
|
||||
'<p id="gebiet-dialog-msg">' + message + '</p>' +
|
||||
'</div>'
|
||||
);
|
||||
}
|
||||
|
||||
$('#gebiet-dialog').dialog({
|
||||
modal: true,
|
||||
width: 400,
|
||||
resizable: false,
|
||||
buttons: [
|
||||
{
|
||||
text: 'OK',
|
||||
click: function() {
|
||||
$(this).dialog('close');
|
||||
document.location.href = 'frage.php?gebiet_id=' + gebiet_id + '&start=true';
|
||||
}
|
||||
},
|
||||
{
|
||||
text: abbrechen,
|
||||
click: function() {
|
||||
$(this).dialog('close');
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
let letzteFrageBestaetigt = false;
|
||||
|
||||
function letzteFrage()
|
||||
{
|
||||
alert(<?php echo "'".$p->t("testtool/alleFragenBeantwortet")."'"?>);
|
||||
return true;
|
||||
if (letzteFrageBestaetigt)
|
||||
return true;
|
||||
|
||||
let message = <?php echo "'".$p->t("testtool/alleFragenBeantwortet")."'"?>;
|
||||
|
||||
if ($('#fertig-dialog').length === 0)
|
||||
{
|
||||
$('body').append(
|
||||
'<div id="fertig-dialog">' +
|
||||
'<p>' + message + '</p>' +
|
||||
'</div>'
|
||||
);
|
||||
}
|
||||
|
||||
$('#fertig-dialog').dialog({
|
||||
modal: true,
|
||||
width: 400,
|
||||
resizable: false,
|
||||
buttons: [
|
||||
{
|
||||
text: 'OK',
|
||||
click: function() {
|
||||
$(this).dialog('close');
|
||||
letzteFrageBestaetigt = true;
|
||||
$('[name="submitantwort"]').click();
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
@@ -647,7 +711,7 @@ if($frage->frage_id!='')
|
||||
}
|
||||
|
||||
$letzte = $frage->getNextFrage($gebiet_id, $_SESSION['pruefling_id'], $frage_id, $demo);
|
||||
echo "<form action=\"$PHP_SELF?gebiet_id=$gebiet_id&frage_id=$frage->frage_id\" method=\"POST\" ".(!$letzte && !$levelgebiet?"onsubmit=\"letzteFrage()\"":"").">";
|
||||
echo "<form action=\"$PHP_SELF?gebiet_id=$gebiet_id&frage_id=$frage->frage_id\" method=\"POST\" ".(!$letzte && !$levelgebiet?"onsubmit=\"return letzteFrage()\"":"").">";
|
||||
echo '
|
||||
<div class="row text-center">
|
||||
<table class="table" style="width: 600px; margin-left: auto; margin-right: auto;">
|
||||
|
||||
@@ -44,6 +44,27 @@ if (isset($_GET['sprache_user']) && !empty($_GET['sprache_user']))
|
||||
$sprache_user = (isset($_SESSION['sprache_user']) && !empty($_SESSION['sprache_user'])) ? $_SESSION['sprache_user'] : DEFAULT_LANGUAGE;
|
||||
$p = new phrasen($sprache_user);
|
||||
|
||||
$showInfo = false;
|
||||
if (isset($_SESSION['alleGebiete']))
|
||||
{
|
||||
$alleGebiete = array_map('intval', $_SESSION['alleGebiete']);
|
||||
$pruefling_id = $_SESSION['pruefling_id'];
|
||||
|
||||
$qry = "SELECT COUNT(DISTINCT gebiet_id) as anzahl
|
||||
FROM testtool.tbl_pruefling_frage
|
||||
JOIN testtool.tbl_frage USING(frage_id)
|
||||
WHERE gebiet_id IN (". implode(',', $alleGebiete) .")
|
||||
AND pruefling_id = ". $pruefling_id ."
|
||||
";
|
||||
|
||||
$result = $db->db_query($qry);
|
||||
$anzahlGebiete = $db->db_fetch_object($result);
|
||||
|
||||
|
||||
if ((int)$anzahlGebiete->anzahl === count($alleGebiete))
|
||||
$showInfo = true;
|
||||
}
|
||||
|
||||
?>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
@@ -69,6 +90,7 @@ $p = new phrasen($sprache_user);
|
||||
<body>
|
||||
<br><br><br><br><br>
|
||||
<center><h2><?php echo $p->t('testtool/zeitAbgelaufen');?></h2>
|
||||
<h3><?php echo ($showInfo ? ($p->t('testtool/alleGebietGestartet') . "<br />" . $p->t('testtool/alleGebieteGestartetInfo')) : ''); ?></h3>
|
||||
</center>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+11
-2
@@ -142,7 +142,9 @@ if (isset($_REQUEST['prestudent']))
|
||||
}
|
||||
if ($reihungstest_id != '' && $rt->load($reihungstest_id))
|
||||
{
|
||||
if ($rt->freigeschaltet)
|
||||
$pruefling_exist = new Pruefling();
|
||||
$alreadyInRT = $pruefling_exist->personAlreadyInRT($ps->person_id, $rt->reihungstest_id, $ps->prestudent_id);
|
||||
if ($rt->freigeschaltet && !$alreadyInRT)
|
||||
{
|
||||
// regenerate Session ID after Login
|
||||
session_regenerate_id();
|
||||
@@ -282,7 +284,14 @@ if (isset($_REQUEST['prestudent']))
|
||||
}
|
||||
else
|
||||
{
|
||||
$alertmsg .= '<div class="alert alert-danger">'.$p->t('testtool/reihungstestNichtFreigeschalten').'</div>';
|
||||
if ($alreadyInRT)
|
||||
{
|
||||
$alertmsg .= '<div class="alert alert-danger">'.$p->t('testtool/reihungstestNichtRegistriert').'</div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$alertmsg .= '<div class="alert alert-danger">'.$p->t('testtool/reihungstestNichtFreigeschalten').'</div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
+25
-1
@@ -187,6 +187,7 @@ else if (isset($_SESSION['pruefling_id']))
|
||||
}
|
||||
|
||||
$qry .= "
|
||||
AND ps_status.bewerbung_abgeschicktamum IS NOT NULL
|
||||
|
||||
/* Order to get last semester when using distinct on */
|
||||
ORDER BY
|
||||
@@ -293,7 +294,7 @@ else if (isset($_SESSION['pruefling_id']))
|
||||
}
|
||||
$lastsemester = $row->semester;
|
||||
|
||||
echo '<table border="0" cellspacing="0" cellpadding="0" id="Gebiet" style="display: visible; border-collapse: separate; border-spacing: 0 3px;">';
|
||||
echo '<table border="0" cellspacing="0" cellpadding="0" id="Gebiet" style="display: visible; border-collapse: separate; border-spacing: 0 3px; margin-top: 5px;">';
|
||||
echo '<tr><td class="HeaderTesttool">'. ($row->semester == '1' ? $p->t('testtool/basisgebiete') : $p->t('testtool/quereinstiegsgebiete')).'</td></tr>';
|
||||
}
|
||||
|
||||
@@ -405,6 +406,29 @@ else if (isset($_SESSION['pruefling_id']))
|
||||
echo '</table>';
|
||||
}
|
||||
|
||||
if (isset($_SESSION['pruefling_id']) && !empty($_SESSION['alleGebiete']))
|
||||
{
|
||||
$alleGebiete = array_map('intval', $_SESSION['alleGebiete']);
|
||||
$pruefling_id = (int)$_SESSION['pruefling_id'];
|
||||
|
||||
$qry = "SELECT COUNT(DISTINCT gebiet_id) AS anzahl
|
||||
FROM testtool.tbl_pruefling_frage
|
||||
JOIN testtool.tbl_frage USING(frage_id)
|
||||
WHERE gebiet_id IN (". implode(',', $alleGebiete) .")
|
||||
AND pruefling_id = ". $pruefling_id;
|
||||
|
||||
$result_check = $db->db_query($qry);
|
||||
$row_check = $db->db_fetch_object($result_check);
|
||||
|
||||
if ((int)$row_check->anzahl === count($alleGebiete))
|
||||
{
|
||||
echo '<tr><td>
|
||||
<div class="alert alert-success small" style="margin-left: 20px; width: 170px; margin-top: 3px;" role="alert">
|
||||
<strong>'.$p->t('testtool/alleGebietGestartet').'</strong>
|
||||
</div>
|
||||
</td></tr>';
|
||||
}
|
||||
}
|
||||
// Link zum Logout
|
||||
|
||||
echo '<tr><td class="ItemTesttool" style="margin-left: 20px;" nowrap>
|
||||
|
||||
+3
-1
@@ -431,7 +431,7 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.6.40",
|
||||
"php": ">=7.0.0",
|
||||
|
||||
"afarkas/html5shiv": "3.7.*",
|
||||
"alvaro-prieto/colresizable": "1.6",
|
||||
@@ -492,6 +492,8 @@
|
||||
|
||||
"rmariuzzo/jquery-checkboxes": "1.0.7",
|
||||
|
||||
"sabre/dav": "4.0.3",
|
||||
"sabre/event": "5.0.3",
|
||||
"scottjehl/respond": "1.4.2",
|
||||
|
||||
"tapmodo/jcrop": "2.0.4",
|
||||
|
||||
@@ -342,6 +342,8 @@ echo '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>';
|
||||
<vbox>
|
||||
<checkbox id="mitarbeiter-entwicklungsteam-detail-checkbox-neu" checked="true" hidden="true" />
|
||||
<textbox id="mitarbeiter-entwicklungsteam-detail-textbox-studiengang" hidden="true" />
|
||||
<textbox id="mitarbeiter-entwicklungsteam-detail-entwicklungsteam_id" hidden="true" />
|
||||
|
||||
<groupbox id="mitarbeiter-entwicklungsteam-detail-groupbox" flex="1">
|
||||
<caption label="Details" />
|
||||
<grid id="mitarbeiter-entwicklungsteam-detail-grid" style="margin:4px;" flex="1">
|
||||
|
||||
@@ -1708,6 +1708,7 @@ function MitarbeiterEntwicklungsteamSelect()
|
||||
document.getElementById('mitarbeiter-entwicklungsteam-detail-textbox-studiengang').value=studiengang_kz;
|
||||
document.getElementById('mitarbeiter-entwicklungsteam-detail-datum-beginn').value=beginn;
|
||||
document.getElementById('mitarbeiter-entwicklungsteam-detail-datum-ende').value=ende;
|
||||
document.getElementById('mitarbeiter-entwicklungsteam-detail-entwicklungsteam_id').value=entwicklungsteam_id;
|
||||
MitarbeiterEntwicklungsteamDetailDisableFields(false);
|
||||
}
|
||||
|
||||
@@ -1725,6 +1726,7 @@ function MitarbeiterEntwicklungsteamSpeichern()
|
||||
studiengang_kz_old = document.getElementById('mitarbeiter-entwicklungsteam-detail-textbox-studiengang').value;
|
||||
beginn = document.getElementById('mitarbeiter-entwicklungsteam-detail-datum-beginn').value;
|
||||
ende = document.getElementById('mitarbeiter-entwicklungsteam-detail-datum-ende').value;
|
||||
entwicklungsteam_id = document.getElementById('mitarbeiter-entwicklungsteam-detail-entwicklungsteam_id').value;
|
||||
|
||||
if(studiengang_kz=='')
|
||||
{
|
||||
|
||||
@@ -3555,6 +3555,14 @@ function StudentZeugnisDokumentArchivieren()
|
||||
case 'microcredential_2':
|
||||
case 'microcredential_3':
|
||||
case 'microcredential_4':
|
||||
case 'microdegree_1':
|
||||
case 'microdegree_2':
|
||||
case 'microdegree_3':
|
||||
case 'microdegree_4':
|
||||
case 'microdegreeabschluss_1':
|
||||
case 'microdegreeabschluss_2':
|
||||
case 'microdegreeabschluss_3':
|
||||
case 'microdegreeabschluss_4':
|
||||
xml = 'microcredential.xml.php';
|
||||
break;
|
||||
|
||||
|
||||
@@ -364,9 +364,10 @@ class entwicklungsteam extends basis_db
|
||||
$bismeldung_jahr = $datetime->format('Y');
|
||||
|
||||
//laden des Datensatzes
|
||||
$qry = "SELECT *
|
||||
$qry = "SELECT tbl_entwicklungsteam.*, tbl_besqual.*, tbl_studiengang.studiengang_kz, tbl_studiengang.melderelevant
|
||||
FROM bis.tbl_entwicklungsteam
|
||||
JOIN bis.tbl_besqual USING(besqualcode)
|
||||
JOIN public.tbl_studiengang USING(studiengang_kz)
|
||||
WHERE mitarbeiter_uid=".$this->db_add_param($mitarbeiter_uid)."
|
||||
AND (beginn is NULL OR beginn <= make_date(". $this->db_add_param($bismeldung_jahr). "::INTEGER, 12, 31))
|
||||
AND (ende is NULL OR ende >= make_date(". $this->db_add_param($bismeldung_jahr). "::INTEGER, 1, 1))";
|
||||
@@ -394,6 +395,7 @@ class entwicklungsteam extends basis_db
|
||||
$obj->insertvon = $row->insertvon;
|
||||
$obj->ext_id = $row->ext_id;
|
||||
$obj->besqual = $row->besqualbez;
|
||||
$obj->melderelevant = $this->db_parse_bool($row->melderelevant);
|
||||
|
||||
$this->result[] = $obj;
|
||||
}
|
||||
|
||||
+49
-1
@@ -25,6 +25,7 @@
|
||||
*/
|
||||
require_once(dirname(__FILE__).'/basis_db.class.php');
|
||||
require_once(dirname(__FILE__).'/'.EXT_FKT_PATH.'/generateZahlungsreferenz.inc.php');
|
||||
require_once(dirname(__FILE__).'/variable.class.php');
|
||||
|
||||
class konto extends basis_db
|
||||
{
|
||||
@@ -432,6 +433,8 @@ class konto extends basis_db
|
||||
|
||||
$qry.=" ORDER BY beschreibung";
|
||||
|
||||
$oehBeitrag = $this->_getOEHBeitrag();
|
||||
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
while($row = $this->db_fetch_object())
|
||||
@@ -440,7 +443,15 @@ class konto extends basis_db
|
||||
|
||||
$typ->buchungstyp_kurzbz = $row->buchungstyp_kurzbz;
|
||||
$typ->beschreibung = $row->beschreibung;
|
||||
$typ->standardbetrag = $row->standardbetrag;
|
||||
if (strtolower($typ->buchungstyp_kurzbz) === 'oeh' && $oehBeitrag)
|
||||
{
|
||||
$typ->standardbetrag = $oehBeitrag;
|
||||
}
|
||||
else
|
||||
{
|
||||
$typ->standardbetrag = $row->standardbetrag;
|
||||
}
|
||||
|
||||
$typ->standardtext = $row->standardtext;
|
||||
$typ->credit_points = $row->credit_points;
|
||||
$typ->aktiv = $this->db_parse_bool($row->aktiv);
|
||||
@@ -990,6 +1001,43 @@ class konto extends basis_db
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private function _getOEHBeitrag()
|
||||
{
|
||||
if(!is_user_logged_in())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$variablen_obj = new variable();
|
||||
$variablen_obj->loadVariables(get_uid());
|
||||
|
||||
$qry = "WITH semstart AS (
|
||||
SELECT start FROM public.tbl_studiensemester
|
||||
WHERE studiensemester_kurzbz = '". $this->db_escape($variablen_obj->variable->semester_aktuell) . "'
|
||||
)
|
||||
SELECT * FROM bis.tbl_oehbeitrag oehb
|
||||
JOIN public.tbl_studiensemester semvon ON oehb.von_studiensemester_kurzbz = semvon.studiensemester_kurzbz
|
||||
LEFT JOIN public.tbl_studiensemester sembis ON oehb.bis_studiensemester_kurzbz = sembis.studiensemester_kurzbz
|
||||
JOIN semstart ON semstart.start::date >= semvon.start::date AND (sembis.studiensemester_kurzbz IS NULL OR semstart.start::date <= sembis.start::date)
|
||||
ORDER BY semvon.start
|
||||
LIMIT 1";
|
||||
|
||||
if ($this->db_query($qry))
|
||||
{
|
||||
if($row = $this->db_fetch_object())
|
||||
{
|
||||
$summe = ($row->studierendenbeitrag + $row->versicherung) * -1;
|
||||
return number_format((float)$summe, 2, '.', '');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler bei der Abfrage aufgetreten';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -584,8 +584,9 @@ class lehreinheitmitarbeiter extends basis_db
|
||||
|
||||
$qry = '
|
||||
WITH semester_sws_tbl AS (
|
||||
SELECT DISTINCT lehreinheit_id, studiensemester_kurzbz, lema.semesterstunden,
|
||||
stg.studiengang_kz, stg.melde_studiengang_kz, stg.lgartcode
|
||||
SELECT
|
||||
DISTINCT lehreinheit_id, studiensemester_kurzbz, lema.semesterstunden,
|
||||
stg.studiengang_kz, stg.melde_studiengang_kz, stg.lgartcode, stg.melderelevant
|
||||
FROM lehre.tbl_lehreinheitmitarbeiter lema
|
||||
JOIN lehre.tbl_lehreinheit USING (lehreinheit_id)
|
||||
JOIN lehre.tbl_lehrveranstaltung lv USING (lehrveranstaltung_id)
|
||||
@@ -598,6 +599,7 @@ class lehreinheitmitarbeiter extends basis_db
|
||||
AND ss.studiensemester_kurzbz IN ('.$this->implode4SQL($studiensemester_kurzbz_arr).')
|
||||
-- nur lehre, die bisgemeldet wird
|
||||
AND lema.bismelden
|
||||
AND stg.melderelevant
|
||||
-- keine lehreinheiten ohne semesterstunden
|
||||
AND lema.semesterstunden != 0
|
||||
)
|
||||
|
||||
@@ -584,6 +584,32 @@ class pruefling extends basis_db
|
||||
|
||||
$qry .= " LIMIT 1";
|
||||
|
||||
if($result = $this->db_query($qry))
|
||||
{
|
||||
if ($this->db_num_rows($result) == 0)
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler bei einer Abfrage';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public function personAlreadyInRT($person_id, $reihungstest_id, $prestudent_id)
|
||||
{
|
||||
$qry = "SELECT tbl_prestudent.prestudent_id
|
||||
FROM public.tbl_rt_person
|
||||
JOIN public.tbl_prestudent ON tbl_prestudent.person_id = tbl_rt_person.person_id
|
||||
JOIN public.tbl_prestudentstatus ON tbl_prestudent.prestudent_id = tbl_prestudentstatus.prestudent_id AND status_kurzbz = 'Bewerber'
|
||||
AND tbl_prestudentstatus.studienplan_id = tbl_rt_person.studienplan_id
|
||||
WHERE tbl_rt_person.person_id = " . $this->db_add_param($person_id) . "
|
||||
AND tbl_rt_person.rt_id = " . $this->db_add_param($reihungstest_id) . "
|
||||
AND tbl_prestudent.prestudent_id != " . $this->db_add_param($prestudent_id) . "
|
||||
AND get_rolle_prestudent(tbl_prestudent.prestudent_id, NULL) = 'Bewerber'
|
||||
LIMIT 1";
|
||||
|
||||
if($result = $this->db_query($qry))
|
||||
{
|
||||
if ($this->db_num_rows($result) == 0)
|
||||
|
||||
@@ -17,6 +17,7 @@ $this->phrasen['testtool/basic']='Basic';
|
||||
$this->phrasen['testtool/basisgebiete']='Basisgebiete';
|
||||
$this->phrasen['testtool/semester']='Semester';
|
||||
$this->phrasen['testtool/reihungstestNichtFreigeschalten']='Der zuteilte Reihungstest ist noch nicht freigeschaltet';
|
||||
$this->phrasen['testtool/reihungstestNichtRegistriert']='Sie sind für den Reihungstest nicht registriert';
|
||||
$this->phrasen['testtool/reihungstestKannNichtGeladenWerden']='Der Reihungstest dem Sie zugeteilt sind, kann nicht geladen werden. Melden Sie sich bitte bei der Reihungstestaufsicht.';
|
||||
$this->phrasen['testtool/geburtsdatumStimmtNichtUeberein']='Ihr Geburtsdatum stimmt nicht mit unseren Daten überein. Bitte wenden Sie sich an die Aufsichtsperson';
|
||||
$this->phrasen['testtool/home']='Home';
|
||||
@@ -31,10 +32,14 @@ $this->phrasen['testtool/keineAntwort']='Keine Antwort';
|
||||
$this->phrasen['testtool/speichernUndWeiter']='Speichern und weiter';
|
||||
$this->phrasen['testtool/alleFragenBeantwortet']='GLÜCKWUNSCH! \n\nSie haben alle Fragen in der zur Verfügung stehenden Zeit beantwortet. \nNutzen Sie die verbleibende Zeit, um Ihre Antworten zu kontrollieren oder fahren Sie mit dem nächsten Teilgebiet fort.';
|
||||
$this->phrasen['testtool/zeitAbgelaufen']='Die Maximalzeit für dieses Gebiet ist abgelaufen, oder alle Fragen wurden beantwortet';
|
||||
$this->phrasen['testtool/alleGebietGestartet']='Sie haben alle Gebiete bearbeitet.';
|
||||
$this->phrasen['testtool/alleGebieteGestartetInfo']='Sie können sich nun ausloggen und den Browser schließen.';
|
||||
$this->phrasen['testtool/spracheDerTestfragen']='Gewünschte Sprache der Testfragen';
|
||||
$this->phrasen['testtool/einleitung']='Einleitung';
|
||||
$this->phrasen['testtool/blaettern']='Blättern';
|
||||
$this->phrasen['testtool/demo']='Demobeispiel ansehen';
|
||||
$this->phrasen['testtool/abbrechen']='Abbrechen';
|
||||
$this->phrasen['testtool/startGebiet']='Gebiet starten';
|
||||
$this->phrasen['testtool/okKlickenUmZuStarten']='Klicken Sie OK um dieses Gebiet zu starten. \nSie haben für die Bearbeitung ein Zeitlimit von';
|
||||
$this->phrasen['testtool/bitteZuerstAnmelden']='Bitte zuerst anmelden!';
|
||||
$this->phrasen['testtool/fehlerBeimGenerierenDesFragenpools']='Fehler beim generieren des Fragenpools';
|
||||
|
||||
@@ -17,6 +17,7 @@ $this->phrasen['testtool/basic']='Basic';
|
||||
$this->phrasen['testtool/basisgebiete']='Basic test';
|
||||
$this->phrasen['testtool/semester']='Semester';
|
||||
$this->phrasen['testtool/reihungstestNichtFreigeschalten']='The entrance examination assigned has not yet been activated.';
|
||||
$this->phrasen['testtool/reihungstestNichtRegistriert']='You are not registered for the placement test.';
|
||||
$this->phrasen['testtool/reihungstestKannNichtGeladenWerden']='The placement test you are assigned to could not be loaded. Please contact the placement test supervisior.';
|
||||
$this->phrasen['testtool/geburtsdatumStimmtNichtUeberein']='Your date of birth does not correspond to the data we have. Please speak to the supervisor. ';
|
||||
$this->phrasen['testtool/home']='Home';
|
||||
@@ -31,10 +32,14 @@ $this->phrasen['testtool/keineAntwort']='No Answer';
|
||||
$this->phrasen['testtool/speichernUndWeiter']='Save and next';
|
||||
$this->phrasen['testtool/alleFragenBeantwortet']='CONGRATULATIONS!\n\nYou have answered all the questions in the time allowed.\n Use the remaining time to check your answers or continue to the next section.';
|
||||
$this->phrasen['testtool/zeitAbgelaufen']='The time for this part has expired or you have answered all the questions.';
|
||||
$this->phrasen['testtool/alleGebietGestartet']='You have worked on all sections.';
|
||||
$this->phrasen['testtool/alleGebieteGestartetInfo']='You can now log out and close the browser.';
|
||||
$this->phrasen['testtool/spracheDerTestfragen']='Desired language of questions';
|
||||
$this->phrasen['testtool/einleitung']='Introduction';
|
||||
$this->phrasen['testtool/blaettern']='Browse';
|
||||
$this->phrasen['testtool/demo']='See an example';
|
||||
$this->phrasen['testtool/abbrechen']='Cancel';
|
||||
$this->phrasen['testtool/startGebiet']='Start the section';
|
||||
$this->phrasen['testtool/okKlickenUmZuStarten']='Click OK to start this section. \nYou have a timelimit of';
|
||||
$this->phrasen['testtool/bitteZuerstAnmelden']='Please log in first!';
|
||||
$this->phrasen['testtool/fehlerBeimGenerierenDesFragenpools']='Error in generating the pool of questions.';
|
||||
|
||||
@@ -197,10 +197,6 @@ html.fs_huge {
|
||||
margin-bottom: -1px;
|
||||
}
|
||||
|
||||
.tiny-90 div.tox.tox-tinymce {
|
||||
height: 90% !important;
|
||||
}
|
||||
|
||||
/* slim begin */
|
||||
.stv .form-label {
|
||||
margin-bottom: .15rem;
|
||||
|
||||
@@ -185,3 +185,101 @@ body {
|
||||
}
|
||||
|
||||
|
||||
.fhc-calendar-base-grid-line-event {
|
||||
position: relative !important;
|
||||
}
|
||||
|
||||
.updated-event {
|
||||
position: relative !important;
|
||||
z-index: 10;
|
||||
animation: modernFocus 1s ease-out;
|
||||
border-radius: 0.25rem;
|
||||
}
|
||||
|
||||
.updated-event-long {
|
||||
position: relative !important;
|
||||
z-index: 10;
|
||||
animation: modernFocus 1.8s ease-out;
|
||||
border-radius: 0.25rem;
|
||||
}
|
||||
|
||||
@keyframes modernFocus {
|
||||
0% {
|
||||
background-color: #cfd4d8;
|
||||
box-shadow:
|
||||
0 0 0 0 rgba(120, 120, 120, 0.8),
|
||||
0 0 0 0 rgba(255, 255, 255, 0.6);
|
||||
}
|
||||
|
||||
30% {
|
||||
background-color: #eef1f3;
|
||||
box-shadow:
|
||||
0 0 0 8px rgba(120, 120, 120, 0.25),
|
||||
0 0 30px 8px rgba(255, 255, 255, 0.7);
|
||||
}
|
||||
|
||||
60% {
|
||||
background-color: #f7f8f9;
|
||||
box-shadow:
|
||||
0 0 0 14px rgba(120, 120, 120, 0.15),
|
||||
0 0 45px 12px rgba(255, 255, 255, 0.5);
|
||||
}
|
||||
|
||||
100% {
|
||||
background-color: inherit;
|
||||
box-shadow:
|
||||
0 0 0 24px rgba(120, 120, 120, 0),
|
||||
0 0 60px 20px rgba(255, 255, 255, 0);
|
||||
}
|
||||
}
|
||||
|
||||
.deemphasized-event {
|
||||
animation: deEmphasize 1s ease-out;
|
||||
}
|
||||
|
||||
.deemphasized-event-long {
|
||||
animation: deEmphasize 1.8s ease-out;
|
||||
}
|
||||
|
||||
@keyframes deEmphasize {
|
||||
0% {
|
||||
opacity: 1;
|
||||
filter: saturate(1) brightness(1);
|
||||
}
|
||||
|
||||
30% {
|
||||
opacity: 0.55;
|
||||
filter: saturate(0.4) brightness(0.4);
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 1;
|
||||
filter: saturate(1) brightness(1);
|
||||
}
|
||||
}
|
||||
|
||||
.spinner-overlay {
|
||||
position: absolute;
|
||||
inset: 0; /* top:0 right:0 bottom:0 left:0 */
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 9999;
|
||||
background: rgba(255, 255, 255, 1);
|
||||
opacity: 0.4;
|
||||
}
|
||||
|
||||
.spinner {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border: 4px solid #ddd;
|
||||
border-top: 4px solid #007bff;
|
||||
border-radius: 50%;
|
||||
animation: spin 0.8s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
@@ -17,13 +17,16 @@
|
||||
|
||||
export default {
|
||||
getMessages(params) {
|
||||
let url = 'api/frontend/v1/messages/messages/getMessages'
|
||||
+ '/' + params.id
|
||||
+ '/' + params.type;
|
||||
if(params.size && params.page) {
|
||||
url += '/' + params.size
|
||||
+ '/' + params.page;
|
||||
}
|
||||
return {
|
||||
method: 'get',
|
||||
url: 'api/frontend/v1/messages/messages/getMessages/'
|
||||
+ params.id + '/'
|
||||
+ params.type + '/'
|
||||
+ params.size + '/'
|
||||
+ params.page
|
||||
url: url
|
||||
};
|
||||
},
|
||||
getVorlagen(){
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* Copyright (C) 2025 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 3 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, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
export default {
|
||||
getSchedulableResourcesByCalendar(calendarID) {
|
||||
return {
|
||||
method: "get",
|
||||
url: "/api/frontend/v1/tempus/OperationalResourceToCalenderAPI/getSchedulableResourcesByCalendar/" + calendarID,
|
||||
};
|
||||
},
|
||||
getAssignedResourcesByCalender(calenderID) {
|
||||
return {
|
||||
method: "get",
|
||||
url: "/api/frontend/v1/tempus/OperationalResourceToCalenderAPI/getAssignedResourcesByCalender/" + calenderID,
|
||||
};
|
||||
},
|
||||
storeResourcesToCalendarRelationship(calenderID, assignedResources) {
|
||||
return {
|
||||
method: "post",
|
||||
url: "/api/frontend/v1/tempus/OperationalResourceToCalenderAPI/storeResourcesToCalendarRelationship",
|
||||
params: { kalender_id: calenderID, assignedResources: assignedResources },
|
||||
};
|
||||
}
|
||||
};
|
||||
@@ -38,6 +38,10 @@ export default {
|
||||
};
|
||||
},
|
||||
insert(params) {
|
||||
if(params.betrag)
|
||||
{
|
||||
params.betrag = params.betrag.replace(',', '.');
|
||||
}
|
||||
return {
|
||||
method: 'post',
|
||||
url: 'api/frontend/v1/stv/konto/insert',
|
||||
@@ -52,6 +56,10 @@ export default {
|
||||
};
|
||||
},
|
||||
edit(params) {
|
||||
if(params.betrag)
|
||||
{
|
||||
params.betrag = params.betrag.replace(',', '.');
|
||||
}
|
||||
return {
|
||||
method: 'post',
|
||||
url: 'api/frontend/v1/stv/konto/update',
|
||||
@@ -65,10 +73,14 @@ export default {
|
||||
params: { buchungsnr }
|
||||
};
|
||||
},
|
||||
getBuchungstypen() {
|
||||
getBuchungstypen(studiensemester_kurzbz) {
|
||||
let url = 'api/frontend/v1/stv/konto/getBuchungstypen'
|
||||
if (!!studiensemester_kurzbz)
|
||||
url = url + '/' + encodeURIComponent(studiensemester_kurzbz);
|
||||
|
||||
return {
|
||||
method: 'get',
|
||||
url: 'api/frontend/v1/stv/konto/getBuchungstypen'
|
||||
url: url
|
||||
};
|
||||
}
|
||||
},
|
||||
};
|
||||
@@ -60,6 +60,7 @@ export default {
|
||||
template: /* html */`
|
||||
<div
|
||||
class="fhc-calendar-base-grid-line"
|
||||
:data-day="date.toISODate()"
|
||||
style="position:relative;display:grid;grid-auto-flow:dense"
|
||||
:style="'grid-template-' + axisRow + 's:subgrid'"
|
||||
>
|
||||
@@ -71,7 +72,7 @@ export default {
|
||||
></line-background>
|
||||
<line-event
|
||||
v-for="(event, i) in eventsWithRowInfo"
|
||||
:key="i"
|
||||
:key="event.orig.kalender_id || i"
|
||||
:style="'grid-' + axisRow + ': ' + event.rows.join('/')"
|
||||
:event="event"
|
||||
@resize-start="$emit('resize-start', $event)"
|
||||
|
||||
@@ -109,6 +109,8 @@ export default {
|
||||
:class="classes"
|
||||
style="z-index: 2"
|
||||
:draggable="draggable"
|
||||
:data-id="'event-' + event.orig.kalender_id"
|
||||
:data-group-id="'event-group-' + event.orig.eindeutige_gruppen_id"
|
||||
ref="eventEl"
|
||||
@dragstart="onDragStart"
|
||||
v-draggable:move.noimage="draggable ? dragKalenderCollection : {}"
|
||||
@@ -145,6 +147,7 @@ export default {
|
||||
/>
|
||||
<ul
|
||||
v-if="contextMenu.show"
|
||||
data-cy="eventContextMenu"
|
||||
class="dropdown-menu show"
|
||||
:style="{ position: 'fixed', top: contextMenu.y + 'px', left: contextMenu.x + 'px', zIndex: 9999 }"
|
||||
>
|
||||
@@ -158,4 +161,4 @@ export default {
|
||||
</teleport>
|
||||
</div>
|
||||
`
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,201 +1,212 @@
|
||||
import FhcCalendar from "./Base.js";
|
||||
|
||||
import { useEventLoader } from '../../composables/EventLoader.js';
|
||||
|
||||
import ModeWeek from './Mode/Week.js';
|
||||
import ModeMonth from './Mode/Month.js';
|
||||
import ModeTable from './Mode/Table.js';
|
||||
import ApiKalender from '../../api/factory/tempus/kalender.js';
|
||||
import draggable from '../../directives/draggable.js';
|
||||
import { useEventLoader } from "../../composables/EventLoader.js";
|
||||
|
||||
import ModeWeek from "./Mode/Week.js";
|
||||
import ModeMonth from "./Mode/Month.js";
|
||||
import ModeTable from "./Mode/Table.js";
|
||||
import ApiKalender from "../../api/factory/tempus/kalender.js";
|
||||
import draggable from "../../directives/draggable.js";
|
||||
|
||||
export default {
|
||||
name: "CalendarTempus",
|
||||
components: {
|
||||
FhcCalendar
|
||||
},
|
||||
inject: {
|
||||
renderers: {from: 'renderers'},
|
||||
appConfig: {
|
||||
from: 'appConfig',
|
||||
default: {
|
||||
visible_status: 'all'
|
||||
}
|
||||
}
|
||||
},
|
||||
directives: {
|
||||
draggable,
|
||||
},
|
||||
props: {
|
||||
timezone: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
date: {
|
||||
type: [Date, String, Number, luxon.DateTime],
|
||||
default: luxon.DateTime.local()
|
||||
},
|
||||
mode: {
|
||||
type: String,
|
||||
default: 'Week'
|
||||
},
|
||||
getPromiseFunc: {
|
||||
type: Function,
|
||||
required: true
|
||||
},
|
||||
parkedEvents: {
|
||||
type: Object,
|
||||
default: () => new Set()
|
||||
},
|
||||
visibleLecturers: {
|
||||
type: Array,
|
||||
default: null
|
||||
},
|
||||
extraBackgrounds: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
visibleStatus: {
|
||||
type: Array,
|
||||
default: () => ['all']
|
||||
},
|
||||
},
|
||||
emits: [
|
||||
"update:date",
|
||||
"update:mode",
|
||||
"update:range",
|
||||
"drop",
|
||||
"resize"
|
||||
],
|
||||
name: "CalendarTempus",
|
||||
components: {
|
||||
FhcCalendar,
|
||||
},
|
||||
inject: {
|
||||
renderers: { from: "renderers" },
|
||||
appConfig: {
|
||||
from: "appConfig",
|
||||
default: {
|
||||
visible_status: "all",
|
||||
},
|
||||
},
|
||||
},
|
||||
directives: {
|
||||
draggable,
|
||||
},
|
||||
props: {
|
||||
timezone: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
date: {
|
||||
type: [Date, String, Number, luxon.DateTime],
|
||||
default: luxon.DateTime.local(),
|
||||
},
|
||||
mode: {
|
||||
type: String,
|
||||
default: "Week",
|
||||
},
|
||||
getPromiseFunc: {
|
||||
type: Function,
|
||||
required: true,
|
||||
},
|
||||
parkedEvents: {
|
||||
type: Object,
|
||||
default: () => new Set(),
|
||||
},
|
||||
visibleLecturers: {
|
||||
type: Array,
|
||||
default: null,
|
||||
},
|
||||
extraBackgrounds: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
visibleStatus: {
|
||||
type: Array,
|
||||
default: () => ["all"],
|
||||
},
|
||||
},
|
||||
emits: ["update:date", "update:mode", "update:range", "drop", "resize"],
|
||||
|
||||
data() {
|
||||
return {
|
||||
modes: {
|
||||
week: Vue.markRaw(ModeWeek),
|
||||
month: Vue.markRaw(ModeMonth),
|
||||
tableList: Vue.markRaw(ModeTable),
|
||||
},
|
||||
modeOptions: {
|
||||
day: {
|
||||
emptyMessage: Vue.computed(() => this.$p.t('lehre/noLvFound')),
|
||||
emptyMessageDetails: Vue.computed(() => this.$p.t('lehre/noLvFound'))
|
||||
},
|
||||
week: {
|
||||
collapseEmptyDays: false
|
||||
}
|
||||
},
|
||||
currentMode: this.mode,
|
||||
teachingunits: null,
|
||||
hoursplan: null,
|
||||
showRaster: true,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
backgrounds() {
|
||||
let now = luxon.DateTime.now().setZone(this.timezone);
|
||||
data() {
|
||||
return {
|
||||
modes: {
|
||||
week: Vue.markRaw(ModeWeek),
|
||||
month: Vue.markRaw(ModeMonth),
|
||||
tableList: Vue.markRaw(ModeTable),
|
||||
},
|
||||
modeOptions: {
|
||||
day: {
|
||||
emptyMessage: Vue.computed(() => this.$p.t("lehre/noLvFound")),
|
||||
emptyMessageDetails: Vue.computed(() => this.$p.t("lehre/noLvFound")),
|
||||
},
|
||||
week: {
|
||||
collapseEmptyDays: false,
|
||||
},
|
||||
},
|
||||
currentMode: this.mode,
|
||||
teachingunits: null,
|
||||
hoursplan: null,
|
||||
showRaster: true,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
backgrounds() {
|
||||
let now = luxon.DateTime.now().setZone(this.timezone);
|
||||
|
||||
let past = [];
|
||||
if (this.mode == 'Month')
|
||||
{
|
||||
past = [{
|
||||
class: 'background-past',
|
||||
end: now.startOf('day')
|
||||
}];
|
||||
}
|
||||
else
|
||||
{
|
||||
past = [{
|
||||
class: 'background-past',
|
||||
end: now,
|
||||
label: now.startOf('minute').toISOTime({ suppressSeconds: true, includeOffset: false })
|
||||
}];
|
||||
}
|
||||
let past = [];
|
||||
if (this.mode == "Month") {
|
||||
past = [
|
||||
{
|
||||
class: "background-past",
|
||||
end: now.startOf("day"),
|
||||
},
|
||||
];
|
||||
} else {
|
||||
past = [
|
||||
{
|
||||
class: "background-past",
|
||||
end: now,
|
||||
label: now
|
||||
.startOf("minute")
|
||||
.toISOTime({ suppressSeconds: true, includeOffset: false }),
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
return [
|
||||
...past,
|
||||
...(this.extraBackgrounds || [])
|
||||
];
|
||||
},
|
||||
visibleEvents()
|
||||
{
|
||||
let list = this.events;
|
||||
return [...past, ...(this.extraBackgrounds || [])];
|
||||
},
|
||||
visibleEvents() {
|
||||
let list = this.events;
|
||||
|
||||
if (Array.isArray(this.visibleLecturers))
|
||||
{
|
||||
const visibleLectures = new Set(this.visibleLecturers);
|
||||
if (Array.isArray(this.visibleLecturers)) {
|
||||
const visibleLectures = new Set(this.visibleLecturers);
|
||||
|
||||
list = list.filter(event => {
|
||||
if (!event.lektor?.length)
|
||||
return true;
|
||||
return event.lektor.some(lektor => visibleLectures.has(lektor.mitarbeiter_uid));
|
||||
});
|
||||
}
|
||||
list = list.filter((event) => {
|
||||
if (!event.lektor?.length) return true;
|
||||
return event.lektor.some((lektor) =>
|
||||
visibleLectures.has(lektor.mitarbeiter_uid),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
if (!this.visibleStatus.length || this.visibleStatus.includes('all'))
|
||||
return list;
|
||||
if (!this.visibleStatus.length || this.visibleStatus.includes("all"))
|
||||
return list;
|
||||
|
||||
return list.filter(event => this.visibleStatus.includes(event.status_kurzbz));
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
eventStyle(event) {
|
||||
if (!event.farbe)
|
||||
return undefined;
|
||||
return '--event-bg:#' + event.farbe;
|
||||
},
|
||||
updateRange(rangeInterval) {
|
||||
this.rangeInterval = rangeInterval;
|
||||
this.$emit('update:range', rangeInterval);
|
||||
},
|
||||
ondrop(payload){
|
||||
this.$emit('drop', payload);
|
||||
},
|
||||
onresize(payload){
|
||||
this.$emit('resize', payload);
|
||||
},
|
||||
resetEventLoader() {
|
||||
this.reset();
|
||||
},
|
||||
return list.filter((event) =>
|
||||
this.visibleStatus.includes(event.status_kurzbz),
|
||||
);
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
eventStyle(event) {
|
||||
if (!event.farbe) return undefined;
|
||||
return "--event-bg:#" + event.farbe;
|
||||
},
|
||||
updateRange(rangeInterval) {
|
||||
this.rangeInterval = rangeInterval;
|
||||
this.$emit("update:range", rangeInterval);
|
||||
},
|
||||
ondrop(payload) {
|
||||
this.$emit("drop", payload);
|
||||
},
|
||||
onresize(payload) {
|
||||
this.$emit("resize", payload);
|
||||
},
|
||||
resetEventLoader() {
|
||||
this.reset();
|
||||
},
|
||||
clearOutCalendarEventEmphasis() {
|
||||
this.$refs.calendar.$el
|
||||
.querySelectorAll(
|
||||
".fhc-calendar-base-grid .fhc-calendar-base-grid-line-event",
|
||||
)
|
||||
.forEach((el) => {
|
||||
const spinner = el.querySelector(".spinner-overlay");
|
||||
if (spinner) {
|
||||
spinner.remove();
|
||||
}
|
||||
|
||||
},
|
||||
setup(props, context) {
|
||||
const rangeInterval = Vue.ref(null);
|
||||
el.classList.remove(
|
||||
"updating-event",
|
||||
"updated-event",
|
||||
"updated-event-long",
|
||||
"deemphasized-event",
|
||||
"deemphasized-event-long",
|
||||
);
|
||||
});
|
||||
},
|
||||
},
|
||||
setup(props, context) {
|
||||
const rangeInterval = Vue.ref(null);
|
||||
|
||||
const { events, lv, reset } = useEventLoader(rangeInterval, props.getPromiseFunc);
|
||||
const { events, lv, reset } = useEventLoader(
|
||||
rangeInterval,
|
||||
props.getPromiseFunc,
|
||||
);
|
||||
|
||||
Vue.watch(lv, newValue => {
|
||||
context.emit('update:lv', newValue);
|
||||
});
|
||||
Vue.watch(lv, (newValue) => {
|
||||
context.emit("update:lv", newValue);
|
||||
});
|
||||
|
||||
return {
|
||||
rangeInterval,
|
||||
events,
|
||||
lv,
|
||||
reset
|
||||
};
|
||||
},
|
||||
return {
|
||||
rangeInterval,
|
||||
events,
|
||||
lv,
|
||||
reset,
|
||||
};
|
||||
},
|
||||
|
||||
created() {
|
||||
this.$api
|
||||
.call(ApiKalender.getStunden())
|
||||
.then(res => {
|
||||
return this.teachingunits = res.data.map(el => ({
|
||||
id: el.stunde,
|
||||
start: el.beginn,
|
||||
end: el.ende
|
||||
}));
|
||||
});
|
||||
created() {
|
||||
this.$api.call(ApiKalender.getStunden()).then((res) => {
|
||||
return (this.teachingunits = res.data.map((el) => ({
|
||||
id: el.stunde,
|
||||
start: el.beginn,
|
||||
end: el.ende,
|
||||
})));
|
||||
});
|
||||
|
||||
this.$api
|
||||
.call(ApiKalender.getCalendarHours())
|
||||
.then(res => {
|
||||
this.hoursplan = {
|
||||
start: res.data.start,
|
||||
end: res.data.end
|
||||
};
|
||||
});
|
||||
},
|
||||
template: /* html */`
|
||||
this.$api.call(ApiKalender.getCalendarHours()).then((res) => {
|
||||
this.hoursplan = {
|
||||
start: res.data.start,
|
||||
end: res.data.end,
|
||||
};
|
||||
});
|
||||
},
|
||||
template: /* html */ `
|
||||
<fhc-calendar
|
||||
ref="calendar"
|
||||
class="fhc-calendar-lvplan"
|
||||
@@ -254,6 +265,7 @@ export default {
|
||||
<div
|
||||
class="d-flex align-items-center gap-2 "
|
||||
v-draggable:move.noimage="{ type: 'reservierung', id: null, orig: {} }"
|
||||
data-cy="reservationDragHandle"
|
||||
>
|
||||
<i
|
||||
class="fa-solid fa-calendar-plus text-primary"
|
||||
@@ -264,5 +276,5 @@ export default {
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</fhc-calendar>`
|
||||
}
|
||||
</fhc-calendar>`,
|
||||
};
|
||||
|
||||
@@ -63,7 +63,7 @@ export default {
|
||||
const vm = this;
|
||||
tinymce.init({
|
||||
target: this.$refs.editor.$refs.input, //Important: not selector: to enable multiple import of component
|
||||
//height: 800,
|
||||
min_height: 300,
|
||||
//plugins: ['lists'],
|
||||
toolbar: 'styleselect | bold italic underline | alignleft aligncenter alignright alignjustify | link',
|
||||
plugins: 'link',
|
||||
@@ -133,6 +133,7 @@ export default {
|
||||
return this.$api
|
||||
.call(ApiMessages.getDataVorlage(vorlage_kurzbz))
|
||||
.then(response => {
|
||||
this.editor.setContent(response.data.text);
|
||||
this.formData.body = response.data.text;
|
||||
this.formData.subject = response.data.subject;
|
||||
}).catch(this.$fhcAlert.handleSystemError);
|
||||
@@ -203,24 +204,6 @@ export default {
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
'formData.body': {
|
||||
handler(newVal) {
|
||||
const tinymcsVal = this.editor.getContent();
|
||||
|
||||
if (newVal && tinymcsVal != newVal) {
|
||||
//Inhalt des Editors aktualisieren
|
||||
this.editor.setContent(newVal);
|
||||
}
|
||||
}
|
||||
},
|
||||
'formData.vorlage_kurzbz': {
|
||||
handler(newVal){
|
||||
if (newVal && newVal != null) {
|
||||
this.formData.subject = newVal;
|
||||
return this.getDataVorlage(newVal);
|
||||
}
|
||||
}
|
||||
},
|
||||
messageId: {
|
||||
immediate: true,
|
||||
handler: async function (newMessageId) {
|
||||
@@ -231,6 +214,7 @@ export default {
|
||||
this.replyData = result.data;
|
||||
|
||||
if (this.replyData.length > 0) {
|
||||
this.editor.setContent(this.replyData[0].replyBody);
|
||||
this.formData.subject = this.replyData[0].replySubject;
|
||||
this.formData.body = this.replyData[0].replyBody;
|
||||
this.formData.relationmessage_id = newMessageId;
|
||||
@@ -290,19 +274,6 @@ export default {
|
||||
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
|
||||
//case of reply
|
||||
if(this.messageId) {
|
||||
this.$api
|
||||
.call(ApiMessages.getReplyData(this.messageId))
|
||||
.then(result => {
|
||||
this.replyData = result.data;
|
||||
this.formData.subject = this.replyData[0].replySubject;
|
||||
this.formData.body = this.replyData[0].replyBody;
|
||||
this.formData.relationmessage_id = this.messageId;
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
}
|
||||
},
|
||||
async mounted() {
|
||||
this.initTinyMCE();
|
||||
@@ -342,7 +313,7 @@ export default {
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-8">
|
||||
<form-form class="row g-3 mt-2 h-100" ref="formMessage">
|
||||
<form-form class="row g-3 mt-2 align-content-start" ref="formMessage">
|
||||
|
||||
<div class="row mb-3">
|
||||
|
||||
@@ -367,7 +338,7 @@ export default {
|
||||
</div>
|
||||
|
||||
<!--Tiny MCE-->
|
||||
<div class="row mb-3 h-100 tiny-90">
|
||||
<div class="row mb-3 tiny-90">
|
||||
<form-input
|
||||
ref="editor"
|
||||
:label="$p.t('global','nachricht') + ' *'"
|
||||
|
||||
@@ -62,9 +62,18 @@ export default {
|
||||
const vm = this;
|
||||
tinymce.init({
|
||||
target: this.$refs.editor.$refs.input, //Important: not selector: to enable multiple import of component
|
||||
//height: 800,
|
||||
min_height: 300,
|
||||
//plugins: ['lists'],
|
||||
toolbar: 'styleselect | bold italic underline | alignleft aligncenter alignright alignjustify',
|
||||
toolbar: 'styleselect | bold italic underline | alignleft aligncenter alignright alignjustify | link',
|
||||
plugins: 'link',
|
||||
link_context_toolbar: true,
|
||||
automatic_uploads: true,
|
||||
default_link_target: "_blank",
|
||||
link_title: true,
|
||||
target_list: [
|
||||
{ title: 'New tab', value: '_blank' },
|
||||
{ title: 'Same tab', value: '_self' }
|
||||
],
|
||||
style_formats: [
|
||||
{title: 'Blocks', block: 'div'},
|
||||
{title: 'Paragraph', block: 'p'},
|
||||
@@ -98,7 +107,8 @@ export default {
|
||||
return this.$api
|
||||
.call(ApiMessages.sendMessage(this.typeId, data))
|
||||
.then(response => {
|
||||
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSent'));
|
||||
if(this.openMode == "inSamePage")
|
||||
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSent'));
|
||||
this.hideTemplate();
|
||||
this.resetForm();
|
||||
this.messageSent = true;
|
||||
@@ -114,19 +124,17 @@ export default {
|
||||
return this.$api
|
||||
.call(ApiMessages.getDataVorlage(vorlage_kurzbz))
|
||||
.then(response => {
|
||||
this.editor.setContent(response.data.text);
|
||||
this.formData.body = response.data.text;
|
||||
this.formData.subject = response.data.subject;
|
||||
}).catch(this.$fhcAlert.handleSystemError);
|
||||
},
|
||||
getPreviewText(){
|
||||
console.log("subj" + this.formData.subject);
|
||||
const data = new FormData();
|
||||
|
||||
data.append('data', JSON.stringify(this.formData.body));
|
||||
data.append('ids', JSON.stringify(this.id));
|
||||
|
||||
console.log("subj" + this.formData.subject);
|
||||
|
||||
return this.$api
|
||||
.call(ApiMessages.getPreviewText(
|
||||
this.typeId, data))
|
||||
@@ -195,6 +203,7 @@ export default {
|
||||
.call(ApiMessages.getReplyData(messageId))
|
||||
.then(result => {
|
||||
this.replyData = result.data;
|
||||
this.editor.setContent(this.replyData[0].replyBody);
|
||||
this.formData.subject = this.replyData[0].replySubject;
|
||||
this.formData.body = this.replyData[0].replyBody;
|
||||
this.formData.relationmessage_id = messageId;
|
||||
@@ -202,27 +211,6 @@ export default {
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'formData.body': {
|
||||
handler(newVal) {
|
||||
const tinymcsVal = this.editor.getContent();
|
||||
|
||||
if (newVal && tinymcsVal != newVal) {
|
||||
//Inhalt des Editors aktualisieren
|
||||
this.editor.setContent(newVal);
|
||||
}
|
||||
}
|
||||
},
|
||||
'formData.vorlage_kurzbz': {
|
||||
handler(newVal){
|
||||
|
||||
if (newVal && newVal != null) {
|
||||
this.formData.subject = newVal;
|
||||
return this.getDataVorlage(newVal);
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
created(){
|
||||
const missingparamsmsgs = [];
|
||||
if(!this.typeId)
|
||||
@@ -291,17 +279,8 @@ export default {
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
|
||||
//case of reply
|
||||
if(this.messageId != null) {
|
||||
if(this.messageId) {
|
||||
this.loadReplyData(this.messageId);
|
||||
/* this.$api
|
||||
.call(ApiMessages.getReplyData(this.messageId))
|
||||
.then(result => {
|
||||
this.replyData = result.data;
|
||||
this.formData.subject = this.replyData[0].replySubject;
|
||||
this.formData.body = this.replyData[0].replyBody;
|
||||
this.formData.relationmessage_id = this.messageId;
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);*/
|
||||
}
|
||||
|
||||
},
|
||||
@@ -499,10 +478,10 @@ export default {
|
||||
|
||||
<div class="row">
|
||||
<div class="col-6" style="border-right: 1px">
|
||||
You can safely close this window.
|
||||
You can safely close this window/tab.
|
||||
</div>
|
||||
<div class="col-6">
|
||||
Sie können dieses Fenster schließen.
|
||||
Fenster/Reiter kann geschlossen werden!
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -30,6 +30,7 @@ export default {
|
||||
personId: null,
|
||||
layoutColumnsOnNewData: false,
|
||||
height: '400',
|
||||
arePhrasesLoaded: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -65,7 +66,14 @@ export default {
|
||||
buildTreemap(messages) {
|
||||
if (!messages || !messages.data || messages.data.length === 0)
|
||||
{
|
||||
return {data: [], last_page: 0};
|
||||
if(this.tabulatorOptions.pagination)
|
||||
{
|
||||
return {data: [], last_page: 0};
|
||||
}
|
||||
else
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
const last_page = messages.meta.count;
|
||||
@@ -106,7 +114,15 @@ export default {
|
||||
// to avoid endless loop
|
||||
if (iteration > messages.length) break;
|
||||
}
|
||||
return {data: messageNested, last_page: last_page};
|
||||
|
||||
if(this.tabulatorOptions.pagination)
|
||||
{
|
||||
return {data: messageNested, last_page: last_page};
|
||||
}
|
||||
else
|
||||
{
|
||||
return messageNested;
|
||||
}
|
||||
},
|
||||
loadAjaxCall(url, config, params){
|
||||
return this.$api.call(
|
||||
@@ -180,7 +196,7 @@ export default {
|
||||
],
|
||||
formatter: (cell, formatterParams) => {
|
||||
const key = formatterParams[cell.getValue()];
|
||||
return this.$p.t('messages', key);
|
||||
return this.$p?.t?.('messages', key) || key;
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -252,7 +268,7 @@ export default {
|
||||
frozen: true
|
||||
}
|
||||
],
|
||||
pagination: true,
|
||||
pagination: false,
|
||||
paginationMode: "remote",
|
||||
paginationSize: 15,
|
||||
paginationInitialPage: 1,
|
||||
@@ -290,8 +306,6 @@ export default {
|
||||
{
|
||||
event: 'tableBuilt',
|
||||
handler: async() => {
|
||||
await this.$p.loadCategory(['global', 'person', 'stv', 'messages', 'ui', 'notiz']);
|
||||
|
||||
const setHeader = (field, text) => {
|
||||
const col = this.$refs.table.tabulator.getColumn(field);
|
||||
if (!col) return;
|
||||
@@ -342,6 +356,12 @@ export default {
|
||||
});*/
|
||||
},
|
||||
created(){
|
||||
this.$p
|
||||
.loadCategory(['global', 'person', 'stv', 'messages', 'ui', 'notiz'])
|
||||
.then(() => {
|
||||
this.arePhrasesLoaded = true;
|
||||
});
|
||||
|
||||
if(this.typeId != 'person_id' && Array.isArray(this.id) && this.id.length === 1) {
|
||||
const params = {
|
||||
id: this.id,
|
||||
@@ -366,6 +386,7 @@ export default {
|
||||
<!--table-->
|
||||
<div class="col-sm-6 pt-1">
|
||||
<core-filter-cmpt
|
||||
v-if="arePhrasesLoaded"
|
||||
ref="table"
|
||||
:tabulator-options="tabulatorOptions"
|
||||
:tabulator-events="tabulatorEvents"
|
||||
@@ -398,6 +419,7 @@ export default {
|
||||
<div class="col-sm-12 pt-6">
|
||||
<core-filter-cmpt
|
||||
ref="table"
|
||||
v-if="arePhrasesLoaded"
|
||||
:tabulator-options="tabulatorOptions"
|
||||
:tabulator-events="tabulatorEvents"
|
||||
table-only
|
||||
|
||||
@@ -82,14 +82,16 @@ export default {
|
||||
this.$refs.modalMsg.show();
|
||||
}
|
||||
else if (this.openMode == "inSamePage"){
|
||||
console.log("in same Page");
|
||||
this.isVisibleDiv = true;
|
||||
if(messageId)
|
||||
this.$refs.templateNewDivMessage.loadReplyData(messageId);
|
||||
else
|
||||
this.$refs.templateNewDivMessage.resetForm();
|
||||
|
||||
this.$refs.templateNewDivMessage.showTemplate();
|
||||
this.$nextTick(() => {
|
||||
if(messageId)
|
||||
this.$refs.templateNewDivMessage.loadReplyData(messageId);
|
||||
else
|
||||
this.$refs.templateNewDivMessage.resetForm();
|
||||
|
||||
this.$refs.templateNewDivMessage.showTemplate();
|
||||
});
|
||||
}
|
||||
else
|
||||
console.log("no valid openMode");
|
||||
|
||||
@@ -84,6 +84,14 @@ export default {
|
||||
'microcredential_2',
|
||||
'microcredential_3',
|
||||
'microcredential_4',
|
||||
'microdegree_1',
|
||||
'microdegree_2',
|
||||
'microdegree_3',
|
||||
'microdegree_4',
|
||||
'microdegreeabschluss_1',
|
||||
'microdegreeabschluss_2',
|
||||
'microdegreeabschluss_3',
|
||||
'microdegreeabschluss_4',
|
||||
]
|
||||
},
|
||||
documentDropdownObject: {}
|
||||
|
||||
@@ -83,6 +83,8 @@ export default {
|
||||
});
|
||||
},
|
||||
open() {
|
||||
|
||||
this.getBuchungstypen(this.currentSemester);
|
||||
this.data = {
|
||||
buchungstyp_kurzbz: '',
|
||||
betrag: '-0.00',
|
||||
@@ -105,7 +107,7 @@ export default {
|
||||
const text = typ.standardtext || '';
|
||||
const creditpoints = typ.credit_points || '';
|
||||
|
||||
if (!this.data.betrag || this.data.betrag == '-0.00')
|
||||
if (!this.data.betrag || this.data.betrag == '-0.00' || this.data.betrag !== amount)
|
||||
this.data.betrag = amount;
|
||||
|
||||
if (!this.data.buchungstext)
|
||||
@@ -113,7 +115,18 @@ export default {
|
||||
|
||||
if (this.config.showCreditpoints && (this.data.credit_points == '0.00' || this.data.credit_points === null))
|
||||
this.data.credit_points = creditpoints;
|
||||
}
|
||||
},
|
||||
getBuchungstypen(studiensemester_kurzbz)
|
||||
{
|
||||
this.$api
|
||||
.call(ApiKonto.getBuchungstypen(studiensemester_kurzbz))
|
||||
.then(result => {
|
||||
this.lists.buchungstypen = result.data;
|
||||
if (this.data.buchungstyp_kurzbz)
|
||||
this.checkDefaultBetrag(this.data.buchungstyp_kurzbz);
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
},
|
||||
},
|
||||
template: `
|
||||
<core-form ref="form" class="stv-details-konto-edit" @submit.prevent="save">
|
||||
@@ -166,6 +179,7 @@ export default {
|
||||
<form-input
|
||||
type="select"
|
||||
v-model="data.studiensemester_kurzbz"
|
||||
@change="getBuchungstypen(data.studiensemester_kurzbz)"
|
||||
name="studiensemester_kurzbz"
|
||||
:label="$p.t('lehre/studiensemester')"
|
||||
>
|
||||
|
||||
@@ -64,8 +64,14 @@ export default {
|
||||
template: /*html*/`
|
||||
<div
|
||||
:class="classes"
|
||||
class="position-relative"
|
||||
@wheel.stop
|
||||
>
|
||||
<div v-if="event.has_assigned_resources" class="position-absolute top-0 start-0 m-1" >
|
||||
<i
|
||||
class="fa-solid fa-table-list text-muted"
|
||||
></i>
|
||||
</div>
|
||||
<div
|
||||
v-if="!event.allDayEvent && event?.beginn && event?.ende"
|
||||
class="event-time d-none d-xl-grid h-100"
|
||||
|
||||
@@ -155,7 +155,7 @@ export default {
|
||||
},
|
||||
// language=HTML
|
||||
template: `
|
||||
<bs-modal ref="modal" class="bootstrap-prompt" dialogClass="modal-xl">
|
||||
<bs-modal ref="modal" class="bootstrap-prompt" dialogClass="modal-xl" data-cy="reservationModal">
|
||||
<template #title>Neue Reservierung</template>
|
||||
<template #default>
|
||||
<div class="row g-3">
|
||||
|
||||
+1156
-686
File diff suppressed because it is too large
Load Diff
@@ -41,8 +41,8 @@ export default {
|
||||
),
|
||||
ajaxResponse: (url, params, response) => response.data,
|
||||
columns: [
|
||||
{title: "Typ", field: "type"},
|
||||
{title: "Betrag", field: "betrag",
|
||||
{title: "Typ", field: "type", headerFilter: "list", headerFilterParams: {valuesLookup:true, listOnEmpty:true, autocomplete:true, sort:"asc"}},
|
||||
{title: "Betrag", field: "betrag", headerFilter: true,
|
||||
formatter: function(cell) {
|
||||
let value = cell.getValue();
|
||||
if (value == null) {
|
||||
@@ -51,14 +51,14 @@ export default {
|
||||
return parseFloat(value).toFixed(2);
|
||||
}
|
||||
},
|
||||
{title: "Bezeichnung", field: "bezeichnung"},
|
||||
{title: "Studiensemester", field: "studiensemester_kurzbz"},
|
||||
{title: "Pruefung_id", field: "pruefung_id", visible: false},
|
||||
{title: "mitarbeiter_uid", field: "mitarbeiter_uid", visible: false},
|
||||
{title: "projektarbeit_id", field: "projektarbeit_id", visible: false},
|
||||
{title: "lehreinheit_id", field: "lehreinheit_id", visible: true},
|
||||
{title: "betreuerart_kurzbz", field: "betreuerart_kurzbz", visible: false},
|
||||
{title: "vertrag_id", field: "vertrag_id", visible: false}, //just for testing
|
||||
{title: "Bezeichnung", field: "bezeichnung", headerFilter: true},
|
||||
{title: "Studiensemester", field: "studiensemester_kurzbz", headerFilter: "list", headerFilterParams: {valuesLookup:true, listOnEmpty:true, autocomplete:true, sort:"asc"}},
|
||||
{title: "Pruefung_id", field: "pruefung_id", visible: false, headerFilter: true},
|
||||
{title: "mitarbeiter_uid", field: "mitarbeiter_uid", visible: false, headerFilter: true},
|
||||
{title: "projektarbeit_id", field: "projektarbeit_id", visible: false, headerFilter: true},
|
||||
{title: "lehreinheit_id", field: "lehreinheit_id", visible: true, headerFilter: true},
|
||||
{title: "betreuerart_kurzbz", field: "betreuerart_kurzbz", visible: false, headerFilter: true},
|
||||
{title: "vertrag_id", field: "vertrag_id", visible: false, headerFilter: true}, //just for testing
|
||||
{
|
||||
title: 'Aktionen', field: 'actions',
|
||||
minWidth: 50,
|
||||
@@ -110,10 +110,10 @@ export default {
|
||||
],
|
||||
layout: 'fitColumns',
|
||||
layoutColumnsOnNewData: false,
|
||||
height: '200',
|
||||
height: '250',
|
||||
selectableRowsRangeMode: 'click',
|
||||
selectableRows: true,
|
||||
persistenceID: 'core-contracts-details-2026021701'
|
||||
persistenceID: 'core-contracts-details-2026050501'
|
||||
},
|
||||
tabulatorEvents: [
|
||||
{
|
||||
@@ -137,7 +137,7 @@ export default {
|
||||
|
||||
setHeader('type', this.$p.t('global', 'typ'));
|
||||
setHeader('bezeichnung', this.$p.t('ui', 'bezeichnung'));
|
||||
setHeader('lehreinheit_id', this.$p.t('ui', 'lehreinheit_id'));
|
||||
setHeader('lehreinheit_id', this.$p.t('lehre', 'lehreinheit_id'));
|
||||
setHeader('betrag', this.$p.t('ui', 'betrag'));
|
||||
setHeader('studiensemester_kurzbz', this.$p.t('lehre', 'studiensemester'));
|
||||
setHeader('mitarbeiter_uid', this.$p.t('ui', 'mitarbeiter_uid'));
|
||||
|
||||
@@ -47,12 +47,13 @@ export default {
|
||||
this.endpoint.getStatiOfContract(this.person_id, this.vertrag_id)
|
||||
),
|
||||
ajaxResponse: (url, params, response) => response.data,
|
||||
persistenceID: 'core-contracts-status-2026021701',
|
||||
persistenceID: 'core-contracts-status-2026050501',
|
||||
columns: [
|
||||
{title: "Status", field: "bezeichnung"},
|
||||
{title: "Status", field: "bezeichnung", headerFilter: "list", headerFilterParams: {valuesLookup:true, listOnEmpty:true, autocomplete:true, sort:"asc"}},
|
||||
{
|
||||
title: "Datum",
|
||||
field: "datum",
|
||||
headerFilter: true,
|
||||
formatter: function (cell) {
|
||||
const dateStr = cell.getValue();
|
||||
const date = new Date(dateStr); // Convert to Date object
|
||||
@@ -66,14 +67,15 @@ export default {
|
||||
});
|
||||
}
|
||||
},
|
||||
{title: "vertrag_id", field: "vertrag_id", visible: false},
|
||||
{title: "Vertragsstatus", field: "vertragsstatus_kurzbz", visible: false},
|
||||
{title: "User", field: "mitarbeiter_uid", visible: false},
|
||||
{title: "insertvon", field: "insertvon", visible: false},
|
||||
{title: "vertrag_id", field: "vertrag_id", visible: false, headerFilter: true},
|
||||
{title: "Vertragsstatus", field: "vertragsstatus_kurzbz", visible: false, headerFilter: true},
|
||||
{title: "User", field: "mitarbeiter_uid", visible: false, headerFilter: true},
|
||||
{title: "insertvon", field: "insertvon", visible: false, headerFilter: true},
|
||||
{
|
||||
title: "insertamum",
|
||||
field: "insertamum",
|
||||
visible: false,
|
||||
headerFilter: true,
|
||||
formatter: function (cell) {
|
||||
const dateStr = cell.getValue();
|
||||
const date = new Date(dateStr);
|
||||
@@ -87,11 +89,12 @@ export default {
|
||||
});
|
||||
}
|
||||
},
|
||||
{title: "updatevon", field: "updatevon", visible: false},
|
||||
{title: "updatevon", field: "updatevon", visible: false, headerFilter: true},
|
||||
{
|
||||
title: "updateamum",
|
||||
field: "updateamum",
|
||||
visible: false,
|
||||
headerFilter: true,
|
||||
formatter: function (cell) {
|
||||
const dateStr = cell.getValue();
|
||||
const date = new Date(dateStr);
|
||||
@@ -148,7 +151,7 @@ export default {
|
||||
],
|
||||
layout: 'fitColumns',
|
||||
layoutColumnsOnNewData: false,
|
||||
height: '200',
|
||||
height: '250',
|
||||
selectableRowsRangeMode: 'click',
|
||||
selectableRows: true,
|
||||
},
|
||||
|
||||
@@ -30,10 +30,11 @@ export default {
|
||||
),
|
||||
ajaxResponse: (url, params, response) => response.data,
|
||||
columns: [
|
||||
{title: "Typ", field: "type", width: 100},
|
||||
{title: "Typ", field: "type", width: 100, headerFilter: "list", headerFilterParams: {valuesLookup:true, listOnEmpty:true, autocomplete:true, sort:"asc"}},
|
||||
{
|
||||
title: "Betrag",
|
||||
field: "betrag1",
|
||||
headerFilter: true,
|
||||
formatter: function(cell) {
|
||||
let value = cell.getValue();
|
||||
if (value == null) {
|
||||
@@ -41,28 +42,29 @@ export default {
|
||||
}
|
||||
return parseFloat(value).toFixed(2);
|
||||
}},
|
||||
{title: "Bezeichnung", field: "bezeichnung", width: 150},
|
||||
{title: "Studiensemester", field: "studiensemester_kurzbz", width: 160},
|
||||
{title: "mitarbeiter_uid", field: "mitarbeiter_uid", visible: false},
|
||||
{title: "projektarbeit_id", field: "projektarbeit_id", visible: false},
|
||||
{title: "lehreinheit_id", field: "lehreinheit_id", visible: true},
|
||||
{title: "betreuerart_kurzbz", field: "betreuerart_kurzbz", visible: false},
|
||||
{title: "Vertragsstunden", field: "vertragsstunden", visible: false},
|
||||
{title: "vertrag_id", field: "vertrag_id", visible: false}, //just for testing
|
||||
{title: "Bezeichnung", field: "bezeichnung", width: 150, headerFilter: true},
|
||||
{title: "Studiensemester", field: "studiensemester_kurzbz", width: 160, headerFilter: "list", headerFilterParams: {valuesLookup:true, listOnEmpty:true, autocomplete:true, sort:"asc"}},
|
||||
{title: "mitarbeiter_uid", field: "mitarbeiter_uid", visible: false, headerFilter: true},
|
||||
{title: "projektarbeit_id", field: "projektarbeit_id", visible: false, headerFilter: true},
|
||||
{title: "lehreinheit_id", field: "lehreinheit_id", visible: true, headerFilter: true},
|
||||
{title: "betreuerart_kurzbz", field: "betreuerart_kurzbz", visible: false, headerFilter: true},
|
||||
{title: "Vertragsstunden", field: "vertragsstunden", visible: false, headerFilter: true},
|
||||
{title: "vertrag_id", field: "vertrag_id", visible: false, headerFilter: true}, //just for testing
|
||||
{
|
||||
title: "VertragsstundenStudiensemester",
|
||||
field: "vertragsstunden_studiensemester_kurzbz",
|
||||
visible: false
|
||||
visible: false,
|
||||
headerFilter: true
|
||||
},
|
||||
],
|
||||
layout: 'fitColumns',
|
||||
layoutColumnsOnNewData: false,
|
||||
height: 150,
|
||||
height: 250,
|
||||
selectableRowsRangeMode: 'click',
|
||||
selectableRows: true,
|
||||
selectableRowsRollingSelection: false, //only allow multiselect with STRG
|
||||
index: "lehreinheit_id",
|
||||
persistenceID: 'core-contracts-unassigned-2026021701'
|
||||
persistenceID: 'core-contracts-unassigned-2026050501'
|
||||
},
|
||||
tabulatorEvents: [
|
||||
{
|
||||
@@ -100,7 +102,7 @@ export default {
|
||||
|
||||
setHeader('type', this.$p.t('global', 'typ'));
|
||||
setHeader('bezeichnung', this.$p.t('ui', 'bezeichnung'));
|
||||
setHeader('lehreinheit_id', this.$p.t('ui', 'lehreinheit_id'));
|
||||
setHeader('lehreinheit_id', this.$p.t('lehre', 'lehreinheit_id'));
|
||||
setHeader('betrag1', this.$p.t('ui', 'betrag'));
|
||||
setHeader('studiensemester_kurzbz', this.$p.t('lehre', 'studiensemester'));
|
||||
setHeader('mitarbeiter_uid', this.$p.t('ui', 'mitarbeiter_uid'));
|
||||
|
||||
@@ -20,9 +20,6 @@ export default {
|
||||
ContractStati
|
||||
},
|
||||
inject: {
|
||||
/* cisRoot: {
|
||||
from: 'cisRoot'
|
||||
},*/
|
||||
hasSchreibrechte: {
|
||||
from: 'hasSchreibrechte',
|
||||
default: false
|
||||
@@ -54,9 +51,9 @@ export default {
|
||||
),
|
||||
ajaxResponse: (url, params, response) => response.data,
|
||||
columns: [
|
||||
{title: "Bezeichnung", field: "bezeichnung", width: 300},
|
||||
{title: "Bezeichnung", field: "bezeichnung", width: 300, headerFilter: true},
|
||||
{
|
||||
title: "Betrag", field: "betrag", width: 100,
|
||||
title: "Betrag", field: "betrag", width: 100, headerFilter: true,
|
||||
formatter: function (cell) {
|
||||
let value = cell.getValue();
|
||||
|
||||
@@ -66,12 +63,13 @@ export default {
|
||||
return parseFloat(value).toFixed(2);
|
||||
}
|
||||
},
|
||||
{title: "Vertragstyp", field: "vertragstyp_bezeichnung", width: 125},
|
||||
{title: "Status", field: "status", width: 100},
|
||||
{title: "Vertragstyp", field: "vertragstyp_bezeichnung", width: 125, headerFilter: "list", headerFilterParams: {valuesLookup:true, listOnEmpty:true, autocomplete:true, sort:"asc"}},
|
||||
{title: "Status", field: "status", width: 100, headerFilter: "list", headerFilterParams: {valuesLookup:true, listOnEmpty:true, autocomplete:true, sort:"asc"}},
|
||||
{
|
||||
title: "Vertragsdatum",
|
||||
field: "vertragsdatum",
|
||||
width: 128,
|
||||
headerFilter: true,
|
||||
formatter: function (cell) {
|
||||
const dateStr = cell.getValue();
|
||||
const date = new Date(dateStr);
|
||||
@@ -82,11 +80,11 @@ export default {
|
||||
});
|
||||
}
|
||||
},
|
||||
{title: "VertragId", field: "vertrag_id", visible: false},
|
||||
{title: "Vertragsstunden", field: "vertragsstunden", visible: false},
|
||||
{title: "VertragsstundenStudiensemester", field: "vertragsstunden_studiensemester_kurzbz", visible: false},
|
||||
{title: "Anmerkung", field: "anmerkung", visible: false},
|
||||
{title: "isAbgerechnet", field: "isabgerechnet", visible: false},
|
||||
{title: "VertragId", field: "vertrag_id", visible: false, headerFilter: true},
|
||||
{title: "Vertragsstunden", field: "vertragsstunden", visible: false, headerFilter: true},
|
||||
{title: "VertragsstundenStudiensemester", field: "vertragsstunden_studiensemester_kurzbz", visible: false, headerFilter: true},
|
||||
{title: "Anmerkung", field: "anmerkung", visible: false, headerFilter: true},
|
||||
{title: "isAbgerechnet", field: "isabgerechnet", visible: false, headerFilter: true},
|
||||
{
|
||||
title: 'Aktionen', field: 'actions',
|
||||
minWidth: 150,
|
||||
@@ -140,11 +138,13 @@ export default {
|
||||
columns: true,
|
||||
filter: false //to avoids js errors
|
||||
},
|
||||
persistenceID: 'core-contracts-2026021701',
|
||||
persistenceID: 'core-contracts-2026050501',
|
||||
};
|
||||
return options;
|
||||
},
|
||||
tabulatorEvents() {
|
||||
const vm = this;
|
||||
|
||||
const events = [
|
||||
{
|
||||
event: 'tableBuilt',
|
||||
@@ -177,28 +177,11 @@ export default {
|
||||
setHeader('actions', this.$p.t('global', 'aktionen'));
|
||||
}
|
||||
},
|
||||
/* {
|
||||
//is just enabled for ADDON Injection KU: MultiprintHonorarvertrag
|
||||
//(maybe enable also for ADDON FH Burgenland: MultiAccept later)
|
||||
event: 'rowClick',
|
||||
handler: (e, row) => {
|
||||
if (this.dataPrintHonorar != null && this.dataPrintHonorar.multiselect != null) {
|
||||
const selectedContract = row.getData().vertrag_id;
|
||||
const status = row.getData().status;
|
||||
const bezeichnung = row.getData().bezeichnung;
|
||||
|
||||
this.toggleRowClick(selectedContract, status, bezeichnung);
|
||||
}
|
||||
}
|
||||
},*/
|
||||
{
|
||||
event: 'rowClick',
|
||||
handler: (e, row) => {
|
||||
if (!this.dataPrintHonorar?.multiselect) return;
|
||||
|
||||
handler: function (e, row) {
|
||||
const { vertrag_id, status, bezeichnung, vertragstyp_bezeichnung } = row.getData();
|
||||
|
||||
this.toggleRowClick(e, vertrag_id, status, bezeichnung, vertragstyp_bezeichnung);
|
||||
vm.toggleRowClick(e, vertrag_id, status, bezeichnung, vertragstyp_bezeichnung);
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -242,8 +225,6 @@ export default {
|
||||
person_id() {
|
||||
this.$refs.table.reloadTable();
|
||||
this.arraySelectedContracts = [];
|
||||
/* if(this.dataPrintHonorar?.multiselect)
|
||||
this.dataPrintHonorar.multiselect = [];*/
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
@@ -270,7 +251,6 @@ export default {
|
||||
)
|
||||
.then(result => {
|
||||
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successDelete'));
|
||||
//window.scrollTo(0, 0);
|
||||
this.reload();
|
||||
this.contractSelected.vertrag_id = null;
|
||||
})
|
||||
@@ -518,19 +498,9 @@ export default {
|
||||
'content/pdfExport.php?xml=' + this.dataPrintHonorar.xml + '&xsl=' + this.dataPrintHonorar.xsl + '&mitarbeiter_uid=' + this.mitarbeiter_uid + vertragString + '&output=pdf&uid=' + this.mitarbeiter_uid;
|
||||
window.open(linkToPdf, '_blank');
|
||||
},
|
||||
/* toggleRowClick(contractId, status, bezeichnung) {
|
||||
const index = this.arraySelectedContracts.findIndex(
|
||||
([id]) => id === contractId
|
||||
);
|
||||
if (index !== -1) {
|
||||
this.arraySelectedContracts.splice(index, 1);
|
||||
} else {
|
||||
this.arraySelectedContracts.push([contractId, status, bezeichnung]);
|
||||
}
|
||||
},*/
|
||||
toggleRowClick(event, vertrag_id, status, bezeichnung, vertragstyp_bezeichnung) {
|
||||
if (!this.dataPrintHonorar?.multiselect) return;
|
||||
|
||||
const isMulti = this.dataPrintHonorar?.multiselect === true;
|
||||
const isCtrl = event.ctrlKey || event.metaKey;
|
||||
|
||||
const entry = {
|
||||
@@ -540,28 +510,29 @@ export default {
|
||||
vertragstyp_bezeichnung
|
||||
};
|
||||
|
||||
// Single click
|
||||
if (!isCtrl) {
|
||||
// allow MultiSelect just in case event multiActionPrintHonorarvertrag
|
||||
const allowMultiClick = isMulti && isCtrl;
|
||||
|
||||
if (!allowMultiClick) {
|
||||
this.arraySelectedContracts = [entry];
|
||||
|
||||
//just mark last selected row as selected
|
||||
this.$refs.table.tabulator.deselectRow();
|
||||
this.$refs.table.tabulator.selectRow(vertrag_id);
|
||||
return;
|
||||
}
|
||||
|
||||
// CTRL / CMD → toggle
|
||||
const index = this.arraySelectedContracts.findIndex(
|
||||
e => e.vertrag_id === vertrag_id
|
||||
);
|
||||
|
||||
if (index === -1) {
|
||||
this.arraySelectedContracts.push(entry);
|
||||
//this.arraySelectedContracts.push([entry.vertrag_id, entry.status, entry.bezeichnung, entry.vertragstyp_bezeichnung]);
|
||||
} else {
|
||||
this.arraySelectedContracts.splice(index, 1);
|
||||
}
|
||||
},
|
||||
/* clearSelection(){
|
||||
this.arraySelectedContracts = [];
|
||||
this.$refs.table.tabulator.deselectRow();
|
||||
}*/
|
||||
|
||||
}
|
||||
},
|
||||
created() {
|
||||
Promise.all([
|
||||
@@ -587,88 +558,6 @@ export default {
|
||||
});
|
||||
this.getFormattedDate();
|
||||
},
|
||||
/*
|
||||
TODO(Manu) delete after check
|
||||
|
||||
<div class="row mb-3">
|
||||
<form-input
|
||||
type="DatePicker"
|
||||
:label="$p.t('vertrag/datum_vertrag')"
|
||||
name="vertragsdatum"
|
||||
v-model="formData.vertragsdatum"
|
||||
auto-apply
|
||||
:enable-time-picker="false"
|
||||
format="dd.MM.yyyy"
|
||||
preview-format="dd.MM.yyyy"
|
||||
:teleport="true"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<form-input
|
||||
type="text"
|
||||
:label="$p.t('ui/bezeichnung')"
|
||||
name="bezeichnung"
|
||||
v-model="formData.bezeichnung"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<form-input
|
||||
type="select"
|
||||
:label="$p.t('global/typ')"
|
||||
v-model="formData.vertragstyp_kurzbz"
|
||||
name="vertragstyp_kurzbz"
|
||||
>
|
||||
<option :value="null">-- {{$p.t('fehlermonitoring', 'keineAuswahl')}} --</option>
|
||||
<option
|
||||
v-for="entry in listContractTypes"
|
||||
:key="entry.vertragstyp_kurzbz"
|
||||
:value="entry.vertragstyp_kurzbz"
|
||||
>
|
||||
{{entry.bezeichnung}}
|
||||
</option>
|
||||
</form-input>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<form-input
|
||||
:label="$p.t('ui/betrag')"
|
||||
name="betrag"
|
||||
v-model="formData.betrag"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
<div class="row mb-3" v-if="!statusNew">
|
||||
<form-input
|
||||
type="text"
|
||||
:label="$p.t('ui/stunden') + ' (' + $p.t('vertrag/vertrag_urfassung')+ ')'"
|
||||
name="vertragsstunden"
|
||||
v-model="formData.vertragsstunden"
|
||||
disabled
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
<div class="row mb-3" v-if="!statusNew">
|
||||
<form-input
|
||||
type="text"
|
||||
:label="$p.t('lehre/studiensemester') + ' (' + $p.t('vertrag/vertrag_urfassung')+ ')'"
|
||||
name="vertragsstunden_studiensemester_kurzbz"
|
||||
v-model="formData.vertragsstunden_studiensemester_kurzbz"
|
||||
disabled
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<form-input
|
||||
type="textarea"
|
||||
:label="$p.t('global/anmerkung')"
|
||||
name="anmerkung"
|
||||
v-model="formData.anmerkung"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
*/
|
||||
template: `
|
||||
<div class="core-contracts h-100 d-flex flex-column">
|
||||
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
// TODO(chris): load events that are longer than the interval without doubling it
|
||||
|
||||
export function useEventLoader(rangeInterval, getPromiseFunc) {
|
||||
export function useEventLoader(rangeInterval, getPromiseFunc, isLoaderVisible = true, isLoaderInitiallyVisible = true) {
|
||||
let hasFirstLoadOccurred = false;
|
||||
let loading_id = 0;
|
||||
|
||||
let tempEventsHolder = [];
|
||||
let rangeIntervalHolder = null;
|
||||
|
||||
const events = Vue.ref([]);
|
||||
const loadingEvents = Vue.ref([]);
|
||||
const allEvents = Vue.computed(() => events.value.concat(loadingEvents.value));
|
||||
@@ -100,13 +105,15 @@ export function useEventLoader(rangeInterval, getPromiseFunc) {
|
||||
|
||||
if (start.ts >= end.ts)
|
||||
return result;
|
||||
|
||||
loadingEvents.value.push({
|
||||
loading_id: loading_id++,
|
||||
type: "loading",
|
||||
isostart: start.toISODate() + 'T' + start.toISOTime(),
|
||||
isoend: end.toISODate() + 'T' + end.toISOTime()
|
||||
});
|
||||
|
||||
if (isLoaderVisible && (!hasFirstLoadOccurred && isLoaderInitiallyVisible)) {
|
||||
loadingEvents.value.push({
|
||||
loading_id: loading_id++,
|
||||
type: "loading",
|
||||
isostart: start.toISODate() + 'T' + start.toISOTime(),
|
||||
isoend: end.toISODate() + 'T' + end.toISOTime()
|
||||
});
|
||||
}
|
||||
|
||||
return mergePromiseArr(getPromiseFunc(start, end), result);
|
||||
};
|
||||
@@ -115,7 +122,14 @@ export function useEventLoader(rangeInterval, getPromiseFunc) {
|
||||
const range = Vue.toValue(rangeInterval);
|
||||
if (!(range instanceof luxon.Interval))
|
||||
return;
|
||||
|
||||
if (!rangeIntervalHolder || !range.equals(rangeIntervalHolder)) {
|
||||
hasFirstLoadOccurred = false;
|
||||
rangeIntervalHolder = range;
|
||||
}
|
||||
|
||||
const promises = markEventsLoaded(range.start, range.end);
|
||||
|
||||
Promise
|
||||
.allSettled(promises)
|
||||
.then(results => {
|
||||
@@ -127,19 +141,24 @@ export function useEventLoader(rangeInterval, getPromiseFunc) {
|
||||
if (res.value.meta.lv)
|
||||
lv.value = res.value.meta.lv;
|
||||
|
||||
events.value = events.value.concat(res.value.data);
|
||||
tempEventsHolder = tempEventsHolder.concat(res.value.data);
|
||||
loadingEvents.value = [];
|
||||
}
|
||||
})
|
||||
|
||||
events.value = tempEventsHolder;
|
||||
|
||||
});
|
||||
|
||||
hasFirstLoadOccurred = true;
|
||||
};
|
||||
|
||||
Vue.watchEffect(reload);
|
||||
|
||||
const reset = () => {
|
||||
loading_id = 0;
|
||||
events.value = [];
|
||||
loadingEvents.value = [];
|
||||
tempEventsHolder = [];
|
||||
//loadingEvents.value = [];
|
||||
eventsLoaded.splice(0, eventsLoaded.length);
|
||||
reload();
|
||||
}
|
||||
|
||||
+3
-3
@@ -450,18 +450,18 @@ td.MarkLine
|
||||
td.HeaderTesttool /*fuer die Button-Optik beim Testtool*/
|
||||
{
|
||||
color: #FFFFFF;
|
||||
background-color: #00639C;
|
||||
background-color: #71787D;
|
||||
white-space:nowrap;
|
||||
line-height: 25px;
|
||||
box-shadow: inset 0 0 2px #FFFFFF;
|
||||
padding: 10px;
|
||||
padding: 0 10px;
|
||||
width: 170px;
|
||||
}
|
||||
td.HeaderTesttoolSTG /*fuer die Button-Optik der Quereinstiegs-Studiengänge beim Testtool*/
|
||||
{
|
||||
color: white;
|
||||
border: 2px solid #73a9d6;
|
||||
padding: 10px;
|
||||
padding: 0 10px;
|
||||
max-width: 100px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
|
||||
+5998
-107
File diff suppressed because it is too large
Load Diff
@@ -94,6 +94,9 @@ require_once('dbupdate_3.4/62889_reihungstest_ueberwachung_mit_constructor.php')
|
||||
require_once('dbupdate_3.4/71399_dashboard_update_widget_paths.php');
|
||||
require_once('dbupdate_3.4/71645_studvw_messagetab_ladezeit.php');
|
||||
require_once('dbupdate_3.4/71566_studienordnungsdokument_neuer_organisationseinheitstyp_programm.php');
|
||||
require_once('dbupdate_3.4/70376_lohnguide.php');
|
||||
require_once('dbupdate_3.4/75888_reihungstest_mehrfachdurchfuehrung.php');
|
||||
require_once('dbupdate_3.4/77375_ressourcen.php');
|
||||
|
||||
// *** Pruefung und hinzufuegen der neuen Attribute und Tabellen
|
||||
echo '<H2>Pruefe Tabellen und Attribute!</H2>';
|
||||
@@ -241,6 +244,11 @@ $tabellen=array(
|
||||
"hr.tbl_valorisierung_instanz" => array("updateamum", "oe_kurzbz", "valorisierungsdatum", "valorisierung_kurzbz", "beschreibung", "ausgewaehlt", "updatevon", "valorisierung_instanz_id"),
|
||||
"hr.tbl_valorisierung_instanz_methode" => array("valorisierung_instanz_id", "valorisierung_methode_kurzbz", "beschreibung", "valorisierung_methode_parameter"),
|
||||
"hr.tbl_valorisierung_methode" => array("beschreibung", "valorisierung_methode_kurzbz"),
|
||||
"hr.tbl_lohnguide_jobfamilie" => array("jobfamilie_kurzbz", "bezeichnung", "aktiv", "sort", "insertvon", "insertamum", "updatevon", "updateamum"),
|
||||
"hr.tbl_lohnguide_modellfunktion" => array("modellfunktion_kurzbz", "bezeichnung", "jobfamilie_kurzbz", "aktiv", "sort", "insertvon", "insertamum", "updatevon", "updateamum"),
|
||||
"hr.tbl_lohnguide_modellstelle" => array("modellstelle_kurzbz", "bezeichnung", "grade", "modellfunktion_kurzbz", "aktiv", "sort", "insertvon", "insertamum", "updatevon", "updateamum"),
|
||||
"hr.tbl_lohnguide_fachrichtung" => array("fachrichtung_kurzbz", "bezeichnung", "aktiv", "insertvon", "insertamum", "updatevon", "updateamum"),
|
||||
"hr.tbl_vertragsbestandteil_lohnguide" => array("vertragsbestandteil_id", "stellenbezeichnung", "vordienstzeit", "fachrichtung_kurzbz", "modellstelle_kurzbz", "kommentar_person", "kommentar_modellstelle"),
|
||||
"lehre.tbl_abschlussbeurteilung" => array("abschlussbeurteilung_kurzbz","bezeichnung","bezeichnung_english","sort"),
|
||||
"lehre.tbl_abschlusspruefung" => array("abschlusspruefung_id","student_uid","vorsitz","pruefer1","pruefer2","pruefer3","abschlussbeurteilung_kurzbz","akadgrad_id","pruefungstyp_kurzbz","datum","uhrzeit","sponsion","anmerkung","updateamum","updatevon","insertamum","insertvon","ext_id","note","protokoll","endezeit","pruefungsantritt_kurzbz","freigabedatum"),
|
||||
"lehre.tbl_abschlusspruefung_antritt" => array("pruefungsantritt_kurzbz","bezeichnung","bezeichnung_english","sort"),
|
||||
|
||||
@@ -1,6 +1,19 @@
|
||||
<?php
|
||||
if (! defined('DB_NAME')) exit('No direct script access allowed');
|
||||
|
||||
if ($result = @$db->db_query("SELECT 1 FROM system.tbl_app WHERE app='lvevaluierung' LIMIT 1"))
|
||||
{
|
||||
if ($db->db_num_rows($result) == 0)
|
||||
{
|
||||
$qry = "INSERT INTO system.tbl_app (app) VALUES ('lvevaluierung');";
|
||||
|
||||
if(!$db->db_query($qry))
|
||||
echo '<strong>system.tbl_app: '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo ' system.tbl_app: lvevaluierung hinzugefügt<br>';
|
||||
}
|
||||
}
|
||||
|
||||
//Add column evaluierung to lehre.tbl_lehrveranstaltung
|
||||
if(!@$db->db_query("SELECT evaluierung FROM lehre.tbl_lehrveranstaltung LIMIT 1"))
|
||||
{
|
||||
@@ -12,4 +25,4 @@ if(!@$db->db_query("SELECT evaluierung FROM lehre.tbl_lehrveranstaltung LIMIT 1"
|
||||
echo '<strong>lehre.tbl_lehrveranstaltung '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo '<br>Spalte evaluierung zu Tabelle lehre.tbl_lehrveranstaltung hinzugefügt';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,357 @@
|
||||
<?php
|
||||
if (! defined('DB_NAME')) exit('No direct script access allowed');
|
||||
|
||||
if ($result = $db->db_query("SELECT * FROM information_schema.tables WHERE table_name='tbl_lohnguide_jobfamilie' AND table_schema='hr'"))
|
||||
{
|
||||
if ($db->db_num_rows($result) == 0)
|
||||
{
|
||||
$qry = "
|
||||
CREATE TABLE IF NOT EXISTS hr.tbl_lohnguide_jobfamilie (
|
||||
jobfamilie_kurzbz character varying(32) NOT NULL,
|
||||
bezeichnung varchar(64) NOT NULL,
|
||||
aktiv boolean DEFAULT FALSE,
|
||||
sort smallint,
|
||||
insertvon character varying(32) NOT NULL,
|
||||
insertamum timestamp without time zone DEFAULT now() NOT NULL,
|
||||
updatevon character varying(32),
|
||||
updateamum timestamp without time zone,
|
||||
CONSTRAINT tbl_lohnguide_jobfamilie_pkey PRIMARY KEY (jobfamilie_kurzbz)
|
||||
);
|
||||
|
||||
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE hr.tbl_lohnguide_jobfamilie TO vilesci;
|
||||
|
||||
INSERT INTO hr.tbl_lohnguide_jobfamilie(jobfamilie_kurzbz, bezeichnung,aktiv, sort, insertvon, insertamum) VALUES
|
||||
('FÜHRUNG','Führung',true,1,'system',NOW()),
|
||||
('AKADEMIA','Akademia',true,2,'system',NOW()),
|
||||
('VERWALTUNG','Verwaltung',true,3,'system',NOW()),
|
||||
('TECHNIK','Technik',true,4,'system',NOW()),
|
||||
('IT_SOFTWARE','IT & Software',true,5,'system',NOW()),
|
||||
('TECHN_DIENSTE','Technische Dienste',true,6,'system',NOW())
|
||||
ON CONFLICT (jobfamilie_kurzbz) DO NOTHING;
|
||||
";
|
||||
|
||||
if (! $db->db_query($qry))
|
||||
echo '<strong>Lohnguide Jobfamilie: ' . $db->db_last_error() . '</strong><br>';
|
||||
else
|
||||
echo 'hr.tbl_lohnguide_jobfamilie wurde neu erstellt<br>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($result = $db->db_query("SELECT * FROM information_schema.tables WHERE table_name='tbl_lohnguide_modellfunktion' AND table_schema='hr'"))
|
||||
{
|
||||
if ($db->db_num_rows($result) == 0)
|
||||
{
|
||||
$qry = "
|
||||
CREATE TABLE IF NOT EXISTS hr.tbl_lohnguide_modellfunktion (
|
||||
modellfunktion_kurzbz character varying(32) NOT NULL,
|
||||
bezeichnung varchar(64) NOT NULL,
|
||||
jobfamilie_kurzbz character varying(32) NOT NULL,
|
||||
aktiv boolean DEFAULT FALSE,
|
||||
sort smallint,
|
||||
insertvon character varying(32) NOT NULL,
|
||||
insertamum timestamp without time zone DEFAULT now() NOT NULL,
|
||||
updatevon character varying(32),
|
||||
updateamum timestamp without time zone,
|
||||
CONSTRAINT tbl_lohnguide_modellfunktion_pkey PRIMARY KEY (modellfunktion_kurzbz),
|
||||
CONSTRAINT tbl_lohnguide_modellfunktion_jobfamilie_fk FOREIGN KEY (jobfamilie_kurzbz) REFERENCES hr.tbl_lohnguide_jobfamilie (jobfamilie_kurzbz) MATCH FULL ON DELETE RESTRICT ON UPDATE CASCADE
|
||||
);
|
||||
|
||||
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE hr.tbl_lohnguide_modellfunktion TO vilesci;
|
||||
|
||||
INSERT INTO hr.tbl_lohnguide_modellfunktion(modellfunktion_kurzbz, bezeichnung, jobfamilie_kurzbz, aktiv, sort, insertvon, insertamum) VALUES
|
||||
('ABTEILUNGSLEITUNG','Abteilungsleitung','FÜHRUNG',true,1,'system',NOW()),
|
||||
('GF','Geschäftsführung','FÜHRUNG',true,2,'system',NOW()),
|
||||
('KOMPETENZFELDLEITER','Kompetenzfeldleiter*in','FÜHRUNG',true,3,'system',NOW()),
|
||||
('DEPARTMENTSLEITER','Departmentsleiter*in','FÜHRUNG',true,4,'system',NOW()),
|
||||
('FAKULTÄTSLEITER','Fakultätsleiter*in','FÜHRUNG',true,5,'system',NOW()),
|
||||
/* Akademia */
|
||||
('STUDENTISCHE_MA','Studentische MA','AKADEMIA',true,6,'system',NOW()),
|
||||
('JUNIOR_LEC_RES','Junior Lecturer/Researcher','AKADEMIA',true,7,'system',NOW()),
|
||||
('LEC_RES','Lecturer/Researcher','AKADEMIA',true,8,'system',NOW()),
|
||||
('SEN_LEC_RES','Senior Lecturer/Researcher','AKADEMIA',true,9,'system',NOW()),
|
||||
('STUDIENGANGSLEITUNG','Studiengangsleitung','AKADEMIA',true,10,'system',NOW()),
|
||||
/* Verwaltung */
|
||||
('FK_VERWALTUNG','Fachkraft Verwaltung','VERWALTUNG',true,11,'system',NOW()),
|
||||
('SFK_VERWALTUNG','Spezial-Fachkraft Verwaltung','VERWALTUNG',true,12,'system',NOW()),
|
||||
('SP_VERWALTUNG','Spezialist:in Verwaltung','VERWALTUNG',true,13,'system',NOW()),
|
||||
('EXP_VERWALTUNG','Expert:in Verwaltung','VERWALTUNG',true,14,'system',NOW()),
|
||||
/* Technik */
|
||||
('FK_TECHNIK','Fachkraft Technik','TECHNIK',true,15,'system',NOW()),
|
||||
/* IT & Software */
|
||||
('FK_IT','Fachkraft IT & Software','IT_SOFTWARE',true,16,'system',NOW()),
|
||||
('SFK_IT','Spezial-Fachkraft IT & Software','IT_SOFTWARE',true,17,'system',NOW()),
|
||||
('SP_IT','Spezialist:in IT & Software','IT_SOFTWARE',true,18,'system',NOW()),
|
||||
('EXP_IT','Expert:in IT & Software','IT_SOFTWARE',true,19,'system',NOW()),
|
||||
/* Technische Dienste */
|
||||
('HK_TECHN_DIENSTE','Hilfskraft Technische Dienste','TECHN_DIENSTE',true,20,'system',NOW()),
|
||||
('FK_TECHN_DIENSTE','Fachkraft Technische Dienste','TECHN_DIENSTE',true,21,'system',NOW()),
|
||||
('SFK_TECHN_DIENSTE','Spezial-Fachkraft Technische Dienste','TECHN_DIENSTE',true,22,'system',NOW())
|
||||
ON CONFLICT (modellfunktion_kurzbz) DO NOTHING;
|
||||
|
||||
|
||||
";
|
||||
|
||||
if (! $db->db_query($qry))
|
||||
echo '<strong>Lohnguide Modellfunktion: ' . $db->db_last_error() . '</strong><br>';
|
||||
else
|
||||
echo 'hr.tbl_lohnguide_modellfunktion wurde neu erstellt<br>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($result = $db->db_query("SELECT * FROM information_schema.tables WHERE table_name='tbl_lohnguide_modellstelle' AND table_schema='hr'"))
|
||||
{
|
||||
if ($db->db_num_rows($result) == 0)
|
||||
{
|
||||
$qry = "
|
||||
CREATE TABLE IF NOT EXISTS hr.tbl_lohnguide_modellstelle (
|
||||
modellstelle_kurzbz character varying(32) NOT NULL,
|
||||
bezeichnung varchar(128) NOT NULL,
|
||||
code character varying(32) NOT NULL,
|
||||
grade int NOT NULL,
|
||||
modellfunktion_kurzbz character varying(32) NOT NULL,
|
||||
aktiv boolean DEFAULT FALSE,
|
||||
sort smallint,
|
||||
insertvon character varying(32) NOT NULL,
|
||||
insertamum timestamp without time zone DEFAULT now() NOT NULL,
|
||||
updatevon character varying(32),
|
||||
updateamum timestamp without time zone,
|
||||
CONSTRAINT tbl_lohnguide_modellstelle_pkey PRIMARY KEY (modellstelle_kurzbz),
|
||||
CONSTRAINT tbl_lohnguide_modellstelle_modellfunktion_fk FOREIGN KEY (modellfunktion_kurzbz) REFERENCES hr.tbl_lohnguide_modellfunktion (modellfunktion_kurzbz) MATCH FULL ON DELETE RESTRICT ON UPDATE CASCADE
|
||||
);
|
||||
|
||||
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE hr.tbl_lohnguide_modellstelle TO vilesci;
|
||||
|
||||
|
||||
-- FÜHRUNG
|
||||
INSERT INTO hr.tbl_lohnguide_modellstelle(modellstelle_kurzbz,bezeichnung, code, grade, modellfunktion_kurzbz, aktiv, sort, insertvon, insertamum) VALUES
|
||||
('ABTL_1_4', 'Abteilungsleitung 1/4', '111', 16, 'ABTEILUNGSLEITUNG', true, 1, 'system', NOW()),
|
||||
('ABTL_2A_4', 'Abteilungsleitung 2a/4', '112a', 17, 'ABTEILUNGSLEITUNG', true, 2, 'system', NOW()),
|
||||
('ABTL_2B_4', 'Abteilungsleitung 2b/4', '112b', 17, 'ABTEILUNGSLEITUNG', true, 3, 'system', NOW()),
|
||||
('ABTL_3A_4', 'Abteilungsleitung 3a/4', '113a', 18, 'ABTEILUNGSLEITUNG', true, 4, 'system', NOW()),
|
||||
('ABTL_3B_4', 'Abteilungsleitung 3b/4', '113b', 18, 'ABTEILUNGSLEITUNG', true, 5, 'system', NOW()),
|
||||
('ABTL_4_4', 'Abteilungsleitung 4/4', '114', 19, 'ABTEILUNGSLEITUNG', true, 6, 'system', NOW()),
|
||||
('GF_1_2', 'Geschäftsführung 1/2', '121', 22, 'GF', true, 7, 'system', NOW()),
|
||||
('GF_2_2', 'Geschäftsführung 2/2', '122', 23, 'GF', true, 8, 'system', NOW()),
|
||||
('KOMFL_1_1', 'Kompetenzfeldleiter*in 1/1', '131', 15, 'KOMPETENZFELDLEITER', true, 9, 'system', NOW()),
|
||||
('DEPL_1_1', 'Departmentleiter*in 1/1', '141', 18, 'DEPARTMENTSLEITER', true, 10, 'system', NOW()),
|
||||
('FAKL_1_1', 'Fakultätsleiter*in 1/1', '151', 20, 'FAKULTÄTSLEITER', true, 11, 'system', NOW())
|
||||
ON CONFLICT (modellstelle_kurzbz) DO NOTHING;
|
||||
|
||||
-- AKADEMIA
|
||||
INSERT INTO hr.tbl_lohnguide_modellstelle(modellstelle_kurzbz, bezeichnung, code, grade, modellfunktion_kurzbz, aktiv, sort, insertvon, insertamum) VALUES
|
||||
('STUDENTISCHE_MA_1_1', 'Studentische MA 1/1', '211', 5, 'STUDENTISCHE_MA', true, 12, 'system', NOW()),
|
||||
('JUNIOR_LEC_RES_1_2', 'Junior Lecturer/Researcher 1/2', '221', 8, 'JUNIOR_LEC_RES', true, 13, 'system', NOW()),
|
||||
('JUNIOR_LEC_RES_2_2', 'Junior Lecturer/Researcher 2/2', '222', 9, 'JUNIOR_LEC_RES', true, 14, 'system', NOW()),
|
||||
('LEC_RES_1_2', 'Lecturer/Researcher 1/2', '231', 11, 'LEC_RES', true, 15, 'system', NOW()),
|
||||
('LEC_RES_2_2', 'Lecturer/Researcher 2/2', '232', 12, 'LEC_RES', true, 16, 'system', NOW()),
|
||||
('SEN_LEC_RES_1_2', 'Senior Lecturer/Researcher 1/2', '241', 13, 'SEN_LEC_RES', true, 17, 'system', NOW()),
|
||||
('SEN_LEC_RES_2_2', 'Senior Lecturer/Researcher 2/2', '242', 14, 'SEN_LEC_RES', true, 18, 'system', NOW()),
|
||||
('STGL_1_2', 'Studiengangsleitung 1/2', '251', 15, 'STUDIENGANGSLEITUNG', true, 19, 'system', NOW()),
|
||||
('STGL_2_2', 'Studiengangsleitung 2/2', '252', 16, 'STUDIENGANGSLEITUNG', true, 20, 'system', NOW())
|
||||
ON CONFLICT (modellstelle_kurzbz) DO NOTHING;
|
||||
|
||||
-- VERWALTUNG
|
||||
INSERT INTO hr.tbl_lohnguide_modellstelle(modellstelle_kurzbz, bezeichnung, code, grade, modellfunktion_kurzbz, aktiv, sort, insertvon, insertamum) VALUES
|
||||
('FK_VERWALTUNG_1_3', 'Fachkraft Verwaltung 1/3', '311', 4, 'FK_VERWALTUNG', true, 21, 'system', NOW()),
|
||||
('FK_VERWALTUNG_2A_3', 'Fachkraft Verwaltung 2a/3', '312a', 5, 'FK_VERWALTUNG', true, 22, 'system', NOW()),
|
||||
('FK_VERWALTUNG_2B_3', 'Fachkraft Verwaltung 2b/3', '312b', 5, 'FK_VERWALTUNG', true, 23, 'system', NOW()),
|
||||
('FK_VERWALTUNG_3_3', 'Fachkraft Verwaltung 3/3', '313', 6, 'FK_VERWALTUNG', true, 24, 'system', NOW()),
|
||||
('SFK_VERWALTUNG_1_4', 'Spezial-Fachkraft Verwaltung 1/4', '321', 7, 'SFK_VERWALTUNG', true, 25, 'system', NOW()),
|
||||
('SFK_VERWALTUNG_2A_4', 'Spezial-Fachkraft Verwaltung 2a/4', '322a', 8, 'SFK_VERWALTUNG', true, 26, 'system', NOW()),
|
||||
('SFK_VERWALTUNG_2B_4', 'Spezial-Fachkraft Verwaltung 2b/4', '322b', 8, 'SFK_VERWALTUNG', true, 27, 'system', NOW()),
|
||||
('SFK_VERWALTUNG_3A_4', 'Spezial-Fachkraft Verwaltung 3a/4', '323a', 9, 'SFK_VERWALTUNG', true, 28, 'system', NOW()),
|
||||
('SFK_VERWALTUNG_3B_4', 'Spezial-Fachkraft Verwaltung 3b/4', '323b', 9, 'SFK_VERWALTUNG', true, 29, 'system', NOW()),
|
||||
('SFK_VERWALTUNG_4_4', 'Spezial-Fachkraft Verwaltung 4/4', '324', 10, 'SFK_VERWALTUNG', true, 30, 'system', NOW()),
|
||||
('SP_VERWATLTUNG_1_4', 'Spezialist:in Verwaltung 1/4', '331', 11, 'SP_VERWALTUNG', true, 31, 'system', NOW()),
|
||||
('SP_VERWATLTUNG_2A_4', 'Spezialist:in Verwaltung 2a/4', '332a', 12, 'SP_VERWALTUNG', true, 32, 'system', NOW()),
|
||||
('SP_VERWATLTUNG_2B_4', 'Spezialist:in Verwaltung 2b/4', '332b', 12, 'SP_VERWALTUNG', true, 33, 'system', NOW()),
|
||||
('SP_VERWATLTUNG_3A_4', 'Spezialist:in Verwaltung 3a/4', '333a', 13, 'SP_VERWALTUNG', true, 34, 'system', NOW()),
|
||||
('SP_VERWATLTUNG_3B_4', 'Spezialist:in Verwaltung 3b/4', '333b', 13, 'SP_VERWALTUNG', true, 35, 'system', NOW()),
|
||||
('SP_VERWATLTUNG_4_4', 'Spezialist:in Verwaltung 4/4', '334', 14, 'SP_VERWALTUNG', true, 36, 'system', NOW()),
|
||||
('EXP_VERWALTUNG_1_1', 'Expert:in Verwaltung 1/1', '341', 15, 'EXP_VERWALTUNG', true, 37, 'system', NOW())
|
||||
ON CONFLICT (modellstelle_kurzbz) DO NOTHING;
|
||||
|
||||
-- TECHNIK
|
||||
INSERT INTO hr.tbl_lohnguide_modellstelle(modellstelle_kurzbz, bezeichnung, code, grade, modellfunktion_kurzbz, aktiv, sort, insertvon, insertamum) VALUES
|
||||
('FK_TECHNIK_1_3', 'Fachkraft Technik 1/3', '311', 4, 'FK_TECHNIK', true, 38, 'system', NOW()),
|
||||
('FK_TECHNIK_2a_3', 'Fachkraft Technik 2a/3', '312a', 5, 'FK_TECHNIK', true, 39, 'system', NOW()),
|
||||
('FK_TECHNIK_2b_3','Fachkraft Technik 2b/3', '312b', 5, 'FK_TECHNIK', true, 40, 'system', NOW()),
|
||||
('FK_TECHNIK_3_3', 'Fachkraft Technik 3/3', '313', 6, 'FK_TECHNIK', true, 41, 'system', NOW())
|
||||
ON CONFLICT (modellstelle_kurzbz) DO NOTHING;
|
||||
|
||||
-- IT & Software
|
||||
INSERT INTO hr.tbl_lohnguide_modellstelle(modellstelle_kurzbz, bezeichnung, code, grade, modellfunktion_kurzbz, aktiv, sort, insertvon, insertamum) VALUES
|
||||
('FK_IT_1_2', 'Fachkraft IT & Software 1/2', '411', 5, 'FK_IT', true, 42, 'system', NOW()),
|
||||
('FK_IT_2_2', 'Fachkraft IT & Software 2/2', '412', 6, 'FK_IT', true, 43, 'system', NOW()),
|
||||
('SFK_IT_1_4', 'Spezial-Fachkraft IT & Software 1/4', '421', 7, 'SFK_IT', true, 44, 'system', NOW()),
|
||||
('SFK_IT_2_4', 'Spezial-Fachkraft IT & Software 2/4', '422', 8, 'SFK_IT', true, 45, 'system', NOW()),
|
||||
('SFK_IT_3_4', 'Spezial-Fachkraft IT & Software 3/4', '423', 9, 'SFK_IT', true, 46, 'system', NOW()),
|
||||
('SFK_IT_4_4', 'Spezial-Fachkraft IT & Software 4/4', '424', 10, 'SFK_IT', true, 47, 'system', NOW()),
|
||||
('SP_IT_1_4', 'Spezialist:in IT & Software 1/4', '431', 11, 'SP_IT', true, 48, 'system', NOW()),
|
||||
('SP_IT_2A_4', 'Spezialist:in IT & Software 2a/4', '432a', 12, 'SP_IT', true, 49, 'system', NOW()),
|
||||
('SP_IT_2B_4', 'Spezialist:in IT & Software 2b/4', '432b', 12, 'SP_IT', true, 50, 'system', NOW()),
|
||||
('SP_IT_3A_4', 'Spezialist:in IT & Software 3a/4', '433a', 13, 'SP_IT', true, 51, 'system', NOW()),
|
||||
('SP_IT_3B_4', 'Spezialist:in IT & Software 3b/4', '433b', 13, 'SP_IT', true, 52, 'system', NOW()),
|
||||
('SP_IT_4_4', 'Spezialist:in IT & Software 4/4', '434', 14, 'SP_IT', true, 53, 'system', NOW()),
|
||||
('EXP_IT_1_1', 'Expert:in IT & Software 1/1', '441', 15, 'EXP_IT', true, 54, 'system', NOW())
|
||||
ON CONFLICT (modellstelle_kurzbz) DO NOTHING;
|
||||
|
||||
-- TECHNISCHE DIENSTE
|
||||
INSERT INTO hr.tbl_lohnguide_modellstelle(modellstelle_kurzbz, bezeichnung, code, grade, modellfunktion_kurzbz, aktiv, sort, insertvon, insertamum) VALUES
|
||||
('HK_TECHN_DIENSTE_1_4', 'Hilfskraft Technische Dienste 1/4', '511', 1, 'HK_TECHN_DIENSTE', true, 55, 'system', NOW()),
|
||||
('HK_TECHN_DIENSTE_2_4', 'Hilfskraft Technische Dienste 2/4', '512', 2, 'HK_TECHN_DIENSTE', true, 56, 'system', NOW()),
|
||||
('HK_TECHN_DIENSTE_3_4', 'Hilfskraft Technische Dienste 3/4', '513', 3, 'HK_TECHN_DIENSTE', true, 57, 'system', NOW()),
|
||||
('HK_TECHN_DIENSTE_4_4', 'Hilfskraft Technische Dienste 4/4', '514', 4, 'HK_TECHN_DIENSTE', true, 58, 'system', NOW()),
|
||||
('FK_TECHN_DIENSTE_1_2', 'Fachkraft Technische Dienste 1/2', '521', 5, 'FK_TECHN_DIENSTE', true, 59, 'system', NOW()),
|
||||
('FK_TECHN_DIENSTE_2_2', 'Fachkraft Technische Dienste 2/2', '522', 6, 'FK_TECHN_DIENSTE', true, 60, 'system', NOW()),
|
||||
('SFK_TECHN_DIENSTE_1_4', 'Spezial-Fachkraft Technische Dienste 1/4', '531', 7, 'SFK_TECHN_DIENSTE', true, 61, 'system', NOW()),
|
||||
('SFK_TECHN_DIENSTE_2_4', 'Spezial-Fachkraft Technische Dienste 2/4', '532', 8, 'SFK_TECHN_DIENSTE', true, 62, 'system', NOW()),
|
||||
('SFK_TECHN_DIENSTE_3_4', 'Spezial-Fachkraft Technische Dienste 3/4', '533', 9, 'SFK_TECHN_DIENSTE', true, 63, 'system', NOW()),
|
||||
('SFK_TECHN_DIENSTE_4_4', 'Spezial-Fachkraft Technische Dienste 4/4', '534', 10, 'SFK_TECHN_DIENSTE', true, 64, 'system', NOW())
|
||||
ON CONFLICT (modellstelle_kurzbz) DO NOTHING;
|
||||
|
||||
";
|
||||
|
||||
if (! $db->db_query($qry))
|
||||
echo '<strong>Lohnguide Modellstelle: ' . $db->db_last_error() . '</strong><br>';
|
||||
else
|
||||
echo 'hr.tbl_lohnguide_modellstelle wurde neu erstellt<br>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($result = $db->db_query("SELECT * FROM information_schema.tables WHERE table_name='tbl_lohnguide_fachrichtung' AND table_schema='hr'"))
|
||||
{
|
||||
if ($db->db_num_rows($result) == 0)
|
||||
{
|
||||
$qry = "
|
||||
CREATE TABLE IF NOT EXISTS hr.tbl_lohnguide_fachrichtung (
|
||||
fachrichtung_kurzbz character varying(32) NOT NULL,
|
||||
bezeichnung varchar(32) NOT NULL,
|
||||
aktiv boolean DEFAULT FALSE,
|
||||
insertvon character varying(32) NOT NULL,
|
||||
insertamum timestamp without time zone DEFAULT now() NOT NULL,
|
||||
updatevon character varying(32),
|
||||
updateamum timestamp without time zone,
|
||||
CONSTRAINT tbl_lohnguide_fachrichtung_pkey PRIMARY KEY (fachrichtung_kurzbz)
|
||||
);
|
||||
|
||||
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE hr.tbl_lohnguide_fachrichtung TO vilesci;
|
||||
|
||||
INSERT INTO hr.tbl_lohnguide_fachrichtung(fachrichtung_kurzbz,bezeichnung,aktiv,insertvon,insertamum) VALUES
|
||||
('FA00','Keine Berücksichtigung',true,'system',NOW())
|
||||
ON CONFLICT (fachrichtung_kurzbz) DO NOTHING;
|
||||
|
||||
";
|
||||
|
||||
if (! $db->db_query($qry))
|
||||
echo '<strong>Lohnguide Fachrichtung: ' . $db->db_last_error() . '</strong><br>';
|
||||
else
|
||||
echo 'hr.tbl_lohnguide_fachrichtung wurde neu erstellt<br>';
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ($result = $db->db_query("SELECT * FROM information_schema.tables WHERE table_name='tbl_vertragsbestandteil_lohnguide' AND table_schema='hr'"))
|
||||
{
|
||||
if ($db->db_num_rows($result) == 0)
|
||||
{
|
||||
$qry = "
|
||||
CREATE TABLE IF NOT EXISTS hr.tbl_vertragsbestandteil_lohnguide (
|
||||
vertragsbestandteil_id integer NOT NULL,
|
||||
vordienstzeit int,
|
||||
stellenbezeichnung varchar(255),
|
||||
fachrichtung_kurzbz character varying(32) NOT NULL,
|
||||
modellstelle_kurzbz character varying(32) NOT NULL,
|
||||
kommentar_person text,
|
||||
kommentar_modellstelle text,
|
||||
CONSTRAINT tbl_vertragsbestandteil_lohnguide_pk PRIMARY KEY (vertragsbestandteil_id),
|
||||
CONSTRAINT tbl_vertragsbestandteil_fk FOREIGN KEY (vertragsbestandteil_id) REFERENCES hr.tbl_vertragsbestandteil (vertragsbestandteil_id) MATCH FULL ON DELETE RESTRICT ON UPDATE CASCADE,
|
||||
CONSTRAINT tbl_vertragsbestandteil_lohnguide_fachrichtung_fk FOREIGN KEY (fachrichtung_kurzbz) REFERENCES hr.tbl_lohnguide_fachrichtung (fachrichtung_kurzbz) MATCH FULL ON DELETE RESTRICT ON UPDATE CASCADE,
|
||||
CONSTRAINT tbl_vertragsbestandteil_modellstelle_fachrichtung_fk FOREIGN KEY (modellstelle_kurzbz) REFERENCES hr.tbl_lohnguide_modellstelle (modellstelle_kurzbz) MATCH FULL ON DELETE RESTRICT ON UPDATE CASCADE
|
||||
);
|
||||
|
||||
COMMENT ON TABLE hr.tbl_vertragsbestandteil_lohnguide IS E'Zuordnung für EU-Entgelttransparenzrichtlinie';
|
||||
|
||||
GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE hr.tbl_vertragsbestandteil_lohnguide TO vilesci;
|
||||
|
||||
|
||||
";
|
||||
|
||||
if (! $db->db_query($qry))
|
||||
echo '<strong>Vertragsbestandteil Lohnguide: ' . $db->db_last_error() . '</strong><br>';
|
||||
else
|
||||
echo 'hr.tbl_vertragsbestandteil_lohnguide wurde neu erstellt<br>';
|
||||
}
|
||||
}
|
||||
|
||||
if($result = $db->db_query("SELECT 1 FROM hr.tbl_vertragsbestandteiltyp WHERE vertragsbestandteiltyp_kurzbz = 'lohnguide'"))
|
||||
{
|
||||
if($db->db_num_rows($result) === 0)
|
||||
{
|
||||
$qry = "insert into hr.tbl_vertragsbestandteiltyp (vertragsbestandteiltyp_kurzbz,bezeichnung,ueberlappend) values('lohnguide','Lohnguide',false)";
|
||||
|
||||
if(!$db->db_query($qry))
|
||||
echo '<strong>Public Tabelle person: '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo "<br>Vertragsbestandteiltyp 'lohnguide' hinzugefuegt";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($result = $db->db_query("SELECT * FROM information_schema.columns WHERE column_name='vordienstzeit' AND table_name='tbl_vertragsbestandteil_lohnguide' AND table_schema='hr'"))
|
||||
{
|
||||
if ($db->db_num_rows($result) == 0)
|
||||
{
|
||||
$qry = "
|
||||
ALTER TABLE
|
||||
hr.tbl_vertragsbestandteil_lohnguide
|
||||
ADD COLUMN
|
||||
vordienstzeit int;
|
||||
";
|
||||
if (! $db->db_query($qry))
|
||||
echo '<strong>Lohnguide: ' . $db->db_last_error() . '</strong><br>';
|
||||
else
|
||||
echo 'Spalte vordienstzeit wurde in hr.tbl_vertragsbestandteil_lohnguide neu erstellt<br>';
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($result = $db->db_query("SELECT * FROM hr.tbl_gehaltstyp WHERE gehaltstyp_kurzbz='ueberstundenpauschale'"))
|
||||
{
|
||||
if ($db->db_num_rows($result) == 0)
|
||||
{
|
||||
$qry = "
|
||||
INSERT INTO hr.tbl_gehaltstyp
|
||||
(gehaltstyp_kurzbz, bezeichnung, valorisierung, sort, aktiv, lvexport)
|
||||
VALUES
|
||||
('ueberstundenpauschale','Überstundenpauschale', true, 8, true, true);
|
||||
";
|
||||
|
||||
if (! $db->db_query($qry))
|
||||
echo '<strong>Gehaltstyp: ' . $db->db_last_error() . '</strong><br>';
|
||||
else
|
||||
echo 'Gehaltstyp "Überstundenpauschale" erstellt.<br />';
|
||||
}
|
||||
}
|
||||
|
||||
if ($result = $db->db_query("SELECT * FROM hr.tbl_gehaltstyp WHERE gehaltstyp_kurzbz='sachbezug_pkw'"))
|
||||
{
|
||||
if ($db->db_num_rows($result) == 0)
|
||||
{
|
||||
$qry = "
|
||||
INSERT INTO hr.tbl_gehaltstyp
|
||||
(gehaltstyp_kurzbz, bezeichnung, valorisierung, sort, aktiv, lvexport)
|
||||
VALUES
|
||||
('sachbezug_pkw','Sachbezug PKW', true, 9, true, true);
|
||||
";
|
||||
|
||||
if (! $db->db_query($qry))
|
||||
echo '<strong>Gehaltstyp: ' . $db->db_last_error() . '</strong><br>';
|
||||
else
|
||||
echo 'Gehaltstyp "Sachbezug PKW" erstellt.<br />';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
if (! defined('DB_NAME')) exit('No direct script access allowed');
|
||||
|
||||
if ($result = $db->db_query("SELECT * FROM pg_class WHERE relname='idx_tbl_benutzerfunktion_uid'"))
|
||||
{
|
||||
if ($db->db_num_rows($result) == 0)
|
||||
{
|
||||
$qry = "CREATE INDEX idx_tbl_benutzerfunktion_uid ON public.tbl_benutzerfunktion USING btree (uid)";
|
||||
|
||||
if (! $db->db_query($qry))
|
||||
echo '<strong>idx_tbl_benutzerfunktion_uid: ' . $db->db_last_error() . '</strong><br>';
|
||||
else
|
||||
echo 'Index idx_tbl_benutzerfunktion_uid angelegt<br>';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
if (! defined('DB_NAME')) exit('No direct script access allowed');
|
||||
|
||||
$result = $db->db_query("SELECT 1 FROM information_schema.columns WHERE table_schema = 'lehre' AND table_name = 'tbl_kalender' AND column_name = 'eindeutige_gruppen_id'");
|
||||
if($db->db_num_rows($result) === 0)
|
||||
{
|
||||
|
||||
$qry = "ALTER TABLE lehre.tbl_kalender
|
||||
ADD COLUMN IF NOT EXISTS eindeutige_gruppen_id UUID";
|
||||
|
||||
if(!$db->db_query($qry))
|
||||
echo '<strong>lehre.tbl_kalender: '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo '<br>lehre.tbl_kalender column eindeutige_gruppen_id hinzugefuegt';
|
||||
}
|
||||
|
||||
$result = $db->db_query("SELECT 1 FROM public.tbl_variablenname WHERE name = 'ignore_resources_collisions'");
|
||||
if($db->db_num_rows($result) === 0)
|
||||
{
|
||||
$qry = "INSERT INTO public.tbl_variablenname
|
||||
(name, defaultwert)
|
||||
VALUES('ignore_resources_collisions', 'false')";
|
||||
|
||||
if(!$db->db_query($qry))
|
||||
echo '<strong>public.tbl_variablenname: '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo '<br>public.tbl_variablenname column ignore_resources_collisions hinzugefuegt';
|
||||
}
|
||||
|
||||
if(!$result = @$db->db_query("SELECT 1 FROM lehre.tbl_betriebsmittel_kalender LIMIT 1"))
|
||||
{
|
||||
$qry = '
|
||||
CREATE TABLE lehre.tbl_betriebsmittel_kalender (
|
||||
"betriebsmittel_kalender_id" INTEGER NOT NULL,
|
||||
"eindeutige_kalender_gruppen_id" UUID NOT NULL,
|
||||
"betriebsmittel_id" INTEGER NOT NULL,
|
||||
"anmerkung" TEXT,
|
||||
"quelle" VARCHAR(32),
|
||||
"insertamum" TIMESTAMP WITH TIME ZONE DEFAULT now(),
|
||||
"insertvon" VARCHAR(32),
|
||||
"updateamum" TIMESTAMP WITH TIME ZONE DEFAULT now(),
|
||||
"updatevon" VARCHAR(32),
|
||||
CONSTRAINT pk_betriebsmittel_kalender_id PRIMARY KEY("betriebsmittel_kalender_id"),
|
||||
CONSTRAINT fk_betriebsmittel_id FOREIGN KEY("betriebsmittel_id") REFERENCES wawi.tbl_betriebsmittel("betriebsmittel_id") ON DELETE CASCADE,
|
||||
CONSTRAINT eindeutige_kalender_gruppen_id_betriebsmittel_id UNIQUE (eindeutige_kalender_gruppen_id, betriebsmittel_id)
|
||||
);';
|
||||
|
||||
if(!$db->db_query($qry))
|
||||
echo '<strong>lehre.tbl_betriebsmittel_kalender: '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo '<br>lehre.tbl_betriebsmittel_kalender table created';
|
||||
|
||||
$db->db_query('CREATE SEQUENCE IF NOT EXISTS lehre.seq_tbl_betriebsmittel_kalender_betriebsmittel_kalender_id
|
||||
INCREMENT BY 1
|
||||
NO MAXVALUE
|
||||
NO MINVALUE
|
||||
CACHE 1;');
|
||||
|
||||
$db->db_query("ALTER TABLE lehre.tbl_betriebsmittel_kalender ALTER COLUMN betriebsmittel_kalender_id SET DEFAULT nextval('lehre.seq_tbl_betriebsmittel_kalender_betriebsmittel_kalender_id');");
|
||||
|
||||
|
||||
$qry = 'GRANT SELECT ON TABLE lehre.tbl_betriebsmittel_kalender TO web;';
|
||||
if(!$db->db_query($qry))
|
||||
echo '<strong>lehre.tbl_betriebsmittel_kalender: '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo '<br>Granted privileges to <strong>web</strong> on lehre.tbl_betriebsmittel_kalender';
|
||||
|
||||
$qry = 'GRANT USAGE ON lehre.seq_tbl_betriebsmittel_kalender_betriebsmittel_kalender_id TO web;';
|
||||
if(!$db->db_query($qry))
|
||||
echo '<strong>lehre.tbl_betriebsmittel_kalender: '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo '<br>Granted privileges to <strong>web</strong> on lehre.tbl_betriebsmittel_kalender';
|
||||
|
||||
|
||||
$qry = 'GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE lehre.tbl_betriebsmittel_kalender TO vilesci;';
|
||||
if(!$db->db_query($qry))
|
||||
echo '<strong>lehre.tbl_betriebsmittel_kalender: '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo '<br>Granted privileges to <strong>vilesci</strong> on lehre.tbl_betriebsmittel_kalender';
|
||||
|
||||
$qry = 'GRANT USAGE, INSERT ON lehre.seq_tbl_betriebsmittel_kalender_betriebsmittel_kalender_id TO vilesci;';
|
||||
if(!$db->db_query($qry))
|
||||
echo '<strong>lehre.tbl_betriebsmittel_kalender: '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo '<br>Granted privileges to <strong>vilesci</strong> on lehre.tbl_betriebsmittel_kalender';
|
||||
|
||||
$qry = 'GRANT USAGE, UPDATE ON lehre.seq_tbl_betriebsmittel_kalender_betriebsmittel_kalender_id TO vilesci;';
|
||||
if(!$db->db_query($qry))
|
||||
echo '<strong>lehre.tbl_betriebsmittel_kalender: '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo '<br>Granted privileges to <strong>vilesci</strong> on lehre.tbl_betriebsmittel_kalender';
|
||||
}
|
||||
+1101
-1
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,28 @@
|
||||
UPDATE public.tbl_funktion SET funktion_kurzbz='Student' WHERE funktion_kurzbz='stud';
|
||||
|
||||
UPDATE public.tbl_benutzer SET uid='demoadmin' WHERE uid='admin';
|
||||
|
||||
-- Add Missing functions
|
||||
INSERT INTO public.tbl_funktion (funktion_kurzbz, beschreibung, aktiv, fachbereich, semester, hrrelevant, vertragsrelevant) VALUES('hsv', 'Hochschulvertretung', true, false, false, false, false);
|
||||
INSERT INTO public.tbl_funktion (funktion_kurzbz, beschreibung, aktiv, fachbereich, semester, hrrelevant, vertragsrelevant) VALUES('jgv', 'Jahrgangsvertretung', true, false, true, false, false);
|
||||
INSERT INTO public.tbl_funktion (funktion_kurzbz, beschreibung, aktiv, fachbereich, semester, hrrelevant, vertragsrelevant) VALUES('oezuordnung', 'Diszpl-Zuordnung', true, false, false, true, true);
|
||||
INSERT INTO public.tbl_funktion (funktion_kurzbz, beschreibung, aktiv, fachbereich, semester, hrrelevant, vertragsrelevant) VALUES('fachzuordnung', 'Fachliche Zuordnung', true, false, false, true, true);
|
||||
|
||||
-- Add Permissions to Admin Role
|
||||
INSERT INTO "system".tbl_rolleberechtigung (berechtigung_kurzbz, rolle_kurzbz, art, anmerkung, insertamum, insertvon) VALUES('basis/cis', 'admin', 'suid', 'Zugriff auf CIS', now(), 'demoadmin');
|
||||
|
||||
INSERT INTO "system".tbl_benutzerrolle (rolle_kurzbz, berechtigung_kurzbz, uid, funktion_kurzbz, oe_kurzbz, art, studiensemester_kurzbz, "start", ende, negativ, updateamum, updatevon, insertamum, insertvon, kostenstelle_id, anmerkung) VALUES
|
||||
(NULL, 'dashboard/benutzer', NULL, 'Mitarbeiter', NULL, 'suid', NULL, NULL, NULL, false, NULL, NULL, now(), 'demoadmin', NULL, NULL),
|
||||
(NULL, 'dashboard/benutzer', NULL, 'Student', NULL, 'suid', NULL, NULL, NULL, false, NULL, NULL, now(), 'demoadmin', NULL, NULL)
|
||||
;
|
||||
|
||||
INSERT INTO "system".tbl_webservicetyp (webservicetyp_kurzbz, beschreibung) VALUES('content', 'CIS-Content ID');
|
||||
|
||||
SELECT setval('campus.seq_contentsprache', (select max(contentsprache_id) from campus.tbl_contentsprache), true);
|
||||
SELECT setval('campus.seq_contentchild', (select max(contentchild_id) from campus.tbl_contentchild), true);
|
||||
|
||||
|
||||
INSERT INTO public.tbl_gruppe (gruppe_kurzbz, studiengang_kz, semester, bezeichnung, beschreibung, sichtbar, lehre, aktiv, sort, mailgrp, generiert, updateamum, updatevon, insertamum, insertvon, ext_id, orgform_kurzbz, content_visible, gesperrt, direktinskription, zutrittssystem, aufnahmegruppe) VALUES
|
||||
('MA', 0, NULL, 'MA', 'MA', false, false, true, NULL, false, false, now(), 'demoadmin', now(), 'demoadmin', NULL, NULL, true, false, false, false, false),
|
||||
('STUD', 0, NULL, 'STUD', 'STUD', false, false, true, NULL, false, false, now(), 'demoadmin', now(), 'demoadmin', NULL, NULL, true, false, false, false, false)
|
||||
;
|
||||
@@ -0,0 +1,28 @@
|
||||
CREATE OR REPLACE FUNCTION NearestWintersemester(var_entfernung integer) RETURNS varchar(32) AS $$
|
||||
DECLARE res varchar(32);
|
||||
BEGIN
|
||||
WITH nearestws AS
|
||||
(
|
||||
SELECT studiensemester_kurzbz, start FROM public.tbl_studiensemester WHERE studiensemester_kurzbz LIKE 'W%' AND ende>=now() ORDER BY start DESC LIMIT 1
|
||||
)
|
||||
SELECT studiensemester_kurzbz into res
|
||||
FROM
|
||||
(
|
||||
SELECT studiensemester_kurzbz, 0 as "entfernung" FROM nearestws
|
||||
UNION
|
||||
SELECT studiensemester_kurzbz, rank() over(order by start desc) as "entfernung" FROM public.tbl_studiensemester where start>(SELECT start FROM nearestws)
|
||||
UNION
|
||||
SELECT studiensemester_kurzbz, (-1 * rank() over(order by start desc)) as "entfernung" FROM public.tbl_studiensemester WHERE start<(SELECT start FROM nearestws)
|
||||
) x where entfernung=var_entfernung;
|
||||
|
||||
return res;
|
||||
END;
|
||||
$$ LANGUAGE plpgsql;
|
||||
|
||||
CREATE OR REPLACE FUNCTION CurrentSemester() RETURNS varchar(32) AS $$
|
||||
DECLARE res varchar(32);
|
||||
BEGIN
|
||||
SELECT studiensemester_kurzbz into res FROM public.tbl_studiensemester WHERE start<=now() AND ende>=now() ORDER BY start DESC LIMIT 1;
|
||||
return res;
|
||||
END;
|
||||
$$ LANGUAGE plpgsql;
|
||||
@@ -0,0 +1,40 @@
|
||||
-- Demodaten fuer Mitarbeiter
|
||||
-- Personen
|
||||
INSERT INTO public.tbl_person (person_id, staatsbuergerschaft,geburtsnation,sprache,anrede,titelpost,titelpre,vorname,nachname,vornamen,gebdatum,gebort,gebzeit,foto,anmerkung,homepage,svnr,ersatzkennzeichen,familienstand,geschlecht,anzahlkinder,aktiv,insertamum,insertvon,updateamum,updatevon,ext_id,bundesland_code,kompetenzen,kurzbeschreibung,zugangscode,foto_sperre,udf_values,bpk,matr_aktiv,matr_nr,zugangscode_timestamp,wahlname,unruly) VALUES
|
||||
(21,'A','A',NULL,'Herr',NULL,NULL,'Demo','Lektor 1',NULL,'1980-01-15',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'m',NULL,true,'2023-08-24 14:56:04.509813','auto','2025-05-13 10:57:19.826386',NULL,NULL,NULL,NULL,NULL,'64e753647c21',false,NULL,NULL,false,NULL,NULL,NULL,false),
|
||||
(22,'A','A',NULL,'Herr',NULL,NULL,'Demo','Lektor 2',NULL,'1980-01-15',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'m',NULL,true,'2023-08-24 14:56:04.509813','auto','2025-05-13 10:57:19.826386',NULL,NULL,NULL,NULL,NULL,'64e753647c22',false,NULL,NULL,false,NULL,NULL,NULL,false),
|
||||
(23,'A','A',NULL,'Herr',NULL,NULL,'Demo','Lektor 3',NULL,'1980-01-15',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'m',NULL,true,'2023-08-24 14:56:04.509813','auto','2025-05-13 10:57:19.826386',NULL,NULL,NULL,NULL,NULL,'64e753647c23',false,NULL,NULL,false,NULL,NULL,NULL,false),
|
||||
(24,'A','A',NULL,'Herr',NULL,NULL,'Demo','Lektor 4',NULL,'1980-01-15',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'m',NULL,true,'2023-08-24 14:56:04.509813','auto','2025-05-13 10:57:19.826386',NULL,NULL,NULL,NULL,NULL,'64e753647c24',false,NULL,NULL,false,NULL,NULL,NULL,false),
|
||||
(25,'A','A',NULL,'Herr',NULL,NULL,'Demo','Lektor 5',NULL,'1980-01-15',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'m',NULL,true,'2023-08-24 14:56:04.509813','auto','2025-05-13 10:57:19.826386',NULL,NULL,NULL,NULL,NULL,'64e753647c25',false,NULL,NULL,false,NULL,NULL,NULL,false),
|
||||
(26,'A','A',NULL,'Frau',NULL,NULL,'Demo','Assistenz',NULL,'1985-01-15',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'w',NULL,true,'2023-08-24 14:56:04.509813','auto','2025-05-13 10:57:19.826386',NULL,NULL,NULL,NULL,NULL,'64e753647c26',false,NULL,NULL,false,NULL,NULL,NULL,false)
|
||||
;
|
||||
|
||||
|
||||
INSERT INTO public.tbl_benutzer (person_id, uid, aktiv, alias, insertamum, insertvon, updateamum, updatevon, updateaktivam, updateaktivvon, aktivierungscode) VALUES
|
||||
('21', 'demolektor1' , true, null, now(), 'auto', null, null, null, false, null),
|
||||
('22', 'demolektor2' , true, null, now(), 'auto', null, null, null, false, null),
|
||||
('23', 'demolektor3' , true, null, now(), 'auto', null, null, null, false, null),
|
||||
('24', 'demolektor4' , true, null, now(), 'auto', null, null, null, false, null),
|
||||
('25', 'demolektor5' , true, null, now(), 'auto', null, null, null, false, null),
|
||||
('26', 'demoassistenz' , true, null, now(), 'auto', null, null, null, false, null)
|
||||
;
|
||||
|
||||
INSERT INTO public.tbl_mitarbeiter (mitarbeiter_uid, personalnummer, telefonklappe, kurzbz, lektor, fixangestellt, stundensatz, ausbildungcode, ort_kurzbz, insertamum, insertvon, bismelden) VALUES
|
||||
('demolektor1', 21, null, 'DemoLKT1', true, true, 80, null, null, now(), 'auto', true),
|
||||
('demolektor2', 22, null, 'DemoLKT2', true, true, 80, null, null, now(), 'auto', true),
|
||||
('demolektor3', 23, null, 'DemoLKT3', true, true, 80, null, null, now(), 'auto', true),
|
||||
('demolektor4', 24, null, 'DemoLKT4', true, true, 80, null, null, now(), 'auto', true),
|
||||
('demolektor5', 25, null, 'DemoLKT5', true, true, 80, null, null, now(), 'auto', true),
|
||||
('demoassistenz', 26, null, 'DemoAss', true, true, 80, null, null, now(), 'auto', true)
|
||||
;
|
||||
|
||||
|
||||
INSERT INTO public.tbl_benutzergruppe (uid, gruppe_kurzbz, updateamum, updatevon, insertamum, insertvon, ext_id, studiensemester_kurzbz) VALUES
|
||||
('demoadmin', 'MA', now(), 'demoadmin', now(), 'demoadmin', NULL, NULL),
|
||||
('demolektor1', 'MA', now(), 'demoadmin', now(), 'demoadmin', NULL, NULL),
|
||||
('demolektor2', 'MA', now(), 'demoadmin', now(), 'demoadmin', NULL, NULL),
|
||||
('demolektor3', 'MA', now(), 'demoadmin', now(), 'demoadmin', NULL, NULL),
|
||||
('demolektor4', 'MA', now(), 'demoadmin', now(), 'demoadmin', NULL, NULL),
|
||||
('demolektor5', 'MA', now(), 'demoadmin', now(), 'demoadmin', NULL, NULL),
|
||||
('demoassistenz', 'MA', now(), 'demoadmin', now(), 'demoadmin', NULL, NULL)
|
||||
;
|
||||
@@ -0,0 +1,27 @@
|
||||
-- Kompetenzfedler
|
||||
INSERT INTO public.tbl_organisationseinheittyp (organisationseinheittyp_kurzbz, bezeichnung, beschreibung) VALUES('Kompetenzfeld', 'Kompetenzfeld', 'Kompetenzfeld');
|
||||
|
||||
INSERT INTO public.tbl_organisationseinheit (oe_kurzbz, oe_parent_kurzbz, bezeichnung, organisationseinheittyp_kurzbz, aktiv, mailverteiler, freigabegrenze, kurzzeichen, lehre, standort, warn_semesterstunden_frei, warn_semesterstunden_fix, standort_id) VALUES
|
||||
('dep', 'etw', 'Fachabteilung', 'Abteilung', true, false, NULL, NULL, true, NULL, NULL, NULL, NULL),
|
||||
('kfSprachen', 'dep', 'Sprachen', 'Kompetenzfeld', true, false, NULL, NULL, true, NULL, NULL, NULL, NULL),
|
||||
('kfMath', 'dep', 'Mathematik', 'Kompetenzfeld', true, false, NULL, NULL, true, NULL, NULL, NULL, NULL),
|
||||
('kfTech', 'dep', 'Technik', 'Kompetenzfeld', true, false, NULL, NULL, true, NULL, NULL, NULL, NULL);
|
||||
|
||||
INSERT INTO public.tbl_organisationseinheit
|
||||
(oe_kurzbz, oe_parent_kurzbz, bezeichnung, organisationseinheittyp_kurzbz, aktiv, mailverteiler, freigabegrenze, kurzzeichen, lehre, standort, warn_semesterstunden_frei, warn_semesterstunden_fix, standort_id, fts_bezeichnung)
|
||||
VALUES('Lehrgaenge', 'etw', 'Lehrgänge', 'Abteilung', true, false, NULL, NULL, false, NULL, NULL, NULL, NULL, '''abteilung'':1 ''lehrgänge'':2'::tsvector);
|
||||
INSERT INTO public.tbl_organisationseinheit
|
||||
(oe_kurzbz, oe_parent_kurzbz, bezeichnung, organisationseinheittyp_kurzbz, aktiv, mailverteiler, freigabegrenze, kurzzeichen, lehre, standort, warn_semesterstunden_frei, warn_semesterstunden_fix, standort_id, fts_bezeichnung)
|
||||
VALUES('studiengaenge', 'etw', 'Studiengänge', 'Abteilung', true, false, NULL, NULL, false, NULL, NULL, NULL, NULL, '''abteilung'':1 ''studiengänge'':2'::tsvector);
|
||||
|
||||
INSERT INTO public.tbl_studienjahr (studienjahr_kurzbz, bezeichnung) VALUES
|
||||
('2026/27', 'Studienjahr 2026/27'),
|
||||
('2027/28', 'Studienjahr 2027/28')
|
||||
;
|
||||
|
||||
INSERT INTO public.tbl_studiensemester (studiensemester_kurzbz, "start", ende, ext_id, bezeichnung, studienjahr_kurzbz, beschreibung, onlinebewerbung) VALUES
|
||||
('WS2026', '2026-09-01', '2027-01-31', NULL, 'Wintersemester 2026/27', '2026/27', NULL, false),
|
||||
('SS2027', '2027-02-01', '2027-07-01', NULL, 'Sommersemester 2027', '2026/27', NULL, false),
|
||||
('WS2027', '2027-09-01', '2028-01-31', NULL, 'Wintersemester 2027/28', '2027/28', NULL, false),
|
||||
('SS2028', '2028-02-01', '2028-07-01', NULL, 'Sommersemester 2028', '2027/28', NULL, false)
|
||||
;
|
||||
@@ -0,0 +1,25 @@
|
||||
INSERT INTO public.tbl_ort
|
||||
(ort_kurzbz, bezeichnung, planbezeichnung, max_person, lehre, reservieren, aktiv, lageplan, dislozierung, kosten, ausstattung, updateamum, updatevon, insertamum, insertvon, ext_id, stockwerk, telefonklappe, standort_id, content_id, m2, gebteil, oe_kurzbz, arbeitsplaetze)
|
||||
VALUES('EG03', 'Besprechungsruam EG03', 'EG03', 8, true, true, true, NULL, NULL, NULL, NULL, '2023-08-24 14:18:50.000', 'oesi', '2023-08-24 14:17:30.000', 'oesi', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
INSERT INTO public.tbl_ort
|
||||
(ort_kurzbz, bezeichnung, planbezeichnung, max_person, lehre, reservieren, aktiv, lageplan, dislozierung, kosten, ausstattung, updateamum, updatevon, insertamum, insertvon, ext_id, stockwerk, telefonklappe, standort_id, content_id, m2, gebteil, oe_kurzbz, arbeitsplaetze)
|
||||
VALUES('EG01', 'Seminarraum EG01', 'EG01', 10, true, true, true, NULL, NULL, NULL, NULL, '2023-08-24 14:18:52.000', 'oesi', '2023-08-24 14:16:47.000', 'oesi', NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
INSERT INTO public.tbl_ort
|
||||
(ort_kurzbz, bezeichnung, planbezeichnung, max_person, lehre, reservieren, aktiv, lageplan, dislozierung, kosten, ausstattung, updateamum, updatevon, insertamum, insertvon, ext_id, stockwerk, telefonklappe, standort_id, content_id, m2, gebteil, oe_kurzbz, arbeitsplaetze)
|
||||
VALUES('EG02', 'Seminarraum EG02', 'EG02', 10, true, true, true, NULL, NULL, NULL, NULL, '2023-08-24 14:18:54.000', 'oesi', '2023-08-24 14:16:56.000', 'oesi', NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
INSERT INTO public.tbl_ort
|
||||
(ort_kurzbz, bezeichnung, planbezeichnung, max_person, lehre, reservieren, aktiv, lageplan, dislozierung, kosten, ausstattung, updateamum, updatevon, insertamum, insertvon, ext_id, stockwerk, telefonklappe, standort_id, content_id, m2, gebteil, oe_kurzbz, arbeitsplaetze)
|
||||
VALUES('EG04', 'EDV EG04', 'EG04', 20, true, true, true, NULL, NULL, NULL, NULL, '2023-08-24 14:18:55.000', 'oesi', '2023-08-24 14:17:49.000', 'oesi', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
|
||||
INSERT INTO public.tbl_ortraumtyp
|
||||
(ort_kurzbz, hierarchie, raumtyp_kurzbz)
|
||||
VALUES('EG01', 1, 'SEM');
|
||||
INSERT INTO public.tbl_ortraumtyp
|
||||
(ort_kurzbz, hierarchie, raumtyp_kurzbz)
|
||||
VALUES('EG02', 1, 'SEM');
|
||||
INSERT INTO public.tbl_ortraumtyp
|
||||
(ort_kurzbz, hierarchie, raumtyp_kurzbz)
|
||||
VALUES('EG04', 1, 'EDV2');
|
||||
INSERT INTO public.tbl_ortraumtyp
|
||||
(ort_kurzbz, hierarchie, raumtyp_kurzbz)
|
||||
VALUES('EG04', 2, 'EDV5/6');
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user